oracle-11g-rac方案

合集下载

VirtualBox安装3节点oracle11GRAC(超级详细)

VirtualBox安装3节点oracle11GRAC(超级详细)

使用vbox创建oracle11GR2 --3节点rac操作系统cenos6.5数据库版本11.2.0.4修改服务器的配置文件:配置网卡cd /etc/sysconfig/network-scripts/关闭防火墙chkconfig iptables offiptables –Fiptables –L关闭内核防火墙:vi /etc/sysconfig/selinux修改hosts内容:192.168.1.110 rac1 192.168.1.111 rac2 192.168.1.112 rac3 #virtual192.168.1.120 rac1-vip 192.168.1.121 rac2-vip 192.168.1.122 rac3-vip #eth1 private18.1.30.50 rac1-priv 18.1.30.51 rac2-priv 18.1.30.52 rac3-priv #scan192.168.1.130 rac-scan给系统打补丁包:之后给系统打包(这个应该先做后调网络)binutils-2.17.50.0.6compat-libstdc++-33-3.2.3compat-libstdc++-33-3.2.3 (32 bit)elfutils-libelf-0.125elfutils-libelf-devel-0.125gcc-4.1.2gcc-c++-4.1.2glibc-2.5-24glibc-2.5-24 (32 bit)glibc-common-2.5glibc-devel-2.5glibc-devel-2.5 (32 bit)libaio-0.3.106libaio-0.3.106 (32 bit)libaio-devel-0.3.106libaio-devel-0.3.106 (32 bit)libgcc-4.1.2libgcc-4.1.2 (32 bit)libstdc++-4.1.2libstdc++-4.1.2 (32 bit)libstdc++-devel 4.1.2make-3.81sysstat-7.0.2yum install XXXXX所有节点执行:[root@rac1 ~]# vi /etc/sysconfig/networkNETWORKING=yesNETWORKING_IPV6=noHOSTNAME=rac1建两个用户和组groupadd oinstallgroupadd dbauseradd -g oinstall -G dba griduseradd -g oinstall -G dba oracleecho -n yangbo|passwd --stdin gridecho -n yangbo|passwd --stdin oraclemkdir -p /u02/app/11.2.0/gridmkdir -p /u02/app/gridmkdir -p /u02/app/oraclechown grid:oinstall /u02/app/11.2.0/gridchown grid:oinstall /u02/app/gridchown -R oracle:oinstall /u02/app/oraclechmod -R 775 /u02/chown -R grid:oinstall /u02修改系统参数sed -i 's/kernel.shmmax/#kernel.shmmax/g' /etc/sysctl.conf sed -i 's/kernel.shmall/#kernel.shmall/g' /etc/sysctl.confcat >> /etc/sysctl.conf << EOFfs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 1073741824kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586EOF配置/etc/security/limits.confcat >> /etc/security/limits.conf << EOForacle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 10240grid soft nproc 2047grid hard nproc 16384grid soft nofile 1024grid hard nofile 65536grid soft stack 10240EOF用户环境变量Oracle:(vi ~/bash_profiel)umask 022unset ORA_NLS10export ORACLE_BASE=/u02/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export ORACLE_SID=base1export NLS_LANG=american_america.zhs16gbkexport NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss"export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/binexport PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/binexport PATH=${PATH}:$ORACLE_BASE/common/oracle/binexportORACLE_PATH=${PATH}:$ORACLE_BASE/common/oracle/sql:.:$ORACLE_HOME/rdbms/admin export ORACLE_TERM=xtermexport TNS_ADMIN=$ORACLE_HOME/network/adminexport LD_LIBRARY_PATH=$ORACLE_HOME/libexport LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/libexport LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/libexport CLASSPATH=$ORACLE_HOME/JREexport CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlibexport CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlibexport CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib#export ORA_NLS10=$ORACLE_HOME/nls/dataexport THREADS_FLAG=nativeexport TEMP=/tmpexport TMPDIR=/tmpgrid用户的变量(vi ~/bash_profiel)umask 022unset ORA_NLS10export ORACLE_BASE=/u02/app/gridexport ORACLE_HOME=/u02/app/11.2/gridexport ORACLE_SID=+ASM1export NLS_LANG=american_america.zhs16gbkexport NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss"export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/binexport PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/binexport PATH=${PATH}:$ORACLE_BASE/common/oracle/binexportORACLE_PATH=${PATH}:$ORACLE_BASE/common/oracle/sql:.:$ORACLE_HOME/rdbms/admin export ORACLE_TERM=xtermexport TNS_ADMIN=$ORACLE_HOME/network/admin#export ORA_NLS10=$ORACLE_HOME/nls/dataexport LD_LIBRARY_PATH=$ORACLE_HOME/libexport LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/libexport LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/libexport CLASSPATH=$ORACLE_HOME/JREexport CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlibexport CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlibexport CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlibexport THREADS_FLAG=nativeexport TEMP=/tmpexport TMPDIR=/tmp八.配置NTP服务8.1节点1sed -i 's/OPTIONS/#OPTIONS/g' /etc/sysconfig/ntpdB.cat >> /etc/sysconfig/ntpd << EOFOPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"EOFC.mv /etc/ntp.conf /etc/ntp.confbakD.cat > /etc/ntp.conf << EOFrestrict 0.0.0.0 mask 0.0.0.0 nomodifyserver 127.127.1.0fudge 127.127.1.0 stratum 10driftfile /var/lib/ntp/driftbroadcastdelay 0.008authenticate nokeys /etc/ntp/keysEOF8.2节点2A.sed -i 's/OPTIONS/#OPTIONS/g' /etc/sysconfig/ntpdB.cat >> /etc/sysconfig/ntpd << EOFOPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"EOFC.mv /etc/ntp.conf /etc/ntp.confbakD.cat >> /etc/ntp.conf << XLrestrict default kod nomodify notrap nopeer noquery restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap restrict 127.0.0.1server 192.168.8.199server 127.127.1.0 # local clockfudge 127.127.1.0 stratum 10driftfile /var/lib/ntp/driftbroadcastdelay 0.008authenticate nokeys /etc/ntp/keysXL8.3启动服务(双节点执行)#service ntpd restart8.4系统启动自动加载(双节点执行)#chkconfig ntpd on 关闭虚拟机:添加磁盘控制器;创建共享磁盘修改共享磁盘属性为可共享:调整RAC2的控制器:修改其他两个节点的网络配置和主机名配置oracle、grid用户的ssh对等性Oracle用户ssh对等性配置Oracle对等性配置Rac1节点[root@rac1 ~]# su - oraclerac1-> clearrac1-> mkdir ~/.sshrac1-> chmod 755 ~/.ssh/rac1-> ssh-keygen -t rsaGenerating public/private rsa key pair.Enter file in which to save the key (/home/oracle/.ssh/id_rsa): Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/oracle/.ssh/id_rsa. Your public key has been saved in /home/oracle/.ssh/id_rsa.pub. The key fingerprint is:26:c6:8a:60:1b:78:c3:6d:09:b0:c0:f3:a3:e5:ff:ce oracle@rac1 The key's randomart image is:+--[ RSA 2048]----+|+ ||.= ||. + ||.. * o ||ooB = + S ||.+o= o o || .. o || .. || oE |+-----------------+rac1-> ssh-keygen -t dsaGenerating public/private dsa key pair.Enter file in which to save the key (/home/oracle/.ssh/id_dsa): Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/oracle/.ssh/id_dsa. Your public key has been saved in /home/oracle/.ssh/id_dsa.pub. The key fingerprint is:d0:05:5d:0c:5b:72:42:87:f8:e8:04:66:e4:b5:bd:8c oracle@rac1 The key's randomart image is:+--[ DSA 1024]----+| .. o=*== || .+o.+oB. || oo.ooo || .oo.. || oE o || . || || || |+-----------------+rac1-> cat ~/.ssh/id_rsa.pub >> .ssh/authorized_keysrac1-> cat ~/.ssh/id_dsa.pub >> .ssh/authorized_keysrac1-> ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysoracle@rac2's password:rac1-> ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keysoracle@rac2's password:rac1-> scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keysoracle@rac2's password:authorized_keys 100% 1992 2.0KB/s 00:00rac1-> ssh rac3 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysoracle@rac3's password:rac1-> ssh rac3 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keysoracle@rac2's password:rac1-> scp ~/.ssh/authorized_keys rac3:~/.ssh/authorized_keysoracle@rac3's password:authorized_keys 100% 1992 2.0KB/s 00:00Rac2节点[root@rac2 ~]# su - oraclerac2-> mkdir ~/.sshrac2-> chmod 755 .ssh/rac2-> ssh-keygen -t rsaGenerating public/private rsa key pair.Enter file in which to save the key (/home/oracle/.ssh/id_rsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/oracle/.ssh/id_rsa.Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.The key fingerprint is:92:05:4d:35:d2:c9:da:21:b4:06:43:bb:ef:4c:6e:45 oracle@rac2The key's randomart image is:+--[ RSA 2048]----+| .=+++o. || =oo=. || . ++ . || =. E || + S. || o . || o. || =. || .+ |+-----------------+rac2-> ssh-keygen -t dsaGenerating public/private dsa key pair.Enter file in which to save the key (/home/oracle/.ssh/id_dsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/oracle/.ssh/id_dsa.Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.The key fingerprint is:99:00:7e:00:b1:a9:d8:45:68:03:4c:ce:ce:ef:30:0d oracle@rac2The key's randomart image is:+--[ DSA 1024]----+|+oo++ ||o.+= o || +o.o o ||+o . . . o ||oE. S || + || o o || + || . |+-----------------+rac2-> cat ~/.ssh/id_rsa.pub >> .ssh/authorized_keysrac2-> cat ~/.ssh/id_dsa.pub >> .ssh/authorized_keysrac2-> ssh rac1 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysThe authenticity of host 'rac1 (192.168.37.21)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1,192.168.37.21' (RSA) to the list of known hosts.rac2-> ssh rac1 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keysrac2-> scp ~/.ssh/authorized_keys rac1:~/.ssh/authorized_keysauthorized_keys 100% 2988 2.9KB/s 00:00rac1-> ssh rac3 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysoracle@rac3's password:rac1-> ssh rac3 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keysoracle@rac2's password:rac1-> scp ~/.ssh/authorized_keys rac3:~/.ssh/authorized_keysoracle@rac3's password:authorized_keys 100% 1992 2.0KB/s 00:00Rac3节点[root@rac2 ~]# su - oraclerac2-> mkdir ~/.sshrac2-> chmod 755 .ssh/rac2-> ssh-keygen -t rsaGenerating public/private rsa key pair.Enter file in which to save the key (/home/oracle/.ssh/id_rsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/oracle/.ssh/id_rsa.Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.The key fingerprint is:92:05:4d:35:d2:c9:da:21:b4:06:43:bb:ef:4c:6e:45 oracle@rac2The key's randomart image is:+--[ RSA 2048]----+| .=+++o. || =oo=. || . ++ . || =. E || + S. || o . || o. || =. || .+ |+-----------------+rac2-> ssh-keygen -t dsaGenerating public/private dsa key pair.Enter file in which to save the key (/home/oracle/.ssh/id_dsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/oracle/.ssh/id_dsa.Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.The key fingerprint is:99:00:7e:00:b1:a9:d8:45:68:03:4c:ce:ce:ef:30:0d oracle@rac2The key's randomart image is:+--[ DSA 1024]----+|+oo++ ||o.+= o || +o.o o ||+o . . . o ||oE. S || + || o o || + || . |+-----------------+rac2-> cat ~/.ssh/id_rsa.pub >> .ssh/authorized_keysrac2-> cat ~/.ssh/id_dsa.pub >> .ssh/authorized_keysrac2-> ssh rac1 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysThe authenticity of host 'rac1 (192.168.37.21)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1,192.168.37.21' (RSA) to the list of known hosts.rac2-> ssh rac1 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keysrac2-> scp ~/.ssh/authorized_keys rac1:~/.ssh/authorized_keysauthorized_keys 100% 2988 2.9KB/s 00:00rac1-> ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysoracle@rac2's password:rac1-> ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keysoracle@rac2's password:rac1-> scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keysoracle@rac3's password:authorized_keys 100% 1992 2.0KB/s 00:00 Oracle用户对等性检测Rac1节点rac1-> ssh rac2 dateTue Jun 17 12:35:32 CST 2014rac1-> ssh rac3 dateTue Jun 17 12:35:32 CST 2014rac1-> ssh rac1 dateThe authenticity of host 'rac1 (192.168.37.21)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1,192.168.37.21' (RSA) to the list of known hosts. Tue Jun 17 12:35:39 CST 2014rac1-> ssh rac1 dateTue Jun 17 12:35:42 CST 2014rac1-> ssh rac1-priv dateThe authenticity of host 'rac1-priv (172.16.1.1)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1-priv,172.16.1.1' (RSA) to the list of known hosts. Tue Jun 17 12:42:40 CST 2014rac1-> ssh rac1-priv dateTue Jun 17 12:42:43 CST 2014rac1-> ssh rac2-priv dateThe authenticity of host 'rac2-priv (172.16.1.2)' can't be established.RSA key fingerprint is c3:1c:e5:62:f2:35:87:4b:51:55:40:41:29:c7:bb:b1.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac2-priv,172.16.1.2' (RSA) to the list of known hosts. Tue Jun 17 12:42:48 CST 2014rac1-> ssh rac2-priv dateTue Jun 17 12:42:50 CST 2014rac1-> ssh rac3-priv dateThe authenticity of host 'rac2-priv (172.16.1.2)' can't be established.RSA key fingerprint is c3:1c:e5:62:f2:35:87:4b:51:55:40:41:29:c7:bb:b1.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac2-priv,172.16.1.2' (RSA) to the list of known hosts. Tue Jun 17 12:42:48 CST 2014rac1-> ssh rac3-priv dateTue Jun 17 12:42:50 CST 2014成功!!!Rac2节点rac2-> ssh rac1 dateTue Jun 17 12:43:06 CST 2014rac2-> ssh rac2 dateThe authenticity of host 'rac2 (192.168.37.22)' can't be established.RSA key fingerprint is c3:1c:e5:62:f2:35:87:4b:51:55:40:41:29:c7:bb:b1.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac2,192.168.37.22' (RSA) to the list of known hosts. Tue Jun 17 12:43:11 CST 2014rac2-> ssh rac2 dateTue Jun 17 12:43:14 CST 2014rac2-> ssh rac3 dateThe authenticity of host 'rac2 (192.168.37.22)' can't be established.RSA key fingerprint is c3:1c:e5:62:f2:35:87:4b:51:55:40:41:29:c7:bb:b1.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac2,192.168.37.22' (RSA) to the list of known hosts. Tue Jun 17 12:43:11 CST 2014rac2-> ssh rac3 dateTue Jun 17 12:43:14 CST 2014rac2-> ssh rac1-priv dateThe authenticity of host 'rac1-priv (172.16.1.1)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1-priv,172.16.1.1' (RSA) to the list of known hosts. Tue Jun 17 12:43:22 CST 2014rac2-> ssh rac1-priv dateTue Jun 17 12:43:24 CST 2014rac2-> ssh rac3-priv dateThe authenticity of host 'rac1-priv (172.16.1.1)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1-priv,172.16.1.1' (RSA) to the list of known hosts. Tue Jun 17 12:43:22 CST 2014rac2-> ssh rac3-priv dateTue Jun 17 12:43:24 CST 2014rac2-> ssh rac2-priv dateThe authenticity of host 'rac2-priv (172.16.1.2)' can't be established.RSA key fingerprint is c3:1c:e5:62:f2:35:87:4b:51:55:40:41:29:c7:bb:b1.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac2-priv,172.16.1.2' (RSA) to the list of known hosts. Tue Jun 17 12:43:28 CST 2014rac2-> ssh rac2-priv dateTue Jun 17 12:43:31 CST 2014成功!!!Rac3节点rac2-> ssh rac1 dateTue Jun 17 12:43:06 CST 2014rac2-> ssh rac2 dateTue Jun 17 12:43:14 CST 2014rac2-> ssh rac3 dateThe authenticity of host 'rac2 (192.168.37.22)' can't be established.RSA key fingerprint is c3:1c:e5:62:f2:35:87:4b:51:55:40:41:29:c7:bb:b1.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac2,192.168.37.22' (RSA) to the list of known hosts. Tue Jun 17 12:43:11 CST 2014rac2-> ssh rac3 dateTue Jun 17 12:43:14 CST 2014rac2-> ssh rac1-priv dateThe authenticity of host 'rac1-priv (172.16.1.1)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1-priv,172.16.1.1' (RSA) to the list of known hosts. Tue Jun 17 12:43:22 CST 2014rac2-> ssh rac1-priv dateTue Jun 17 12:43:24 CST 2014rac2-> ssh rac2-priv dateThe authenticity of host 'rac1-priv (172.16.1.1)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1-priv,172.16.1.1' (RSA) to the list of known hosts. Tue Jun 17 12:43:22 CST 2014rac2-> ssh rac2-priv dateTue Jun 17 12:43:24 CST 2014rac2-> ssh rac3-priv dateThe authenticity of host 'rac2-priv (172.16.1.2)' can't be established.RSA key fingerprint is c3:1c:e5:62:f2:35:87:4b:51:55:40:41:29:c7:bb:b1.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac2-priv,172.16.1.2' (RSA) to the list of known hosts. Tue Jun 17 12:43:28 CST 2014rac2-> ssh rac3-priv dateTue Jun 17 12:43:31 CST 2014成功!!!Grid用户ssh对等性配置Grid用户对等性配置Rac1节点[root@rac1 ~]# su - gridrac1-> mkdir ~/.sshrac1-> chmod 755 ~/.ssh/rac1-> ssh-keygen -t rsaGenerating public/private rsa key pair.Enter file in which to save the key (/home/grid/.ssh/id_rsa): Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/grid/.ssh/id_rsa.Your public key has been saved in /home/grid/.ssh/id_rsa.pub.The key fingerprint is:99:cd:f4:44:a9:f1:23:16:40:d6:a9:b7:99:a0:e7:76 grid@rac1The key's randomart image is:+--[ RSA 2048]----+| .+o ... || . =.. || ..=. || o*=oo || .S+o=.. || . . + || o || o E || . . |+-----------------+rac1-> ssh-keygen -t dsaGenerating public/private dsa key pair.Enter file in which to save the key (/home/grid/.ssh/id_dsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/grid/.ssh/id_dsa.Your public key has been saved in /home/grid/.ssh/id_dsa.pub.The key fingerprint is:03:60:03:14:2e:c1:77:ee:d2:55:46:00:4b:ac:bb:68 grid@rac1The key's randomart image is:+--[ DSA 1024]----+|o.+o=o..o. || + o.=. o ||. o +.. o || . . . o || + . S || o o . || . o || E . ||. |+-----------------+rac1-> cat ~/.ssh/id_rsa.pub >> .ssh/authorized_keysrac1-> cat ~/.ssh/id_dsa.pub >> .ssh/authorized_keysrac1-> ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysThe authenticity of host 'rac2 (192.168.37.22)' can't be established.RSA key fingerprint is c3:1c:e5:62:f2:35:87:4b:51:55:40:41:29:c7:bb:b1.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac2,192.168.37.22' (RSA) to the list of known hosts.grid@rac2's password:rac1-> ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keysgrid@rac2's password:rac1-> scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keysgrid@rac2's password:authorized_keys 100% 1984 1.9KB/s 00:00rac1-> ssh rac3 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysThe authenticity of host 'rac2 (192.168.37.22)' can't be established.RSA key fingerprint is c3:1c:e5:62:f2:35:87:4b:51:55:40:41:29:c7:bb:b1.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac2,192.168.37.22' (RSA) to the list of known hosts.grid@rac2's password:rac1-> ssh rac3 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keysgrid@rac2's password:rac1-> scp ~/.ssh/authorized_keys rac3:~/.ssh/authorized_keysgrid@rac2's password:authorized_keys 100% 1984 1.9KB/s 00:00 Rac2节点[root@rac2 ~]# su - gridrac2-> mkdir ~/.sshrac2-> chmod 755 ~/.ssh/rac2-> ssh-keygen -t rsaGenerating public/private rsa key pair.Enter file in which to save the key (/home/grid/.ssh/id_rsa): Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/grid/.ssh/id_rsa.Your public key has been saved in /home/grid/.ssh/id_rsa.pub.The key fingerprint is:ae:87:bc:30:60:98:98:d4:36:bb:60:d6:dd:df:3d:54 grid@rac2The key's randomart image is:+--[ RSA 2048]----+| || . || . + E ||o+o + . . ||=+oo . .S . ||o.... .. . o || .o. ... . o || oo.. . || oo |+-----------------+rac2-> ssh-keygen -t dsaGenerating public/private dsa key pair.Enter file in which to save the key (/home/grid/.ssh/id_dsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/grid/.ssh/id_dsa.Your public key has been saved in /home/grid/.ssh/id_dsa.pub.The key fingerprint is:63:49:2d:9b:55:54:8a:52:d8:5e:4a:c0:fc:ff:ff:91 grid@rac2The key's randomart image is:+--[ DSA 1024]----+| o.+..o.. || +ooo.. || +++o. || . B+ || S . || . . . .|| . E || . .|| .+|+-----------------+rac2-> cat ~/.ssh/id_rsa.pub >> .ssh/authorized_keysrac2-> cat ~/.ssh/id_dsa.pub >> .ssh/authorized_keysrac2-> ssh rac1 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysThe authenticity of host 'rac1 (192.168.37.21)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1,192.168.37.21' (RSA) to the list of known hosts.rac2-> ssh rac1 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keysrac2-> scp ~/.ssh/authorized_keys rac1:~/.ssh/authorized_keysauthorized_keys 100% 2976 2.9KB/s 00:00rac2-> ssh rac3 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysThe authenticity of host 'rac1 (192.168.37.21)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1,192.168.37.21' (RSA) to the list of known hosts.rac2-> ssh rac3 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keysrac2-> scp ~/.ssh/authorized_keys rac3:~/.ssh/authorized_keysauthorized_keys 100% 2976 2.9KB/s 00:00Rac3节点[root@rac2 ~]# su - gridrac2-> mkdir ~/.sshrac2-> chmod 755 ~/.ssh/rac2-> ssh-keygen -t rsaGenerating public/private rsa key pair.Enter file in which to save the key (/home/grid/.ssh/id_rsa): Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/grid/.ssh/id_rsa.Your public key has been saved in /home/grid/.ssh/id_rsa.pub.The key fingerprint is:ae:87:bc:30:60:98:98:d4:36:bb:60:d6:dd:df:3d:54 grid@rac2The key's randomart image is:+--[ RSA 2048]----+| || . || . + E ||o+o + . . ||=+oo . .S . ||o.... .. . o || .o. ... . o || oo.. . || oo |+-----------------+rac2-> ssh-keygen -t dsaGenerating public/private dsa key pair.Enter file in which to save the key (/home/grid/.ssh/id_dsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/grid/.ssh/id_dsa.Your public key has been saved in /home/grid/.ssh/id_dsa.pub.The key fingerprint is:63:49:2d:9b:55:54:8a:52:d8:5e:4a:c0:fc:ff:ff:91 grid@rac2The key's randomart image is:+--[ DSA 1024]----+| o.+..o.. || +ooo.. || +++o. || . B+ || S . || . . . .|| . E || . .|| .+|+-----------------+rac2-> cat ~/.ssh/id_rsa.pub >> .ssh/authorized_keysrac2-> cat ~/.ssh/id_dsa.pub >> .ssh/authorized_keysrac2-> ssh rac1 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysThe authenticity of host 'rac1 (192.168.37.21)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1,192.168.37.21' (RSA) to the list of known hosts.rac2-> ssh rac1 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keysrac2-> scp ~/.ssh/authorized_keys rac1:~/.ssh/authorized_keysauthorized_keys 100% 2976 2.9KB/s 00:00rac2-> ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysThe authenticity of host 'rac1 (192.168.37.21)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1,192.168.37.21' (RSA) to the list of known hosts.rac2-> ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keysrac2-> scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keysauthorized_keys 100% 2976 2.9KB/s 00:00Oracle用户对等性检测Rac1节点rac1-> iduid=1100(grid) gid=1000(oinstall) groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper)context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023rac1-> ssh rac1 dateThe authenticity of host 'rac1 (192.168.37.21)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1,192.168.37.21' (RSA) to the list of known hosts.Tue Jun 17 13:10:05 CST 2014rac1-> ssh rac1 dateTue Jun 17 13:10:08 CST 2014rac1-> ssh rac2 dateTue Jun 17 13:10:12 CST 2014rac1-> ssh rac3 dateTue Jun 17 13:10:12 CST 2014rac1-> ssh rac1-priv dateThe authenticity of host 'rac1-priv (172.16.1.1)' can't be established.RSA key fingerprint is 53:b8:a1:de:30:e3:d4:80:17:d3:7f:f5:b2:9d:11:45.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac1-priv,172.16.1.1' (RSA) to the list of known hosts.Tue Jun 17 13:10:36 CST 2014rac1-> ssh rac1-priv dateTue Jun 17 13:10:37 CST 2014rac1-> ssh rac2-priv dateThe authenticity of host 'rac2-priv (172.16.1.2)' can't be established.RSA key fingerprint is c3:1c:e5:62:f2:35:87:4b:51:55:40:41:29:c7:bb:b1.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'rac2-priv,172.16.1.2' (RSA) to the list of known hosts.Tue Jun 17 13:10:42 CST 2014rac1-> ssh rac2-priv dateTue Jun 17 13:10:45 CST 2014rac1-> ssh rac3-priv dateThe authenticity of host 'rac2-priv (172.16.1.2)' can't be established.。

