User Tools

Site Tools


database:oracle:rac:commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
database:oracle:rac:commands [2018/12/03 12:14] – [Check cluster status] odeftadatabase:oracle:rac:commands [2023/07/04 19:36] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Oracle RAC commands ====== ====== Oracle RAC commands ======
  
-===== Check cluster status =====+===== Check one node status ===== 
 + 
 +Execute as root:
  
 <code> <code>
Line 9: Line 11:
 Normal output: Normal output:
  
 +<code>
 [root@lptxrac122n1 ~]# crsctl check crs [root@lptxrac122n1 ~]# crsctl check crs
 CRS-4638: Oracle High Availability Services is online CRS-4638: Oracle High Availability Services is online
Line 14: Line 17:
 CRS-4529: Cluster Synchronization Services is online CRS-4529: Cluster Synchronization Services is online
 CRS-4533: Event Manager is online CRS-4533: Event Manager is online
 +</code>
 +
 +===== Check all nodes status =====
 +
 +Execute as root:
 +
 +<code>
 +crsctl check cluster -all
 +</code>
 +
 +Normal output:
 +
 +<code>
 +
 +[root@lptxrac122n1 ~]# crsctl check cluster -all
 +**************************************************************
 +lptxrac122n1:
 +CRS-4537: Cluster Ready Services is online
 +CRS-4529: Cluster Synchronization Services is online
 +CRS-4533: Event Manager is online
 +**************************************************************
 +lptxrac122n2:
 +CRS-4537: Cluster Ready Services is online
 +CRS-4529: Cluster Synchronization Services is online
 +CRS-4533: Event Manager is online
 +**************************************************************
 +</code>
 +
 +===== Verify DBCA requirements (before installing database instance) =====
 +
 +GRID_HOME: /oracle-inst \\
 +ORACLE_HOME: /home/oracle/app/oracle/product/12.2.0/dbhome_1 \\
 +Node1: lptxrac122n1
 +Node2: lptxrac122n2
 +
 +<code>
 +/oracle-inst/bin/cluvfy stage -pre dbcfg -fixup -n lptxrac122n1,lptxrac122n2 -d /home/oracle/app/oracle/product/12.2.0/dbhome_1
 +</code>
 +
 +This command will generate a script (/tmp/CVU_12.2.0.1.0_oracle/runfixup.sh) that should be run (in another console) as root to fix the problems found.
 +
 +Possible output:
 +
 +<code>
 +Verifying Physical Memory ...PASSED
 +Verifying Available Physical Memory ...PASSED
 +Verifying Swap Size ...PASSED
 +Verifying Free Space: lptxrac122n2:/tmp ...PASSED
 +Verifying Free Space: lptxrac122n1:/tmp ...PASSED
 +Verifying User Existence: oracle ...
 +  Verifying Users With Same UID: 1100 ...PASSED
 +Verifying User Existence: oracle ...PASSED
 +Verifying Group Existence: asmdba ...PASSED
 +Verifying Group Existence: oper ...PASSED
 +Verifying Group Existence: oinstall ...PASSED
 +Verifying Group Membership: asmdba ...PASSED
 +Verifying Group Membership: oinstall(Primary) ...PASSED
 +Verifying Group Membership: oper ...PASSED
 +Verifying Run Level ...PASSED
 +Verifying Hard Limit: maximum open file descriptors ...FAILED (PRVG-0446)
 +Verifying Soft Limit: maximum open file descriptors ...PASSED
 +Verifying Hard Limit: maximum user processes ...PASSED
 +Verifying Soft Limit: maximum user processes ...PASSED
 +Verifying Soft Limit: maximum stack size ...PASSED
 +Verifying Architecture ...PASSED
 +Verifying OS Kernel Version ...PASSED
 +Verifying OS Kernel Parameter: semmsl ...PASSED
 +Verifying OS Kernel Parameter: semmns ...PASSED
 +Verifying OS Kernel Parameter: semopm ...PASSED
 +Verifying OS Kernel Parameter: semmni ...PASSED
 +Verifying OS Kernel Parameter: shmmax ...PASSED
 +Verifying OS Kernel Parameter: shmmni ...PASSED
 +Verifying OS Kernel Parameter: shmall ...PASSED
 +Verifying OS Kernel Parameter: file-max ...PASSED
 +Verifying OS Kernel Parameter: ip_local_port_range ...PASSED
 +Verifying OS Kernel Parameter: rmem_default ...PASSED
 +Verifying OS Kernel Parameter: rmem_max ...PASSED
 +Verifying OS Kernel Parameter: wmem_default ...PASSED
 +Verifying OS Kernel Parameter: wmem_max ...PASSED
 +Verifying OS Kernel Parameter: aio-max-nr ...PASSED
 +Verifying Package: binutils-2.23.52.0.1 ...PASSED
 +Verifying Package: compat-libcap1-1.10 ...PASSED
 +Verifying Package: libgcc-4.8.2 (x86_64) ...PASSED
 +Verifying Package: libstdc++-4.8.2 (x86_64) ...PASSED
 +Verifying Package: libstdc++-devel-4.8.2 (x86_64) ...PASSED
 +Verifying Package: sysstat-10.1.5 ...PASSED
 +Verifying Package: ksh ...PASSED
 +Verifying Package: make-3.82 ...PASSED
 +Verifying Package: glibc-2.17 (x86_64) ...PASSED
 +Verifying Package: glibc-devel-2.17 (x86_64) ...PASSED
 +Verifying Package: libaio-0.3.109 (x86_64) ...PASSED
 +Verifying Package: libaio-devel-0.3.109 (x86_64) ...PASSED
 +Verifying Package: smartmontools-6.2-4 ...PASSED
 +Verifying Package: net-tools-2.0-0.17 ...PASSED
 +Verifying Current Group ID ...PASSED
 +Verifying CRS Integrity ...
 +  Verifying Clusterware Version Consistency ...PASSED
 +Verifying CRS Integrity ...PASSED
 +Verifying Node Application Existence ...PASSED
 +Verifying Time zone consistency ...PASSED
 +Verifying Single Client Access Name (SCAN) ...
 +  Verifying DNS/NIS name service 'rac122-cluster-scan' ...
 +    Verifying Name Service Switch Configuration File Integrity ...PASSED
 +  Verifying DNS/NIS name service 'rac122-cluster-scan' ...PASSED
 +Verifying Single Client Access Name (SCAN) ...WARNING (PRVG-11368)
 +Verifying ASM Integrity ...
 +  Verifying Node Connectivity ...
 +    Verifying Hosts File ...PASSED
 +    Verifying Check that maximum (MTU) size packet goes through subnet ...PASSED
 +    Verifying subnet mask consistency for subnet "192.168.20.0" ...PASSED
 +    Verifying subnet mask consistency for subnet "10.128.72.0" ...PASSED
 +  Verifying Node Connectivity ...PASSED
 +Verifying ASM Integrity ...PASSED
 +Verifying Database Clusterware Version Compatibility ...PASSED
 +Verifying File system mount options for path ORACLE_HOME ...PASSED
 +Verifying /dev/shm mounted as temporary file system ...PASSED
 +
 +Pre-check for database configuration was unsuccessful.
 +Checks did not pass for the following nodes:
 +        lptxrac122n1
 +
 +
 +Failures were encountered during execution of CVU verification request "stage -pre dbcfg".
 +
 +Verifying Hard Limit: maximum open file descriptors ...FAILED
 +lptxrac122n1: PRVG-0446 : Proper hard limit for maximum open file descriptors
 +              was not found on node "lptxrac122n1" [Expected >= "65536" ; Found
 +              = "4096"].
 +
 +Verifying Single Client Access Name (SCAN) ...WARNING
 +lptxrac122n2: PRVG-11368 : A SCAN is recommended to resolve to "3" or more IP
 +              addresses, but SCAN "rac122-cluster-scan" resolves to only
 +              "/10.128.79.23"
 +
 +lptxrac122n1: PRVG-11368 : A SCAN is recommended to resolve to "3" or more IP
 +              addresses, but SCAN "rac122-cluster-scan" resolves to only
 +              "/10.128.79.23"
 +
 +
 +CVU operation performed:      stage -pre dbcfg
 +Date:                         Dec 3, 2018 11:29:37 AM
 +CVU home:                     /oracle-inst/
 +User:                         oracle
 +******************************************************************************************
 +Following is the list of fixable prerequisites selected to fix in this session
 +******************************************************************************************
 +--------------                ---------------     ----------------
 +Check failed.                 Failed on nodes     Reboot required?
 +--------------                ---------------     ----------------
 +Hard Limit: maximum open      lptxrac122n1        no
 +file descriptors
 +
 +
 +Execute "/tmp/CVU_12.2.0.1.0_oracle/runfixup.sh" as root user on nodes "lptxrac122n1" to perform the fix up operations manually
 +
 +Press ENTER key to continue after execution of "/tmp/CVU_12.2.0.1.0_oracle/runfixup.sh" has completed on nodes "lptxrac122n1"
 +
 +Fix: Hard Limit: maximum open file descriptors
 +Result:
 +"Hard Limit: maximum open file descriptors" was successfully fixed on all the applicable nodes
 +</code>
 +
 +===== Check if instances are running in RAC =====
 +
 +Suppose global SID name is SNT:
 +
 +<code>
 +srvctl status database -db SNT
 +</code>
 +
 +Output should be:
 +
 +<code>
 +Instance SNT1 is running on node lptxrac122n1
 +Instance SNT2 is running on node lptxrac122n2
 +</code>
 +
 +===== Find server pool name =====
 +
 +<code>
 +srvctl status srvpool
 +</code>
 +
 +Possible output:
 +
 +<code>
 +Server pool name: Free
 +Active servers count: 0
 +Server pool name: Generic
 +Active servers count: 2
 +</code>
 +
 +===== Automate start / stop PDB =====
 +
 +Adding the service (for admin-managed database) with PDB name SNTL:
 +
 +<code>
 +srvctl add service -db SNT -service plug -preferred SNT1 -available SNT2 -tafpolicy BASIC -policy AUTOMATIC -failovertype SELECT -failovermethod BASIC -failoverretry 5 -pdb SNTL -verbose
 +</code>
 +
 +Start the service:
 +
 +<code>
 +srvctl start service -db SNT -s plug
 +</code>
 +
 +Check that the PDB is started:
 +
 +<code>
 +sqlplus / as sysdba
 +SQL*Plus: Release 12.2.0.1.0 Production on Mon Dec 3 20:11:28 2018
 +
 +Copyright (c) 1982, 2016, Oracle.  All rights reserved.
 +
 +
 +Connected to:
 +Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production
 +
 +SQL> COLUMN NAME FORMAT A15
 +SQL> COLUMN RESTRICTED FORMAT A10
 +SQL> COLUMN OPEN_TIME FORMAT A30
 +SQL> SELECT NAME, OPEN_MODE, RESTRICTED, OPEN_TIME FROM V$PDBS;
 +
 +NAME            OPEN_MODE  RESTRICTED OPEN_TIME
 +--------------- ---------- ---------- ------------------------------
 +PDB$SEED        READ ONLY  NO         03-DEC-18 07.16.38.734 PM +01:
 +                                      00
 +
 +SNTL            READ WRITE NO         03-DEC-18 07.18.06.241 PM +01:
 +                                      00
 +
 +
 +SQL> exit
 +</code>
 +
 +Full custom URL to connect from java:
 +
 +<code>
 +jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=OFF)(FAILOVER=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=lptxrac122n1.lab.ptx.axway.int)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=lptxrac122n2.lab.ptx.axway.int)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=SNTL)(SERVER=DEDICATED)))
 +</code>
 +
  
  
database/oracle/rac/commands.1543832079.txt.gz · Last modified: 2023/07/04 19:36 (external edit)