# From Oracle Enterprise Linux 4.5 Disk 1 cd /media/cdrecorder/CentOS/RPMS rpm -Uvh setarch-1* rpm -Uvh compat-libstdc++-33-3* rpm -Uvh make-3* rpm -Uvh glibc-2* cd / eject # From Oracle Enterprise Linux 4.5 Disk 2 cd /media/cdrecorder/CentOS/RPMS rpm -Uvh openmotif-2* rpm -Uvh compat-db-4* rpm -Uvh gcc-3* cd / eject # From Oracle Enterprise Linux 4.5 Disk 3 cd /media/cdrecorder/CentOS/RPMS rpm -Uvh libaio-0* rpm -Uvh rsh-* rpm -Uvh compat-gcc-32-3* rpm -Uvh compat-gcc-32-c++-3* rpm -Uvh openmotif21* cd / eject
Notice that the NAS1 entry is actually pointing to the RAC1 node. If you are using a real NAS or a third server to provide your shared storage put the correct IP address into the file.127.0.0.1 localhost.localdomain localhost # Public 192.168.2.101 rac1.localdomain rac1 192.168.2.102 rac2.localdomain rac2 #Private 192.168.0.101 rac1-priv.localdomain rac1-priv 192.168.0.102 rac2-priv.localdomain rac2-priv #Virtual 192.168.2.111 rac1-vip.localdomain rac1-vip 192.168.2.112 rac2-vip.localdomain rac2-vip #NAS 192.168.2.101 nas1.localdomain nas1
Run the following command to change the current kernel parameters.kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 # semaphores: semmsl, semmns, semopm, semmni kernel.sem = 250 32000 100 128 #fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 #net.core.rmem_default=262144 #net.core.rmem_max=262144 #net.core.wmem_default=262144 #net.core.wmem_max=262144 # Additional and amended parameters suggested by Kevin Closson net.core.rmem_default = 524288 net.core.wmem_default = 524288 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.ipv4.ipfrag_high_thresh=524288 net.ipv4.ipfrag_low_thresh=393216 net.ipv4.tcp_rmem=4096 524288 16777216 net.ipv4.tcp_wmem=4096 524288 16777216 net.ipv4.tcp_timestamps=0 net.ipv4.tcp_sack=0 net.ipv4.tcp_window_scaling=1 net.core.optmem_max=524287 net.core.netdev_max_backlog=2500 sunrpc.tcp_slot_table_entries=128 sunrpc.udp_slot_table_entries=128 net.ipv4.tcp_mem=16384 16384 16384
Add the following lines to the /etc/security/limits.conf file./sbin/sysctl -p
Add the following line to the /etc/pam.d/login file, if it does not already exist.* soft nproc 2047 * hard nproc 16384 * soft nofile 1024 * hard nofile 65536
Disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows.session required /lib/security/pam_limits.so
Alternatively, this alteration can be done using the GUI tool (Applications > System Settings > Security Level). Click on the SELinux tab and disable the feature.SELINUX=disabled
To load the module immediately, execute "modprobe -v hangcheck-timer".options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
During the installation, both RSH and RSH-Server were installed. Enable remote shell and rlogin by doing the following.groupadd oinstall groupadd dba groupadd oper useradd -g oinstall -G dba oracle passwd oracle
Create the /etc/hosts.equiv file as the root user.chkconfig rsh on chkconfig rlogin on service xinetd reload
Edit the /etc/hosts.equiv file to include all the RAC nodes:touch /etc/hosts.equiv chmod 600 /etc/hosts.equiv chown root:root /etc/hosts.equiv
Login as the oracle user and add the following lines at the end of the .bash_profile file.+rac1 oracle +rac2 oracle +rac1-priv oracle +rac2-priv oracle
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=RAC1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fiRemember to set the ORACLE_SID to RAC2 on the second node.Add the following lines to the /etc/exports file.mkdir /share1 mkdir /share2
Run the following command to export the NFS shares./share1 *(rw,sync,no_wdelay,insecure_locks,no_root_squash) /share2 *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
On both RAC1 and RAC2 create some mount points to mount the NFS shares to.chkconfig nfs on service nfs restart
Add the following lines to the "/etc/fstab" file. The mount options are suggestions from Kevin Closson.mkdir /u01 mkdir /u02
Mount the NFS shares on both servers.nas1:/share1 /u01 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=300,rsize=32768,wsize=32768,actimeo=0 0 0 nas1:/share2 /u02 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=300,rsize=32768,wsize=32768,actimeo=0 0 0
Create the shared CRS Configuration and Voting Disk files.mount /u01 mount /u02
Create the directories in which the Oracle software will be installed.touch /u01/crs_configuration touch /u01/voting_disk
mkdir -p /u01/crs/oracle/product/10.2.0/crs mkdir -p /u01/app/oracle/product/10.2.0/db_1 mkdir -p /u01/oradata chown -R oracle:oinstall /u01 /u02
Login to RAC1 as the oracle user and start the Oracle installer.cd /u02 unzip 10201_clusterware_linux32.zip unzip 10201_database_linux32.zip
On the "Welcome" screen, click the "Next" button.cd /u02/clusterware ./runInstaller