oracle 11gr2图文安装rac版

oracle 11gr2图文安装rac版

Oracle 11G R2 RAC实施过程图文版(本文仅限于11G R2 on redhatlinux 6.x系列)内容目录1 实施准备 (2)1.1 调研与方案制定 (2)1.2 存储划分方案(参考) (3)1.3 介质 (4)2 设置系统 (4)2.1 系统检查 (4)2.1.1 cpu信息 (4)2.1.1 确认内存大小 (5)2.1.2 检查文件系统 (5)2.1.3 检查网络设置 (6)2.2 设置操作系统 (7)2.2.1 主机正名 (7)2.2.2 配置本地主机名解析hosts文件 (7)2.2.3 修改内核参数 (7)2.2.4 关闭防火墙服务 (8)2.2.5 关闭selinux (8)2.2.6 配置时钟同步 (9)2.3 设置软件安装/运行用户 (9)2.3.1 创建用户 (9)2.3.2 设置初始密码 (10)2.3.3 设置用户进程资源配额 (10)2.4 设置存储 (10)2.4.1 多路径软件配置 (10)2.4.2 udev绑定参考 (11)3 安装软件 (12)3.1 准备安装介质 (12)3.1.1 准备目录和权限(所有节点) (12)3.1.2 上传zip包(推荐ftp方式) (12)3.1.3 使用grid用户解包 (13)3.2 安装集群软件 (13)3.2.1 运行安装程序runInstaller (13)3.2.2 设置grid用户环境变量 (37)3.2.3 验证资源和服务状态,确定成功安装 (37)3.2.4 验证缺省监听 (38)3.2.5 查看scan_listener (39)3.3 安装数据库软件 (39)3.3.1 运行交互式安装程序runInstaller (39)3.3.2 为oracle用户的添加软件环境变量 (47)4 创建数据库 (47)4.1 创建asm diskgroup (47)4.1.1 以grid用户运行asmca工具 (47)4.2 创建数据库zbwshx(在1节点操作) (49)5 应用累计补丁更新PSU (69)5.1 升级补丁工具opatch (69)5.2 补丁1节点软件 (69)5.3 补丁2节点软件 (71)5.4 升级数据库(1节点操作) (71)6 附加脚本(可选) (72)6.1 调整数据库一些缺省设置 (72)6.2 管理集群服务 (73)7 初始化业务环境(举例) (73)1 实施准备1.1 调研与方案制定1.2 存储划分方案(参考)存储要1T1T分配,超过2T会有问题1.3 介质2 设置系统2.1 系统检查2.1.1 cpu信息1 查看物理cpu数shell(root)>cat /proc/cpuinfo |grep physical\ id|sort|uniq2 查看单个cpu coresshell(root)>cat /proc/cpuinfo |grepcpu\ cores|uniq3 查看单个是否超线程shell(root)>cat /proc/cpuinfo |grepcpu\ cores|uniq4 合计cpu coresshell(root)>cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c shell(root)>mpstat 12.1.1 确认内存大小物理内存是256Gswap取值算法为物理内存的一倍,当物理内存超过64G,建议>=物理内存,这里32G符合最小2.1.2 检查文件系统/var和/tmp空间至少2G,建议10G/dev/shm共享空间设为物理内存/2 2.1.3 检查网络设置检查1节点public网卡设置检查2节点public网卡设置检查1节点private网卡地址(第一组)检查2节点private网卡设置(第一组)检查1节点 private网卡(第二组)检查2节点private网卡(第二组)2.2 设置操作系统2.1.1 主机正名1节点(全部小写最好了)2节点注意:重新登陆确认改变生效2.1.2 配置本地主机名解析hosts文件shell(root)>vi /etc/hosts#public address192.168.9.101 zbwshx01192.168.9.102 zbwshx02#public vip address192.168.9.103 zbwshx01-vip192.168.9.104 zbwshx02-vip192.168.9.105 zbwshx-cluster-scan(建议3个,用DNS解析)#private group #110.10.11.11 zbwshx01-priv110.10.11.12 zbwshx02-priv1#private group #210.10.12.11 zbwshx01-priv210.10.12.12 zbwshx02-priv2#NTP服务器192.168.5.11 ntpserver2.1.3 修改内核参数1.编辑sysctl.confshell(root)>vi /etc/sysctl.conf#ORACLE SETTINGfs.aio-max-nr = 1048576fs.file-max = 6815744#{shmall}单位pages,命令"echo $((物理内存/$(getconf PAGESIZE)))"(计算:物理内存/4096)kernel.shmall = 67108864#{shmmax},单位bytes,为物理内存一半,echo $((256*1024*1024*1024/2))kernel.shmmax = 137438953472(物理内存/2)kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586net.ipv4.ipfrag_high_thresh=524288net.ipv4.ipfrag_low_thresh=393216net.ipv4.tcp_rmem=4096 524288 16777216net.ipv4.tcp_wmem=4096 524288 16777216net.ipv4.tcp_timestamps=0net.ipv4.tcp_sack=0net.ipv4.tcp_window_scaling=1net.core.optmem_max=524287dev_max_backlog=2500sunrpc.tcp_slot_table_entries=128sunrpc.udp_slot_table_entries=128net.ipv4.tcp_mem=16384 16384 16384#多心跳网卡时需要多播技术net.ipv4.conf.default.rp_filter = 0#多播设备eth2,eth4net.ipv4.conf.eth2.rp_filter = 0net.ipv4.conf.eth4.rp_filter = 02.生效shell(root)>modprobesunrpcshell(root)>sysctl -p2.1.4 关闭防火墙服务shell(root)>chkconfig --level 2345 iptables offshell(root)>chkconfig --level 2345 ip6tables offshell(root)>service iptables stopshell(root)>service ip6tables stop2.1.5 关闭selinuxshell(root)>setenforce 0shell(root)>vi /etc/selinux/configSELINUX=disabled2.1.6 配置时钟同步∙配置NTP服务器<非数据库内容,略>∙配置ntp客户端shell(root)>vi /etc/ntp.conf注释掉其他restrict和server条目,增加如下serverntpserverrestrictntpserver mask 255.255.255.255nomodifynotrapnoquery ∙修改ntpd配置文件shell(root)>vi /etc/sysconfig/ntpdSYNC_HWCLOCK=yesOPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"∙重启ntpd进程shell(root)>chkconfig --level 2345 ntpd onshell(root)>service ntpd start∙确认握手成功shell(root)>ntpq -p(初次同步需要一定时间)∙检查状态shell(root)>ntpstat2.2 设置软件安装/运行用户2.2.1 创建用户shell(root)>groupadd -g 10501 oinstallshell(root)>groupadd -g 10502 asmadminshell(root)>groupadd -g 10503 asmdbashell(root)>groupadd -g 10504 asmopershell(root)>groupadd -g 10505 dbashell(root)>groupadd -g 10506 opershell(root)>useradd -m -u 10501 -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -s /bin/bash -c "Grid Infrastructure Owner" gridshell(root)>useradd -m -u 10502 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle2.2.2 设置初始密码shell(root)>password gridshell(root)>password oracle2.2.3 设置用户进程资源配额shell(root)>vi /etc/security/limits.conf#ORACLE SETTINGroot soft nproc 2047root hard nproc 16384root soft nofile 1024root hard nofile 65536root soft stack 10240root hard stack 32768grid soft nproc 2047grid hard nproc 16384grid soft nofile 1024grid hard nofile 65536grid soft stack 10240grid hard stack 32768oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 10240oracle hard stack 327682.3 设置存储要求:✓同一个lun/vdisk在每个节点上设备名一致✓根据方案,通过scsi_id确认每一个lun/vdisk从存储上划分正确的✓共享模式要求在lun/vdisk在每个节点能同时读写✓RAC安装,lun/vdisk在操作系统上的设备名的属主是grid,组主是asmadmin,权限6602.3.1 多路径软件配置<非数据库内容,略>redhatlinux自带多路径软件multipath的参考文档官方文档:https:///documentation/zh-CN/Red_Hat_Enterprise_Linux/6/html/DM_Multipath/index.html百度搜索文档:/i6241962348353946114/绑定用户组案例:/2014/01/multipath实现设备用户组设置.html2.3.2 udev绑定参考注意:∙如果多路径软件已经实现了设备名绑定、属(组)主设置、权限设置,则不需要再配置udev∙udev不具有多路径failover能力∙本例为scsi磁盘∙∙1.shell(root)>fdisk -l|grep Disk\ /dev/sd根据系统人员告知,设备sda是本地操作系统宿主硬盘,不能使用,剩下的是共享磁盘2.查看scsi_idshell(root)>scsi_id -gvu /dev/sdN3.新建或编辑udev的rule文件shell(root)>vi /etc/udev/rules.d/99-oracle.rules(必须是99)KERNEL=="sd*", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk",ENV{ID_SERIAL}=="36006016010402600126dd2e653ebe511", NAME+="crs_01", OWNER="grid", GROUP="asmadmin", MODE="0660"KERNEL=="sd*", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk",ENV{ID_SERIAL}=="360060160104026004eb5b3db53ebe511", NAME+="crs_02", OWNER="grid", GROUP="asmadmin", MODE="0660"KERNEL=="sd*", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk",ENV{ID_SERIAL}=="360060160104026006edcb7d153ebe511", NAME+="crs_03", OWNER="grid", GROUP="asmadmin", MODE="0660"KERNEL=="sd*", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk",ENV{ID_SERIAL}=="36006016010402600f0b413ee53ebe511", NAME+="fra_data_01", OWNER="grid", GROUP="asmadmin", MODE="0660"KERNEL=="sd*", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk",ENV{ID_SERIAL}=="36006016010402600162f6d1254ebe511", NAME+="zbwshx_data_01", OWNER="grid", GROUP="asmadmin", MODE="0660"4.启动udevshell(root)>udevadm control reload-rulesshell(root)>start_udev3 安装软件3.1 准备安装介质(介质上传到/u01/media/oracle/linux_x64目录)3.1.1 准备目录和权限(所有节点)shell(root)>mkdir -p /u01/media/oracle/linux_x64shell(root)>chown -R grid:oinstall /u01shell(root)>chmod -R g+w /u013.1.2 上传zip包(推荐ftp方式)✓用grid用户上传✓上传grid安装包,database安装包,补丁包,补丁工具✓上传后介质属主grid,组主oinstall3.1.3 使用grid用户解包shell(grid)>cd /u01/media/oracle/linux_x64shell(grid)>unzip p1*******_112040_Linux-x86-64_1of7.zipshell(grid)>unzip p1*******_112040_Linux-x86-64_2of7.zipshell(grid)>unzip p1*******_112040_Linux-x86-64_3of7.zip3.2 安装集群软件3.2.1 运行安装程序runInstallershell(grid)>cd gridshell(grid)>./runInstaller提示:为了把x-windows程序的界面投射到windows终端上,需要执行2个步骤1.在windows上启动本地X11Forward程序,推荐x-manager中的xpassive(端口默认6000,注意firewall)2.在服务器上设定shell环境变量:export DISPLAY=YourIP:0.03.执行xclock测试在DHCP+DNS的环境,需要激活GNS,这里关闭本方案只有一个SCAN IP,使用/etc/hosts解析(也就是说需要将SCAN IP写入到/etc/hosts 下)建立主机之间ssh互信,这样可以免密码互相登陆,oracle安装过程中会把1节点的软件自动复制到2节点。

