Menu Bar

Tuesday, July 18, 2023

2 Node RAC setup from scratch

[oracle@oraclelab1 ~]$ cd /u01/app/19.0.0.0/grid/

[oracle@oraclelab1 grid]$ ./runcluvfy.sh stage -pre crsinst -n oraclelab1,oraclelab2 -verbose

./u01/app/orainventory/orainstRoot.sh
/u01/app/12.2.0/grid_1/root.sh

You must run the scripts first on the local node. After the scripts complete successfully on the local node, you can run the scripts in parallel in all the other nodes. If you attempt to run the scripts in parallel on all nodes, the scripts on the non-local nodes will fail.

The first script, orainstRoot.sh, sets the inventory settings. The second script, root.sh, sets the permission for the files inside the Oracle Grid Infrastructure home, configures the cluster, and starts Oracle Clusterware on the cluster node.




[root@oraclelab2 u01]# cd /u01/app/oraInventory

[root@oraclelab2 oraInventory]# ls -lrt *.sh

-rwxrwx---. 1 oracle oinstall 1617 Jul 19 12:21 orainstRoot.sh

[root@oraclelab2 oraInventory]#

[root@oraclelab2 oraInventory]# ./orainstRoot.sh

Changing permissions of /u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.


Changing groupname of /u01/app/oraInventory to oinstall.

The execution of the script is complete.

[root@oraclelab2 oraInventory]# cd /u01/app/19.0.0.0/grid




 Root.sh 

[root@oraclelab1 grid]# ./root.sh

Performing root user operation.


The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/19.0.0.0/grid


Enter the full pathname of the local bin directory: [/usr/local/bin]:

   Copying dbhome to /usr/local/bin ...

   Copying oraenv to /usr/local/bin ...

   Copying coraenv to /usr/local/bin ...



Creating /etc/oratab file...

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.

Relinking oracle with rac_on option

Using configuration parameter file: /u01/app/19.0.0.0/grid/crs/install/crsconfig_params

The log of current session can be found at:

  /u01/app/oracle/crsdata/oraclelab1/crsconfig/rootcrs_oraclelab1_2023-07-19_12-37-04AM.log

2023/07/19 12:37:45 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.

2023/07/19 12:37:45 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.

2023/07/19 12:37:45 CLSRSC-363: User ignored prerequisites during installation

2023/07/19 12:37:45 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.

2023/07/19 12:37:55 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.

2023/07/19 12:38:00 CLSRSC-594: Executing installation step 5 of 19: 'SetupOSD'.

2023/07/19 12:38:00 CLSRSC-594: Executing installation step 6 of 19: 'CheckCRSConfig'.

2023/07/19 12:38:01 CLSRSC-594: Executing installation step 7 of 19: 'SetupLocalGPNP'.

2023/07/19 12:41:05 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.

2023/07/19 12:41:13 CLSRSC-594: Executing installation step 8 of 19: 'CreateRootCert'.

2023/07/19 12:41:37 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.

2023/07/19 12:42:26 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.

2023/07/19 12:42:27 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.

2023/07/19 12:42:54 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.

2023/07/19 12:42:55 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'

2023/07/19 12:44:08 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.

2023/07/19 12:44:37 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.

2023/07/19 12:45:05 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.

2023/07/19 12:45:27 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.


ASM has been created and started successfully.


[DBT-30001] Disk groups created successfully. Check /u01/app/oracle/cfgtoollogs/asmca/asmca-230719PM124631.log for details.


2023/07/19 12:48:06 CLSRSC-482: Running command: '/u01/app/19.0.0.0/grid/bin/ocrconfig -upgrade oracle oinstall'

CRS-4256: Updating the profile

Successful addition of voting disk 3126a57d0d6c4f8cbfae77011b1fa4c4.

Successfully replaced voting disk group with +OCR.

CRS-4256: Updating the profile

CRS-4266: Voting file(s) successfully replaced

##  STATE    File Universal Id                File Name Disk group