The output of the root.sh will vary a little depending on the node it is run on. The following text is the output from the RAC1 node.# cd /u01/app/oracle/oraInventory # ./orainstRoot.sh Changing permissions of /u01/app/oracle/oraInventory to 770. Changing groupname of /u01/app/oracle/oraInventory to oinstall. The execution of the script. is complete #
Ignore the directory ownership warnings. We should really use a separate directory structure for the clusterware so it can be owned by the root user, but it has little effect on the finished results.# cd /u01/crs/oracle/product/10.2.0/crs # ./root.sh WARNING: directory '/u01/crs/oracle/product/10.2.0' is not owned by root WARNING: directory '/u01/crs/oracle/product' is not owned by root WARNING: directory '/u01/crs/oracle' is not owned by root WARNING: directory '/u01/crs' is not owned by root WARNING: directory '/u01' is not owned by root Checking to see if Oracle CRS stack is already configured /etc/oracle does not exist. Creating it now. Setting the permissions on OCR backup directory Setting up NS directories Oracle Cluster Registry configuration upgraded successfully WARNING: directory '/u01/crs/oracle/product/10.2.0' is not owned by root WARNING: directory '/u01/crs/oracle/product' is not owned by root WARNING: directory '/u01/crs/oracle' is not owned by root WARNING: directory '/u01/crs' is not owned by root WARNING: directory '/u01' is not owned by root assigning default hostname rac1 for node 1. assigning default hostname rac2 for node 2. Successfully accumulated necessary OCR keys. Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897. node: node 1: rac1 rac1-priv rac1 node 2: rac2 rac2-priv rac2 Creating OCR keys for user 'root', privgrp 'root'.. Operation successful. Now formatting voting device: /u01/voting_disk Format of 1 voting devices complete. Startup will be queued to init within 90 seconds. Adding daemons to inittab Expecting the CRS daemons to be up within 600 seconds. CSS is active on these nodes. rac1 CSS is inactive on these nodes. rac2 Local node checking complete. Run root.sh on remaining nodes to start CRS daemons. #
Here you can see that some of the configuration steps are omitted as they were done by the first node. In addition, the final part of the script. ran the Virtual IP Configuration Assistant (VIPCA) in silent mode, but it failed. This is because my public IP addresses are actually within the "192.168.255.255" range which is a private IP range. If you were using "legal" IP addresses you would not see this and you could ignore the following VIPCA steps.# /u01/crs/oracle/product/10.2.0/crs # ./root.sh WARNING: directory '/u01/crs/oracle/product/10.2.0' is not owned by root WARNING: directory '/u01/crs/oracle/product' is not owned by root WARNING: directory '/u01/crs/oracle' is not owned by root WARNING: directory '/u01/crs' is not owned by root WARNING: directory '/u01' is not owned by root Checking to see if Oracle CRS stack is already configured /etc/oracle does not exist. Creating it now. Setting the permissions on OCR backup directory Setting up NS directories Oracle Cluster Registry configuration upgraded successfully WARNING: directory '/u01/crs/oracle/product/10.2.0' is not owned by root WARNING: directory '/u01/crs/oracle/product' is not owned by root WARNING: directory '/u01/crs/oracle' is not owned by root WARNING: directory '/u01/crs' is not owned by root WARNING: directory '/u01' is not owned by root clscfg: EXISTING configuration version 3 detected. clscfg: version 3 is 10G Release 2. assigning default hostname rac1 for node 1. assigning default hostname rac2 for node 2. Successfully accumulated necessary OCR keys. Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897. node: node 1: rac1 rac1-priv rac1 node 2: rac2 rac2-priv rac2 clscfg: Arguments check out successfully. NO KEYS WERE WRITTEN. Supply -force parameter to override. -force is destructive and will destroy any previous cluster configuration. Oracle Cluster Registry for cluster has already been initialized Startup will be queued to init within 90 seconds. Adding daemons to inittab Expecting the CRS daemons to be up within 600 seconds. CSS is active on these nodes. rac1 rac2 CSS is active on all nodes. Waiting for the Oracle CRSD and EVMD to start Waiting for the Oracle CRSD and EVMD to start Waiting for the Oracle CRSD and EVMD to start Waiting for the Oracle CRSD and EVMD to start Waiting for the Oracle CRSD and EVMD to start Waiting for the Oracle CRSD and EVMD to start Waiting for the Oracle CRSD and EVMD to start Oracle CRS stack installed and running under init(1M) Running vipca(silent) for configuring nodeapps The given interface(s), "eth0" is not public. Public interfaces should be used to configure virtual IPs. #
Click the "Next" button on the VIPCA welcome screen.# cd /u01/crs/oracle/product/10.2.0/crs/bin # ./vipca