ORACLE 11G RAC 安装部署及测试方案

ORACLE 11G RAC 安装部署及测试方案

ORACLE 11G RAC 安装部署及测试方案BY:JM.CAO一、系统要求1.1硬件环境要求Oracle11gR2 RAC 最低安装要求:内存:安装 grid infrastructure 最少需要 1.5GB 的内存,安装grid infrastructure 和 RAC 最少需要 2.5GB 的内存swap:最少需要 1.5GB,推荐等于实际物理内存temp:最少 1GB /tmp安装目录:grid infrastructure最少需要 15GB空间,oracle database 至少15GB ,建议为安装目录创建单独的文件系统,如: /u01。

操作系统:aix 6.1,并且需要安装如下软件包:lslpp -l bos.adt.base bos.adt.lib \bos.adt.libm bos.perf.libperfstat\bos.perf.perfstat bos.perf.proctools rsct.basic.rte \ pat.clients.rte xlC.aix61.rte1.2 网络环境要求1.2.1、IP 地址要求Oracle 11gR2 RAC 中对网络的要求与 10g 稍有些不同,除 Public IP、Private IP、VIP外,在Oracle 11gR2RAC 中还引入了 SCAN IP的概念。

SCAN 全称是 Single Client Access Name ,它是 Oracle RAC 11gR2 版本的一个新特性。

