Oracle RAC9i(R2) for Sun Cluster Workshop RAC 개념 RAC 는하드웨어클러스터상에서운영된다. 클러스터는단일시스템으로서함께연동되는독립서버 ( 노드 ) 그룹이다. 주요클러스터컴포넌트는프로세서노드, 클러스터인터커넥트및공유스토리지서브시스템등이다. 노드는데이타를관리하는스토리지서브시스템과자원에대한액세스를공유하지만개별노드에서메인메모리를물리적으로공유하지는않는다. ORAC 은개별노드의메모리를결합해전체데이타베이스시스템에대한분산캐시메모리의단일뷰를제공한다. 노드는다중프로세서로구성될수있다. 대표적인노드유형은 SMP(Symmetric Multi-Processor) 노드이다. 각노드는자체전용시스템메모리뿐만아니라자체운영체계, 데이타베이스인스턴스및애플리케이션소프트웨어를보유하고있다. 클러스터의장점 단일대규모노드보다클러스터를이용함으로써실현되는이점은다음과같다. - 시스템이원하는용량으로확장할수있도록지원하는용량계획의유연성및비용효율성 - 특히노드장애발생시클러스터내부분적장애에대한폴트톨로런스 확장성 ORAC 은용량에대한요구가증가함에따라클러스터에노드를추가할수있는유연성을사용자에게제공함으로써시스템을단계적으로확장해자본투자비용을절감하고소규모단일노드시스템을대규모노드시스템으로교체해야하는필요성을없애도록했다. 대부분의경우 1-67
시스템을업그레이드하기위해완전히새로운대규모노드를이용하는대신유사하거나동일한구성을보유한하나이상의노드가클러스터에추가되기때문에이는보다쉽고신속하게용량업그레이드프로세스를실행할수있도록하게된다. ORAC 에구현된 Cache Fusion 기술은거의선형적으로용량을확장할수있도록지원한다. 고가용성클러스터아키텍처의또다른주요장점은다중노드에의해제공되는고유폴트톨로런스이다. 물리적인노드가독립적으로운영되기때문에하나이상의노드에장애가발생하더라도클러스터의여타노드에영향을미치지않는다. 극한상황의경우, 클러스터시스템은단하나의노드만이생존하더라도이용할수있기때문에클러스터를토대로하는시스템은고도의가용성을실현할수있게된다. 또한이아키텍처는유지보수를위해노드그룹이오프라인으로되어있는동안나머지클러스터가서비스를온라인으로제공할수있도록지원한다. 9i (RAC) New Feautes Cache Fusion - 모든 node 의 interconnected cache 를활용한다. - write/write 충돌시필요한 data block 을 remote node 의 cache 에서바로요청한 Instance 로고속 interconect 를통하여전송 - Update 작업의동기화를위한 Disk I/O 불필요하다. ( 이전버전에서는 Cache 상에변경되어있는 Block 을 Disk 에기록한후, 다른 Instance 는해당 Block 을 Disk 에서 Cache 로다시읽어변경작업을하는 Ping protocol 사용 ) Cache Fusion 기법의개념적구조 Node A Data Transfer Node B Reques t Databas e buffers Databas e buffers Databas e 2-67
Cache Fusion 을이용한경우의비교 100 msec Block Access Time(ms) Without Cache Fusion With Cache Fusion Time to write data block to disk 20 msec 1 msec 0.01 msec Block in Local Cache Block in Remote Cache Block on Disk Real Application Clusters Installation Overview Oracle Real Application Clusters Validation Matrix RAC 구축 1. Install the operating system-dependent (OSD) clusterware. The OSD clusterware installation process varies according to platform: 1.1 For UNIX, refer to your vendor documentation and to the documentation for the SunCluster UDLM patch. 2. If you are not using a cluster file system, then configure the shared disks 3. Run the OUI to install the Oracle9i Enterprise Edition and the Oracle9i Real Application Clusters software 4. Create and configure your database as described in either: 4.1 Create a RAC Database using the Oracle Database Configuration Assistant(DBCA), or: 4.2 Manually Creating Real Application Clusters Databases 5. Single Database 에서 RAC 구현하기 (node 추가하기 ) 6. Administering Real Application Clusters Instances ( 옵션 ) 3-67
7. Network 구성 & CTF (Connection Time Failover) vs TAF (Transparent Application Failover) Trouble Shooting 4-67
Oracle Real Application Clusters Validation Matrix Oracle Real Application Clusters is a proven way to scale applications both in terms of number of users and volume of transactions. Additionally, Oracle Real Application Clusters provides proven availability that is a must for any mission-critical application. In this environment, Network Appliance enables these mission-critical applications to scale storage rapidly on an as-needed basis without any unplanned downtime. With its software offerings like Snapshot, SnapMirror, and SnapRestore, Network Appliance provides a proven and compelling platform that makes the Oracle Real Application Clusters implementation even more unbreakable. Oracle has created an extensive test suite that validates compatibility of servers and storage with Oracle Real Application Clusters database. NetApp has received the validation for the following products from Oracle and Cluster Software vendors. Following is a matrix of Oracle Real Application Clusters Validation. 5-67
RAC Inatallation 1. Install the operating system-dependent (OSD) clusterware. The OSD clusterware installation process varies according to platform: 1.1 Sun Cluster 1.1.1 Installation UDLM package The Sun Cluster install CD's contain the required SC udlm package:- Package SUNWudlm Sun Cluster Support for Oracle Parallel Server UDLM, (opt) on SunCluster v3 To install use the pkgadd command:- # pkgadd -d. SUNWudlm Once installed, Oracle's interface with this, the Oracle UDLM, can be installed. 1.1.1.1 VxVM 을사용할경우 To install Sun Cluster Support for RAC with VxVM, the following Sun Cluster 3 Agents data services packages need to be installed as superuser (see Sun's Sun Cluster 3 Data Services Installation and Configuration Guide):- # pkgadd -d. SUNWscucm SUNWudlmr SUNWcvmr SUNWcvm (SUNWudlm will also need to be included unless already installed from the step above) 1.1.2 UDLM package check 및 UDLM patch Before rebooting the nodes, you must ensure that you have correctly installed and configured the Oracle UDLM software. The Oracle Unix Distributed Lock Manager (ORCLudlm also known as the Oracle Node Monitor) must be installed. This may be referred to in the Oracle documentation as the "Parallel Server Patch". To check version information on any previously installed dlm package: $ pkginfo -l ORCLudlm grep PSTAMP OR $ pkginfo -l ORCLudlm grep VERSION You must apply the following steps to all cluster nodes. The Oracle udlm can be found on Disk1 of the Oracle9i server installation CD-ROM, in the directory opspatch or racpatch in later versions. Oracle patchsets may also ship udlm installs which are again found in the Disk1 racpatch directory of the patchset. A version of the Oracle udlm may also be found on the Sun Cluster CD set but check the Oracle release for the latest applicable version. The informational files README.udlm & release_notes.334x are located in this directory with version and install 6-67
information. This is the Oracle udlm package for 7.X.X or later on Solaris Operating System (SPARC) and requires any previous versions to be removed prior to installation. Use the latest udlm pacakge as this supports previous versions of Oracle RAC and Parallel Server provided that the same bit-size (32-bit or 64-bit) for Oracle is used throughout. Shutdown all existing clients of Oracle Unix Distributed Lock Manager (including all Oracle Parallel Server/RAC instances). Become super user. Reboot the cluster node in non-cluster mode (replace <node name> with your cluster node name):- # scswitch -S -h <node name> # shutdown -g 0 -y... wait for the ok prompt ok boot -x Unpack the file ORCLudlm.tar.Z into a directory: cd <CD-ROM mount>/opspatch #(or racpatch in later versions) cp ORCLudlm.tar.Z /tmp cd /tmp uncompress ORCLudlm.tar.Z tar xvf ORCLudlm.tar Install the patch by adding the package as root: cd /tmp pkgadd -d. ORCLudlm The udlm configuration files in SC2.X and SC3.0 are the following: SC2.X: /etc/opt/sunwcluster/conf/<default_cluster_name>.ora_cdb SC3.0: /etc/opt/sunwcluster/conf/udlm.conf The udlm log files in SC2.X and SC3.0 are the following: SC2.X: /var/opt/sunwcluster/dlm_<node_name>/logs/dlm.log SC3.0: /var/cluster/ucmm/dlm_<node_name>/logs/dlm.log pkgadd will copy a template file, <configuration_file_name>.template, to /etc/opt/sunwcluster/conf. Now that udlm (also referred to as the "Cluster Membership Monitor") is installed, you can start it up by rebooting the cluster node in cluster mode:- # shutdown -g 0 -y -i 6 7-67
2. Configure the shared disks and UNIX preinstallation tasks. 2.1 Configure the shared disks(raw Device 생성 ) The Oracle instances in the RAC configuration write information to raw devices defined for: The control file The spfile.ora Each datafile Each ONLINE redo log file Server Manager (SRVM) configuration information : svrctl 기능을사용할경우필요 It is therefore necessary to define raw devices for each of these categories of file. The Oracle Database Configuration Assistant (DBCA) will create a seed database expecting the following configuration: Create a Raw Device for: File Size Sample name SYSTEM tablespace 400 MB db_name_raw_system_400 USERS tablespace 120 MB db_name_raw_user_120 TEMP tablespace 100 MB db_name_raw_temp_100 An undo tablespace per instance 500 MB db_name_raw_undo_500 OEMREPO 20 MB db_name_raw_oemrepo_20 INDX tablespace 70 MB db_name_raw_indx_70 TOOLS tablespace 12 MB db_name_raw_tools_12 DRYSYS tablespace 90 MB db_name_raw_dr_90 EXAMPLES tablespace 160 MB db_name_raw_examples_160 First control file 110 MB db_name_raw_control01_110 Second control file 110 MB db_name_raw_control02_110 Two redo log files per instance 120 MB per file db_name_thread_lognumb_120 Spfile.ora 5 MB db_name_raw_spfile_5 Srvmconfig 100 MB db_name_raw_srvmconf_100 Srvmconfig file 은 svrctl 기능을사용할경우필요하다. 2.1.1 On the node from which you run the Oracle Universal Installer, create an ASCII file identifying the raw volume objects as shown above. The DBCA requires that these objects exist during installation and database creation. When creating the ASCII file content for the objects, name them using the format: database_object=raw_device_file_path When you create the ASCII file, separate the database objects from the paths with equals (=) signs as shown in the example below:- system=/dev/vx/rdsk/oracle_dg/clustdb_raw_system_400m spfile=/dev/vx/rdsk/oracle_dg/clustdb_raw_spfile_5m users=/dev/vx/rdsk/oracle_dg/clustdb_raw_users_120m temp=/dev/vx/rdsk/oracle_dg/clustdb_raw_temp_100m undotbs1=/dev/vx/rdsk/oracle_dg/clustdb_raw_undotbs1_290m 8-67
undotbs2=/dev/vx/rdsk/oracle_dg/clustdb_raw_undotbs2_290m example=/dev/vx/rdsk/oracle_dg/clustdb_raw_example_30m cwmlite=/dev/vx/rdsk/oracle_dg/clustdb_raw_cwmlite_100m indx=/dev/vx/rdsk/oracle_dg/clustdb_raw_indx_70m tools=/dev/vx/rdsk/oracle_dg/clustdb_raw_tools_12m drsys=/dev/vx/rdsk/oracle_dg/clustdb_raw_dr_90m control1=/dev/vx/rdsk/oracle_dg/clustdb_raw_controlfile1_110m control2=/dev/vx/rdsk/oracle_dg/clustdb_raw_controlfile2_110m redo1_1=/dev/vx/rdsk/oracle_dg/clustdb_raw_log11_120m redo1_2=/dev/vx/rdsk/oracle_dg/clustdb_raw_log12_120m redo2_1=/dev/vx/rdsk/oracle_dg/clustdb_raw_log21_120m redo2_2=/dev/vx/rdsk/oracle_dg/clustdb_raw_log22_120m You must specify that Oracle should use this file to determine the raw device volume names by setting the following environment variable where filename is the name of the ASCII file that contains the entries shown in the example above: setenv DBCA_RAW_CONFIG filename or export DBCA_RAW_CONFIG=filename $ vi /var/opt/oracle/srvconfig.loc srvconfig_loc=/dev/vx/rdsk/datadg/rac_srvconfig_10m 2.2 UNIX Preinstallation Steps 2.2.1 Group(dba) 생성 ( 각 node 에서실행 ) # groupadd g 900 dba 2.2.2 User(oracle) 생성 ( 각 node 에서실행 ) # useradd -g dba -u 900 -m -d /oracle -s /bin/ksh oracle # passwd oracle 2.2.3 remote shell(rcp, rlogin, rsh) 구성 Select the node from which you will run the Oracle Universal Installer (OUI) and establish user equivalence by adding an entry for all nodes in the cluster, including the local node, to the.rhosts file of the oracle account, or to the /etc/host.equiv file. 2.2.3.1 Set up user equivalence for the oracle account, to enable rsh, rcp, rlogin commands. /etc/hosts (on all nodes) 127.0.0.1 localhost 61.250.123.231 sc1 loghost 61.250.123.232 sc2 172.16.0.129 inter1 172.16.0.130 inter2 /etc/hosts.equiv file. Put the list of machines or nodes into hosts.equiv. /etc/hosts.equiv (on all nodes) +sc1 root 9-67
+sc2 root +sc1 oracle +sc2 oracle +inter1 root +inter2 root +inter1 oracle +inter2 oracle.rhosts file. In the root and oracle users home directory, put the list of machines into.rhosts. [sc1:oracle:/oracle]% cat /oracle/.rhosts + Note : It is possible, though not advised for security reasons, to put a + in the hosts.equiv and.rhosts files. Test if the user equivalence is correctly set up (node2 is the secondary cluster machine) : Logged on node1 as oracle (then, as root) : $ rlogin node2 (-> no pwd) $ rcp /tmp/toto node2:/tmp/toto $ rsh node2 pwd 2.2.3.2 remote shell test [sc1:oracle:/oracle]% touch test [sc1:oracle:/oracle]% rcp test sc2:/oracle [sc2:oracle:/oracle]% rsh sc2 ls -l total 16 drwx------ 2 root root 8192 Mar 5 05:04 lost+found -rw-r--r-- 1 oracle dba 0 Mar 5 11:15 test 2.2.4 System Kernel Parameters( 각 node 에설정 ) Kernel Parameter Setting Purpose SHMMAX 4294967295 Maximum allowable size of one shared memory segment (4 Gb) SHMMIN 1 Minimum allowable size of a single shared memory segment. SHMMNI 100 Maximum number of shared memory segments in the entire system. SHMSEG 10 Maximum number of shared memory segments one process can attach. SEMMNI 1024 Maximum number of semaphore sets in the entire system. SEMMSL 100 Minimum recommended value. SEMMSL should be 10 plus the largest PROCESSES parameter of any Oracle database on the system. SEMMNS 1024 Maximum semaphores on the system. This setting is a minimum recommended value. SEMMNS should be set to the sum of the PROCESSES parameter for each Oracle database, add the largest one twice, plus add an additional 10 for each database. SEMOPM 100 Maximum number of operations per semop call. SEMVMX 32767 Maximum value of a semaphore. (swap space) 750 MB Two to four times your system's physical memory size. /etc/system (on all nodes) set shmsys:shminfo_shmmax=4294967295 set shmsys:shminfo_shmmin=1 set shmsys:shminfo_shmmni=100 set shmsys:shminfo_shmseg=10 10-67
set semsys:seminfo_semmap=100 set semsys:seminfo_semmni=1024 set semsys:seminfo_semmns=1024 set semsys:seminfo_semmnu=2500 set semsys:seminfo_semmsl=100 set semsys:seminfo_semopm=100 set semsys:seminfo_semume=2500 set semsys:seminfo_semvmx=32767 set msgsys:msginfo_msgmax=16384 set msgsys:msginfo_msgmnb=16384 set msgsys:msginfo_msgmni=2200 set msgsys:msginfo_msgtql=2500 forceload: sys/shmsys forceload: sys/semsys forceload: sys/msgsys 2.2.5 Establish system environment variables Set a local bin directory in the user's PATH, such as /usr/local/bin, or /opt/bin. It is necessary to have execute permissions on this directory. Set the DISPLAY variable to point to the system's (from where you will run OUI) IP address, or name, X server, and screen. Set a temporary directory path for TMPDIR with at least 20 Mb of free space to which the OUI has write permission. 2.2.5.1 Establish Oracle environment variables: Set the following Oracle environment variables: Environment Variable ORACLE_BASE ORACLE_HOME ORACLE_TERM NLS_LANG ORA_NLS33 eg /u01/app/oracle eg /u01/app/oracle/product/9201 xterm Suggested value AMERICAN-AMERICA.UTF8 for example $ORACLE_HOME/ocommon/nls/admin/data PATH Should contain $ORACLE_HOME/bin CLASSPATH $ORACLE_HOME/JRE:$ORACLE_HOME/jlib \ $ORACLE_HOME/rdbms/jlib: \ $ORACLE_HOME/network/jlib Create the directory /var/opt/oracle and set ownership to the oracle user. Verify the existence of the file /opt/sunwcluster/bin/lkmgr. This is used by the OUI to indicate that the installation is being performed on a cluster. [sc1:oracle:/oracle]% cat /oracle/.profile (on all nodes) 11-67
umask 022 set filec set -o trackall set -o vi stty erase ^H stty -istrip cs8 erase ^H stty -istrip cs8 werase ^W stty -istrip cs8 intr ^C export PATH=/usr/local/bin/:$PATH export PATH=/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/ucb:/usr/ucb/bin:/usr/local/bin:/etc:. export PATH=/usr/openwin/bin:/usr/j2se/jre/bin:/usr/j2se/jre/lib:/usr/j2se/bin:$PATH export EDITOR=vi export LANG=ko export ENV=./.kshrc export PS1=[`hostname`:`whoami`:'$PWD]% ' alias alias alias alias alias alias alias df='df -k' rm='rm -i' ll='ls -al' dead='/usr/ucb/ps -aux more' cls='clear' ls='ls -af' ptd='/usr/platform/sun4u/sbin/prtdiag -v' #export DISPLAY=61.250.123.158:0.0 export ORACLE_BASE=/oracle/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/920 export ORACLE_TERM=vt100 export ORACLE_SID=RAC1 # node2(sc2) 에서는 RAC2 로설정 export TNS_ADMIN=$ORACLE_HOME/network/admin export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/ctx/bin:/tmp/OPatch:$ORACLE_HOME/Apatch/perl/bin export NLS_LANG=American_America.KO16KSC5601 export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data export LD_LIBRARY_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib:/usr/lib:/usr/local/lib:$DAMO_INST_HOME export CLASSPATH=$ORACLE_HOME/jre/1.4.2/bin #export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/local/lib export DATE=d`date`+%Y%m%d export LANG=ko export TMPDIR=/tmp alias oh='cd $ORACLE_HOME' alias ob='cd $ORACLE_BASE/admin/RAC/bdump' alias ss='sqlplus "/as sysdba"' 12-67
Verification Script (Note: 189256.1) Note: There is a verification script InstallPrep.sh available which may be downloaded and run prior to the installation of Oracle Real Application Clusters. This script verifies that the system is configured correctly according to the Installation Guide. The output of the script will report any further tasks that need to be performed before successfully installing Oracle 9.x DataServer (RDBMS). This script performs the following verifications:- ORACLE_HOME Directory Verification UNIX User/umask Verification UNIX Group Verification Memory/Swap Verification TMP Space Verification Real Application Cluster Option Verification Unix Kernel Verification Unix InstallPrep Script The Unix InstallPrep Script should be run prior to installing the Oracle 8.0.5 to 9.2 DataServer. This script checks for all known items that will cause the install to fail. Follow these steps to download and run the script: 1. Change the name of the script to InstallPrep.sh 2. Ftp the InstallPrep.sh script (in ascii format) to the Unix system that you will be installing the Oracle DataServer on. 3. Change the permissions of the script to execute for the user running the script: chmod 777 InstallPrep.sh 4. Log in as the user that will be installing the Oracle software. 5. Copy the InstallPrep.sh script to the /tmp directory and run it from this location. 6. Note: on some Linux platforms you may get the error "bad interpreter", just run the command 'sh InstallPrep.sh' and the try running it. Otherwise, you can try "dos2unix InstallPrep.sh" and then retry it. 7. Answer the first few questions, the output from the script will be written to /tmp/installprep.out and the errors written to /tmp/installprep.err. 8. Resolve any problems found in /tmp/installprep.err and then install the Oracle DataServer software.../installprep.sh 13-67
3 Using the Oracle Universal Installer for Real Application Clusters 3.1 install the Oracle Software Login as the oracle user # su oracle [sc1:oracle:/media/9i/disk1]% export LANG=C [sc1:oracle:/media/9i/disk1]%./runinstaller At the OUI Welcome screen, click Next. 14-67
A prompt will appear for the Inventory Location (if this is the first time that OUI has been run on this system). This is the base directory into which OUI will install files. The Oracle Inventory definition can be found in the file /var/opt/oracle/orainst.loc. Click OK. Unix Group Name 15-67
Verify the UNIX group name of the user who controls the installation of the Oracle9i software. If an instruction to run /tmp/orainstroot.sh appears, the pre-installation steps were not completed successfully. Typically, the /var/opt/oracle directory does not exist or is not writeable by oracle. Run /tmp/orainstroot.sh to correct this, forcing Oracle Inventory files, and others, to be written to the ORACLE_HOME directory. Once again this screen only appears the first time Oracle9i products are installed on the system. Click Next. Select the other nodes on to which the Oracle RDBMS software will be installed. It is not necessary to select the node on which the OUI is currently running. Click Next. Cluster Node Selection : <SHIFT> 키를누르면서 mouse 로화면에보이는모든 node 들을선택후에 Next 버튼을누른다. % 이부분을실행하면동시에각각의노드에 oracle 이설치된다. 16-67
The File Location window will appear. Do NOT change the Source field. The Destination field defaults to the ORACLE_HOME environment variable. Click Next. Select the Products to install. In this example, select the Oracle9i Server then click Next. 17-67
Product Language 를선택한다 Select the installation type. Choose the Custom option. Click Next. 18-67
Oracle9i Real Application Cluster 를체크하고, 기타필요 / 불필요한 option 들을추가 / 제거한다. click Next. Identify the raw partition in to which the Oracle9i Real Application Clusters (RAC) configuration information will be written. It is recommended that this raw partition is a minimum of 100MB in size. Raw Device 생성시에생성한 Srvmconfig 파일명을입력한다. 19-67
Privileged Operating System Groups dba 를입력한다. An option to Upgrade or Migrate an existing database is presented. Do NOT select the radio button. The Oracle Migration utility is not able to upgrade a RAC database, and will error if selected to do so. 20-67
Create Database No 를선택하고, Next 를클릭한다. The Summary screen will be presented. Confirm that the RAC database software will be installed and then click Install. The OUI will install the Oracle9i software on to the local node, and then copy this information to the other nodes selected. 21-67
Once Install is selected, the OUI will install the Oracle RAC software on to the local node, and then copy software to the other nodes selected earlier. This will take some time. During the installation process, the OUI does not display messages indicating that components are being installed on other nodes - I/O activity may be the only indication that the process is continuing. A screen indicating the OUI progress will be displayed 99% 에서 2 번 node 로 copy 한다.(cpio) ps 명령등으로확인할수있음. 22-67
RAC option 제거하기 (manually) [oracle:/oracle/app/oracle/product/9.2.0/rdbms/lib] make -f ins_rdbms.mk rac_off rm -f /oracle/app/oracle/product/9.2.0/lib/libskgxp9.a cp /oracle/app/oracle/product/9.2.0/lib//libskgxpd.a /oracle/app/oracle/product/9.2.0/lib/libskgxp9.a rm -f /oracle/app/oracle/product/9.2.0/lib/libskgxn9.a cp /oracle/app/oracle/product/9.2.0/lib//libskgxns.a /oracle/app/oracle/product/9.2.0/lib/libskgxn9.a /bin/ar -X64 d /oracle/app/oracle/product/9.2.0/rdbms/lib/libknlopt.a kcsm.o /bin/ar -X64 cr /oracle/app/oracle/product/9.2.0/rdbms/lib/libknlopt.a /oracle/app/oracle/product/9.2.0/rdbms/lib/ksnkcs.o [oracle:/oracle/app/oracle/product/9.2.0/rdbms/lib] make -f ins_rdbms.mk ioracle - Linking Oracle rm -f /oracle/app/oracle/product/9.2.0/rdbms/lib/oracle ld -b64 -o /oracle/app/oracle/product/9.2.0/rdbms/lib/oracle -L/oracle/app/oracle/product/9.2.0/rdbms/lib/ - L/oracle/app/oracle/product/9.2.0/lib/ -bbigtoc -bnoipath -bi:/oracle/app/oracle/product/9.2.0/lib/ksms.imp /oracle/app/oracle/product/9.2.0/rdbms/lib/opimai.o /oracle/app/oracle/product/9.2.0/rdbms/lib/ssoraed.o /oracle/app/oracle/product/9.2.0/rdbms/lib/ttcsoi.o /oracle/app/oracle/product/9.2.0/lib/nautab.o /oracle/app/oracle/product/9.2.0/lib/naeet.o /oracle/app/oracle/product/9.2.0/lib/naect.o /oracle/app/oracle/product/9.2.0/lib/naedhs.o /oracle/app/oracle/product/9.2.0/rdbms/lib/config.o -lserver9 /oracle/app/oracle/product/9.2.0/lib/libodm9.so -lskgxp9 -lskgxn9 -lclient9 -lvsn9 -lwtcserver9 -lcommon9 -lgeneric9 /oracle/app/oracle/product/9.2.0/rdbms/lib/defopt.o -lknlopt `if /bin/ar -X64 tv /oracle/app/oracle/product/9.2.0/rdbms/lib/libknlopt.a grep xsyeolap.o > /dev/null 2>&1 ; then echo "-loraolap9 - be:/oracle/app/oracle/product/9.2.0/rdbms/lib/olap.exp -be:/oracle/app/oracle/product/9.2.0/rdbms/lib/libamd.exp" ; fi` - lslax9 -lpls9 -lplp9 -be:/oracle/app/oracle/product/9.2.0/rdbms/lib/plsqlncomp.exp -lserver9 -lclient9 -lvsn9 -lwtcserver9 -lcommon9 -lgeneric9 -lknlopt -lslax9 -lpls9 -lplp9 -ljox9 -be:/oracle/app/oracle/product/9.2.0/rdbms/lib//oracle.exp - lwwg9 `sed -e 's/-ljava//g' /oracle/app/oracle/product/9.2.0/lib/ldflags` -lncrypt9 -lnsgr9 -lnzjs9 -ln9 -lnl9 -lnzjs9 -lnro9 `sed -e 's/-ljava//g' /oracle/app/oracle/product/9.2.0/lib/ldflags` -lncrypt9 -lnsgr9 -lnzjs9 -ln9 -lnl9 -lnzjs9 -lclient9 - lvsn9 -lwtcserver9 -lcommon9 -lgeneric9 -lwtcserver9 -lmm -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 - lnls9 `sed -e 's/-ljava//g' /oracle/app/oracle/product/9.2.0/lib/ldflags` -lncrypt9 -lnsgr9 -lnzjs9 -ln9 -lnl9 -lnzjs9 -lnro9 `sed -e 's/-ljava//g' /oracle/app/oracle/product/9.2.0/lib/ldflags` -lncrypt9 -lnsgr9 -lnzjs9 -ln9 -lnl9 -lnzjs9 -lclient9 - lvsn9 -lwtcserver9 -lcommon9 -lgeneric9 -lpls9 -ltrace9 -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 -lnls9 - lclient9 -lvsn9 -lwtcserver9 -lcommon9 -lgeneric9 -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 -lnls9 - lserver9 `if /bin/ar -X64 tv /oracle/app/oracle/product/9.2.0/rdbms/lib/libknlopt.a grep "kxmnsd.o" > /dev/null 2>&1 ; then echo " " ; else echo "-lordsdo9"; fi` -lctxc9 -lctx9 -lzx9 -lgx9 -lctx9 -lzx9 -lgx9 -lordimt9 -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 - lxml9 -lcore9 -lunls9 -lnls9 -lsnls9 -lunls9 -be:/oracle/app/oracle/product/9.2.0/rdbms/lib//libcorejava.exp -lld -lm `cat /oracle/app/oracle/product/9.2.0/lib/sysliblist` -lm `if [ "\`/usr/bin/uname -v\`" = "4" ]; \ then echo "-bi:/oracle/app/oracle/product/9.2.0/lib/pw-syscall.exp"; fi;` `if /bin/ar -X64 t /oracle/app/oracle/product/9.2.0/rdbms/lib/libknlopt.a grep '^'kcsm.o > /dev/null 2>&1 ; then echo "-lha_gs64_r -lha_em_r"; fi` -locijdbcst9 -lxsd9 ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_adt is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_char is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_datetime is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_indexed is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_interval is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_lob is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_objref is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_opq is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_sscalar is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_urowid is already exported. ld: 0711-415 WARNING: Symbol plzcls is already exported. ld: 0711-415 WARNING: Symbol plzexe is already exported. ld: 0711-415 WARNING: Symbol plzopn is already exported. ld: 0711-415 WARNING: Symbol plzosq is already exported. ld: 0711-415 WARNING: Symbol pevm_enter is already exported. ld: 0711-415 WARNING: Symbol pevm_movx is already exported. 23-67
ld: 0711-415 WARNING: Symbol peslcl2 is already exported. ld: 0711-319 WARNING: Exported symbol not defined: pen_pipe ld: 0711-319 WARNING: Exported symbol not defined: pevm_movcadt ld: 0711-319 WARNING: Exported symbol not defined: pevm_movl ld: 0711-319 WARNING: Exported symbol not defined: pevm_movs ld: 0711-319 WARNING: Exported symbol not defined: pifi_i ld: 0711-773 WARNING: Object /oracle/app/oracle/product/9.2.0/lib//libordsdo9.a[mdrcr.o], imported symbol kcbstdbz_ Symbol was expected to be local. Extra instructions are being generated to reference the symbol. ld: 0711-773 WARNING: Object /oracle/app/oracle/product/9.2.0/lib//libordsdo9.a[mdrt.o], imported symbol kcbstdbz_ Symbol was expected to be local. Extra instructions are being generated to reference the symbol. ld: 0711-783 WARNING: TOC overflow. TOC size: 87032 Maximum size: 65536 Extra instructions are being generated for each reference to a TOC symbol if the symbol is in the TOC overflow area. mv -f /oracle/app/oracle/product/9.2.0/bin/oracle /oracle/app/oracle/product/9.2.0/bin/oracleo mv /oracle/app/oracle/product/9.2.0/rdbms/lib/oracle /oracle/app/oracle/product/9.2.0/bin/oracle chmod 6751 /oracle/app/oracle/product/9.2.0/bin/oracle RAC option 추가하기 (manually) [oracle:/oracle/app/oracle/product/9.2.0/rdbms/lib] make -f ins_rdbms.mk rac_on rm -f /oracle/app/oracle/product/9.2.0/lib/libskgxp9.a cp /oracle/app/oracle/product/9.2.0/lib//libskgxpu.a /oracle/app/oracle/product/9.2.0/lib/libskgxp9.a - Use reference SKGXN library rm -f /oracle/app/oracle/product/9.2.0/lib/libskgxn9.a cp /oracle/app/oracle/product/9.2.0/lib//libskgxnr.a /oracle/app/oracle/product/9.2.0/lib/libskgxn9.a /bin/ar -X64 d /oracle/app/oracle/product/9.2.0/rdbms/lib/libknlopt.a ksnkcs.o /bin/ar -X64 cr /oracle/app/oracle/product/9.2.0/rdbms/lib/libknlopt.a /oracle/app/oracle/product/9.2.0/rdbms/lib/kcsm.o [oracle:/oracle/app/oracle/product/9.2.0/rdbms/lib] make -f ins_rdbms.mk ioracle - Linking Oracle rm -f /oracle/app/oracle/product/9.2.0/rdbms/lib/oracle ld -b64 -o /oracle/app/oracle/product/9.2.0/rdbms/lib/oracle -L/oracle/app/oracle/product/9.2.0/rdbms/lib/ - L/oracle/app/oracle/product/9.2.0/lib/ -bbigtoc -bnoipath -bi:/oracle/app/oracle/product/9.2.0/lib/ksms.imp /oracle/app/oracle/product/9.2.0/rdbms/lib/opimai.o /oracle/app/oracle/product/9.2.0/rdbms/lib/ssoraed.o /oracle/app/oracle/product/9.2.0/rdbms/lib/ttcsoi.o /oracle/app/oracle/product/9.2.0/lib/nautab.o /oracle/app/oracle/product/9.2.0/lib/naeet.o /oracle/app/oracle/product/9.2.0/lib/naect.o /oracle/app/oracle/product/9.2.0/lib/naedhs.o /oracle/app/oracle/product/9.2.0/rdbms/lib/config.o -lserver9 /oracle/app/oracle/product/9.2.0/lib/libodm9.so -lskgxp9 -lskgxn9 -lclient9 -lvsn9 -lwtcserver9 -lcommon9 -lgeneric9 /oracle/app/oracle/product/9.2.0/rdbms/lib/defopt.o -lknlopt `if /bin/ar -X64 tv /oracle/app/oracle/product/9.2.0/rdbms/lib/libknlopt.a grep xsyeolap.o > /dev/null 2>&1 ; then echo "-loraolap9 - be:/oracle/app/oracle/product/9.2.0/rdbms/lib/olap.exp -be:/oracle/app/oracle/product/9.2.0/rdbms/lib/libamd.exp" ; fi` - lslax9 -lpls9 -lplp9 -be:/oracle/app/oracle/product/9.2.0/rdbms/lib/plsqlncomp.exp -lserver9 -lclient9 -lvsn9 -lwtcserver9 -lcommon9 -lgeneric9 -lknlopt -lslax9 -lpls9 -lplp9 -ljox9 -be:/oracle/app/oracle/product/9.2.0/rdbms/lib//oracle.exp - lwwg9 `sed -e 's/-ljava//g' /oracle/app/oracle/product/9.2.0/lib/ldflags` -lncrypt9 -lnsgr9 -lnzjs9 -ln9 -lnl9 -lnzjs9 -lnro9 `sed -e 's/-ljava//g' /oracle/app/oracle/product/9.2.0/lib/ldflags` -lncrypt9 -lnsgr9 -lnzjs9 -ln9 -lnl9 -lnzjs9 -lclient9 - lvsn9 -lwtcserver9 -lcommon9 -lgeneric9 -lwtcserver9 -lmm -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 - lnls9 `sed -e 's/-ljava//g' /oracle/app/oracle/product/9.2.0/lib/ldflags` -lncrypt9 -lnsgr9 -lnzjs9 -ln9 -lnl9 -lnzjs9 -lnro9 `sed -e 's/-ljava//g' /oracle/app/oracle/product/9.2.0/lib/ldflags` -lncrypt9 -lnsgr9 -lnzjs9 -ln9 -lnl9 -lnzjs9 -lclient9 - lvsn9 -lwtcserver9 -lcommon9 -lgeneric9 -lpls9 -ltrace9 -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 -lnls9 - lclient9 -lvsn9 -lwtcserver9 -lcommon9 -lgeneric9 -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 -lnls9-24-67
lserver9 `if /bin/ar -X64 tv /oracle/app/oracle/product/9.2.0/rdbms/lib/libknlopt.a grep "kxmnsd.o" > /dev/null 2>&1 ; then echo " " ; else echo "-lordsdo9"; fi` -lctxc9 -lctx9 -lzx9 -lgx9 -lctx9 -lzx9 -lgx9 -lordimt9 -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 - lxml9 -lcore9 -lunls9 -lnls9 -lsnls9 -lunls9 -be:/oracle/app/oracle/product/9.2.0/rdbms/lib//libcorejava.exp -lld -lm `cat /oracle/app/oracle/product/9.2.0/lib/sysliblist` -lm `if [ "\`/usr/bin/uname -v\`" = "4" ]; \ then echo "-bi:/oracle/app/oracle/product/9.2.0/lib/pw-syscall.exp"; fi;` `if /bin/ar -X64 t /oracle/app/oracle/product/9.2.0/rdbms/lib/libknlopt.a grep '^'kcsm.o > /dev/null 2>&1 ; then echo "-lha_gs64_r -lha_em_r"; fi` -locijdbcst9 -lxsd9 ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_adt is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_char is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_datetime is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_indexed is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_interval is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_lob is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_objref is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_opq is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_sscalar is already exported. ld: 0711-415 WARNING: Symbol pevm_inmdh_indexed_urowid is already exported. ld: 0711-415 WARNING: Symbol plzcls is already exported. ld: 0711-415 WARNING: Symbol plzexe is already exported. ld: 0711-415 WARNING: Symbol plzopn is already exported. ld: 0711-415 WARNING: Symbol plzosq is already exported. ld: 0711-415 WARNING: Symbol pevm_enter is already exported. ld: 0711-415 WARNING: Symbol pevm_movx is already exported. ld: 0711-415 WARNING: Symbol peslcl2 is already exported. ld: 0711-319 WARNING: Exported symbol not defined: pen_pipe ld: 0711-319 WARNING: Exported symbol not defined: pevm_movcadt ld: 0711-319 WARNING: Exported symbol not defined: pevm_movl ld: 0711-319 WARNING: Exported symbol not defined: pevm_movs ld: 0711-319 WARNING: Exported symbol not defined: pifi_i ld: 0711-773 WARNING: Object /oracle/app/oracle/product/9.2.0/lib//libordsdo9.a[mdrcr.o], imported symbol kcbstdbz_ Symbol was expected to be local. Extra instructions are being generated to reference the symbol. ld: 0711-773 WARNING: Object /oracle/app/oracle/product/9.2.0/lib//libordsdo9.a[mdrt.o], imported symbol kcbstdbz_ Symbol was expected to be local. Extra instructions are being generated to reference the symbol. ld: 0711-783 WARNING: TOC overflow. TOC size: 87536 Maximum size: 65536 Extra instructions are being generated for each reference to a TOC symbol if the symbol is in the TOC overflow area. mv -f /oracle/app/oracle/product/9.2.0/bin/oracle /oracle/app/oracle/product/9.2.0/bin/oracleo mv /oracle/app/oracle/product/9.2.0/rdbms/lib/oracle /oracle/app/oracle/product/9.2.0/bin/oracle chmod 6751 /oracle/app/oracle/product/9.2.0/bin/oracle 25-67
4. Create and configure your database 4.1 Create a RAC Database using the Oracle Database Configuration Assistant(DBCA) Verify that you correctly configured the shared disks for each tablespace (for non-cluster file system platforms) Create the database Configure the Oracle network services Start the database instances and listeners Oracle Corporation recommends that you use the DBCA to create your database. This is because the DBCA preconfigured databases optimize your environment to take advantage of Oracle9i features such as the server parameter file and automatic undo management. The DBCA also enables you to define arbitrary tablespaces as part of the database creation process. So even if you have datafile requirements that differ from those offered in one of the DBCA templates, use the DBCA. You can also execute user-specified scripts as part of the database creation process. The DBCA and the Oracle Net Configuration Assistant (NETCA) also accurately configure your Real Application Clusters environment for various Oracle high availability features and cluster administration tools. Note: Prior to running the DBCA it may be necessary to run the NETCA tool or to manually set up your network files. To run the NETCA tool execute the command netca from the $ORACLE_HOME/bin directory. This will configure the necessary listener names and protocol addresses, client naming methods, Net service names and Directory server usage. Also, it is recommended that the Global Services Daemon (GSD) is started on all nodes prior to running DBCA. To run the GSD execute the command gsd from the $ORACLE_HOME/bin directory. DBCA will launch as part of the installation process, but can be run manually by executing the command dbca from the $ORACLE_HOME/bin directory on UNIX platforms. The RAC Welcome Page displays. Choose Oracle Cluster Database option and select Next. 26-67
The Operations page is displayed. Choose the option Create a Database and click Next. The Node Selection page appears. Select the nodes that you want to configure as part of the RAC database and click Next. If nodes are missing from the Node Selection then perform clusterware diagnostics by executing the $ORACLE_HOME/bin/lsnodes -v command and analyzing its output. Refer to your vendor's clusterware documentation if the output indicates that your clusterware is not properly installed. Resolve the problem and then restart the DBCA. 27-67
The Database Templates page is displayed. The templates other than New Database include datafiles. Choose New Database and then click Next. The Show Details button provides information on the database template selected. 28-67
DBCA now displays the Database Identification page. Enter the Global Database Name and Oracle System Identifier (SID). The Global Database Name is typically of the form name.domain, for example mydb.us.oracle.com while the SID is used to uniquely identify an instance (DBCA should insert a suggested SID, equivalent to name1 where name was entered in the Database Name field). In the RAC case the SID specified will be used as a prefix for the instance number. For example, MYDB, would become MYDB1, MYDB2 for instance 1 and 2 respectively. The Database Options page is displayed. Select the options you wish to configure and then choose Next. Note: If you did not choose New Database from the Database Template page, you will not see this screen. 29-67
The Additional database Configurations button displays additional database features. Make sure both are checked and click OK. Select the connection options desired from the Database Connection Options page. Note: If you did not choose New Database from the Database Template page, you will not see this screen. Click Next. 30-67
DBCA now displays the Initialization Parameters page. This page comprises a number of Tab fields. Modify the Memory settings if desired and then select the File Locations tab to update information on the Initialization Parameters filename and location. Then click Next. 31-67
The option Create persistent initialization parameter file is selected by default. If you have a cluster file system, then enter a file system name, otherwise a raw device name for the location of the server parameter file (spfile) must be entered. Then click Next. The button File Location Variables displays variable information. Click OK. 32-67
The button All Initialization Parameters displays the Initialization Parameters dialog box. This box presents values for all initialization parameters and indicates whether they are to be included in the spfile to be created through the check box, included (Y/N). Instance specific parameters have an instance value in the instance column. Complete entries in the All Initialization Parameters page and select Close. Note: There are a few exceptions to what can be altered via this screen. Ensure all entries in the Initialization Parameters page are complete and select Next. DBCA now displays the Database Storage Window. This page allows you to enter file names for each tablespace in your database. 33-67
The file names are displayed in the Datafiles folder, but are entered by selecting the Tablespaces icon, and then selecting the tablespace object from the expanded tree. Any names displayed here can be changed. A configuration file can be used, see section 3.2.1, (pointed to by the environment variable DBCA_RAW_CONFIG). Complete the database storage information and click Next. The Database Creation Options page is displayed. Ensure that the option Create Database is checked and click Finish. 34-67
The DBCA Summary window is displayed. Review this information and then click OK. 35-67
Once the Summary screen is closed using the OK option, DBCA begins to create the database according to the values specified. 36-67
4.2 Manually Creating Real Application Clusters Databases ============================================================== Manual Database Creation steps for Real Application Clusters (137288.1) ============================================================== Here are the steps to be followed to create a Real Application Clusters database: 1. Make a init<sid>.ora in your $ORACLE_HOME/dbs directory. To simplify, you can copy init.ora to init<sid>.ora and modify the file. Remember that your control file must be pointing to a pre-existing raw device or cluster file system location. *** Path names, file names, and sizes will need to be modified Example parameter settings for the first instance: Cluster-Wide Parameters for Database "RAC": db_block_size=8192 db_cache_size=52428800 background_dump_dest=/oracle/app/oracle/product/9.0.1/rdbms/log core_dump_dest=/oracle/oracle/product/9.0.1/rdbms/log user_dump_dest=/oracle/oracle/product/9.0.1/rdbms/log timed_statistics=true control_files=("/dev/rac/control_01.ctl", "/dev/rac/control_02.ctl") db_name=rac shared_pool_size=52428800 sort_area_size=524288 undo_management=auto cluster_database=true cluster_database_instances=2 remote_listener=listeners_rac Instance Specific Parameters for Instance "RAC1": instance_name=rac1 instance_number=1 local_listener=listener_rac1 thread=1 undo_tablespace=undotbs * The local_listener parameter requires that you first add the listener address to the TNSNAMES.ORA - remember to do so on both Node 1 and Node 2. ** You can also use an spfile as described in Note 136327.1. 2. Run the following sqlplus command to connect to the database: sqlplus '/ as sysdba' 3. Startup up the database in NOMOUNT mode: SQL> startup nomount 37-67
4. Create the Database (All raw devices must be pre-created) : *** Path names, file names, and sizes will need to be modified CREATE DATABASE <db_name> CONTROLFILE REUSE MAXDATAFILES 254 MAXINSTANCES 32 MAXLOGHISTORY 100 MAXLOGMEMBERS 5 MAXLOGFILES 64 DATAFILE '/dev/rac/system_01_400.dbf' SIZE 400M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED UNDO TABLESPACE "UNDOTBS" DATAFILE '/dev/rac/undotbs_01_210.dbf' SIZE 200M REUSE NEXT 5120K MAXSIZE UNLIMITED CHARACTER SET US7ASCII LOGFILE GROUP 1 ('/dev/rac/redo1_01_100.dbf') SIZE 100M REUSE, GROUP 2 ('/dev/rac/redo1_02_100.dbf') SIZE 100M REUSE; 5. Create a Users Tablespace: *** Path names, file names, and sizes will need to be modified CREATE TABLESPACE "USERS" LOGGING DATAFILE '/dev/rac/users_01_125.dbf' SIZE 120M REUSE NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL; 6. Create a Temporary Tablespace: *** Path names, file names, and sizes will need to be modified CREATE TEMPORARY TABLESPACE "TEMP" TEMPFILE '/dev/rac/temp_01_50.dbf' SIZE 40M REUSE 7. Create a 2nd Undo Tablespace: *** Path names, file names, and sizes will need to be modified CREATE UNDO TABLESPACE "UNDOTBS2" DATAFILE '/dev/rac/undotbs_02_210.dbf' SIZE 200M REUSE NEXT 5120K MAXSIZE UNLIMITED; 8. Run the necessary scripts to build views, synonyms, etc.: The primary scripts that you must run are: i> CATALOG.SQL--creates the views of data dictionary tables and the dynamic performance views SQL> @?/rdbms/admin/catalog.sql ii> CATPROC.SQL--establishes the usage of PL/SQL functionality and creates many of the PL/SQL Oracle supplied packages SQL> @?/rdbms/admin/catproc.sql iii> CATCLUST.SQL--creates RAC specific views SQL> @?/rdbms/admin/catclust.sql 38-67
9. Edit init<sid>.ora and set appropriate values for the 2nd instance on the 2nd Node: *** Names may need to be modified instance_name=rac2 instance_number=2 local_listener=listener_rac2 thread=2 undo_tablespace=undotbs2 10. From the first instance, run the following command: *** Path names, file names, and sizes will need to be modified RAC1-SQL> alter database add logfile thread 2 group 3 ('/dev/rac/redo2_01_100.dbf') size 100M, group 4 ('/dev/rac/redo2_02_100.dbf') size 100M; RAC1-SQL> alter database enable public thread 2; 11. Start the second Instance. (Assuming that your cluster configuration is up and running). RAC2-SQL> startup 39-67
5. Single Database 에서 RAC 구현하기 (Node 추가하기 ) 5.1 shutdown database / stop listener 5.2 network (rsh, rcp, rlogin) 구성 /etc/hosts.equive + + ~$HOME/.rhosts (all node) 5.2.1 rcp test [RAC1:/oracle] $ rcp test node2:/oracle [RAC1:/oracle] $ rlogin node2 5.3 rac option 추가 (using OUI) 및 node2 로 rcp 5.3.1 node1 에서 OUI 실행후, Available Product Components 에서 RAC 만추가설치 5.3.2 rcp 를이용해서 node1 의 product 를 node2 로 copy 한다. [RAC1:/oracle] $ rcp r /oracle/* node2:/oracle 5.4 node1 init<sid>.ora 수정및 clustered database startup 5.4.1 maxinstance 수를체크하여 1 로되어있으면, 필요한 node 수이상으로 controlfile 을재생성한다. 5.4.2 init<sid>.ora 수정 $ORACLE_HOME/initRAC1.ora ################################################################ 40-67
# Cluster Database ################################################################ cluster_database_instances=1 #cluster_database_instances=2 cluster_database=true #cluster_database=true instance_name=rac1 #instance_name=rac2 instance_number=1 #instance_number=2 #local_listener=listener_rac1 ##local_listener=listener_rac2 thread=1 #thread=2 undo_tablespace=undotbs1 #undo_tablespace=undotbs2 cluster_interconnects = 192.168.2.102 #cluster_interconnects = 192.168.2.202 log_archive_dest=/arch/rac1 #log_archive_dest=/arch/rac2 5.5 node2 (thread 2) 추가 (undo tablespace, Online redologfile 생성, archive dest 지정 (file system)) 5.5.1 Thread 2 용 redolog 생성 RAC1-SQL> alter database add logfile thread 2 group 4 '/dev/rrac_redo2_01' size 100m; RAC1-SQL> alter database add logfile thread 2 group 5 '/dev/rrac_redo2_02' size 100m; RAC1-SQL> alter database add logfile thread 2 group 6 '/dev/rrac_redo2_03' size 100m; 5.5.2 undotbs02 용 Undo tablespace 생성 RAC1-SQL> create undo tablespace undotbs2 datafile '/dev/rrac_undotbs02' size 500M reuse AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED; 5.5.3 Thread 2 enable RAC1-SQL> alter database enable thread 2; 5.6 RAC 용 Data Dictionary 생성 RAC1-SQL> @?/rdbms/admin/catclust.sql 5.7 node2 Database startup 5.7.1 init<sid>.ora 수정 $ORACLE_HOME/initRAC1.ora ################################################################ # Cluster Database ################################################################ cluster_database_instances=2 #cluster_database_instances=1 cluster_database=true #cluster_database=true instance_name=rac2 #instance_name=rac1 instance_number=2 #instance_number=1 #local_listener=listener_rac2 ##local_listener=listener_rac1 thread=2 #thread=1 undo_tablespace=undotbs2 #undo_tablespace=undotbs1 cluster_interconnects = 192.168.2.202 #cluster_interconnects = 192.168.2.102 log_archive_dest=/arch/rac2 #log_archive_dest=/arch/rac1 RAC2-SQL> startup 41-67
6. Administering Real Application Clusters Instances Oracle Corporation recommends that you use SRVCTL to administer your Real Application Clusters database environment. SRVCTL manages configuration information that is used by several Oracle tools. For example, Oracle Enterprise Manager and the Intelligent Agent use the configuration information that SRVCTL generates to discover and monitor nodes in your cluster. Before using SRVCTL, ensure that your Global Services Daemon (GSD) is running after you configure your database. To use SRVCTL, you must have already created the configuration information for the database that you want to administer. You must have done this either by using the Oracle Database Configuration Assistant (DBCA), or by using the srvctl add command as described below. If this is the first Oracle9i database created on this cluster, then you must initialize the clusterwide SRVM configuration. Firstly, create or edit the file /var/opt/oracle/srvconfig.loc file and add the entry srvconfig_loc=path_name.where the path name is a small cluster-shared raw volume eg $ vi /var/opt/oracle/srvconfig.loc srvconfig_loc=/dev/vx/rdsk/datadg/rac_srvconfig_10m Then execute the following command to initialize this raw volume (Note: This cannot be run while the gsd is running. Prior to 9i Release 2 you will need to kill the.../jre/1.1.8/bin/... process to stop the gsd from running. From 9i Release 2 use the gsdctl stop command):- $ srvconfig -init The first time you use the SRVCTL Utility to create the configuration, start the Global Services Daemon (GSD) on all nodes so that SRVCTL can access your cluster's configuration information. Then execute the srvctl add command so that Real Application Clusters knows what instances belong to your cluster using the following syntax:- For Oracle RAC v9.0.1:- $ gsd Successfully started the daemon on the local node. $ srvctl add db -p db_name -o oracle_home Then for each instance enter the command: $ srvctl add instance -p db_name -i sid -n node To display the configuration details for, example, databases racdb1/2, on nodes racnode1/2 with instances racinst1/2 run:- $ srvctl config racdb1 racdb2 $ srvctl config -p racdb1 racnode1 racinst1 racnode2 racinst2 42-67
$ srvctl config -p racdb1 -n racnode1 racnode1 racinst1 Examples of starting and stopping RAC follow:- $ srvctl start -p racdb1 Instance successfully started on node: racnode2 Listeners successfully started on node: racnode2 Instance successfully started on node: racnode1 Listeners successfully started on node: racnode1 $ srvctl stop -p racdb2 Instance successfully stopped on node: racnode2 Instance successfully stopped on node: racnode1 Listener successfully stopped on node: racnode2 Listener successfully stopped on node: racnode1 $ srvctl stop -p racdb1 -i racinst2 -s inst Instance successfully stopped on node: racnode2 $ srvctl stop -p racdb1 -s inst PRKO-2035 : Instance is already stopped on node: racnode2 Instance successfully stopped on node: racnode1 For Oracle RAC v9.2.0+:- $ gsdctl start Successfully started GSD on the local node. $ srvctl add database -d db_name -o oracle_home [-m domain_name] [-s spfile] Then for each instance enter the command: $ srvctl add instance -d db_name -i sid -n node To display the configuration details for, example, databases racdb1/2, on nodes racnode1/2 with instances racinst1/2 run:- $ srvctl config racdb1 racdb2 $ srvctl config -p racdb1 -n racnode1 racnode1 racinst1 /u01/app/oracle/product/9.2.0.1 $ srvctl status database -d racdb1 Instance racinst1 is running on node racnode1 Instance racinst2 is running on node racnode2 43-67
Examples of starting and stopping RAC follow:- $ srvctl start database -d racdb2 $ srvctl stop database -d racdb2 $ srvctl stop instance -d racdb1 -i racinst2 $ srvctl start instance -d racdb1 -i racinst2 $ gsdctl stat GSD is running on local node $ gsdctl stop For further information on srvctl and gsdctl see the Oracle9i Real Application Clusters Administration manual. 44-67
7. Network 구성 & CTF (Connection Time Failover) vs TAF (Transparent Application Failover) No. 17563 OPS 의 TAF (TRANSPARENT APPLICATION FAILOVER) 개념및구성 (8.1 이상 ) =================================================================== PURPOSE ------- Oracle8 부터는 OPS node 간의 TAF (Transparent Application Fail-over) 가제공된다. 즉 OPS 의한쪽 node 에 fail 이발생하여도해당 node 로접속하여사용하던모든 session 이사용하던 session 을잃지않고자동으로정상적인 node 로의재접속이이루어저작업이계속진행하도록하는것이다. 이문서에는이 TAF 에대해서간단히살펴보고실제 configuration 을기술한다. Explanation ----------- TAF 가 cover 하는 fail 의형태에대한설명과, TAF 시지정하는 fail over 의 type 과 method 에대해서설명한다. (1) fail 의형태 : TAF 는다음과같은 fail 에대해서모두 TAF 가정상적으로수행되게된다. 단 MTS mode 에대해서는전혀문제가없지만, dedicated mode 의경우는반드시 dynamic registration 형태로구현이되어야정상적으로 TAF 가가능하다. instance fail: mts 의경우는문제가없지만 dedicated mode 의경우는반드시 dynamic registration 형태로구성되어야한다. fail 된 instance 측의 listener 가정상적이라하더라도, dynamic registration 에의해서 instance 가 fail 되면 listener 로부터 deregistration 되게되어 listener 정보를확인후다른 node 의 listener 로접속을시도하게된다. 그러나 dynamic registration 을사용하지않게되면 fail 된 instance 쪽의 listener 는 fail 된 instance 정보를 services 로보여주게되고해당 instance 와연결을시도하면서 ORA-1034: Oracle not available 오류가발생하게되는것이다. instance & listener down: listener 까지 down 되게되면문제발생후재접속시도시 fail 된쪽의 listener 접속이실패하게되고, 다른 node 의 listener 로접속이이루어지게된다. node down: node 자체가 down 되는경우에도 TAF 는이루어진다. 단 clinet 에적정한 TCP configuration parameter 인 keepalive 의설정이요구되어진다. node fail 시 client 와 server 간의작업이진행중이라면문제가없지만만약 server 쪽에서수행되는작업이없는상태라면 cleint 가 node 가 down 이되어도바로인지할수가없다. client 에서다음 server 로의요청이이루어지는순간에 client 가더이상존재하지않는 TCP end point 쪽으로 TCP packet 을보내게되고, server node 가더이상살아있지않다는것을확인하게되는데일반적으로 2,3 분이걸릴수있다. node 가 fail 이된경우 network 에대한 write() function call 이오류를 return 하게되고, 이것을 client 가받은후 failover 기능을호출하게되는것이다. 45-67