Announcements

Oracle training based on real-time expertise as per industry standards. Upcoming batch details are here.

View batch schedule

Free Oracle mock interview. Register using the link.

Register

#DBAchallenge: submit your questions.

Ask questions
Swipe for more →
Browse by Topic
Latest Posts

    Monday, February 12, 2024

    RAC Database Vs RAC Instance Maintenance

    Database Level Maintenance:
    srvctl status database -d TEST
    srvctl config database -d TEST
    srvctl stop database -d TEST
    srvctl status database -d TEST
    srvctl start database -d TEST

    Instance Level Maintenance:
    srvctl status instance -i TEST1 -d TEST 
    srvctl status instance -i TEST2 -d TEST 
    srvctl stop instance -i TEST1 -d TEST 
    srvctl status database -d TEST
    srvctl stop instance -i TEST2 -d TEST 
    srvctl status database -d TEST

    srvctl start instance -i TEST1 -d TEST 
    srvctl status database -d TEST
    srvctl start instance -i TEST2 -d TEST 
    srvctl status database -d TEST

    Database Level Maintenance (Execute on all cluster nodes):
    sqlplus / as sysdba
    select instance_name, status from v$instance;
    shut immediate;

    All cluster nodes:
    sqlplus / as sysdba
    startup; 
    select instance_name, status from v$instance;

    Log:
    ====
    [root@hostnode1 ~]# ps -ef|grep smon
    root     11661 17862  0 23:04 pts/0    00:00:00 grep --color=auto smon
    oracle   19560     1  0 Feb10 ?        00:00:03 ora_smon_UAT1
    oracle   20881     1  0 Feb10 ?        00:00:03 ora_smon_DEV1
    root     27647     1  1 Feb04 ?        02:32:51 /u01/app/19.0.0.0/grid/bin/osysmond.bin
    oracle   28823     1  0 Feb04 ?        00:00:10 asm_smon_+ASM1
    oracle   32544     1  0 Feb10 ?        00:00:03 ora_smon_TEST1
    [root@hostnode1 ~]# . oraenv
    ORACLE_SID = [root] ? +ASM1
    The Oracle base has been set to /u01/app/oracle
    [root@hostnode1 ~]#
    [root@hostnode1 ~]# env |grep ORA
    ORACLE_SID=+ASM1
    ORACLE_BASE=/u01/app/oracle
    ORACLE_HOME=/u01/app/19.0.0.0/grid
    [root@hostnode1 ~]#
    [root@hostnode1 ~]#
    [root@hostnode1 ~]#
    [root@hostnode1 ~]# olsnodes
    hostnode1
    hostnode2
    [root@hostnode1 ~]# su - oracle
    Last login: Sun Feb 11 23:04:30 IST 2024
    [oracle@hostnode1 ~]$ . oraenv
    ORACLE_SID = [oracle] ? TEST1
    The Oracle base has been set to /u01/app/oracle
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$ env |grep ORA
    ORACLE_SID=TEST1
    ORACLE_BASE=/u01/app/oracle
    ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$ srvctl status database -d TEST
    Instance TEST1 is running on node hostnode1
    Instance TEST2 is running on node hostnode2
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$ srvctl config database -d TEST
    Database unique name: TEST
    Database name: TEST
    Oracle home: /u01/app/oracle/product/19.0.0.0/dbhome_1
    Oracle user: oracle
    Spfile: +DATA/TEST/PARAMETERFILE/spfileTEST.ora
    Password file: +DATA/TEST/PASSWORD/pwdtest.293.1160546127
    Domain:
    Start options: open
    Stop options: immediate
    Database role: PRIMARY
    Management policy: AUTOMATIC
    Server pools:
    Disk Groups: RECO,DATA
    Mount point paths:
    Services:
    Type: RAC
    Start concurrency:
    Stop concurrency:
    OSDBA group: oinstall
    OSOPER group: oinstall
    Database instances: TEST1,TEST2
    Configured nodes: hostnode1,hostnode2
    CSS critical: no
    CPU count: 0
    Memory target: 0
    Maximum memory: 0
    Default network number for database services:
    Database is administrator managed
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$ srvctl stop database -d TEST
    [oracle@hostnode1 ~]$ srvctl status database -d TEST
    Instance TEST1 is not running on node hostnode1
    Instance TEST2 is not running on node hostnode2
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$ srvctl start database -d TEST
    [oracle@hostnode1 ~]$ srvctl status database -d TEST
    Instance TEST1 is running on node hostnode1
    Instance TEST2 is running on node hostnode2
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$ srvctl status instance -i TEST1 -d TEST
    Instance TEST1 is running on node hostnode1
    [oracle@hostnode1 ~]$ srvctl status instance -i TEST2 -d TEST
    Instance TEST2 is running on node hostnode2
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$ srvctl stop instance -i TEST1 -d TEST
    [oracle@hostnode1 ~]$ srvctl status database -d TEST
    Instance TEST1 is not running on node hostnode1
    Instance TEST2 is running on node hostnode2
    [oracle@hostnode1 ~]$ srvctl stop instance -i TEST2 -d TEST
    [oracle@hostnode1 ~]$ srvctl status database -d TEST
    Instance TEST1 is not running on node hostnode1
    Instance TEST2 is not running on node hostnode2
    [oracle@hostnode1 ~]$ srvctl start instance -i TEST1 -d TEST
    [oracle@hostnode1 ~]$ srvctl status database -d TEST

    Instance TEST1 is running on node hostnode1
    Instance TEST2 is not running on node hostnode2
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$ srvctl start instance -i TEST2 -d TEST
    [oracle@hostnode1 ~]$ srvctl status database -d TEST
    Instance TEST1 is running on node hostnode1
    Instance TEST2 is running on node hostnode2
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$
    [oracle@hostnode1 ~]$ sqlplus / as sysdba

    SQL*Plus: Release 19.0.0.0.0 - Production on Sun Feb 11 23:14:02 2024
    Version 19.19.0.0.0

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


    Connected to:
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.19.0.0.0

    SQL> select instance_name, status from v$instance;

    INSTANCE_NAME    STATUS
    ---------------- ------------
    TEST1            OPEN

    SQL> shut immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> exit
    Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.19.0.0.0
    [oracle@hostnode1 ~]$ srvctl status database -d TEST
    Instance TEST1 is not running on node hostnode1
    Instance TEST2 is running on node hostnode2
    [oracle@hostnode1 ~]$ srvctl status database -d TEST
    Instance TEST1 is not running on node hostnode1
    Instance TEST2 is not running on node hostnode2
    [oracle@hostnode1 ~]$ sqlplus / as sysdba

    SQL*Plus: Release 19.0.0.0.0 - Production on Sun Feb 11 23:16:14 2024
    Version 19.19.0.0.0

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

    Connected to an idle instance.

    SQL> startup;
    ORACLE instance started.

    Total System Global Area 3690985832 bytes
    Fixed Size                  8931688 bytes
    Variable Size             855638016 bytes
    Database Buffers         2818572288 bytes
    Redo Buffers                7843840 bytes
    Database mounted.
    Database opened.
    SQL> select instance_name, status from v$instance;

    INSTANCE_NAME    STATUS
    ---------------- ------------
    TEST1            OPEN

    SQL> exit
    Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.19.0.0.0
    [oracle@hostnode1 ~]$ srvctl status database -d TEST
    Instance TEST1 is running on node hostnode1
    Instance TEST2 is running on node hostnode2
    [oracle@hostnode1 ~]$

    [root@hostnode2 ~]# ps -ef|grep smon
    oracle    6047     1  0 Feb10 ?        00:00:02 ora_smon_UAT2
    oracle    7938     1  0 Feb10 ?        00:00:02 ora_smon_TEST2
    root     15114 31455  0 23:04 pts/0    00:00:00 grep --color=auto smon
    oracle   17687     1  0 Feb10 ?        00:00:02 ora_smon_DEV2
    root     21607     1  1 Feb04 ?        02:13:19 /u01/app/19.0.0.0/grid/bin/osysmond.bin
    oracle   22497     1  0 Feb04 ?        00:00:10 asm_smon_+ASM2
    [root@hostnode2 ~]# su - oracle
    Last login: Sun Feb 11 23:12:05 IST 2024
    [oracle@hostnode2 ~]$ . oraenv
    ORACLE_SID = [oracle] ? TEST2
    The Oracle base has been set to /u01/app/oracle
    [oracle@hostnode2 ~]$
    [oracle@hostnode2 ~]$ sqlplus / as sysdba

    SQL*Plus: Release 19.0.0.0.0 - Production on Sun Feb 11 23:14:46 2024
    Version 19.19.0.0.0

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


    Connected to:
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.19.0.0.0

    SQL> select instance_name, status from v$instance;

    INSTANCE_NAME    STATUS
    ---------------- ------------
    TEST2            OPEN

    SQL> shut immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> exit
    Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.19.0.0.0
    [oracle@hostnode2 ~]$ sqlplus / as sysdba

    SQL*Plus: Release 19.0.0.0.0 - Production on Sun Feb 11 23:16:23 2024
    Version 19.19.0.0.0

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

    Connected to an idle instance.

    SQL> startup;
    ORACLE instance started.

    Total System Global Area 3690985832 bytes
    Fixed Size                  8931688 bytes
    Variable Size             788529152 bytes
    Database Buffers         2885681152 bytes
    Redo Buffers                7843840 bytes
    Database mounted.
    Database opened.
    SQL> select instance_name, status from v$instance;

    INSTANCE_NAME    STATUS
    ---------------- ------------
    TEST2            OPEN

    SQL> exit
    Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.19.0.0.0
    [oracle@hostnode2 ~]$

    Regards,
    Mallikarjun

    No comments:

    Post a Comment

    🌟 Proud to be an Oracle ACE Pro! 🚀

    🌟 Proud to be an Oracle ACE Pro! 🚀 I’m excited to share my official Oracle ACE Profile with the Oracle community. 👨‍💻 Mallikarjun ...