它为需要访问Oracle 集群数据的客户端提供一个简单名字。

1.2.2、DNS 服务器在 Oracle 11gR2 RAC 中引入了 SCAN 的概念,而 ORACLE 推荐使用DNS 解析的方法来实现 SCAN,这就要求网络中有一台 DNS 服务器用来解析SCAN 地址。

如果你网络中没有专用的 DNS 服务器,那么也可以使用hosts文件进行解析。

oracle11grac安装图解

oracle11grac安装图解

oracle11grac安装图解(1)安装和配置集群的⽹络基本结构(2)选择⾼级安装(3)将中⽂添加到右侧边框,添加中⽂可避免在使⽤ em 时乱码(4)填写集群名称和scan的解析名称及端⼝,点击next(5)在弹出界⾯,点击add,填写节点2的信息(6)接⼝⽤法,公⽤专⽤(7)为OCR和表决盘选择 ASM 存储⽅式(8)选择crsvol,并填写磁盘组名称,点击下⼀步(9)填写密码(10)不配置IPMI(11)默认组(12)指定安装位置与环境变量中⽬录相同(13)产品清单与环境变量中⽬录相同(14)开始安装(15)执⾏脚本顺序不能错[root@rac1 ~]# /oracle/app/oraInventory/orainstRoot.sh[root@rac2 ~]# /oracle/app/oraInventory/orainstRoot.sh[root@rac1 ~]# /oracle/app/11.2.0/grid/product/db_1/root.sh[root@rac2 ~]# /oracle/app/11.2.0/grid/product/db_1/root.shINS-20802 实⽤程序失败,可忽略创建asm磁盘组在grid ⽤户下,执⾏ asmca,启动 asm 磁盘组创建向导点击create 按钮,在弹出的创建界⾯中填写磁盘组名称,选择外边存储⽅,并勾选成员,选择完毕后点击 ok 选项为外部显⽰符合项。