--  -----    -----------------                --------- ---------

 1. ONLINE   3126a57d0d6c4f8cbfae77011b1fa4c4 (/dev/oracleasm/disks/ASMDISK1) [OCR]

Located 1 voting disk(s).

2023/07/19 12:52:17 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.

2023/07/19 12:54:15 CLSRSC-343: Successfully started Oracle Clusterware stack

2023/07/19 12:54:16 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.

2023/07/19 13:00:42 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.

2023/07/19 13:02:34 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded

[root@oraclelab1 grid]#

[root@oraclelab1 grid]#

==========================
ora.oraclelab1.vip
      1        ONLINE  INTERMEDIATE oraclelab2               FAILED OVER,STABLE
ora.oraclelab2.vip

[root@oraclelab1 grid]# srvctl relocate vip -vip oraclelab1 -node oraclelab1 -force -verbose
VIP was relocated successfully.


ora.oraclelab1.vip
      1        ONLINE  ONLINE       oraclelab1               STABLE

=======================
[root@oraclelab1 grid]# hostnamectl
   Static hostname: oraclelab1.localdomain.com
         Icon name: computer-vm
           Chassis: vm
        Machine ID: a40ae07d7081b346b017abb7cd13780e
           Boot ID: 38cd23869f944118adb58bd949d728dd
    Virtualization: kvm
  Operating System: Oracle Linux Server 7.9
       CPE OS Name: cpe:/o:oracle:linux:7:9:server
            Kernel: Linux 5.4.17-2102.201.3.el7uek.x86_64
      Architecture: x86-64
[root@oraclelab1 grid]#
===============================
A Policy-Managed database has managed instances on the basis of server pools for the effective use of resources. An Admin-Managed database has instances connected to specific servers

There are two methods to manage your cluster database.

  1. Administrator Managed database
  2. Policy Managed Database

Administrator Managed Database : In Administrator Managed database , a DBA manages each instance of the database by defining specific instances to run on specific nodes in the cluster.It is traditional way of cluster management.

Policy Managed Database : It’s a new method to manage clustered database.It is introduced to help implement dynamic grid configurations.                                                                                                                                            In Policy Managed database , DBA is required only to define the cardinality(number of database required).                Oracle Clusterware manages the allocation of nodes to run the instances and Oracle RAC allocates the required redo threads and undo tablespaces as needed

===============================

crsctl stat res -t -init

crsctl check crs

crsctl check cluster -all

crsctl stop cluster -all
crsctl stop has

crsctl status res |grep -v "^$"|awk -F "=" 'BEGIN {print " "} {printf("%s",NR%4 ? $2"|" : $2"\n")}'|sed -e 's/ *, /,/g' -e 's/, /,/g'| awk -F "|" 'BEGIN { printf "%-40s%-35s%-20s%-50s\n","Resource Name","Resource Type","Target ","State" }{ split ($3,trg,",") split ($4,st,",")}{for (i in trg) {printf "%-40s%-35s%-20s%-50s\n",$1,$2,trg[i],st[i]}}'



