使用UDEV在Oracle Linux 6上安装Oracle 11g RAC(11.2.0.3) (一)
在所有node上创建oracle,grid用户,创建相关目录
[root@node2 ~]# groupadd -g 1000 oinstall [root@node2 ~]# groupadd -g 1200 asmadmin [root@node2 ~]# groupadd -g 1201 asmdba [root@node2 ~]# groupadd -g 1202 asmoper [root@node2 ~]# useradd -m -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash -c "Grid Infrastructure Owner" grid [root@node2 ~]# groupadd -g 1300 dba [root@node2 ~]# groupadd -g 1301 oper [root@node2 ~]# useradd -m -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle [root@node2 ~]# mkdir -p /u01/app/grid [root@node2 ~]# mkdir -p /u01/app/11.2.0/grid [root@node2 ~]# chown -R grid:oinstall /u01 [root@node2 ~]# mkdir -p /u01/app/oracle [root@node2 ~]# chown oracle:oinstall /u01/app/oracle [root@node2 ~]# chmod -R 775 /u01 [root@node2 ~]# passwd oracle Changing password for user oracle. New password: BAD PASSWORD: it is based on a dictionary word BAD PASSWORD: is too simple Retype new password: passwd: all authentication tokens updated successfully. [root@node2 ~]# passwd grid Changing password for user grid. New password: BAD PASSWORD: it is too short BAD PASSWORD: is too simple Retype new password: passwd: all authentication tokens updated successfully. [root@node2 ~]# id oracle -a uid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper) [root@node2 ~]# id grid -a uid=1100(grid) gid=1000(oinstall) groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper)
安装相关rpm包,配置系统内核参数,这里我使用的是OL6提供的oracle-rdbms-server-11gR2-preinstall
[root@node2 ~]# yum -y install oracle-rdbms-server-11gR2-preinstall Loaded plugins: refresh-packagekit, security ol6_UEK_latest | 1.2 kB 00:00 ol6_UEK_latest/primary | 5.0 MB 00:14 ol6_UEK_latest 120/120 ol6_latest | 1.4 kB 00:00 ol6_latest/primary | 24 MB 01:07 ol6_latest 18391/18391 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el6 will be installed --> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: gcc for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: libstdc++-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: glibc-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Running transaction check ---> Package compat-libcap1.x86_64 0:1.10-1 will be installed ---> Package compat-libstdc++-33.x86_64 0:3.2.3-69.el6 will be installed ---> Package gcc.x86_64 0:4.4.6-4.el6 will be installed --> Processing Dependency: cpp = 4.4.6-4.el6 for package: gcc-4.4.6-4.el6.x86_64 --> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.6-4.el6.x86_64 ---> Package gcc-c++.x86_64 0:4.4.6-4.el6 will be installed --> Processing Dependency: libmpfr.so.1()(64bit) for package: gcc-c++-4.4.6-4.el6.x86_64 ---> Package glibc-devel.x86_64 0:2.12-1.80.el6_3.6 will be installed --> Processing Dependency: glibc-headers = 2.12-1.80.el6_3.6 for package: glibc-devel-2.12-1.80.el6_3.6.x86_64 --> Processing Dependency: glibc = 2.12-1.80.el6_3.6 for package: glibc-devel-2.12-1.80.el6_3.6.x86_64 --> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.80.el6_3.6.x86_64 ---> Package ksh.x86_64 0:20100621-16.el6 will be installed ---> Package libaio-devel.x86_64 0:0.3.107-10.el6 will be installed ---> Package libstdc++-devel.x86_64 0:4.4.6-4.el6 will be installed --> Running transaction check ---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed --> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64 --> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64 ---> Package cpp.x86_64 0:4.4.6-4.el6 will be installed ---> Package glibc.x86_64 0:2.12-1.80.el6 will be updated --> Processing Dependency: glibc = 2.12-1.80.el6 for package: glibc-common-2.12-1.80.el6.x86_64 ---> Package glibc.x86_64 0:2.12-1.80.el6_3.6 will be an update ---> Package glibc-headers.x86_64 0:2.12-1.80.el6_3.6 will be installed --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.80.el6_3.6.x86_64 --> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.80.el6_3.6.x86_64 ---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed --> Running transaction check ---> Package glibc-common.x86_64 0:2.12-1.80.el6 will be updated ---> Package glibc-common.x86_64 0:2.12-1.80.el6_3.6 will be an update ---> Package kernel-uek-headers.x86_64 0:2.6.32-300.39.2.el6uek will be installed ---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================================================= Package Arch Version Repository Size ======================================================================================================================================================================= Installing: oracle-rdbms-server-11gR2-preinstall x86_64 1.0-6.el6 ol6_latest 15 k Installing for dependencies: cloog-ppl x86_64 0.15.7-1.2.el6 ol6_latest 93 k compat-libcap1 x86_64 1.10-1 ol6_latest 17 k compat-libstdc++-33 x86_64 3.2.3-69.el6 ol6_latest 183 k cpp x86_64 4.4.6-4.el6 ol6_latest 3.7 M gcc x86_64 4.4.6-4.el6 ol6_latest 10 M gcc-c++ x86_64 4.4.6-4.el6 ol6_latest 4.7 M glibc-devel x86_64 2.12-1.80.el6_3.6 ol6_latest 970 k glibc-headers x86_64 2.12-1.80.el6_3.6 ol6_latest 600 k kernel-uek-headers x86_64 2.6.32-300.39.2.el6uek ol6_latest 716 k ksh x86_64 20100621-16.el6 ol6_latest 684 k libaio-devel x86_64 0.3.107-10.el6 ol6_latest 13 k libstdc++-devel x86_64 4.4.6-4.el6 ol6_latest 1.5 M mpfr x86_64 2.4.1-6.el6 ol6_latest 156 k ppl x86_64 0.10.2-11.el6 ol6_latest 1.3 M Updating for dependencies: glibc x86_64 2.12-1.80.el6_3.6 ol6_latest 3.8 M glibc-common x86_64 2.12-1.80.el6_3.6 ol6_latest 14 M Transaction Summary ======================================================================================================================================================================= Install 15 Package(s) Upgrade 2 Package(s) Total download size: 43 M Downloading Packages: (1/17): cloog-ppl-0.15.7-1.2.el6.x86_64.rpm | 93 kB 00:00 (2/17): compat-libcap1-1.10-1.x86_64.rpm | 17 kB 00:00 (3/17): compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm | 183 kB 00:00 (4/17): cpp-4.4.6-4.el6.x86_64.rpm | 3.7 MB 00:12 (5/17): gcc-4.4.6-4.el6.x86_64.rpm | 10 MB 00:28 (6/17): gcc-c++-4.4.6-4.el6.x86_64.rpm | 4.7 MB 00:13 (7/17): glibc-2.12-1.80.el6_3.6.x86_64.rpm | 3.8 MB 00:10 (8/17): glibc-common-2.12-1.80.el6_3.6.x86_64.rpm | 14 MB 00:40 (9/17): glibc-devel-2.12-1.80.el6_3.6.x86_64.rpm | 970 kB 00:02 (10/17): glibc-headers-2.12-1.80.el6_3.6.x86_64.rpm | 600 kB 00:02 (11/17): kernel-uek-headers-2.6.32-300.39.2.el6uek.x86_64.rpm | 716 kB 00:02 (12/17): ksh-20100621-16.el6.x86_64.rpm | 684 kB 00:02 (13/17): libaio-devel-0.3.107-10.el6.x86_64.rpm | 13 kB 00:00 (14/17): libstdc++-devel-4.4.6-4.el6.x86_64.rpm | 1.5 MB 00:04 (15/17): mpfr-2.4.1-6.el6.x86_64.rpm | 156 kB 00:00 (16/17): oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64.rpm | 15 kB 00:00 (17/17): ppl-0.10.2-11.el6.x86_64.rpm | 1.3 MB 00:03 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 329 kB/s | 43 MB 02:12 warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Retrieving key from http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 Importing GPG key 0xEC551F03: Userid: "Oracle OSS group (Open Source Software group) <[email protected]>" From : http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : libstdc++-devel-4.4.6-4.el6.x86_64 1/19 Updating : glibc-2.12-1.80.el6_3.6.x86_64 2/19 Updating : glibc-common-2.12-1.80.el6_3.6.x86_64 3/19 Installing : mpfr-2.4.1-6.el6.x86_64 4/19 Installing : cpp-4.4.6-4.el6.x86_64 5/19 Installing : compat-libcap1-1.10-1.x86_64 6/19 Installing : ksh-20100621-16.el6.x86_64 7/19 Installing : compat-libstdc++-33-3.2.3-69.el6.x86_64 8/19 Installing : ppl-0.10.2-11.el6.x86_64 9/19 Installing : cloog-ppl-0.15.7-1.2.el6.x86_64 10/19 Installing : kernel-uek-headers-2.6.32-300.39.2.el6uek.x86_64 11/19 Installing : glibc-headers-2.12-1.80.el6_3.6.x86_64 12/19 Installing : glibc-devel-2.12-1.80.el6_3.6.x86_64 13/19 Installing : gcc-4.4.6-4.el6.x86_64 14/19 Installing : gcc-c++-4.4.6-4.el6.x86_64 15/19 Installing : libaio-devel-0.3.107-10.el6.x86_64 16/19 Installing : oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 17/19 Cleanup : glibc-2.12-1.80.el6.x86_64 18/19 Cleanup : glibc-common-2.12-1.80.el6.x86_64 19/19 Verifying : compat-libcap1-1.10-1.x86_64 1/19 Verifying : ksh-20100621-16.el6.x86_64 2/19 Verifying : glibc-common-2.12-1.80.el6_3.6.x86_64 3/19 Verifying : gcc-4.4.6-4.el6.x86_64 4/19 Verifying : libaio-devel-0.3.107-10.el6.x86_64 5/19 Verifying : oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 6/19 Verifying : gcc-c++-4.4.6-4.el6.x86_64 7/19 Verifying : glibc-headers-2.12-1.80.el6_3.6.x86_64 8/19 Verifying : libstdc++-devel-4.4.6-4.el6.x86_64 9/19 Verifying : compat-libstdc++-33-3.2.3-69.el6.x86_64 10/19 Verifying : glibc-2.12-1.80.el6_3.6.x86_64 11/19 Verifying : mpfr-2.4.1-6.el6.x86_64 12/19 Verifying : kernel-uek-headers-2.6.32-300.39.2.el6uek.x86_64 13/19 Verifying : cpp-4.4.6-4.el6.x86_64 14/19 Verifying : glibc-devel-2.12-1.80.el6_3.6.x86_64 15/19 Verifying : ppl-0.10.2-11.el6.x86_64 16/19 Verifying : cloog-ppl-0.15.7-1.2.el6.x86_64 17/19 Verifying : glibc-2.12-1.80.el6.x86_64 18/19 Verifying : glibc-common-2.12-1.80.el6.x86_64 19/19 Installed: oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el6 Dependency Installed: cloog-ppl.x86_64 0:0.15.7-1.2.el6 compat-libcap1.x86_64 0:1.10-1 compat-libstdc++-33.x86_64 0:3.2.3-69.el6 cpp.x86_64 0:4.4.6-4.el6 gcc.x86_64 0:4.4.6-4.el6 gcc-c++.x86_64 0:4.4.6-4.el6 glibc-devel.x86_64 0:2.12-1.80.el6_3.6 glibc-headers.x86_64 0:2.12-1.80.el6_3.6 kernel-uek-headers.x86_64 0:2.6.32-300.39.2.el6uek ksh.x86_64 0:20100621-16.el6 libaio-devel.x86_64 0:0.3.107-10.el6 libstdc++-devel.x86_64 0:4.4.6-4.el6 mpfr.x86_64 0:2.4.1-6.el6 ppl.x86_64 0:0.10.2-11.el6 Dependency Updated: glibc.x86_64 0:2.12-1.80.el6_3.6 glibc-common.x86_64 0:2.12-1.80.el6_3.6 Complete!
[root@node2 ~]# cat /etc/sysctl.conf # Kernel sysctl configuration file for Red Hat Linux # # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and # sysctl.conf(5) for more details. # Controls IP packet forwarding net.ipv4.ip_forward = 0 # Controls source route verification net.ipv4.conf.default.rp_filter = 1 # Do not accept source routing net.ipv4.conf.default.accept_source_route = 0 # Controls the System Request debugging functionality of the kernel kernel.sysrq = 0 # Controls whether core dumps will append the PID to the core filename. # Useful for debugging multi-threaded applications. kernel.core_uses_pid = 1 # Controls the use of TCP syncookies net.ipv4.tcp_syncookies = 1 # Disable netfilter on bridges. net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0 # Controls the default maxmimum size of a mesage queue kernel.msgmnb = 65536 # Controls the maximum size of a message, in bytes kernel.msgmax = 65536 # Controls the maximum shared segment size, in bytes # Controls the maximum number of shared memory segments, in pages # oracle-rdbms-server-11gR2-preinstall setting for fs.file-max is 6815744 fs.file-max = 6815744 # oracle-rdbms-server-11gR2-preinstall setting for kernel.sem is '250 32000 100 128' kernel.sem = 250 32000 100 128 # oracle-rdbms-server-11gR2-preinstall setting for kernel.shmmni is 4096 kernel.shmmni = 4096 # oracle-rdbms-server-11gR2-preinstall setting for kernel.shmall is 1073741824 on x86_64 # oracle-rdbms-server-11gR2-preinstall setting for kernel.shmall is 2097152 on i386 kernel.shmall = 1073741824 # oracle-rdbms-server-11gR2-preinstall setting for kernel.shmmax is 4398046511104 on x86_64 # oracle-rdbms-server-11gR2-preinstall setting for kernel.shmmax is 4294967295 on i386 kernel.shmmax = 4398046511104 # oracle-rdbms-server-11gR2-preinstall setting for net.core.rmem_default is 262144 net.core.rmem_default = 262144 # oracle-rdbms-server-11gR2-preinstall setting for net.core.rmem_max is 4194304 net.core.rmem_max = 4194304 # oracle-rdbms-server-11gR2-preinstall setting for net.core.wmem_default is 262144 net.core.wmem_default = 262144 # oracle-rdbms-server-11gR2-preinstall setting for net.core.wmem_max is 1048576 net.core.wmem_max = 1048576 # oracle-rdbms-server-11gR2-preinstall setting for fs.aio-max-nr is 1048576 fs.aio-max-nr = 1048576 # oracle-rdbms-server-11gR2-preinstall setting for net.ipv4.ip_local_port_range is 9000 65500 net.ipv4.ip_local_port_range = 9000 65500
[root@node2 ~]# cat /etc/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/sda3 # initrd /initrd-[generic-]version.img #boot=/dev/sda default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Oracle Linux Server-uek (2.6.39-200.24.1.el6uek.x86_64) root (hd0,0) kernel /vmlinuz-2.6.39-200.24.1.el6uek.x86_64 ro root=UUID=8adc03e5-e7c8-42c9-a1e8-aae4bc1d2647 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet numa=off initrd /initramfs-2.6.39-200.24.1.el6uek.x86_64.img title Oracle Linux Server (2.6.32-279.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-279.el6.x86_64 ro root=UUID=8adc03e5-e7c8-42c9-a1e8-aae4bc1d2647 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet numa=off initrd /initramfs-2.6.32-279.el6.x86_64.img
[root@node2 ~]# tail -40 /etc/security/limits.conf #@faculty hard nproc 50 #ftp hard nproc 0 #@student - maxlogins 4 # End of file # oracle-rdbms-server-11gR2-preinstall setting for nofile soft limit is 1024 oracle soft nofile 1024 # oracle-rdbms-server-11gR2-preinstall setting for nofile hard limit is 65536 oracle hard nofile 65536 # oracle-rdbms-server-11gR2-preinstall setting for nproc soft limit is 2047 oracle soft nproc 2047 # oracle-rdbms-server-11gR2-preinstall setting for nproc hard limit is 16384 oracle hard nproc 16384 # oracle-rdbms-server-11gR2-preinstall setting for stack soft limit is 10240KB oracle soft stack 10240 # oracle-rdbms-server-11gR2-preinstall setting for stack hard limit is 32768KB oracle hard stack 32768 # oracle-rdbms-server-11gR2-preinstall setting for nofile soft limit is 1024 grid soft nofile 1024 # oracle-rdbms-server-11gR2-preinstall setting for nofile hard limit is 65536 grid hard nofile 65536 # oracle-rdbms-server-11gR2-preinstall setting for nproc soft limit is 2047 grid soft nproc 2047 # oracle-rdbms-server-11gR2-preinstall setting for nproc hard limit is 16384 grid hard nproc 16384 # oracle-rdbms-server-11gR2-preinstall setting for stack soft limit is 10240KB grid soft stack 10240 # oracle-rdbms-server-11gR2-preinstall setting for stack hard limit is 32768KB grid hard stack 32768
在node1和node2上使用oracle用户和grid执行以下操作,在家目录下生成.ssh目录
[root@node1 ~]# su - oracle [oracle@node1 ~]$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/oracle/.ssh/id_rsa): Created directory '/home/oracle/.ssh'. 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: 38:4e:6f:b0:fc:7e:f2:c0:00:67:13:79:ef:2a:a5:e8 [email protected] The key's randomart image is: +--[ RSA 2048]----+ | .. | | ... | | . +. . | | + o . | | * S. | | + B. . | | .+o=. | | . ooo.. | | .E oo+. | +-----------------+ [oracle@node1 ~]$ ssh-keygen -t dsa Generating 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: 42:77:1b:2e:24:1d:ec:cf:88:4a:3f:37:f0:b3:b2:cd [email protected] The key's randomart image is: +--[ DSA 1024]----+ | .. | | ... | | o.+ o | | . +.o o | | ..S+o | | . o...o | | . o o | | . +o= | | .=E+ | +-----------------+ [oracle@node1 ~]$ su - grid Password: [grid@node1 ~]$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/grid/.ssh/id_rsa): Created directory '/home/grid/.ssh'. 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: c2:e6:ee:b5:b6:c5:14:1a:78:e9:96:97:d9:0b:a1:13 [email protected] The key's randomart image is: +--[ RSA 2048]----+ | | | . . | | . E o | | . o * * | | + S * . | | o o = . . | | . . o . | | . ..o | | .o.o. | +-----------------+ [grid@node1 ~]$ ssh-keygen -t dsa Generating 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: d3:36:e8:54:10:84:a8:c6:59:6d:24:5f:3d:90:48:9d [email protected] The key's randomart image is: +--[ DSA 1024]----+ | .=o=** | | oo=.E.o | | . + .. .. | | = + | | . S + | | o o . | | . | | | | | +-----------------+
[oracle@node1 ~]$ cd .ssh/ [oracle@node1 .ssh]$ cat id_dsa.pub >> authorized_keys [oracle@node1 .ssh]$ cat id_rsa.pub >> authorized_keys [oracle@node1 .ssh]$ ssh node2 cat ~/.ssh/id_dsa.pub >> authorized_keys The authenticity of host 'node2 (192.168.1.52)' can't be established. RSA key fingerprint is 09:78:b3:fd:8d:a5:9a:a4:d8:fc:98:bd:e3:5e:80:3b. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'node2,192.168.1.52' (RSA) to the list of known hosts. oracle@node2's password: [oracle@node1 .ssh]$ ssh node2 cat ~/.ssh/id_rsa.pub >> authorized_keys oracle@node2's password: [oracle@node1 .ssh]$ scp authorized_keys node2:~/.ssh oracle@node2's password: authorized_keys 100% 2040 2.0KB/s 00:00 [oracle@node1 .ssh]$ su - grid Password: [grid@node1 ~]$ cd .ssh/ [grid@node1 .ssh]$ cat id_dsa.pub >> authorized_keys [grid@node1 .ssh]$ cat id_rsa.pub >> authorized_keys [grid@node1 .ssh]$ ssh node2 cat ~/.ssh/id_dsa.pub >> authorized_keys The authenticity of host 'node2 (192.168.1.52)' can't be established. RSA key fingerprint is 09:78:b3:fd:8d:a5:9a:a4:d8:fc:98:bd:e3:5e:80:3b. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'node2,192.168.1.52' (RSA) to the list of known hosts. grid@node2's password: [grid@node1 .ssh]$ ssh node2 cat ~/.ssh/id_rsa.pub >> authorized_keys grid@node2's password: [grid@node1 .ssh]$ scp authorized_keys node2:~/.ssh grid@node2's password: authorized_keys 100% 2032 2.0KB/s 00:00 [grid@node1 .ssh]$
[oracle@node1 ~]$ ssh node1-priv date;ssh node2-priv date Fri Dec 28 15:44:41 CST 2012 Fri Dec 28 15:44:41 CST 2012 [oracle@node1 ~]$ ssh node1 date;ssh node2 date Fri Dec 28 15:44:43 CST 2012 Fri Dec 28 15:44:43 CST 2012 [oracle@node1 ~]$ su - grid Password: [grid@node1 ~]$ ssh node1 date;ssh node2 date Fri Dec 28 15:44:48 CST 2012 Fri Dec 28 15:44:49 CST 2012 [grid@node1 ~]$ ssh node1-priv date;ssh node2-priv date Fri Dec 28 15:44:50 CST 2012 Fri Dec 28 15:44:50 CST 2012 [grid@node1 ~]$
[oracle@node2 ~]$ ssh node1-priv date;ssh node2-priv date Fri Dec 28 15:46:56 CST 2012 Fri Dec 28 15:46:56 CST 2012 [oracle@node2 ~]$ ssh node1 date;ssh node2 date Fri Dec 28 15:46:58 CST 2012 Fri Dec 28 15:46:58 CST 2012 [oracle@node2 ~]$ su - grid Password: [grid@node2 ~]$ ssh node1 date;ssh node2 date Fri Dec 28 15:47:02 CST 2012 Fri Dec 28 15:47:02 CST 2012 [grid@node2 ~]$ ssh node1-priv date;ssh node2-priv date Fri Dec 28 15:47:03 CST 2012 Fri Dec 28 15:47:03 CST 2012
node1上oracle用户
[oracle@node1 ~]$ cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH alias ls="ls -FA" ORACLE_SID=zhongwc1; export ORACLE_SID ORACLE_UNQNAME=zhongwc; export ORACLE_UNQNAME JAVA_HOME=/usr/local/java; export JAVA_HOME ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME ORACLE_PATH=/u01/app/common/oracle/sql; export ORACLE_PATH ORACLE_TERM=xterm; export ORACLE_TERM NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11 DISPLAY=192.168.2.224:0.0; export DISPLAY NLS_LANG=AMERICAN_AMERICA.ZHS16GBK; export NLS_LANG PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin PATH=${PATH}:/u01/app/common/oracle/bin export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib export CLASSPATH THREADS_FLAG=native; export THREADS_FLAG export TEMP=/tmp export TMPDIR=/tmp umask 022 alias sqlplus="rlwrap sqlplus" alias rman="rlwrap rman" alias ggsci="rlwrap ggsci" alias logdump="rlwrap logdump" alias asmcmd="rlwrap asmcmd" alias base="cd $ORACLE_BASE" alias home="cd $ORACLE_HOME"
[grid@node1 ~]$ cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH alias ls="ls -FA" ORACLE_SID=+ASM1; export ORACLE_SID JAVA_HOME=/usr/local/java; export JAVA_HOME ORACLE_BASE=/u01/app/grid; export ORACLE_BASE ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME ORACLE_PATH=/u01/app/oracle/common/oracle/sql; export ORACLE_PATH ORACLE_TERM=xterm; export ORACLE_TERM NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11 DISPLAY=192.168.2.224:0.0; export DISPLAY NLS_LANG=AMERICAN_AMERICA.ZHS16GBK; export NLS_LANG PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin PATH=${PATH}:/u01/app/common/oracle/bin export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib export CLASSPATH THREADS_FLAG=native; export THREADS_FLAG export TEMP=/tmp export TMPDIR=/tmp umask 022 alias sqlplus="rlwrap sqlplus" alias rman="rlwrap rman" alias ggsci="rlwrap ggsci" alias logdump="rlwrap logdump" alias asmcmd="rlwrap asmcmd" alias base="cd $ORACLE_BASE" alias home="cd $ORACLE_HOME"