创建数据库(1)仅安装数据库软件(2)选择全部节点,点击 next(3)将简体中⽂添加到安装选项(4)选择企业版,点击 next(5)保持默认的⽬录,点击 next 应该与环境变量设置相同(6)保持默认的属组信息,点击 next(7)安装过程⾃动进⾏安装检查创建集群数据库实例[oracle@rac1 database]$ dbca(1)选中oracle real application cluters database,下⼀步:(2)创建数据库(3)定制数据库(4)填写全局数据库名和SID,全选节点(5)默认(6)⼝令管理(7)默认(8)指定ASM⼝令(9)⼀直默认,知道字符集选UTF8完成。

Oracle11g搭建RAC步骤

Oracle11g搭建RAC步骤

一、网卡绑定1、修改配置文件/etc/modprobe.confalias bond0 bondingalias bond1 bonding/etc/sysconfig/network-scripts/ifcfg-bond0DEVICE=bond0BOOTPROTO=staticONBOOT=yesUSERCTL=noIPADDR=192.168.56.101BROADCAST=192.168.56.255NETWORK=192.168.56.0NETMASK=255.255.255.0TYPE=EthernetBONDING_OPTS="mode=1 miimon=100"/etc/sysconfig/network-scripts/ifcfg-bond1DEVICE=bond1BOOTPROTO=staticONBOOT=yesUSERCTL=noIPADDR=192.168.136.101BROADCAST=192.168.136.255NETWORK=192.168.136.0NETMASK=255.255.255.0TYPE=EthernetBONDING_OPTS="mode=1 miimon=100"/etc/sysconfig/network-scripts/ifcfg-eth0# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] DEVICE=eth0BOOTPROTO=noneONBOOT=yesUSERCTL=noHWADDR=00:0c:29:9e:87:44MASTER=bond0SLAVE=yes/etc/sysconfig/network-scripts/ifcfg-eth1# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] DEVICE=eth1BOOTPROTO=noneONBOOT=yesHWADDR=00:0c:29:9e:87:4eMASTER=bond0SLAVE=yes/etc/sysconfig/network-scripts/ifcfg-eth2# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] DEVICE=eth2BOOTPROTO=noneONBOOT=yesUSERCTL=noHWADDR=00:0c:29:9e:87:58MASTER=bond1SLAVE=yes/etc/sysconfig/network-scripts/ifcfg-eth3# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] DEVICE=eth3BOOTPROTO=noneONBOOT=yesHWADDR=00:0c:29:9e:87:62USERCTL=noMASTER=bond1SLAVE=yes命令:ifensalve bond0 eth0 eth1ifensalve bond1 eth2 eth3service network restart2、检查配置cat /proc/net/bonding/bond0Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)Bonding Mode: fault-tolerance (active-backup)Primary Slave: NoneCurrently Active Slave: eth0MII Status: upMII Polling Interval (ms): 100Up Delay (ms): 0Down Delay (ms): 0Slave Interface: eth0MII Status: upLink Failure Count: 0Permanent HW addr: 00:0c:29:9e:87:44Slave queue ID: 0Slave Interface: eth1MII Status: upLink Failure Count: 0Permanent HW addr: 00:0c:29:9e:87:4eSlave queue ID: 0cat /proc/net/bonding/bond1Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)Bonding Mode: fault-tolerance (active-backup)Primary Slave: NoneCurrently Active Slave: eth2MII Status: upMII Polling Interval (ms): 100Up Delay (ms): 0Down Delay (ms): 0Slave Interface: eth2MII Status: upLink Failure Count: 0Permanent HW addr: 00:0c:29:9e:87:58Slave queue ID: 0Slave Interface: eth3MII Status: upLink Failure Count: 0Permanent HW addr: 00:0c:29:9e:87:62Slave queue ID: 03、测试自动切换在vmware workstation界面上将相应的网卡(cat /proc/met/bonding/bondN)disconnect,依次测试。

Oracle三种高可用方案原理介绍--解决方案

Oracle三种高可用方案原理介绍--解决方案

Oracle三种高可用方案原理介绍--解决方案Oracle 三种高可用方案原理介绍一、概述Oracle因为是商用版本,所以高可用方案都已经非常成熟,主要有三种高可用方案,下边分别介绍一下。

1 RAC(Real Application Clusters)多个Oracle服务器组成一个共享的Cache,而这些oracle服务器共享一个基于网络的存储。

这个系统可以容忍单机/或是多机失败。

不过系统内部的多个节点需要高速网络互连,基本上也就是要全部东西放在在一个机房内,或者说一个数据中心内。

如果机房出故障,比如网络不通,那就坏了。

所以仅仅用RAC还是满足不了一般互联网公司的重要业务的需要,重要业务需要多机房来容忍单个机房的事故。

2 Data Guard.(最主要的功能是冗灾)Data Guard这个方案就适合多机房的。

某机房一个production 的数据库,另外其他机房部署standby的数据库。

Standby数据库分物理的和逻辑的。

物理的standby数据库主要用于production失败后做切换。

而逻辑的standby数据库则在平时可以分担production数据库的读负载。

3 MAAMAA(Maximum Availability Architecture)其实不是独立的第三种,而是前面两种的结合,来提供最高的可用性。

每个机房内部署RAC集群,多个机房间用Data Guard同步。

二、三种高可用方式工作原理1、Oracle 11G RACRAC环境与单实例最主要的区别是:.RAC的每个实例都有属于自己的SGA、后台进程。

由于数据文件、控制文件共享于所有实例,所以必须放在共享存储中。

..联机重做日志文件:只有一个实例可以写入,但是其他实例可以再回复和存档期间读取。

..归档日志:属于该实例,但在介质恢复期间,其他实例需要访问所需的归档日志。

..alter和trace日志:属于每个实例自己,其他实例不可读写。

oracle_g_R2_RAC原理解读

oracle_g_R2_RAC原理解读

oracle_g_R2_RAC原理解读Oracle 11g R2 RAC(Real Application Clusters)是一种高可用性和高性能的数据库解决方案。

它允许多个服务器共享单一的数据库,并且可以在一个节点发生故障时无缝地转移到另一个节点。

在这篇文章中,我们将解读Oracle 11g R2 RAC的原理,包括它的架构和主要特性。

首先,让我们来了解一下Oracle RAC的架构。

Oracle RAC由多个独立的服务器节点(也称为集群节点)组成,这些节点通过共享存储访问同一个数据库。

每个节点都运行自己的Oracle实例,并且这些实例之间通过高速网络互联。

在RAC环境中,所有节点都可以同时处理客户端请求,并且可以动态地调度工作负载以提高性能和可扩展性。

在Oracle RAC中,有两个关键的组件:Clusterware和数据库实例。

Clusterware是Oracle提供的集群管理工具,它可以确保集群节点之间的通信以及集群节点的高可用性。

它负责监控和管理节点、资源分配和故障恢复等任务。

数据库实例则是在每个节点上运行的Oracle数据库引擎,负责处理客户端请求、执行SQL语句和维护数据一致性。

下面我们来详细讨论一下Oracle RAC的主要特性和工作原理。

1.共享存储:在RAC环境中,所有节点都可以访问存储器中的相同数据文件。

这意味着无论请求来自哪个节点,都可以使用相同的数据文件进行访问。

这样可以避免数据复制和数据不一致的问题,并且可以实现更高的数据可用性和可扩展性。

2.负载均衡:RAC环境中的Clusterware可以动态地将工作负载分散到不同的节点上,以提高性能和可扩展性。

当一些节点的负载较高时,Clusterware会将新的请求路由到负载较低的节点上,这样可以避免节点过载,并且能够更好地利用集群资源。

3.故障转移:RAC环境中,如果一些节点发生故障,Clusterware会自动将该节点上的数据库实例转移到其他正常运行的节点上。

oracle 11g rac 原理

oracle 11g rac 原理

oracle 11g rac 原理Oracle 11g RAC(Real Application Clusters)是Oracle数据库的一种高可用解决方案,它允许多个节点共享同一个数据库实例,以提供更高的可用性和可扩展性。

以下是Oracle 11g RAC 的原理:1. 共享存储:Oracle 11g RAC需要使用共享存储来存储数据库的数据文件、控制文件和日志文件。

共享存储通常是通过网络连接到多个节点,因此所有节点可以同时访问存储中的数据。

2. 共享连接:Oracle 11g RAC使用Cluster Interconnect来提供节点之间的高速连接。

Cluster Interconnect是一个专用的高速网络,用于节点之间的通信,以确保数据的一致性和互操作性。

3. 共享缓存:每个节点都有自己的SGA(System Global Area)用来缓存数据库的数据块。

Oracle 11g RAC使用Cache Fusion技术来确保所有节点的缓存数据的一致性。

当一个节点需要访问另一个节点的数据时,它可以直接从其他节点的缓存中读取数据,而不需要访问磁盘。

