oracle11gr2 linux6.3 rac asm安装过程全记录,实际测试可用。用的是asmlib的方式,实际使用时发现直接使用裸设备会更简单和高效,只做参考。这次测试都是一些较老的方式,没有用到yum,是一个一个的安装的软件包,顺序都是测试出来的。呵呵。之后的测试都会用到yum,方便了许多。dns使用的是windows的dns,在集群测试时,会报错,报延时的问题,联系oracle后也没有发现原因。后来使用linux的bind,没有这种错误。
1、linux磁盘划分
Sda1 /boot 1G Sda2 / 30G Sda3 /home 4G Sda5 /u01 20G Sda6 swap 8G
|
[root@racnode1 ~]# df -lh Filesystem Size Used Avail Use% Mounted on /dev/sda2 30G 3.1G 25G 12% / tmpfs 2.0G 176K 2.0G 1% /dev/shm /dev/sda1 1008M 78M 880M 9% /boot /dev/sda3 4.0G 137M 3.7G 4% /home /dev/sda5 20G 172M 19G 1% /u01 [root@racnode1 ~]# |
2、登陆用户名
raclinux1 ,raclinux2
机器名,racnode1,racnode2。
3、安装vmware tools
4、禁用firewall
禁用firewall在图形界面直接操作。
5、禁用selinux
将enforcing改为disable,然后重起服务器。
修改前,/etc/selinux/config
[root@racnode1 selinux]# more config
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=enforcing # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted |
修改后,
[root@racnode1 selinux]# more config
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted |
[root@racnode1 ~]# getenforce
Disabled
6、配置网络,host文件
建立iscsi网络,win2008存储使用的专用网卡是vnet2。
IP地址,10.10.10.10。两台linux的专用网卡的IP为,10.10.10.21,10.10.10.22。没有配置网关。
建立心跳网络,新建一个vnet4,专门给两台linux使用。172.16.31.1,172.16.31.2,无网关。
建立外部连接,外部连接默认的最初的网卡,这里不配置dns。
192.168.91.31,网关,192.168.91.2。
192.168.91.32,网关,192.168.91.2。
删除ip v6选项。
注意,两个节点的 /etc/hosts 设置相同,删除与 IPv6 有关的所有项。
/etc/hosts文件内容,
::1 localhost6.localdomain6 localhost6
[root@racnode1 ~]# more /etc/hosts 127.0.0.1 localhostlocalhost.localdomain localhost4 localhost4.localdomain4 ::1 localhostlocalhost.localdomain 192.168.91.31 racnode1 192.168.91.33 racnode1-vip
192.168.91.32 racnode2 192.168.91.34 racnode2-vip
192.168.91.35 racnode-scan注意scan IP通过dns来设置,这里没有这条!! |
7、时间同步
配置集群时间同步服务 — (CTSS)
如果您想使用集群时间同步服务在集群中提供同步服务,需要卸载网络时间协议 (NTP) 及其配置。
要停用 NTP 服务,必须停止当前的 ntpd 服务,从初始化序列中禁用该服务,并删除 ntp.conf 文件。要在Oracle Enterprise Linux 上完成这些步骤,以 root 用户身份在两个 Oracle RAC节点上运行以下命令:
[root@racnode1 ~]# /sbin/service ntpd stop
[root@racnode1 ~]# chkconfig ntpd off
[root@racnode1 ~]# mv /etc/ntp.conf /etc/ntp.conf.original
还要删除以下文件:
[root@racnode1 ~]# rm /var/run/ntpd.pid
此文件保存了 NTP 后台程序的 pid。
当安装程序发现 NTP 协议处于非活动状态时,安装集群时间同步服务将以活动模式自动进行安装并通过所有节点的时间。如果发现配置了NTP,则以观察者模式 启动集群时间同步服务,Oracle Clusterware 不会在集群中进行活动的时间同步。
在安装后,要确认 ctssd 处于活动状态,请作为网格安装所有者 (grid) 输入以下命令:
[grid@racnode1 ~]$ crsctl check ctss
CRS-4701: The Cluster Time Synchronization Service is in Activemode.
CRS-4702: Offset (in msec): 0
[root@racnode1 ~]# /sbin/service ntpd stop Shutting downntpd: [ OK ] [root@racnode1 ~]# chkconfig ntpd off [root@racnode1 ~]# mv /etc/ntp.conf /etc/ntp.conf.original [root@racnode1 ~]# rm /var/run/ntpd.pid rm: cannot remove `/var/run/ntpd.pid': No such file ordirectory [root@racnode1 ~]# ll /var/run/n* /var/run/netreport: total 0
/var/run/net-snmp: total 0
[root@racnode1 ~]# service ntpd status ntpd is stopped |
8、启动iscsi
直接在service服务的图形界面enable,iscsi和iscsid,两个服务。在两个节点上分别执行。
在win2008上配置iscsi的源。
共三个空间,ocr和voting,4G,database,20G,archive,20G。
启动linux上的iscsi,发现三个共享磁盘。
[root@racnode2 ~]# iscsiadm -m discovery -t sendtargets -p10.10.10.10 Startingiscsid: [ OK ] 10.10.10.10:3260,1iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target 192.168.91.10:3260,1iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target |
[root@racnode1 ~]# iscsiadm -m node -Tiqn.1991-05.com.microsoft:vmracvdisk-racnode63-target -p10.10.10.10 -l Logging in to [iface: default, target:iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target, portal:10.10.10.10,3260] (multiple) Login to [iface: default, target:iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target, portal:10.10.10.10,3260] successful. [root@racnode1 ~]# |
[root@racnode1 ~]# iscsiadm -m node -Tiqn.1991-05.com.microsoft:vmracvdisk-racnode63-target -p10.10.10.10 --op update -n node.startup -v automatic [root@racnode1 ~]# |
[root@racnode1 ~]# (cd /dev/disk/by-path; ls -l *vmracvdisk* |awk '{FS=" "; print $9 " " $10 " " $11}') ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-0-> ../../sdb ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-1-> ../../sdc ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-2-> ../../sdd [root@racnode1 ~]# |
[root@racnode1 ~]# fdisk -l
Disk /dev/sda: 96.6 GB, 96636764160 bytes 255 heads, 63 sectors/track, 11748 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0005dd3d
DeviceBoot Start End Blocks Id System /dev/sda1 * 1 131 1048576 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 131 3986 30965760 83 Linux /dev/sda3 3986 4508 4194304 83 Linux /dev/sda4 4508 11749 58162176 5 Extended /dev/sda5 4509 7119 20971520 83 Linux /dev/sda6 7120 8164 8388608 82 Linux swap / Solaris
Disk /dev/sdb: 4294 MB, 4294967296 bytes 133 heads, 62 sectors/track, 1017 cylinders Units = cylinders of 8246 * 512 = 4221952 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000
Disk /dev/sdc: 21.5 GB, 21474836480 bytes 64 heads, 32 sectors/track, 20480 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000
Disk /dev/sdd: 21.5 GB, 21474836480 bytes 64 heads, 32 sectors/track, 20480 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000
[root@racnode1 ~]# |
9、创建分区
[root@racnode1 ~]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun,SGI or OSF disklabel Building a new DOS disklabel with disk identifier0x5c08ed10. Changes will remain in memory only, until you decide to writethem. After that, of course, the previous content won't berecoverable.
Warning: invalid flag 0x0000 of partition table 4 will becorrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's stronglyrecommended to switch off the mode (command 'c') and change display units to sectors (command 'u').
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-1017, default 1): 1 Last cylinder, +cylinders or +size{K,M,G} (1-1017, default1017): Using default value 1017
Command (m for help): p
Disk /dev/sdb: 4294 MB, 4294967296 bytes 133 heads, 62 sectors/track, 1017 cylinders Units = cylinders of 8246 * 512 = 4221952 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x5c08ed10
DeviceBoot Start End Blocks Id System /dev/sdb1 1 1017 4193060 83 Linux
Command (m for help): w The partition table has been altered!
Calling ioctl() to re-read partition table. Syncing disks. |
[root@racnode1 ~]# fdisk /dev/sdc Device contains neither a valid DOS partition table, nor Sun,SGI or OSF disklabel Building a new DOS disklabel with disk identifier0x70405c5a. Changes will remain in memory only, until you decide to writethem. After that, of course, the previous content won't berecoverable.
Warning: invalid flag 0x0000 of partition table 4 will becorrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's stronglyrecommended to switch off the mode (command 'c') and change display units to sectors (command 'u').
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-20480, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-20480, default20480): Using default value 20480
Command (m for help): p
Disk /dev/sdc: 21.5 GB, 21474836480 bytes 64 heads, 32 sectors/track, 20480 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x70405c5a
DeviceBoot Start End Blocks Id System /dev/sdc1 1 20480 20971504 83 Linux
Command (m for help): w The partition table has been altered!
Calling ioctl() to re-read partition table. Syncing disks. |
[root@racnode1 ~]# fdisk /dev/sdd Device contains neither a valid DOS partition table, nor Sun,SGI or OSF disklabel Building a new DOS disklabel with disk identifier0xfa2d8d65. Changes will remain in memory only, until you decide to writethem. After that, of course, the previous content won't berecoverable.
Warning: invalid flag 0x0000 of partition table 4 will becorrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's stronglyrecommended to switch off the mode (command 'c') and change display units to sectors (command 'u').
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): Value out of range. Partition number (1-4): 1 First cylinder (1-20480, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-20480, default20480): Using default value 20480
Command (m for help): p Disk /dev/sdd: 21.5 GB, 21474836480 bytes 64 heads, 32 sectors/track, 20480 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xfa2d8d65
DeviceBoot Start End Blocks Id System /dev/sdd1 1 20480 20971504 83 Linux
Command (m for help): w The partition table has been altered!
Calling ioctl() to re-read partition table. Syncing disks. [root@racnode1 ~]# |
[root@racnode1 ~]# fdisk -l
Disk /dev/sda: 96.6 GB, 96636764160 bytes 255 heads, 63 sectors/track, 11748 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0005dd3d
DeviceBoot Start End Blocks Id System /dev/sda1 * 1 131 1048576 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 131 3986 30965760 83 Linux /dev/sda3 3986 4508 4194304 83 Linux /dev/sda4 4508 11749 58162176 5 Extended /dev/sda5 4509 7119 20971520 83 Linux /dev/sda6 7120 8164 8388608 82 Linux swap / Solaris
Disk /dev/sdb: 4294 MB, 4294967296 bytes 133 heads, 62 sectors/track, 1017 cylinders Units = cylinders of 8246 * 512 = 4221952 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x5c08ed10
DeviceBoot Start End Blocks Id System /dev/sdb1 1 1017 4193060 83 Linux
Disk /dev/sdc: 21.5 GB, 21474836480 bytes 64 heads, 32 sectors/track, 20480 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x70405c5a
DeviceBoot Start End Blocks Id System /dev/sdc1 1 20480 20971504 83 Linux
Disk /dev/sdd: 21.5 GB, 21474836480 bytes 64 heads, 32 sectors/track, 20480 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xfa2d8d65
DeviceBoot Start End Blocks Id System /dev/sdd1 1 20480 20971504 83 Linux [root@racnode1 ~]# |
在备节点执行,partprobe。
[root@racnode2 ~]# partprobe Warning: WARNING: the kernel failed to re-read the partitiontable on /dev/sda (Device or resource busy). As aresult, it may not reflect all of your changes until afterreboot.
[root@racnode2 ~]# fdisk -l
Disk /dev/sda: 96.6 GB, 96636764160 bytes 255 heads, 63 sectors/track, 11748 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000c12e5
DeviceBoot Start End Blocks Id System /dev/sda1 * 1 131 1048576 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 131 3986 30965760 83 Linux /dev/sda3 3986 4508 4194304 83 Linux /dev/sda4 4508 11749 58162176 5 Extended /dev/sda5 4509 7119 20971520 83 Linux /dev/sda6 7120 8164 8388608 82 Linux swap / Solaris
Disk /dev/sdb: 4294 MB, 4294967296 bytes 133 heads, 62 sectors/track, 1017 cylinders Units = cylinders of 8246 * 512 = 4221952 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x5c08ed10
DeviceBoot Start End Blocks Id System /dev/sdb1 1 1017 4193060 83 Linux
Disk /dev/sdc: 21.5 GB, 21474836480 bytes 64 heads, 32 sectors/track, 20480 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x70405c5a
DeviceBoot Start End Blocks Id System /dev/sdc1 1 20480 20971504 83 Linux
Disk /dev/sdd: 21.5 GB, 21474836480 bytes 64 heads, 32 sectors/track, 20480 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xfa2d8d65
DeviceBoot Start End Blocks Id System /dev/sdd1 1 20480 20971504 83 Linux [root@racnode2 ~]# |
[root@racnode1 ~]# (cd /dev/disk/by-path; ls -l *vmracvdisk* |awk '{FS=" "; print $9 " " $10 " " $11}') ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-0-> ../../sdb ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-0-part1-> ../../sdb1 ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-1-> ../../sdc ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-1-part1-> ../../sdc1 ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-2-> ../../sdd ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-2-part1-> ../../sdd1 [root@racnode1 ~]# |
[root@racnode2 ~]# (cd /dev/disk/by-path; ls -l *vmracvdisk* |awk '{FS=" "; print $9 " " $10 " " $11}') ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-0-> ../../sdb ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-0-part1-> ../../sdb1 ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-1-> ../../sdc ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-1-part1-> ../../sdc1 ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-2-> ../../sdd ip-10.10.10.10:3260-iscsi-iqn.1991-05.com.microsoft:vmracvdisk-racnode63-target-lun-2-part1-> ../../sdd1 [root@racnode2 ~]# |
10、asmlib安装
在两个节点上安装
oracleasm-support-2.1.5-1.el6.x86_64.rpm 和oracleasmlib-2.0.4-1.el6.x86_64.rpm。配置工作需要在用户和组建立后再执行。
[root@racnode1 tmp]# rpm -ivhoracleasm-support-2.1.5-1.el6.x86_64.rpm warning: oracleasm-support-2.1.5-1.el6.x86_64.rpm: Header V3RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ########################################### [100%] 1:oracleasm-support ########################################### [100%]
[root@racnode1 tmp]# rpm -ivhoracleasmlib-2.0.4-1.el6.x86_64.rpm warning: oracleasmlib-2.0.4-1.el6.x86_64.rpm: Header V3RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ########################################### [100%] 1:oracleasmlib ########################################### [100%] |
11、创建用户和组
创建grid用户和组
[root@racnode1 /]# groupadd -g 1000 oinstall [root@racnode1 /]# groupadd -g 1200 asmadmin [root@racnode1 /]# groupadd -g 1201 asmdba [root@racnode1 /]# groupadd -g 1202 asmoper [root@racnode1 /]# useradd -m -u 1100 -g oinstall -Gasmadmin,asmdba,asmoper -d /home/grid -s /bin/bash -c "GridInfrastructure Owner" grid [root@racnode1 /]# id grid uid=1100(grid) gid=1000(oinstall)groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper) [root@racnode1 /]# passwd grid Changing password for user grid. 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@racnode1 /]#
|
[root@racnode2 tmp]# whoami root [root@racnode2 tmp]# cd / [root@racnode2 /]# groupadd -g 1000 oinstall [root@racnode2 /]# groupadd -g 1200 asmadmin [root@racnode2 /]# groupadd -g 1201 asmdba [root@racnode2 /]# groupadd -g 1202 asmoper [root@racnode2 /]# useradd -m -u 1100 -g oinstall -Gasmadmin,asmdba,asmoper -d /home/grid -s /bin/bash -c "GridInfrastructure Owner" grid [root@racnode2 /]# id grid uid=1100(grid) gid=1000(oinstall)groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper) [root@racnode2 /]# passwd grid Changing password for user grid. 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@racnode2 /]# |
.bash_profile racnode1
[root@racnode1 grid]# more /home/grid/.bash_profile # --------------------------------------------------- # .bash_profile # --------------------------------------------------- # OSUser: grid # Application: Oracle Grid Infrastructure #Version: Oracle 11g release 2 # ---------------------------------------------------
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
alias ls="ls -FA"
# --------------------------------------------------- # ORACLE_SID # --------------------------------------------------- # Specifies the Oracle system identifier (SID) # for the Automatic Storage Management (ASM)instance # running on this node. # Each RAC node must have a unique ORACLE_SID. # (i.e. +ASM1, +ASM2,...) # --------------------------------------------------- ORACLE_SID=+ASM1; export ORACLE_SID
# --------------------------------------------------- # JAVA_HOME # --------------------------------------------------- # Specifies the directory of the Java SDK and Runtime # Environment. # --------------------------------------------------- JAVA_HOME=/usr/local/java; export JAVA_HOME
# --------------------------------------------------- # ORACLE_BASE # --------------------------------------------------- # Specifies the base of the Oracle directory structure # for Optimal Flexible Architecture (OFA) compliant # installations. The Oracle base directory for the # grid installation owner is the location where # diagnostic and administrative logs, and other logs # associated with Oracle ASM and Oracle Clusterware # are stored. # --------------------------------------------------- ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
# --------------------------------------------------- # ORACLE_HOME # --------------------------------------------------- # Specifies the directory containing the Oracle # Grid Infrastructure software. For grid # infrastructure for a cluster installations, the Grid # home must not be placed under one of the Oracle base # directories, or under Oracle home directories of # Oracle Database installation owners, or in the home # directory of an installation owner. During # installation, ownership of the path to the Grid # home is changed to root. This change causes # permission errors for other installations. # --------------------------------------------------- ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME
# --------------------------------------------------- # ORACLE_PATH # --------------------------------------------------- # Specifies the search path for files used by Oracle # applications such as SQL*Plus. If the full path to # the file is not specified, or if the file is not # in the current directory, the Oracle application # uses ORACLE_PATH to locate the file. # This variable is used by SQL*Plus, Forms and Menu. # --------------------------------------------------- ORACLE_PATH=/u01/app/oracle/common/oracle/sql; exportORACLE_PATH
# --------------------------------------------------- # SQLPATH # --------------------------------------------------- # Specifies the directory or list of directories that # SQL*Plus searches for a login.sql file. # --------------------------------------------------- # SQLPATH=/u01/app/common/oracle/sql; export SQLPATH
# --------------------------------------------------- # ORACLE_TERM # --------------------------------------------------- # Defines a terminal definition. If not set, it # defaults to the value of your TERM environment # variable. Used by all character mode products. # --------------------------------------------------- ORACLE_TERM=xterm; export ORACLE_TERM
# --------------------------------------------------- # NLS_DATE_FORMAT # --------------------------------------------------- # Specifies the default date format to use with the # TO_CHAR and TO_DATE functions. The default value of # this parameter is determined by NLS_TERRITORY. The # value of this parameter can be any valid date # format mask, and the value must be surrounded by # double quotation marks. For example: # # NLS_DATE_FORMAT = "MM/DD/YYYY" # # --------------------------------------------------- NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; exportNLS_DATE_FORMAT
# --------------------------------------------------- # TNS_ADMIN # --------------------------------------------------- # Specifies the directory containing the Oracle Net # Services configuration files like listener.ora, # tnsnames.ora, and sqlnet.ora. # --------------------------------------------------- TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
# --------------------------------------------------- # ORA_NLS11 # --------------------------------------------------- # Specifies the directory where the language, # territory, character set, and linguistic definition # files are stored. # --------------------------------------------------- ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
# --------------------------------------------------- # PATH # --------------------------------------------------- # Used by the shell to locate executable programs; # must include the $ORACLE_HOME/bin directory. # --------------------------------------------------- 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 # --------------------------------------------------- # Specifies the list of directories that the shared # library loader searches to locate shared object # libraries at runtime. # --------------------------------------------------- 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 # --------------------------------------------------- # Specifies the directory or list of directories that # contain compiled Java classes. # --------------------------------------------------- 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 # --------------------------------------------------- # All the tools in the JDK use green threads as a # default. To specify that native threads should be # used, set the THREADS_FLAG environment variable to # "native". You can revert to the use of green # threads by setting THREADS_FLAG to the value # "green". # --------------------------------------------------- THREADS_FLAG=native; export THREADS_FLAG
# --------------------------------------------------- # TEMP, TMP, and TMPDIR # --------------------------------------------------- # Specify the default directories for temporary # files; if set, tools that create temporary files # create them in one of these directories. # --------------------------------------------------- export TEMP=/tmp export TMPDIR=/tmp
# --------------------------------------------------- # UMASK # --------------------------------------------------- # Set the default file mode creation mask # (umask) to 022 to ensure that the user performing # the Oracle software installation creates files # with 644 permissions. # --------------------------------------------------- umask 022
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH [root@racnode1grid]# |
.bash_profile racnode2
[root@racnode2 grid]# more /home/grid/.bash_profile # --------------------------------------------------- # .bash_profile # --------------------------------------------------- # OSUser: grid # Application: Oracle Grid Infrastructure #Version: Oracle 11g release 2 # ---------------------------------------------------
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
alias ls="ls -FA"
# --------------------------------------------------- # ORACLE_SID # --------------------------------------------------- # Specifies the Oracle system identifier (SID) # for the Automatic Storage Management (ASM)instance # running on this node. # Each RAC node must have a unique ORACLE_SID. # (i.e. +ASM1, +ASM2,...) # --------------------------------------------------- ORACLE_SID=+ASM2; export ORACLE_SID
# --------------------------------------------------- # JAVA_HOME # --------------------------------------------------- # Specifies the directory of the Java SDK and Runtime # Environment. # --------------------------------------------------- JAVA_HOME=/usr/local/java; export JAVA_HOME
# --------------------------------------------------- # ORACLE_BASE # --------------------------------------------------- # Specifies the base of the Oracle directory structure # for Optimal Flexible Architecture (OFA) compliant # installations. The Oracle base directory for the # grid installation owner is the location where # diagnostic and administrative logs, and other logs # associated with Oracle ASM and Oracle Clusterware # are stored. # --------------------------------------------------- ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
# --------------------------------------------------- # ORACLE_HOME # --------------------------------------------------- # Specifies the directory containing the Oracle # Grid Infrastructure software. For grid # infrastructure for a cluster installations, the Grid # home must not be placed under one of the Oracle base # directories, or under Oracle home directories of # Oracle Database installation owners, or in the home # directory of an installation owner. During # installation, ownership of the path to the Grid # home is changed to root. This change causes # permission errors for other installations. # --------------------------------------------------- ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME
# --------------------------------------------------- # ORACLE_PATH # --------------------------------------------------- # Specifies the search path for files used by Oracle # applications such as SQL*Plus. If the full path to # the file is not specified, or if the file is not # in the current directory, the Oracle application # uses ORACLE_PATH to locate the file. # This variable is used by SQL*Plus, Forms and Menu. # --------------------------------------------------- ORACLE_PATH=/u01/app/oracle/common/oracle/sql; exportORACLE_PATH
# --------------------------------------------------- # SQLPATH # --------------------------------------------------- # Specifies the directory or list of directories that # SQL*Plus searches for a login.sql file. # --------------------------------------------------- # SQLPATH=/u01/app/common/oracle/sql; export SQLPATH
# --------------------------------------------------- # ORACLE_TERM # --------------------------------------------------- # Defines a terminal definition. If not set, it # defaults to the value of your TERM environment # variable. Used by all character mode products. # --------------------------------------------------- ORACLE_TERM=xterm; export ORACLE_TERM
# --------------------------------------------------- # NLS_DATE_FORMAT # --------------------------------------------------- # Specifies the default date format to use with the # TO_CHAR and TO_DATE functions. The default value of # this parameter is determined by NLS_TERRITORY. The # value of this parameter can be any valid date # format mask, and the value must be surrounded by # double quotation marks. For example: # # NLS_DATE_FORMAT = "MM/DD/YYYY" # # --------------------------------------------------- NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; exportNLS_DATE_FORMAT
# --------------------------------------------------- # TNS_ADMIN # --------------------------------------------------- # Specifies the directory containing the Oracle Net # Services configuration files like listener.ora, # tnsnames.ora, and sqlnet.ora. # --------------------------------------------------- TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
# --------------------------------------------------- # ORA_NLS11 # --------------------------------------------------- # Specifies the directory where the language, # territory, character set, and linguistic definition # files are stored. # --------------------------------------------------- ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
# --------------------------------------------------- # PATH # --------------------------------------------------- # Used by the shell to locate executable programs; # must include the $ORACLE_HOME/bin directory. # --------------------------------------------------- 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 # --------------------------------------------------- # Specifies the list of directories that the shared # library loader searches to locate shared object # libraries at runtime. # --------------------------------------------------- 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 # --------------------------------------------------- # Specifies the directory or list of directories that # contain compiled Java classes. # --------------------------------------------------- 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 # --------------------------------------------------- # All the tools in the JDK use green threads as a # default. To specify that native threads should be # used, set the THREADS_FLAG environment variable to # "native". You can revert to the use of green # threads by setting THREADS_FLAG to the value # "green". # --------------------------------------------------- THREADS_FLAG=native; export THREADS_FLAG
# --------------------------------------------------- # TEMP, TMP, and TMPDIR # --------------------------------------------------- # Specify the default directories for temporary # files; if set, tools that create temporary files # create them in one of these directories. # --------------------------------------------------- export TEMP=/tmp export TMPDIR=/tmp
# --------------------------------------------------- # UMASK # --------------------------------------------------- # Set the default file mode creation mask # (umask) to 022 to ensure that the user performing # the Oracle software installation creates files # with 644 permissions. # --------------------------------------------------- umask 022
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH [root@racnode2 grid]# |
创建oracle用户和组
[root@racnode1 grid]# whoami root [root@racnode1 grid]# groupadd -g 1300 dba [root@racnode1 grid]# groupadd -g 1301 oper [root@racnode1 grid]# useradd -m -u 1101 -g oinstall -Gdba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle SoftwareOwner" oracle [root@racnode1 grid]# id oracle uid=1101(oracle) gid=1000(oinstall)groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper) [root@racnode1 grid]# 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: Sorry, passwords do not match. 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@racnode1 grid]# |
[root@racnode2 grid]# whoami root [root@racnode2 grid]# groupadd -g 1300 dba [root@racnode2 grid]# groupadd -g 1301 oper [root@racnode2 grid]# useradd -m -u 1101 -g oinstall -Gdba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle SoftwareOwner" oracle [root@racnode2 grid]# id oracle uid=1101(oracle) gid=1000(oinstall)groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper) [root@racnode2 grid]# 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@racnode2 grid]# |
[oracle@racnode1 ~]$ more .bash_profile # .bash_profile
# --------------------------------------------------- # .bash_profile # --------------------------------------------------- # OSUser: oracle # Application: Oracle Database SoftwareOwner #Version: Oracle 11g release 2 # ---------------------------------------------------
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
alias ls="ls -FA"
# --------------------------------------------------- # ORACLE_SID # --------------------------------------------------- # Specifies the Oracle system identifier (SID) for # the Oracle instance running on this node. # Each RAC node must have a unique ORACLE_SID. # (i.e. racdb1, racdb2,...) # --------------------------------------------------- ORACLE_SID=racdb1; export ORACLE_SID
# --------------------------------------------------- # ORACLE_UNQNAME # --------------------------------------------------- # In previous releases of Oracle Database, you were # required to set environment variables for # ORACLE_HOME and ORACLE_SID to start, stop, and # check the status of Enterprise Manager. With # Oracle Database 11g release 2 (11.2) and later, you # need to set the environment variables ORACLE_HOME # and ORACLE_UNQNAME to use Enterprise Manager. # Set ORACLE_UNQNAME equal to the database unique # name. # --------------------------------------------------- ORACLE_UNQNAME=racdb; export ORACLE_UNQNAME
# --------------------------------------------------- # JAVA_HOME # --------------------------------------------------- # Specifies the directory of the Java SDK and Runtime # Environment. # --------------------------------------------------- JAVA_HOME=/usr/local/java; export JAVA_HOME
# --------------------------------------------------- # ORACLE_BASE # --------------------------------------------------- # Specifies the base of the Oracle directory structure # for Optimal Flexible Architecture (OFA) compliant # database software installations. # --------------------------------------------------- ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
# --------------------------------------------------- # ORACLE_HOME # --------------------------------------------------- # Specifies the directory containing the Oracle # Database software. # --------------------------------------------------- ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; exportORACLE_HOME
# --------------------------------------------------- # ORACLE_PATH # --------------------------------------------------- # Specifies the search path for files used by Oracle # applications such as SQL*Plus. If the full path to # the file is not specified, or if the file is not # in the current directory, the Oracle application # uses ORACLE_PATH to locate the file. # This variable is used by SQL*Plus, Forms and Menu. # --------------------------------------------------- ORACLE_PATH=/u01/app/common/oracle/sql; export ORACLE_PATH
# --------------------------------------------------- # SQLPATH # --------------------------------------------------- # Specifies the directory or list of directories that # SQL*Plus searches for a login.sql file. # --------------------------------------------------- # SQLPATH=/u01/app/common/oracle/sql; export SQLPATH
# --------------------------------------------------- # ORACLE_TERM # --------------------------------------------------- # Defines a terminal definition. If not set, it # defaults to the value of your TERM environment # variable. Used by all character mode products. # --------------------------------------------------- ORACLE_TERM=xterm; export ORACLE_TERM
# --------------------------------------------------- # NLS_DATE_FORMAT # --------------------------------------------------- # Specifies the default date format to use with the # TO_CHAR and TO_DATE functions. The default value of # this parameter is determined by NLS_TERRITORY. The # value of this parameter can be any valid date # format mask, and the value must be surrounded by # double quotation marks. For example: # # NLS_DATE_FORMAT = "MM/DD/YYYY" # # --------------------------------------------------- NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; exportNLS_DATE_FORMAT
# --------------------------------------------------- # TNS_ADMIN # --------------------------------------------------- # Specifies the directory containing the Oracle Net # Services configuration files like listener.ora, # tnsnames.ora, and sqlnet.ora. # --------------------------------------------------- TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
# --------------------------------------------------- # ORA_NLS11 # --------------------------------------------------- # Specifies the directory where the language, # territory, character set, and linguistic definition # files are stored. # --------------------------------------------------- ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
# --------------------------------------------------- # PATH # --------------------------------------------------- # Used by the shell to locate executable programs; # must include the $ORACLE_HOME/bin directory. # --------------------------------------------------- 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 # --------------------------------------------------- # Specifies the list of directories that the shared # library loader searches to locate shared object # libraries at runtime. # --------------------------------------------------- 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 # --------------------------------------------------- # Specifies the directory or list of directories that # contain compiled Java classes. # --------------------------------------------------- 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 # --------------------------------------------------- # All the tools in the JDK use green threads as a # default. To specify that native threads should be # used, set the THREADS_FLAG environment variable to # "native". You can revert to the use of green # threads by setting THREADS_FLAG to the value # "green". # --------------------------------------------------- THREADS_FLAG=native; export THREADS_FLAG
# --------------------------------------------------- # TEMP, TMP, and TMPDIR # --------------------------------------------------- # Specify the default directories for temporary # files; if set, tools that create temporary files # create them in one of these directories. # --------------------------------------------------- export TEMP=/tmp export TMPDIR=/tmp
# --------------------------------------------------- # UMASK # --------------------------------------------------- # Set the default file mode creation mask # (umask) to 022 to ensure that the user performing # the Oracle software installation creates files # with 644 permissions. # --------------------------------------------------- umask 022
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH [oracle@racnode1 ~]$ |
[oracle@racnode2 ~]$ more .bash_profile # .bash_profile
# --------------------------------------------------- # .bash_profile # --------------------------------------------------- # OSUser: oracle # Application: Oracle Database SoftwareOwner #Version: Oracle 11g release 2 # ---------------------------------------------------
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
alias ls="ls -FA"
# --------------------------------------------------- # ORACLE_SID # --------------------------------------------------- # Specifies the Oracle system identifier (SID) for # the Oracle instance running on this node. # Each RAC node must have a unique ORACLE_SID. # (i.e. racdb1, racdb2,...) # --------------------------------------------------- ORACLE_SID=racdb2; export ORACLE_SID
# --------------------------------------------------- # ORACLE_UNQNAME # --------------------------------------------------- # In previous releases of Oracle Database, you were # required to set environment variables for # ORACLE_HOME and ORACLE_SID to start, stop, and # check the status of Enterprise Manager. With # Oracle Database 11g release 2 (11.2) and later, you # need to set the environment variables ORACLE_HOME # and ORACLE_UNQNAME to use Enterprise Manager. # Set ORACLE_UNQNAME equal to the database unique # name. # --------------------------------------------------- ORACLE_UNQNAME=racdb; export ORACLE_UNQNAME
# --------------------------------------------------- # JAVA_HOME # --------------------------------------------------- # Specifies the directory of the Java SDK and Runtime # Environment. # --------------------------------------------------- JAVA_HOME=/usr/local/java; export JAVA_HOME
# --------------------------------------------------- # ORACLE_BASE # --------------------------------------------------- # Specifies the base of the Oracle directory structure # for Optimal Flexible Architecture (OFA) compliant # database software installations. # --------------------------------------------------- ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
# --------------------------------------------------- # ORACLE_HOME # --------------------------------------------------- # Specifies the directory containing the Oracle # Database software. # --------------------------------------------------- ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; exportORACLE_HOME
# --------------------------------------------------- # ORACLE_PATH # --------------------------------------------------- # Specifies the search path for files used by Oracle # applications such as SQL*Plus. If the full path to # the file is not specified, or if the file is not # in the current directory, the Oracle application # uses ORACLE_PATH to locate the file. # This variable is used by SQL*Plus, Forms and Menu. # --------------------------------------------------- ORACLE_PATH=/u01/app/common/oracle/sql; export ORACLE_PATH
# --------------------------------------------------- # SQLPATH # --------------------------------------------------- # Specifies the directory or list of directories that # SQL*Plus searches for a login.sql file. # --------------------------------------------------- # SQLPATH=/u01/app/common/oracle/sql; export SQLPATH
# --------------------------------------------------- # ORACLE_TERM # --------------------------------------------------- # Defines a terminal definition. If not set, it # defaults to the value of your TERM environment # variable. Used by all character mode products. # --------------------------------------------------- ORACLE_TERM=xterm; export ORACLE_TERM
# --------------------------------------------------- # NLS_DATE_FORMAT # --------------------------------------------------- # Specifies the default date format to use with the # TO_CHAR and TO_DATE functions. The default value of # this parameter is determined by NLS_TERRITORY. The # value of this parameter can be any valid date # format mask, and the value must be surrounded by # double quotation marks. For example: # # NLS_DATE_FORMAT = "MM/DD/YYYY" # # --------------------------------------------------- NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; exportNLS_DATE_FORMAT
# --------------------------------------------------- # TNS_ADMIN # --------------------------------------------------- # Specifies the directory containing the Oracle Net # Services configuration files like listener.ora, # tnsnames.ora, and sqlnet.ora. # --------------------------------------------------- TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
# --------------------------------------------------- # ORA_NLS11 # --------------------------------------------------- # Specifies the directory where the language, # territory, character set, and linguistic definition # files are stored. # --------------------------------------------------- ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
# --------------------------------------------------- # PATH # --------------------------------------------------- # Used by the shell to locate executable programs; # must include the $ORACLE_HOME/bin directory. # --------------------------------------------------- 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 # --------------------------------------------------- # Specifies the list of directories that the shared # library loader searches to locate shared object # libraries at runtime. # --------------------------------------------------- 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 # --------------------------------------------------- # Specifies the directory or list of directories that # contain compiled Java classes. # --------------------------------------------------- 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 # --------------------------------------------------- # All the tools in the JDK use green threads as a # default. To specify that native threads should be # used, set the THREADS_FLAG environment variable to # "native". You can revert to the use of green # threads by setting THREADS_FLAG to the value # "green". # --------------------------------------------------- THREADS_FLAG=native; export THREADS_FLAG
# --------------------------------------------------- # TEMP, TMP, and TMPDIR # --------------------------------------------------- # Specify the default directories for temporary # files; if set, tools that create temporary files # create them in one of these directories. # --------------------------------------------------- export TEMP=/tmp export TMPDIR=/tmp
# --------------------------------------------------- # UMASK # --------------------------------------------------- # Set the default file mode creation mask # (umask) to 022 to ensure that the user performing # the Oracle software installation creates files # with 644 permissions. # --------------------------------------------------- umask 022
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH [oracle@racnode2~]$ |
12、创建目录路径
在两个节点上执行
[root@racnode1 ~]# mkdir -p /u01/app/grid [root@racnode1 ~]# mkdir -p /u01/app/11.2.0/grid [root@racnode1 ~]# chown -R grid:oinstall /u01 [root@racnode1 ~]# mkdir -p /u01/app/oracle [root@racnode1 ~]# chown oracle:oinstall /u01/app/oracle [root@racnode1 ~]# chmod -R 775 /u01 |
13、用户资源限制修改
三个文件
/etc/security/limits.conf
/etc/pam.d/login
/etc/profile
[root@racnode2 security]# more limits.conf # /etc/security/limits.conf # #Each line describes a limit for a user in the form: # # # #Where: # can be: # - an user name # - a group name, with @group syntax # - the wildcard *, for default entry # - the wildcard %, can be also used with %group syntax, # for maxlogin limit # # can have the two values: # - "soft" for enforcing the soft limits # - "hard" for enforcing hard limits # # can be one of the following: # - core - limits the core file size (KB) # - data - max data size (KB) # - fsize - maximum filesize (KB) # - memlock - max locked-in-memory address space (KB) # - nofile - max number of open files # - rss - max resident set size (KB) # - stack - max stack size (KB) # - cpu - max CPU time (MIN) # - nproc - max number of processes # - as - address space limit (KB) # - maxlogins - max number of logins for this user # - maxsyslogins - max number of logins on the system # - priority - the priority to run user process with # - locks - max number of file locks the user can hold # - sigpending - max number of pending signals # - msgqueue - max memory used by POSIX message queues (bytes) # - nice - max nice priority allowed to raise to values: [-20,19] # - rtprio - max realtime priority # # #
#* soft core 0 #* hard rss 10000 #@student hard nproc 20 #@faculty soft nproc 20 #@faculty hard nproc 50 #ftp hard nproc 0 #@student - maxlogins 4
# End of file oracle soft nofile 1024 oracle hard nofile 65536 oracle soft nproc 2047 oracle hard nproc 16384 oracle soft stack 10240 oracle hard stack 32768
grid soft nproc 2047 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 |
[root@racnode2 pam.d]# more login #%PAM-1.0 auth [user_unknown=ignore success=ok ignore=ignore default=bad]pam_securetty.so auth include system-auth account required pam_nologin.so account include system-auth password include system-auth # pam_selinux.so close should be the first session rule session required pam_selinux.so close session required pam_loginuid.so session optional pam_console.so # pam_selinux.so open should only be followed by sessions to beexecuted in the user context session required pam_selinux.so open session required pam_namespace.so session optional pam_keyinit.so force revoke session include system-auth -session optional pam_ck_connector.so session required pam_limits.so |
[root@racnode2 etc]# more profile # /etc/profile
# System wide environment and startup programs, for loginsetup # Functions and aliases go in /etc/bashrc
# It's NOT a good idea to change this file unless you know whatyou # are doing. It's much better to create a custom.sh shell scriptin # /etc/profile.d/ to make custom changes to your environment, asthis # will prevent the need for merging in future updates.
pathmunge () { case":${PATH}:" in *:"$1":*) ;; *) if [ "$2" = "after" ] ; then PATH=$PATH:$1 else PATH=$1:$PATH fi esac }
if [ -x /usr/bin/id ]; then if [ -z"$EUID" ]; then # ksh workaround EUID=`id -u` UID=`id -ru` fi USER="`id-un`" LOGNAME=$USER MAIL="/var/spool/mail/$USER" fi
# Path manipulation if [ "$EUID" = "0" ]; then pathmunge/sbin pathmunge/usr/sbin pathmunge/usr/local/sbin else pathmunge/usr/local/sbin after pathmunge/usr/sbin after pathmunge/sbin after fi
HOSTNAME=`/bin/hostname 2>/dev/null` HISTSIZE=1000 if [ "$HISTCONTROL" = "ignorespace" ] ; then exportHISTCONTROL=ignoreboth else exportHISTCONTROL=ignoredups fi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
# By default, we want umask to get set. This sets it for loginshell # Current threshold for system reserved uid/gids is 200 # You could check uidgid reservation validity in # /usr/share/doc/setup-*/uidgid file if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ];then umask002 else umask022 fi
for i in /etc/profile.d/*.sh ; do if [ -r"$i" ]; then if [ "${-#*i}" != "$-" ]; then . "$i" else . "$i" >/dev/null 2>&1 fi fi done
unset i unset pathmunge if [ \$USER = "oracle" ] || [ \$USER = "grid" ]; then if [\$SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi umask022 fi
[root@racnode2 etc]# |
14、内核参数调整
[root@racnode2 etc]# cat >> /etc/sysctl.conf<<EOF > # Controls the maximum number of shared memory segmentssystem wide > kernel.shmmni = 4096 > > # Sets the following semaphore values: > # SEMMSL_value SEMMNS_value SEMOPM_value SEMMNI_value > kernel.sem = 250 32000 100 128 > > # Sets the maximum number of file-handles that the Linuxkernel will allocate > fs.file-max = 6815744 > > # Defines the local port range that is used by TCP andUDP > # traffic to choose the local port > net.ipv4.ip_local_port_range = 9000 65500 > > # Default setting in bytes of the socket "receive" bufferwhich > # may be set by using the SO_RCVBUF socket option > net.core.rmem_default=262144 > > # Maximum setting in bytes of the socket "receive" bufferwhich > # may be set by using the SO_RCVBUF socket option > net.core.rmem_max=4194304 > > # Default setting in bytes of the socket "send" bufferwhich > # may be set by using the SO_SNDBUF socket option > net.core.wmem_default=262144 > > # Maximum setting in bytes of the socket "send" bufferwhich > # may be set by using the SO_SNDBUF socket option > net.core.wmem_max=1048576 > > # Maximum number of allowable concurrent asynchronous I/Orequests requests > fs.aio-max-nr=1048576 > EOF [root@racnode2 etc]# |
[root@racnode1 etc]# sysctl -p net.ipv4.ip_forward = 0 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 error: "net.bridge.bridge-nf-call-ip6tables" is an unknownkey error: "net.bridge.bridge-nf-call-iptables" is an unknownkey error: "net.bridge.bridge-nf-call-arptables" is an unknownkey kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.shmmax = 68719476736 kernel.shmall = 4294967296 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 6815744 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 fs.aio-max-nr = 1048576 |
[root@racnode2 etc]# sysctl -p net.ipv4.ip_forward = 0 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.shmmax = 68719476736 kernel.shmall = 4294967296 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 6815744 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 fs.aio-max-nr = 1048576 [root@racnode2 etc]# |
[root@racnode2 etc]# /sbin/sysctl -a | grep shm kernel.shmmax = 68719476736 kernel.shmall = 4294967296 kernel.shmmni = 4096 vm.hugetlb_shm_group = 0 [root@racnode2 etc]# /sbin/sysctl -a | grep sem kernel.sem =250 32000 100 128 [root@racnode2 etc]# /sbin/sysctl -a | grep file-max fs.file-max = 6815744 [root@racnode2 etc]# /sbin/sysctl -a | grepip_local_port_range net.ipv4.ip_local_port_range =9000 65500 [root@racnode2 etc]# /sbin/sysctl -a | grep 'core\.[rw]mem' net.core.wmem_max = 1048576 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.rmem_default = 262144 [root@racnode2 etc]# |
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
这几个参数是负责,集群使用UDP进行私有网络通信为提高UDP传输效率,在较大数据时避免出现超出OS限制的错误,调整手段是,1、UDP发送缓冲区,大小设置大于db_block_size*db_multiblock_read_count+4K;2、UDP接收缓冲区,设置10倍发送缓冲区;UDP缓冲区最大值,设置尽量大,一定大于前两个值。
15、创建asmlib磁盘
[root@racnode1 init.d]# ./oracleasm configure Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASMlibrary driver. The following questions will determinewhether the driver is loaded on boot and what permissions it willhave. The current values will be shown in brackets ('[]'). Hittingwithout typing an answer will keep that current value. Ctrl-Cwill abort.
Default user to own the driver interface []: grid Default group to own the driver interface []: asmadmin Start Oracle ASM library driver on boot (y/n) [n]: y Scan for Oracle ASM disks on boot (y/n) [y]: y Writing Oracle ASM library driver configuration: done Initializing the Oracle ASMLibdriver: [ OK ] Scanning the system for Oracle ASMLibdisks: [ OK ] |
[root@racnode1 init.d]# /etc/init.d/oracleasm disable Writing Oracle ASM library driver configuration: done Dropping Oracle ASMLibdisks: [ OK ] Shutting down the Oracle ASMLibdriver: [ OK ] [root@racnode1 init.d]# /etc/init.d/oracleasm enable Writing Oracle ASM library driver configuration: done Initializing the Oracle ASMLibdriver: [ OK ] Scanning the system for Oracle ASMLibdisks: [ OK ] [root@racnode1 init.d]# |
[root@racnode1 init.d]# ll /dev/sd* brw-rw---- 1 root disk 8, 0Dec 5 10:38 /dev/sda brw-rw---- 1 root disk 8, 1Dec 5 10:39 /dev/sda1 brw-rw---- 1 root disk 8, 2Dec 5 10:39 /dev/sda2 brw-rw---- 1 root disk 8, 3Dec 5 10:39 /dev/sda3 brw-rw---- 1 root disk 8, 4Dec 5 10:38 /dev/sda4 brw-rw---- 1 root disk 8, 5Dec 5 10:39 /dev/sda5 brw-rw---- 1 root disk 8, 6Dec 5 10:38 /dev/sda6 brw-rw---- 1 root disk 8, 16 Dec 5 16:25/dev/sdb brw-rw---- 1 root disk 8, 17 Dec 5 16:25/dev/sdb1 brw-rw---- 1 root disk 8, 32 Dec 5 16:25/dev/sdc brw-rw---- 1 root disk 8, 33 Dec 5 16:25/dev/sdc1 brw-rw---- 1 root disk 8, 48 Dec 5 16:25/dev/sdd brw-rw---- 1 root disk 8, 49 Dec 5 16:25/dev/sdd1 [root@racnode1 init.d]# ./oracleasm createdisk CRSVOL1/dev/sdb1 Marking disk "CRSVOL1" as an ASMdisk: [ OK ] [root@racnode1 init.d]# ./oracleasm createdisk DATAVOL1/dev/sdc1 Marking disk "DATAVOL1" as an ASMdisk: [ OK ] [root@racnode1 init.d]# ./oracleasm createdisk FRAVOL1/dev/sdd1 Marking disk "FRAVOL1" as an ASMdisk: [ OK ] [root@racnode1 init.d]# |
在备节点执行
[root@racnode2 init.d]# ./oracleasm scandisks Scanning the system for Oracle ASMLibdisks: [ OK ] [root@racnode2 init.d]# ./oracleasm listdisks CRSVOL1 DATAVOL1 FRAVOL1 |
16、安装所有缺少的系统组件
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils\ compat-libstdc++-33 \ elfutils-libelf \ elfutils-libelf-devel \ gcc \ gcc-c++ \ glibc \ glibc-common \ glibc-devel \ glibc-headers \ ksh \ libaio \ libaio-devel \ libgcc \ libstdc++ \ libstdc++-devel \ make \ sysstat \ unixODBC \ unixODBC-devel |
binutils-2.20.51.0.2-5.34.el6 (x86_64) package compat-libstdc++-33 is not installed elfutils-libelf-0.152-1.el6 (x86_64) package elfutils-libelf-devel is not installed package gcc is not installed package gcc-c++ is not installed glibc-2.12-1.80.el6 (x86_64) glibc-common-2.12-1.80.el6 (x86_64) package glibc-devel is not installed package glibc-headers is not installed package ksh is not installed libaio-0.3.107-10.el6 (x86_64) package libaio-devel is not installed libgcc-4.4.6-4.el6 (x86_64) libstdc++-4.4.6-4.el6 (x86_64) package libstdc++-devel is not installed make-3.81-20.el6 (x86_64) sysstat-9.0.4-20.el6 (x86_64) package unixODBC is not installed package unixODBC-devel is not installed |
安装缺少的组件包
挂载linux6.3安装光盘,
[root@racnode2 init.d]# cd /media/ [root@racnode2 media]# ll total 6 drwxr-xr-x 12 root root 6144 Jun 27 10:35 OL6.3 x86_64 Disc 120120626 [root@racnode2 media]# cd OL6.3\ x86_64\ Disc\ 1\ 20120626/ [root@racnode2 OL6.3 x86_64 Disc 1 20120626]# cd Packages/ |
rpm -Uvh binutils-2.* rpm -Uvh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm rpm -Uvh elfutils-libelf-0.152-1.el6.x86_64.rpm rpm -Uvh elfutils-libelf-devel-0.152-1.el6.x86_64.rpm rpm -Uvh libaio-0.* rpm -Uvh libaio-devel-0.* rpm -Uvh sysstat-9.* rpm -Uvh glibc-2.12-1.80.el6.x86_64.rpm rpm -Uvh glibc-common-2.* rpm -Uvh kernel-headers-2.6.32-279.el6.x86_64.rpm rpm -Uvh glibc-headers-2.12-1.80.el6.x86_64.rpm rpm -Uvh glibc-devel-2.12-1.80.el6.x86_64.rpm rpm -Uvh ksh-2*
rpm -Uvh ppl-0.10.2-11.el6.x86_64.rpm rpm -Uvh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm rpm -Uvh mpfr-2.4.1-6.el6.x86_64.rpm rpm -Uvh cpp-4.4.6-4.el6.x86_64.rpm rpm -Uvh gcc-4.4.6-4.el6.x86_64.rpm rpm -Uvh libstdc++-devel-4.4.6-4.el6.x86_64.rpm rpm -Uvh gcc-c++-4.4.6-4.el6.x86_64.rpm
rpm -Uvh compat-libcap1-1.10-1.x86_64.rpm rpm -Uvh unixODBC-2.2.14-11.el6.x86_64.rpm rpm -Uvh unixODBC-devel-2.2.14-11.el6.x86_64.rpm
|
[root@racnode2 Packages]# rpm -q --qf'%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils \ > compat-libstdc++-33 \ > elfutils-libelf \ > elfutils-libelf-devel \ > gcc \ > gcc-c++ \ > glibc \ > glibc-common \ > glibc-devel \ > glibc-headers \ > ksh \ > libaio \ > libaio-devel \ > libgcc \ > libstdc++ \ > libstdc++-devel \ > make \ > sysstat \ > unixODBC \ > unixODBC-devel binutils-2.20.51.0.2-5.34.el6 (x86_64) compat-libstdc++-33-3.2.3-69.el6 (x86_64) elfutils-libelf-0.152-1.el6 (x86_64) elfutils-libelf-devel-0.152-1.el6 (x86_64) gcc-4.4.6-4.el6 (x86_64) gcc-c++-4.4.6-4.el6 (x86_64) glibc-2.12-1.80.el6 (x86_64) glibc-common-2.12-1.80.el6 (x86_64) glibc-devel-2.12-1.80.el6 (x86_64) glibc-headers-2.12-1.80.el6 (x86_64) ksh-20100621-16.el6 (x86_64) libaio-0.3.107-10.el6 (x86_64) libaio-devel-0.3.107-10.el6 (x86_64) libaio-devel-0.3.107-10.el6 (i686) libgcc-4.4.6-4.el6 (x86_64) libstdc++-4.4.6-4.el6 (x86_64) libstdc++-devel-4.4.6-4.el6 (x86_64) make-3.81-20.el6 (x86_64) sysstat-9.0.4-20.el6 (x86_64) unixODBC-2.2.14-11.el6 (x86_64) unixODBC-devel-2.2.14-11.el6 (x86_64) [root@racnode2 Packages]# |
17、cvuqdisk RPM安装
将程序包拷贝到/tmp目录下。
-rwxrw-rw- 1root root 8551 Sep 22 2011 cvuqdisk-1.0.9-1.rpm
[root@racnode1 tmp]# export CVUQDISK_GRP=oinstall [root@racnode1 tmp]# rpm -ivh cvuqdisk-1.0.9-1.rpm Preparing... ########################################### [100%] 1:cvuqdisk ########################################### [100%] [root@racnode1 tmp]# |
18、SCAN IP配置
在windows2008服务器上,搭建dns服务,设置以下解析。
这里要注意,scanIP是三个
Name: racdb-scan.testrac.com Address: 192.168.91.35 |
[root@racnode1 ~]# nslookup > racdb-scan.testrac.com Server: 192.168.91.10 Address: 192.168.91.10#53
Name: racdb-scan.testrac.com Address: 192.168.91.35 > |
19、安装grid
mkdir -p /u01/software/oracle mv /tmp/p10404530_112030_Linux-x86-64_3of7.zip/u01/software/oracle/ [grid@racnode1 oracle]$ unzipp10404530_112030_Linux-x86-64_3of7.zip [grid@racnode1 oracle]$ ll total 956256 drwxr-xr-x 8 gridoinstall 4096 Sep 22 2011 grid -rwxrw-rw- 1 grid oinstall 979195792 Dec 316:57 p10404530_112030_Linux-x86-64_3of7.zip
这里必须在grid用户下,登陆liinux系统。
[grid@racnode1 grid]$ export DISPLAY=192.168.91.31:0.0 [grid@racnode1 grid]$ ./runInstaller Starting Oracle Universal Installer... |
安装完成后,检查各项状态。
20、安装oracle
在节点1。先在/u01下创建orasoftw目录,chown给oracle:oinstall。之后,用oracle用户登录,创建/u01/orasoftworacle/,将oracle的两个压缩包上传到该目录。 用oracle用户解压缩。 |
[oracle@racnode1 orasoftw]$ ll total 1326620 -rwxrw-rw- 1 oracle oinstall 1358454646 Dec 316:57 p10404530_112030_Linux-x86-64_1of7.zip [oracle@racnode1 orasoftw]$ cd .. [oracle@racnode1 u01]$ ll total 28 drwxr-xr-x 6root oinstall 4096 Dec 6 22:53 app drwxrwxr-x. 2 grid oinstall16384 Dec 5 06:41 lost+found drwxr-xr-x 2 oracle oinstall 4096 Dec 9 16:16 orasoftw drwxr-xr-x 3grid oinstall 4096 Dec 6 17:08 software [oracle@racnode1 orasoftw]$ ll total 2442052 -rwxrw-rw- 1 oracle oinstall 1358454646 Dec 316:57 p10404530_112030_Linux-x86-64_1of7.zip -rwxrw-rw- 1 oracle oinstall 1142195302 Dec 316:57 p10404530_112030_Linux-x86-64_2of7.zip
[oracle@racnode1 orasoftw]$ ll total 2442056 drwxr-xr-x 8 oracleoinstall 4096 Sep 22 2011 database -rwxrw-rw- 1 oracle oinstall 1358454646 Dec 316:57 p10404530_112030_Linux-x86-64_1of7.zip -rwxrw-rw- 1 oracle oinstall 1142195302 Dec 316:57 p10404530_112030_Linux-x86-64_2of7.zip [oracle@racnode1 orasoftw]$ unzipp10404530_112030_Linux-x86-64_1of7.zip [oracle@racnode1 orasoftw]$ unzipp10404530_112030_Linux-x86-64_2of7.zip
在oracle用户下,./runInstallser
|
[root@racnode1 dbhome_1]# ./root.sh Performing root user operation for Oracle 11g
The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin directory:[/usr/local/bin]: The contents of "dbhome" have not changed. No need tooverwrite. The contents of "oraenv" have not changed. No need tooverwrite. The contents of "coraenv" have not changed. No need tooverwrite.
Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script. Now product-specific root actions will be performed. Finished product-specific root actions. [root@racnode1 dbhome_1]# |
[root@racnode2 app]# whoami root [root@racnode2 app]# cd/u01/app/oracle/product/11.2.0/dbhome_1 [root@racnode2 dbhome_1]# pwd /u01/app/oracle/product/11.2.0/dbhome_1 [root@racnode2 dbhome_1]# ./root.sh Performing root user operation for Oracle 11g
The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin directory:[/usr/local/bin]: The contents of "dbhome" have not changed. No need tooverwrite. The contents of "oraenv" have not changed. No need tooverwrite. The contents of "coraenv" have not changed. No need tooverwrite.
Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script. Now product-specific root actions will be performed. Finished product-specific root actions. [root@racnode2 dbhome_1]# |
21、创建oracle数据库的asm存储
在第一个节点,在grid用户下,执行asmca。
创建两个分区。一个RACDB_DATA用的disk path是ORCL:DATAVOL1
一个FRA用的是ORCL:FRAVOL1
退出asmca。
22、创建oracle数据库
在第一个节点,用oracle用户打开终端,执行dbca,开始建库。
Global database name:racdbclp
+RACDB_DATA
+FRA ,flasharea
23、完成安装
监听程序已经自动安装完成,通过远端的客户端可以正常访问racdbclp数据库。
24、修改SID,错误!
由于之前dbca走向导时,SID设置错误,导致数据库有问题。所以需要将/home/oracle下的.bash_profile文件里的SID和dbca向导里的SID一致了。Profile文件里的sid是racdb,向导里是racdbclp以下是修改过程。在.bash_profile里修改两个地方,一个是ORACLE_SID=racdb2;export ORACLE_SID,一个是ORACLE_UNQNAME=racdb; exportORACLE_UNQNAME。分别修改成racdbclp2,racdbclp1,racdbclp。
请在.bash_profile中正确设置ORACLE_BASE,ORACLE_HOME,ORACLE_SID再执行下面命令。 $ . ./.bash_profile 这个命令是生效profile文件。 如果已经生效就不用在执行以下命令了。 直接sqlplus登陆数据库就好了。 su - oracle $ oraenv ORACLE_SID = [oracle] ? racdbclp1 $ sqlplus / as sysdba |
[oracle@racnode1 ~]$ env | grep SID ORACLE_SID=racdbclp1 [oracle@racnode1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Dec 11 16:52:422012
Copyright (c) 1982, 2011, Oracle. All rightsreserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 -64bit Production With the Partitioning, Real Application Clusters, AutomaticStorage Management, OLAP, Data Mining and Real Application Testing options
SQL> |
25、配置em
由于安装向导没有配置em,所以这里补充配置em,注意,以下的过程,是先配置了一遍deconfig向导,导致删除了sysman用户,以及所有的em信息,然后重新配置的config过程。在配置之后,sysman用户也自动创建回来了。
[oracle@racnode1 bin]$ emca -deconfig dbcontrol db -repos drop-cluster
STARTED EMCA at Dec 13, 2012 4:55:34 PM EM Configuration Assistant, Version 11.2.0.3.0 Production Copyright (c) 2003, 2011, Oracle. All rightsreserved.
Enter the following information: Database unique name: racdbclp Service name: racdbclp Listener port number: 1521 Listener ORACLE_HOME [ /u01/app/11.2.0/grid ]: Password for SYS user: Password for SYSMAN user: Password for SYSMAN user: Password for SYSMAN user: Password for SYSMAN user: ---------------------------------------------------------------------- WARNING : While repository is dropped the database will be putin quiesce mode. ---------------------------------------------------------------------- Do you wish to continue? [yes(Y)/no(N)]: Y Dec 13, 2012 4:56:33 PM oracle.sysman.emcp.EMConfig perform INFO: This operation is being logged at/u01/app/oracle/cfgtoollogs/emca/racdbclp/emca_2012_12_13_16_55_34.log. Dec 13, 2012 4:56:37 PM oracle.sysman.emcp.util.GeneralUtilinitSQLEngineRemotely WARNING: Error during db connection : ORA-01017: invalidusername/password; logon denied
Dec 13, 2012 4:56:43 PM oracle.sysman.emcp.util.GeneralUtilinitSQLEngineRemotely WARNING: ORA-01017: invalid username/password; logon denied
Dec 13, 2012 4:56:43 PM oracle.sysman.emcp.ParamsManagercheckListenerStatusForDBControl WARNING: Error initializing SQL connection. SQL operationscannot be performed Dec 13, 2012 4:56:43 PM oracle.sysman.emcp.EMDBPreConfigperformDeconfiguration WARNING: EM is not configured for this database. No EM-specificactions can be performed. Some of the possible reasons may be: 1) EM is configured with different hostnamethen physical host. Set environment variable ORACLE_HOSTNAME= andre-run EMCA script 2) ORACLE_HOSTNAME is set. Unset it and re-runEMCA script Dec 13, 2012 4:56:43 PM oracle.sysman.emcp.EMReposConfiginvoke INFO: Dropping the EM repository (this may take a while) ... Dec 13, 2012 4:56:46 PM oracle.sysman.emcp.EMReposConfiginvoke INFO: Repository successfully dropped Enterprise Manager configuration completed successfully FINISHED EMCA at Dec 13, 2012 4:56:46 PM [oracle@racnode1 bin]$ emca -config dbcontrol db -repos create-cluster
STARTED EMCA at Dec 13, 2012 4:57:59 PM EM Configuration Assistant, Version 11.2.0.3.0 Production Copyright (c) 2003, 2011, Oracle. All rightsreserved.
Enter the following information: Database unique name: racdbclp Service name: racdbclp Listener port number: 1521 Listener ORACLE_HOME [ /u01/app/11.2.0/grid ]: Password for SYS user: Password for SYS user: racclp Password for SYSMAN user: Cluster name: racnode-cluster Email address for notifications (optional): Outgoing Mail (SMTP) server for notifications (optional): ASM ORACLE_HOME [ /u01/app/11.2.0/grid ]: ASM port [ 1521 ]: ASM username [ ASMSNMP ]: ASM user password: ASM user password: racclp Dec 13, 2012 5:06:11 PM oracle.sysman.emcp.util.GeneralUtilinitSQLEngineRemotely WARNING: Error during db connection : ORA-12514: TNS:listenerdoes not currently know of service requested in connectdescriptor
Dec 13, 2012 5:06:17 PM oracle.sysman.emcp.util.GeneralUtilinitSQLEngineRemotely WARNING: ORA-01017: invalid username/password; logon denied
Dec 13, 2012 5:06:18 PM oracle.sysman.emcp.util.GeneralUtilinitSQLEngineRemotely WARNING: Error during db connection : ORA-12514: TNS:listenerdoes not currently know of service requested in connectdescriptor
null [ORA-01219: database not open: queries allowed on fixedtables/views only] -----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................/u01/app/oracle/product/11.2.0/dbhome_1
Database instance hostname ................ Listener ORACLE_HOME................ /u01/app/11.2.0/grid Listener port number ................ 1521 Cluster name ................ racnode-cluster Database unique name ................ racdbclp Email address for notifications ............... Outgoing Mail (SMTP) server for notifications............... ASM ORACLE_HOME ................ /u01/app/11.2.0/grid ASM port ................ 1521 ASM user role ................ SYSDBA ASM username ................ ASMSNMP
----------------------------------------------------------------- Do you wish to continue? [yes(Y)/no(N)]: Y Dec 13, 2012 5:06:48 PM oracle.sysman.emcp.EMConfig perform INFO: This operation is being logged at/u01/app/oracle/cfgtoollogs/emca/racdbclp/emca_2012_12_13_16_57_59.log. Dec 13, 2012 5:06:53 PM oracle.sysman.emcp.EMReposConfigcreateRepository INFO: Creating the EM repository (this may take a while) ... Dec 13, 2012 5:18:09 PM oracle.sysman.emcp.EMReposConfiginvoke INFO: Repository successfully created Dec 13, 2012 5:18:28 PM oracle.sysman.emcp.EMReposConfiguploadConfigDataToRepository INFO: Uploading configuration data to EM repository (this maytake a while) ... Dec 13, 2012 5:20:02 PM oracle.sysman.emcp.EMReposConfiginvoke INFO: Uploaded configuration data successfully Dec 13, 2012 5:20:03 PM oracle.sysman.emcp.EMDBCConfiginstantiateOC4JConfigFiles INFO: Propagating/u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_racnode1_racdbclpto remote nodes ... Dec 13, 2012 5:20:06 PM oracle.sysman.emcp.EMDBCConfiginstantiateOC4JConfigFiles INFO: Propagating/u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_racnode2_racdbclpto remote nodes ... Dec 13, 2012 5:20:16 PM oracle.sysman.emcp.EMAgentConfigdeployStateDirs INFO: Propagating/u01/app/oracle/product/11.2.0/dbhome_1/racnode1_racdbclp to remotenodes ... Dec 13, 2012 5:20:23 PM oracle.sysman.emcp.EMAgentConfigdeployStateDirs INFO: Propagating/u01/app/oracle/product/11.2.0/dbhome_1/racnode2_racdbclp to remotenodes ... Dec 13, 2012 5:20:50 PM oracle.sysman.emcp.util.DBControlUtilsecureDBConsole INFO: Securing Database Control (this may take a while) ... Dec 13, 2012 5:21:45 PM oracle.sysman.emcp.util.DBControlUtilstartOMS INFO: Starting Database Control (this may take a while) ... Dec 13, 2012 5:23:07 PM oracle.sysman.emcp.EMDBPostConfigperformConfiguration INFO: Database Control started successfully Dec 13, 2012 5:23:07 PM oracle.sysman.emcp.EMDBPostConfigperformConfiguration INFO: >>>>>>>>>>> The DatabaseControl URL is https://racnode1:1158/em<<<<<<<<<<<</P> Dec 13, 2012 5:23:17 PM oracle.sysman.emcp.EMDBPostConfigshowClusterDBCAgentMessage INFO: **************** CurrentConfiguration **************** INSTANCE NODE DBCONTROL_UPLOAD_HOST ---------- ---------- ---------------------
racdbclp racnode1 racnode1 racdbclp racnode2 racnode1
Dec 13, 2012 5:23:17 PM oracle.sysman.emcp.EMDBPostConfiginvoke WARNING: ************************ WARNING ************************
Management Repository has been placed in secure mode whereinEnterprise Manager data will be encrypted. Theencryption key has been placed in the file:/u01/app/oracle/product/11.2.0/dbhome_1/racnode1_racdbclp/sysman/config/emkey.ora.Ensure this file is backed up as the encrypted data will becomeunusable if this file is lost.
*********************************************************** Enterprise Manager configuration completed successfully FINISHED EMCA at Dec 13, 2012 5:23:17 PM [oracle@racnode1 bin]$ emctl start dbconsole Oracle Enterprise Manager 11g Database Control Release11.2.0.3.0 Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved. https://racnode1:1158/em/console/aboutApplication - An instance of Oracle Enterprise Manager 11gDatabase Control is already running. [oracle@racnode1 bin]$ emctl status dbconsole Oracle Enterprise Manager 11g Database Control Release11.2.0.3.0 Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved. https://racnode1:1158/em/console/aboutApplication Oracle Enterprise Manager 11g is running. ------------------------------------------------------------------ Logs are generated in directory/u01/app/oracle/product/11.2.0/dbhome_1/racnode1_racdbclp/sysman/log [oracle@racnode1 bin]$ |
[oracle@racnode2 ~]$ emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
https://racnode1:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control ....started.
------------------------------------------------------------------
Logs are generated in directory/u01/app/oracle/product/11.2.0/dbhome_1/racnode2_racdbclp/sysman/log
[oracle@racnode2 ~]$