Visit Counter

Wednesday, April 15, 2015

Oracle Basic RAC Administration Commands



Oracle RAC Basic Administration Commands.

1. Startup / Download database (all nodes)


/ora/12/grid/bin

[oracle@rac1 bin]$ ./srvctl status database -d racora1
Instance racora11 is running on node rac1
Instance racora12 is running on node rac2
Instance racora13 is running on node rac3
[oracle@rac1 bin]$

[oracle@rac1 bin]$ ./srvctl stop database -d racora1

[oracle@rac1 bin]$ ./srvctl status database -d racora1
Instance racora11 is not running on node rac1
Instance racora12 is not running on node rac2
Instance racora13 is not running on node rac3

[oracle@rac1 bin]$ ./srvctl start  database -d racora1

[oracle@rac1 bin]$ ./srvctl status database -d racora1
Instance racora11 is running on node rac1
Instance racora12 is running on node rac2
Instance racora13 is running on node rac3
[oracle@rac1 bin]$



[oracle@rac1 bin]$ ./sqlplus /nolog

SQL*Plus: Release 12.1.0.1.0 Production on Tue Apr 14 21:43:23 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> conn sys/afi123@racora1 as sysdba
Connected.
SQL> select inst_name from v$active_instances;

INST_NAME
------------------------------------------------------------
rac1.localdomain:racora11
rac2.localdomain:racora12
rac3.localdomain:racora13



SQL> !cat /etc/oratab
#Backup file is  /ora/oracle/app/oracle/product/12.1.0/dbhome_1/srvm/admin/oratab.bak.rac1 line added by Agent
#



# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM1:/ora/12/grid:N: # line added by Agent
racora1:/ora/oracle/app/oracle/product/12.1.0/dbhome_1:N: # line added by Agent

SQL>

SQL> startup
ORACLE instance started.

Total System Global Area  705662976 bytes
Fixed Size    2292384 bytes
Variable Size  360711520 bytes
Database Buffers  339738624 bytes
Redo Buffers    2920448 bytes
Database mounted.
Database opened.
SQL>


SQL> select instance_name,status from gv$instance;

INSTANCE_NAME STATUS
---------------- ------------
racora12 OPEN
racora11 OPEN
racora13 OPEN


2. Start / Stop & check CRS (Cluster Ready Service)


[oracle@rac1 bin]$ ./crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online


[oracle@rac1 bin]$ ./crs_stat -t
Name           Type           Target    State     Host      
------------------------------------------------------------
ora.DATA.dg    ora....up.type ONLINE    ONLINE    rac1      
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1      
ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac1      
ora....N2.lsnr ora....er.type ONLINE    ONLINE    rac3      
ora....N3.lsnr ora....er.type ONLINE    ONLINE    rac2      
ora.asm        ora.asm.type   ONLINE    ONLINE    rac1      
ora.cvu        ora.cvu.type   ONLINE    ONLINE    rac2      
ora....network ora....rk.type ONLINE    ONLINE    rac1      
ora.oc4j       ora.oc4j.type  OFFLINE   OFFLINE              
ora.ons        ora.ons.type   ONLINE    ONLINE    rac1      
ora....SM1.asm application    ONLINE    ONLINE    rac1      
ora....C1.lsnr application    ONLINE    ONLINE    rac1      
ora.rac1.ons   application    ONLINE    ONLINE    rac1      
ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1      
ora....SM2.asm application    ONLINE    ONLINE    rac2      
ora....C2.lsnr application    ONLINE    ONLINE    rac2      
ora.rac2.ons   application    ONLINE    ONLINE    rac2      
ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2      
ora....SM3.asm application    ONLINE    ONLINE    rac3      
ora....C3.lsnr application    ONLINE    ONLINE    rac3      
ora.rac3.ons   application    ONLINE    ONLINE    rac3      
ora.rac3.vip   ora....t1.type ONLINE    ONLINE    rac3      
ora.racdb.db   ora....se.type ONLINE    OFFLINE              
ora.racora1.db ora....se.type ONLINE    ONLINE    rac1      
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac1      
ora.scan2.vip  ora....ip.type ONLINE    ONLINE    rac3      
ora.scan3.vip  ora....ip.type ONLINE    ONLINE    rac2      


[oracle@rac1 bin]$ ./crsctl check cluster -all
**************************************************************
rac1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
rac2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
rac3:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************


3. Start /Stop an individual instance

[oracle@rac1 bin]$ ./srvctl stop instance -d racora1 -i racora13
[oracle@rac1 bin]$ ./srvctl start instance -d racora1 -i racora13

4. Locate the voting Disk


[oracle@rac1 bin]$ ./crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   825b153bbbc84fa7bf3f735175abf312 (/dev/oracleasm/disks/DISK1) [DATA]
Located 1 voting disk(s).

[oracle@rac1 bin]$ ocrcheck
bash: ocrcheck: command not found
[oracle@rac1 bin]$ ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version                  :          4
Total space (kbytes)     :     409568
Used space (kbytes)      :       1628
Available space (kbytes) :     407940
ID                       : 1066761921
Device/File Name         :      +DATA
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

Cluster registry integrity check succeeded

Logical corruption check bypassed due to non-privileged user


5. To prevent a database starting at boot time.

[oracle@rac1 bin]$ ./srvctl disable database -d racora1



No comments:

Post a Comment