4. 共享处理:Oracle 11g RAC使用Global Cache Service(GCS)和Global Enqueue Service(GES)来协调多个节点上的并发事务。

GCS负责管理缓存数据的锁定和共享,以保证数据的一致性,而GES负责处理并发事务之间的资源请求和释放。

5. 自动故障转移:Oracle 11g RAC具有自动故障转移功能,当某个节点宕机时,自动将该节点上的数据库实例转移到其他节点上,以保证服务的连续性。

故障转移是通过Clusterware软件来实现的,它可以监控节点的状态,并在节点失效时自动触发故障转移操作。

总的来说,Oracle 11g RAC通过共享存储、共享连接、共享缓存和共享处理来实现多个节点之间的数据共享和并发访问。

Oracle 11gRAC数据库安装(HPUX11.31+ASM without MC-SG)

Oracle 11gRAC数据库安装(HPUX11.31+ASM without MC-SG)

HPUX11.31+RAC11G数据库安装2011年6月Author: ma.yu@目录1.用户需求: (3)2.安装过程: (4)2.1 系统环境准备,检查两台机器的状况: (4)2.2 网络环境准备: (7)2.3 补丁: (7)2.4 内核参数修改: (7)2.5 创建ORACLE用户: (8)2.6 磁盘分配: (10)2.7 ORACLE 安装前准备: (13)2.8 ORACLE Clusterware安装: (15)2.9 ORACLE RAC database软件安装: (30)2.10 升级11.1.0.6到11.1.0.7: (38)2.11 Listener创建: (53)2.12 dbca创建数据库: (54)1.用户需求:用户需要安装一套数据库RAC:数据库软件:Oracle11g数据库软件版本:11.1.0.6 ,升级到11.1.0.7。

模式:rac数据库sid:MIS数据库ip 规划如下:目前这边硬件环境是两台rx6600 ,操作系统版本:HP-UX B.11.31存贮设备hp storage works P2000,总存储空间2.8T ,这套存储设备供MIS系统使用的磁盘分为四个,分别为1G,800G*3。

2.安装过程:由于用户没有购买SGeRAC,所以在这次的安装过程中,使用Clusterware+RACdatabase+ASM的方式,不使用SGeRAC。

这样的话,所有的非ASM数据都要保存在共享磁盘分区裸设备上,而不是共享的lv 上。

2.1 系统环境准备,检查两台机器的状况:A.检查内存大小,至少>1GB.# /usr/contrib/bin/machinfo | grep -i Memory# /usr/sbin/dmesg | grep "Physical:"16GB.B.交换空间的检查:-If RAM between 1GB and 2GB, then swap space required is 1.5 times the size of RAM-If RAM > 2GB, then swap space required is equal to the size of RAM# /usr/sbin/swapinfo –a16GB。

VMware搭建Oracle-11g-RAC测试环境-For-Linux

VMware搭建Oracle-11g-RAC测试环境-For-Linux

2015-01-11 17:16 15359人阅读评论(0) 收藏举报分类:Oracle RAC(1)声明:本文为博主原创文章,未经博主允许不得。

环境如下:Linux操作系统:Centos 6.5 64bit (这个版本的redhat 6核等OS在安装grid最后执行root.sh时会出现crs-4124,是oracle11.2.0.1的bug)VMware version:Workstation 8.0.3 build-703057Oracle版本:11G R2 grid/oracle 64位11.2.0.1.0 for linux步骤规划:1,配置虚拟机、安装Linux操作系统2,配置OS3,配置ASM4,安装Oracle grid5,安装Oracle database6,创建ASM磁盘组7,建立数据库实例1,配置虚拟机、安装Linux操作系统1.1 新建虚拟机:RAC1和RAC2,并安装OS下载Centos的iso后新建虚拟机后安装即可,这里略。

注意存分配,每个虚拟机至少1.5G存比较好,我的机器8G存,给每个虚拟机分了2G,给每个虚拟机分配50GB硬盘容量,配置2个桥接网卡。

1.2 配置Share Disks新建共享硬盘,在DOS VM安装目录下执行:cd \D F:/Software/vm8/vmware-vdiskmanager.exe -c -s 1000Mb -a lsilogic -t 2 K:\VMDisk\Sharedisk\ocr.vmdk vmware-vdiskmanager.exe -c -s 1000Mb -a lsilogic -t 2 K:\VMDisk\Sharedisk\ocr2.vmdk vmware-vdiskmanager.exe -c -s 1000Mb -a lsilogic -t 2K:\VMDisk\Sharedisk\votingdisk.vmdkvmware-vdiskmanager.exe -c -s 20000Mb -a lsilogic -t 2 K:\VMDisk\Sharedisk\data.vmdkvmware-vdiskmanager.exe -c -s 10000Mb -a lsilogic -t 2K:\VMDisk\Sharedisk\backup.vmdk配置虚拟机RAC1 RAC2目录下的vmx虚拟机配置文件,在行最后添加如下:scsi1.present = "TRUE"scsi1.virtualDev = "lsilogic"scsi1.sharedBus = "virtual"scsi1:1.present = "TRUE"scsi1:1.mode = "independent-persistent"scsi1:1.filename = "K:\VMDisk\Sharedisk\ocr.vmdk"scsi1:1.deviceType = "plainDisk"scsi1:2.present = "TRUE"scsi1:2.mode = "independent-persistent"scsi1:2.filename = "K:\VMDisk\Sharedisk\votingdisk.vmdk"scsi1:2.deviceType = "plainDisk"scsi1:3.present = "TRUE"scsi1:3.mode = "independent-persistent"scsi1:3.filename = "K:\VMDisk\Sharedisk\data.vmdk"scsi1:3.deviceType = "plainDisk"scsi1:4.present = "TRUE"scsi1:4.mode = "independent-persistent"scsi1:4.filename = "K:\VMDisk\Sharedisk\backup.vmdk"scsi1:4.deviceType = "plainDisk"scsi1:5.present = "TRUE"scsi1:5.mode = "independent-persistent"scsi1:5.filename = "K:\VMDisk\Sharedisk\ocr2.vmdk"scsi1:5.deviceType = "plainDisk"disk.locking = "false"diskLib.dataCacheMaxSize = "0"diskLib.dataCacheMaxReadAheadSize = "0"diskLib.DataCacheMinReadAheadSize = "0"diskLib.dataCachePageSize = "4096"diskLib.maxUnsyncedWrites = "0"保存退出。

oracle11grac规划计划方案.docx

oracle11grac规划计划方案.docx

ORACLE 高可用性(RAC)技术方案目录一、基础知识介绍 ........................................错误 !未定义书签。

1. RAC 是什么 ........................................错误 !未定义书签。

2. RAC 的优势 ........................................错误 !未定义书签。

RAC 原理 ............................................错误 !未定义书签。

二、 RAC 系统结构设计 ....................................错误 !未定义书签。

系统拓扑结构基本如下图所示: ........................错误 !未定义书签。

2.用户组规划 .........................................错误 !未定义书签。

3.用户规划 ...........................................错误 !未定义书签。

4.磁盘规划 ...........................................错误 !未定义书签。

rac 网络规划 ........................................错误 !未定义书签。

一、基础知识介绍1. RAC 是什么RAC ,全称 real application clusters,译为“实时应用集群”, 是 Oracle 新版数据库中采用的一项新技术,是高可用性的一种,也是Oracle数据库支持网格计算环境的核心技术。

2. RAC 的优势Oracle RAC 主要支持 Oracle9i 、 10g、11g 版本,可以支持 24 x 7 有效的数据库应用系统,在低成本服务器上构建高可用性数据库系统,并且自由部署应用,无需修改代码。

Canaima(Debian)Linux上安装oracle11g RAC

Canaima(Debian)Linux上安装oracle11g RAC

VMware WorkStation+Canaima GNU/Linux4.0+Oracle11gR2+RAC1在VMware WorkStation上安装Canaima GNU/Linux 4.0版本系统1.1新建虚拟机canaimalinux1选择自定义安装注:这里的选项中没有Canaima linux的选项,Canaima linux是委内瑞拉国内在Debian linux 上开发的一个操作系统,所以这里就选择Debian了注:给虚拟机指定CPU数量和核数注:给虚拟机指定内存数量。

安装oracle 11gR2的RAC官方推荐的内存为不小于4G,但是我这里是在自己的笔记本上安装的虚拟机,只能分配1G的内存。

注:创建一个虚拟磁盘注:最好为创建的虚拟磁盘提前分配好足够的空间然后点击“完成”就开始创建虚拟磁盘了。

虚拟磁盘创建完成之后,虚拟机自动重启,进入安装Canaima linux的过程。

1.2安装Canaima linux注:选择系统默认的选项,回车就可继续安装由于Canaima linux操作系统是委内瑞拉政府指定使用的操作系统,所以该操作系统的安装过程中的默认引导语言是西班牙语,选择“Adelante”就代表“下一步”的意思。

点击下一步之后,Canaima linux4.0版本允许选择地区/国家时区、语言、键盘类型,这三个选项默认都是委内瑞拉瑞拉、西班牙语、西班牙式键盘,这个暂时可以根据自身需要具体选择。

关于Canaima linux的磁盘分区:系统默认给出三种分区,但是三种分区给定的swap分区都只有1G,无法通过安装界面调整,需要调整的话,可以在操作系统安装完成之后,手动调整swap分区大小。

分区如下所示:设置管理员用户和密码、添加一个用户,并设置用户名和密码:点击“Adelante”按钮,进入如下页面后,系统开始自动安装,大约40分钟左右即可安装完成:出现这一步之后点击“reiniciar ahora”按钮,这个按钮表示“立即重启”,前面的按钮表示“稍后重启”。

oracle11g+asm+rac安装指南linux

oracle11g+asm+rac安装指南linux

oracle11g+asm+rac安装指南linuxoracle11g+asm+rac安装指导环境描述:网络接口、ip分配:#publicbind0192.100.65.19tpps-ora01192。