Resource Name                           Resource Type                      Target              State                                           
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)  ora.asm_listener.type              ONLINE              ONLINE on oraclelab1                            
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)  ora.asm_listener.type              ONLINE              ONLINE on oraclelab2                            
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)  ora.asm_listener.type              ONLINE              OFFLINE                                         
ora.DATA.dg(ora.asmgroup)               ora.diskgroup.type                 OFFLINE             OFFLINE                                         
ora.DATA.dg(ora.asmgroup)               ora.diskgroup.type                 ONLINE              ONLINE on oraclelab2                            
ora.DATA.dg(ora.asmgroup)               ora.diskgroup.type                 OFFLINE             OFFLINE                                         
ora.LISTENER.lsnr                       ora.listener.type                  ONLINE              ONLINE on oraclelab1                            
ora.LISTENER.lsnr                       ora.listener.type                  ONLINE              ONLINE on oraclelab2                            
ora.LISTENER_SCAN1.lsnr                 ora.scan_listener.type             ONLINE              ONLINE on oraclelab1                            
ora.LISTENER_SCAN2.lsnr                 ora.scan_listener.type             ONLINE              ONLINE on oraclelab2                            
ora.LISTENER_SCAN3.lsnr                 ora.scan_listener.type             ONLINE              ONLINE on oraclelab2                            
ora.OCR.dg(ora.asmgroup)                ora.diskgroup.type                 OFFLINE             OFFLINE                                         
ora.OCR.dg(ora.asmgroup)                ora.diskgroup.type                 ONLINE              ONLINE on oraclelab2                            
ora.OCR.dg(ora.asmgroup)                ora.diskgroup.type                 OFFLINE             OFFLINE                                         
ora.RECO.dg(ora.asmgroup)               ora.diskgroup.type                 OFFLINE             OFFLINE                                         
ora.RECO.dg(ora.asmgroup)               ora.diskgroup.type                 ONLINE              ONLINE on oraclelab2                            
ora.RECO.dg(ora.asmgroup)               ora.diskgroup.type                 OFFLINE             OFFLINE                                         
ora.asm(ora.asmgroup)                   ora.asm.type                       ONLINE              OFFLINE                                         
ora.asm(ora.asmgroup)                   ora.asm.type                       ONLINE              ONLINE on oraclelab2                            
ora.asm(ora.asmgroup)                   ora.asm.type                       OFFLINE             OFFLINE                                         
ora.asmnet1.asmnetwork(ora.asmgroup)    ora.asm_network.type               ONLINE              ONLINE on oraclelab1                            
ora.asmnet1.asmnetwork(ora.asmgroup)    ora.asm_network.type               ONLINE              ONLINE on oraclelab2                            
ora.asmnet1.asmnetwork(ora.asmgroup)    ora.asm_network.type               OFFLINE             OFFLINE                                         
ora.chad                                ora.chad.type                      ONLINE              ONLINE on oraclelab1                            
ora.chad                                ora.chad.type                      ONLINE              ONLINE on oraclelab2                            
ora.cvu                                 ora.cvu.type                       ONLINE              ONLINE on oraclelab2                            
ora.devdb.db                            ora.database.type                  ONLINE              OFFLINE                                         
ora.devdb.db                            ora.database.type                  ONLINE              ONLINE on oraclelab2                            
ora.net1.network                        ora.network.type                   ONLINE              ONLINE on oraclelab1                            
ora.net1.network                        ora.network.type                   ONLINE              ONLINE on oraclelab2                            
ora.ons                                 ora.ons.type                       ONLINE              ONLINE on oraclelab1                            
ora.ons                                 ora.ons.type                       ONLINE              ONLINE on oraclelab2                            
ora.oraclelab1.vip                      ora.cluster_vip_net1.type          ONLINE              ONLINE on oraclelab1                            
ora.oraclelab2.vip                      ora.cluster_vip_net1.type          ONLINE              ONLINE on oraclelab2                            
ora.qosmserver                          ora.qosmserver.type                ONLINE              ONLINE on oraclelab2                            
ora.scan1.vip                           ora.scan_vip.type                  ONLINE              ONLINE on oraclelab1                            
ora.scan2.vip                           ora.scan_vip.type                  ONLINE              ONLINE on oraclelab2                            
ora.scan3.vip                           ora.scan_vip.type                  ONLINE              ONLINE on oraclelab2                            
[root@oraclelab1 ~]#

[root@oraclelab1 ~]# ps -ef|grep pmon
oracle    8551     1  0 00:28 ?        00:00:00 asm_pmon_+ASM1
oracle    9068     1  0 00:29 ?        00:00:00 ora_pmon_DEVDB1
root      9290  8086  0 00:30 pts/3    00:00:00 grep --color=auto pmon
[root@oraclelab1 ~]#








No comments:

Post a Comment