On the "Welcome" screen, click the "Next" button.cd /u02/database ./runInstaller











On the "Welcome" screen, select the "Oracle Real Application Clusters database" option and click the "Next" button.dbca



















LISTENER_RAC2 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip.lynx.co.uk)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.102)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
LISTENER_RAC1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip.lynx.co.uk)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.101)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)The shared "$ORACLE_HOME/network/admin/tnsnames.ora" file will contain the following entries.RAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip.lynx.co.uk)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip.lynx.co.uk)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.WORLD)
)
)
LISTENERS_RAC =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip.lynx.co.uk)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip.lynx.co.uk)(PORT = 1521))
)
RAC2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip.lynx.co.uk)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.WORLD)
(INSTANCE_NAME = RAC2)
)
)
RAC1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip.lynx.co.uk)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.WORLD)
(INSTANCE_NAME = RAC1)
)
)This configuration allows direct connections to specific instance, or using a load balanced connection to the main service.$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Tue Apr 18 12:27:11 2006 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, Real Application Clusters, OLAP and Data Mining options SQL> CONN sys/password@rac1 AS SYSDBA Connected. SQL> SELECT instance_name, host_name FROM v$instance; INSTANCE_NAME HOST_NAME ---------------- ---------------------------------------------------------------- RAC1 rac1.localdomain SQL> CONN sys/password@rac2 AS SYSDBA Connected. SQL> SELECT instance_name, host_name FROM v$instance; INSTANCE_NAME HOST_NAME ---------------- ---------------------------------------------------------------- RAC2 rac2.localdomain SQL> CONN sys/password@rac AS SYSDBA Connected. SQL> SELECT instance_name, host_name FROM v$instance; INSTANCE_NAME HOST_NAME ---------------- ---------------------------------------------------------------- RAC1 rac1.localdomain SQL>
The V$ACTIVE_INSTANCES view can also display the current status of the instances.$ srvctl config database -d RAC rac1 RAC1 /u01/app/oracle/product/10.2.0/db_1 rac2 RAC2 /u01/app/oracle/product/10.2.0/db_1 $ $ srvctl status database -d RAC Instance RAC1 is running on node rac1 Instance RAC2 is running on node rac2 $
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Apr 18 12:15:15 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> SELECT * FROM v$active_instances;
INST_NUMBER INST_NAME
----------- ------------------------------------------------------------
1 rac1.localdomain:RAC1
2 rac2.localdomain:RAC2
SQL>Finally, the GV$ allow you to display global information for the whole RAC.SQL> SELECT inst_id, username, sid, serial# FROM gv$session WHERE username IS NOT NULL;
INST_ID USERNAME SID SERIAL#
---------- ------------------------------ ---------- ----------
1 SYS 127 2
1 SYS 128 28
1 SYS 130 10
1 SYS 131 4
1 SYS 133 9
1 DBSNMP 134 27
1 DBSNMP 135 1
1 SYS 153 122
2 SYSMAN 120 243
2 DBSNMP 122 37
2 DBSNMP 124 93
INST_ID USERNAME SID SERIAL#
---------- ------------------------------ ---------- ----------
2 SYSMAN 125 2
2 SYSMAN 127 6
2 SYS 128 26
2 SYS 129 30
2 SYS 130 3
2 SYS 133 149
2 SYSMAN 134 58
2 SYS 136 32
19 rows selected.
SQL>If you have configured Enterprise Manager, it can be used to view the configuration and current status of the database.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/119501/viewspace-607296/ ,如需转载,请注明出处,否则将追究法律责任。