100.65.20tpps-ora02#vip192.100.65.21tpps-ora01-vip192.100.65.22tpps-ora02-vip#私人的172.16.65.19tpps-ora01-priv172.16.65.20tpps-ora02-priv#扫描192.100.65.23orascan主机名:修改hostname如主节点tpps-ora01,次节点tpps-ora02注:图中rac01改为tpps-ora01,rac02改为tpps-ora02,以下各图均按此方式操作。

[ root@localhost~]#vi/etc/sysconfig/network关闭selinux配置:[ root@localhost~]#cat/etc/selinux/config#thisfilecontrolsthestateofselinuxonthesystem.#selinux=cantakeoneofthesethreev alues:#强制执行SELinuxSecurity政策。

#permissive-selinuxprintswarningsinsteadofenforcing.#disabled-selinuxisfullydisabled.selinux=disabled#selinuxtype=政策的类型。

可能的价值是:#targeted-onlytargetednetworkdaemonsareprotected.#strict-fullselinuxprotection.selinuxtype=targeted关闭防火墙:[ root@localhost~]#chkconfig——列表表iptables0:off1:off2:on3:on4:on5:on6:off[root@localhost~]#chkconfigiptablesoff[ root@localhost~]#chkconfig--listiptablesiTables0:off1:off2:off3:off4:off5:off6:off1.检查每个节点的os环境1.检查可用空间:○[root@localhost~]#df-hFileSystemSizeUse%mountedon/dev/sda2124g4.2g114g4%//dev/sda1494m17m452m4%/boottmpfs2。

oracle 11gR2 RAC更换存储数据迁移方案

oracle 11gR2 RAC更换存储数据迁移方案

数据库更换存储迁移方案生产数据库环境数据库版本:Oracle 11g R2 RAC (11204)数据存储方式:共享存储,ASM管理ASM 组及名字: crsdg,datadg数据库实例名:zgdb1,zgdb2数据库数据量:100G操作系统版本:RedHat 5.8数据迁移实施步骤流程目前数据库的数据是存放在和其他业务共用的存储上,此次实施的目的是将数据迁移到新的存储上而不影响业务正常运行,迁移方案主要利用ASM 重平衡特性实现更换存储迁移数据,时间需要预计2天左右,大体迁移步骤就是如下几步操作:1.首先保证新存储和RAC当前节点间的可用性;2.将新存储划分LUN给2台数据库服务器,2台数据库服务器不替换,可以重新规划存储方案或者保持原存储方案,目前依照原存储规划方案;3.LUN磁盘映射给ORACLE集群,通过asmca或者asm命令行添加到ASM组中;4.迁移原OCR和votedisk表决盘到新ASM组;5.给现有ASM磁盘组添加ASM磁盘(新存储分配的),进行数据DATADG迁移,采用ASM重平衡的方式;6.删除原存储的ASM磁盘;7.检查系统、集群、数据库日志;新存储映射流程存储划分LUN映射1.存储和服务器之间连线;2.划分存储LUN,保证LUN数量及大小与之前旧存储划分一致;3.在数据库服务器安装多路径软件,保证2台服务链路一致;4.检查链路是否一致 powermt display dev=allLUN映射到ORACLE1.编辑/etc/udev/rules.d/50-udev.rules文件,添加新存储映射SUBSYSTEM=="block", KERNEL=="emcpowera", GROUP="asmadmin", OWNER="grid", MODE="0660"SUBSYSTEM=="block", KERNEL=="emcpowerb", GROUP="asmadmin", OWNER="grid", MODE="0660"SUBSYSTEM=="block", KERNEL=="emcpowerc", GROUP="asmadmin", OWNER="grid", MODE="0660"SUBSYSTEM=="block", KERNEL=="emcpowerd", GROUP="asmadmin", OWNER="grid", MODE="0660"SUBSYSTEM=="block", KERNEL=="emcpowere", GROUP="asmadmin", OWNER="grid", MODE="0660"SUBSYSTEM=="block", KERNEL=="emcpowerf", GROUP="asmadmin", OWNER="grid", MODE="0660"2.启动udev_start,识别存储路径3.切到grid用户,使用ASMCA,添加新的ASM磁盘组数据库双重备份数据库迁移实施之前,先把当前数据进行备份,防止迁移异常之后,能够及时恢复数据,使用2种方式对数据库进行备份;方式一:rman备份数据1.开启数据库归档,启动到mount下,alter database archivelog2.备份参数文件c reate pfile=’/home/oracle/backup/init.ora’ from spfile;3.备份数据库export ORACLE_SID= zgdb1rman target / log='/tmp/rman_full.log' append <<EOFrun{allocate channel c1 type disk;allocate channel c2 type disk;allocate channel c3 type disk;allocate channel c4 type disk;backup as compressed backupset filesperset 6 databaseformat '/home/oracle/backup/full_%d_%T_%s_%p';backup current controlfile format '/home/oracle/backup/ctl_%d_%T_%s_%p';}EOF4.备份密码文件cp $ORACLE_HOME/dbs/initpwzgdb1 /home/oracle/backup/5.数据库还原startup pfile=’/home/oracle/backup/init.ora’nomount;restore controlfile from '/home/oracle/rman/ctl_ ';alter database mount;restore database;recover database;alter database open;方式二:数据泵方式进行数据库备份1.创建directory目录create directory backup as '/home/oracle/backup';2.授权导出用户权限grant read,write on directory backup to system;3.备份数据expdp system/oracle directory=backup dumpfile=zgdb.dmp logfile=expdp.log schemas=hsman exclude=statistics cluster=n parallel=8;4.恢复数据impdp system/oracle directory=backup dumpfile=zgdb.dmp logfile=impdp.log schemas=hsman cluster=n parallel=8ASM迁移详细步骤集群迁移实施步骤1.grid用户下,使用asmca添加新的ASM组ocrvoting,3个10G LUN,采用normal方式;2.grid用户下,添加votediskcrsctl query css votediskcrsctl replace votedisk ocrvotingcreate pfile='/home/grid/asmpfile.ora' from spfile;create spfile='+ocrvoting' from pfile='/home/grid/asmpfile.ora';3.root用户下迁移ocrocrcheckocrconfig -add +ocrvotingocrconfig -replace +vocrvoting -replacement +crsdgocrconfig -delete +crsdgsqlplus / as sysasmalter diskgroup crsdg dismount;drop diskgroup crsdg including contents;4.检查votedisk和ocr状态crsctl query css votediskocrcheck数据迁移实施步骤1.查看数据磁盘状态sqlplus / as sysdbacol GROUP_NUMBER format 99col state format a10col name format a15col path format a20col failgroup format a20set line 200select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;2.迁移数据磁盘组数据(PATH),时间较长;SQL> alter diskgroup DATA add disk '/DEV/EMCPOWER1' rebalance power 11;Diskgroup altered.SQL> alter diskgroup DATA add disk '/DEV/EMCPOWER2' rebalance power 11;Diskgroup altered.SQL> alter diskgroup DATA add disk '/DEV/EMCPOWER3' rebalance power 11;Diskgroup altered.由于指定rebalance power 11,ASM会自动均衡ASM磁盘组DATA里面存放的数据在各ASM磁盘的分布。

ORACLE-11G-R2-搭建RAC集群硬件需求文档

ORACLE-11G-R2-搭建RAC集群硬件需求文档
ORACLE 11G R2 搭建RAC集群硬件需求文档
(数据量10亿条,并发量1000个)
配置说明
1
Dell R610两台
2
每台DELL服务器上有两个双端口千兆网卡,一个SAS HBA卡
3
每台DELL服务器内存容量:16GB ECC DDR3
4
每台DELL服务器Xeon E5606 2.13GHz CPU数量:2颗*4核
5
存储设备:Dell MD3200一台,外接主机通道:SAS,单机磁盘数量:12个
进行恰当的RAID配置,平均传输率:6GB/s,硬盘转速:SAS硬盘15000rpm,近线SAS硬盘
6
操作系统版本:Red Hat Enterprise linux5.6
7
Oracle版本:Oracle 11g R2
网络设置说明
192.168.1.252
Openfile1192.168. Nhomakorabea.195
192.168.2.195
Oracle软件组件说明
软件组件
操作系统用户
主组
辅助组
主目录
Oracle基目录/Oracle主目录
Grid Infrastructure
grid
oinstall
asmadmin、asmdba、asmoper
/home/grid
/u01/app/grid
/u01/app/11.2.0/grid
Oracle RAC
oracle
oinstall
dba、oper、asmdba
/home/oracle
/u01/app/oracle
/u01/app/oracle/product/11.2.0/dbhome_1

ORACLE LINUX 11G RAC 单实例DATAGUARD

ORACLE LINUX 11G RAC 单实例DATAGUARD

ORACLE LINUX 11G RAC 单实例DATAGUARD环境说明:源库:双节点RAC:CPU:12MEM:8G操作系统:Linux 2.6.18-194.el510.135.33.170 11grac110.135.33.171 11grac210.135.33.172 11grac1-vip10.135.33.173 11grac2-vipDB_NAME=oemdb_unique_Name=oemDATAGUARD目标库:单实例CPU:4MEM:6G操作系统:Linux 2.6.18-194.el510.135.161.241DB_NAME=oemdb_unique_name=dgtest安装步骤一、源库设置强制归档:二、源库设置参数,设置完毕后参数如下所示DB_NAME=oemDB_UNIQUE_NAME=oemLOG_ARCHIVE_CONFIG='DG_CONFIG=(oem,oem_dg)'LOG_ARCHIVE_DEST_1='LOCATION=/dbfs_backup/oemVALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=oem'LOG_ARCHIVE_DEST_2='SERVICE=oem_dg LGWR AFFIRMVALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=oem_dg'LOG_ARCHIVE_DEST_STATE_1=ENABLELOG_ARCHIVE_DEST_STATE_2=ENABLEREMOTE_LOGIN_PASSWORDFILE=EXCLUSIVELOG_ARCHIVE_FORMAT=%t_%s_%r.arcLOG_ARCHIVE_MAX_PROCESSES=4FAL_SERVER=oem_dgDB_FILE_NAME_CONVERT='/oradata/oem_dg/datafile/','+DATA/oem/dataf ile/'LOG_FILE_NAME_CONVERT='/oradata/oem_dg/','+DATA/oem/STANDBY_FILE_MANAGEMENT=AUTO执行如下命令设置:alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(oem,oem_dg)'scope=both sid='*';alter system set LOG_ARCHIVE_DEST_1='LOCATION=/dbfs_backup/oem VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=oem'scope=both sid='*';alter system set LOG_ARCHIVE_DEST_2='SERVICE=oem_dg LGWR AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=oem_dg' scope=both sid='*';alter system set log_archive_format='%t_%s_%r.arc'scope=spfile sid='*';alter system set log_archive_max_processes=4scope=both sid='*';alter system set fal_server=oem_dg scope=both sid='*';alter system setDB_FILE_NAME_CONVERT='/oradata/oem_dg/datafile/','+DATA/oem/dataf ile/'scope=spfile sid='*';alter system set LOG_FILE_NAME_CONVERT='/oradata/oem_dg/,'+DATA/oem/'scope=spfile sid='*';三、重启源库,设置为归档模式。

oracle11grac静默安装+racADG部署搭建

oracle11grac静默安装+racADG部署搭建

oracle11grac静默安装+racADG部署搭建说明以下说描述的的安装rac是安装⼀个rac备端,只需要安装grid软件和oracle软件即可。

⼀、硬件配置:cup:Linux db51 3.10.0-1062.el7.x86_64 #1 SMP Wed Aug 7 18:08:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux内存:250GOCR:3G*3DATA:480G*6⼆、软件环境:操作系统:CentOS Linux release 7.7.1908 (Core)数据库:oracle 11.2.0.4 R2 RAC三、业务系统:业务系统四、主机规划:五、数据库安装前准备1、配置DNS内容(可忽略):vi /etc/resolv.confnameserver 192.168.3.1nameserver 192.168.3.22、改hosts⽂件节点⼀db51和节点⼆db52:#pub192.168.3.51 db51192.168.3.52 db52#vip192.168.3.54 db51-vip10.10.10.52 db52-vip#priv10.10.10.51 db51-priv192.168.3.55 db52-priv#scan172.16.53.56 db-scan3、关闭防⽕墙systemctl status firewalldsystemctl stop firewalldsystemctl disable firewalld4、关闭selinuxSetenforce 0vi /etc/sysconfig/selinux将SELINUX值改为disabled6、关闭透明⼤页==查看:cat /sys/kernel/mm/transparent_hugepage/enabled[always] madvise never默认为always。

Oracle11gr2RAC到单实例的DG搭建(落地备份)

Oracle11gr2RAC到单实例的DG搭建(落地备份)

Oracle11gr2RAC到单实例的DG搭建(落地备份)⼀、实施⽅案这⼏天给客户的Oracle 11gr2 RAC搭建到单实例的DG,整理了⼀下步骤,理清⼀下思路,⽂中敏感信息已做模糊处理。

RAC⾄单实例的Dataguard为双节点各⾃传递⾃⼰当前线程的归档⾄备库。

由于节点1存储不⾜,备份在节点2上跑。

整体搭建思路如下:备库⽂件⽬录创建à主库force logging(已是归档模式)à备份节点⼆à复制节点⼆⼝令⽂件à创建备库pfileà创建备库à恢复备库à创建主备standby logfileà配置主备监听及TNSà修改主库(节点⼀、节点⼆)参数à打开备库并实时应⽤1.1 主备环境说明Primary Node1Node2Hostname hostname01hostname02Public10.10.10.14110.10.10.143VIP10.10.10.14210.10.10.144SCAN10.10.10.140Instance_name repprod1repprod2DB_name repprodService_names repprodDB_unique_name repprodStorage_mode ASMStandby NodeHostname hostnamedgIP10.10.10.191Instance_name RepproddgDB_name repprodService_names repproddgDB_unique_name repproddgStorage_mode Local disk1.2 ⽂件系统规划Primary Standby+DATADG/repprod/datafile/oradata/datafile+DATADG/repprod/tempfile/oradata/tempfile+ARCDG/repprod/onlinelog/oradata/onlinelog+DATADG/repprod/onlinelog+ARCDG//oradata/arch1.3 实施操作步骤1.3.1 备库存储和⽂件系统创建#standby库上新建各个数据⽂件的存放位置$mkdir -p /oradata/datafile --数据⽂件$mkdir -p /oradata/tempfile --临时⽂件$mkdir -p /oradata/onlinelog --redo⽇志$mkdir -p /oradata/controlfile --控制⽂件$mkdir -p /oradata/arch --归档⽂件#备库为全新安装oracle 11.2.0.4软件,需要⼿⼯建⽴以下⽬录,保持与主库⽬录⼀致。

oracle11gRAC的基本概念

oracle11gRAC的基本概念

oracle11gRAC的基本概念oracle 11g RAC 的一些基本概念(一)总的来说,oracle 11g r2 RAC提供了以下功能:1. 高可用:shared-everything 模式保证了单节点的故障不会停止服务,集群中的其他节点将快速接管2. 可扩展性:多节点分担负载,可以提供远超单机数据库能提供的处理能力。

且增删节点可以在线完成,不需要停机3. 易用性:多个数据库可以加入到一个集群中4. 低成本:RAC可以部署在标准硬件上,硬件上节省的成本抵消了购买license的成本Oracle 11g r2 还提供了一个叫RAC One Node的新功能。

Oracle发现一些RAC的部署纯粹只是为了高可用,而虚拟化越来越多的被用户所使用,并成为了一个新的趋势。

Oracle One Node建立在以下基础之上:Oracle Clusterware、Oracle ASM、Oracle database。

我们再来看一眼RAC的结构图相比较单机数据库,RAC需要一个共享存储;一个私有网络来进行集群内部通讯;一个公有网络来连接应用和客户端;配置虚拟IP来提高节点故障时的连接速度,当一个节点出现故障,它的虚拟ip立即指向其他节点的ip上(若不配置vip,当一个节点发生故障时,新的连接将会发生等待,直到与该节点ip的通讯出现time out)。

Failover的连接配置有两种连接方式可以实现数据库连接的failover1. TAF(Transparent Application Failover)让我们看一下官方文档。

TAF让Oracle Net将一个失效的连接从故障点转移到另一个监听上,用户能使用这个新的连接来继续未完成的工作,这是一个client端的功能。

TAF可以配置为使用client端的(Transparent Network Substrate)TNS 连接字符串来连接,或者使用server端的服务。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

ORACLE 高可用性
(RAC)
技术方案
目录
一、基础知识介绍 (3)
1. RAC 是什么 (3)
2. RAC 的优势 (3)
3.Oracle RAC原理 (3)
二、RAC 系统结构设计 (4)
1.RAC 系统拓扑结构基本如下图所示: (4)
2.用户组规划 (4)
3.用户规划 (5)
4.磁盘规划 (6)
5.oracle rac网络规划 (7)
一、基础知识介绍
1. RAC 是什么
RAC,全称real application clusters,译为“实时应用集群”,是Oracle 新版数据库中采用的一项新技术,是高可用性的一种,也是Oracle 数据库支持网格计算环境的核心技术。

2. RAC 的优势
Oracle RAC 主要支持Oracle9i、10g、11g 版本,可以支持24 x 7 有效的数据库应用系统,在低成本服务器上构建高可用性数据库系统,并且自由部署应用,无需修改代码。

在Oracle RAC 环境下,Oracle 集成提供了集群软件和存储管理软件,为用户降低了应用成本。

当应用规模需要扩充时,用户可以按需扩展系统,以保证系统的性能。

( 1)多节点负载均衡;
(2)提供高可用:故障容错和无缝切换功能,将硬件和软件错误造成的影响
最小化;
(3)通过并行执行技术提高事务响应时间----通常用于数据分析系统;
(4)通过横向扩展提高每秒交易数和连接数----通常对于联机事务系统;
(5)节约硬件成本,可以用多个廉价PC 服务器代替昂贵的小型机或大型机,
同时节约相应维护成本;
(6)可扩展性好,可以方便添加删除节点,扩展硬件资源。

3.Oracle RAC原理
在一个应用环境当中,所有的服务器使用和管理同一个数据库,目的是为了分散每一台服务器的工作量,硬件上至少需要两台以上的服务器,而且还需要一个共享存储设备。

同时所有服务器上的OS 都应该是同一类OS,根据负载均衡的配置策略,当一个客户端发送请求到某一台服务的listener 后,这台服务器根据我们的负载均衡策略,会把请求发送给本机的RAC 组件处理也可能会发送给另外一台服务器的RAC 组件处理,处理完请求后,RAC 会通过集群软件
来访问共享存储设备。

逻辑结构上看:
每一个参加集群的节点有一个独立的instance,这些instance 访问同一个数据库。

每一个节点的linstance 都有自己的SGA。

每一个节点的linstance 都有自己的background process。

每一个节点的linstance 都有自己的redo logs。

每一个节点的instance 都有自己的undo 表空间。

所有节点都共享一份datafiles 和controlfiles。

三类Resource:
VIP - 虚拟IP 地址(Virtual IP) l
OCR - Oracle Cluster Registry(集群注册文件),记录每个节点的相关信息l
Voting Disk,仲裁机制用于仲裁多个节点向共享节点同时写的行为,这样做是为了避免发生冲突。

二、RAC 系统结构设计
1.RAC 系统拓扑结构基本如下图所示:
2.用户组规划
RAC支持常用的linux、AIX、windows、solaris 等操作系统,本方案以linux
操作为例。

3.用户规划
4.磁盘规划
磁盘规划示例:
5.oracle rac网络规划
网络规划示例:。

相关文档
最新文档