Shutdown and Startup Of CDB And PDB

                         Validate CDB Status  

 [oracle@oratest ~]$ srvctl status database -d RACDB

Instance RACDB1 is not running on node oratest

Instance RACDB2 is not running on node oratest2

 

                       Start CDB


 [oracle@oratest ~]$ srvctl start database -db RACDB


[oracle@oratest ~]$ srvctl status database -d RACDB  -v

Instance RACDB1 is running on node oratest. Instance status: Open.

Instance RACDB2 is running on node oratest2. Instance status: Open.

 

            Shut down CDB Gracefully

 

[oracle@oratest2 ~]$ srvctl stop database -db RACDB


[oracle@oratest2 ~]$  srvctl status database -db RACDB

Instance RACDB1 is not running on node oratest

Instance RACDB2 is not running on node oratest2

 

    Shut down And Start Specific Instance of CDB

 

[oracle@oratest2 ~]$ srvctl stop instance -i RACDB1 -db RACDB

 

[oracle@oratest2 ~]$  srvctl status database -db RACDB -v

Instance RACDB1 is not running on node oratest

Instance RACDB2 is running on node oratest2. Instance status: Open.

 

[oracle@oratest2 ~]$ srvctl start instance -i RACDB1 -db RACDB

 

[oracle@oratest2 ~]$  srvctl status database -db RACDB -v

Instance RACDB1 is running on node oratest. Instance status: Open.

Instance RACDB2 is running on node oratest2. Instance status: Open.

 

            START CDB in a specific mode

 

[oracle@oratest2 ~]$ srvctl start database -db RACDB -o mount


[oracle@oratest2 ~]$  srvctl status database -db RACDB -v

Instance RACDB1 is running on node oratest. Instance status: Mounted (Closed).

Instance RACDB2 is running on node oratest2. Instance status: Mounted (Closed).

 

Verify default open mode of CDB

 

[oracle@oratest2 ~]$ srvctl config database -d RACDB | grep -i 'start options'

Start options: open

 

Modify default open mode of CDB

 

[oracle@oratest2 ~]$ srvctl modify database -db RACDB -startoption mount

 

[oracle@oratest2 ~]$ srvctl config database -d RACDB | grep -i 'start options'

Start options: mount

 

NOTE: this is an online operation and will not affect the current running database however once the database will reboot then next time by default, it’ll open in mount mode as per the changed configuration

 

                        Validate CDB configuration

 

[oracle@oratest2 ~]$ srvctl config database -db RACDB

 

Database unique name: RACDB

Database name: RACDB

Oracle home: /u01/app/oracle/product/19c/db_1

Oracle user: oracle

Spfile: +DATA/RACDB/PARAMETERFILE/spfile.279.1161907821

Password file: +DATA/RACDB/PASSWORD/pwdracdb.258.1161906509

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools:

Disk Groups: DATA

Mount point paths:

Services:

Type: RAC

Start concurrency:

Stop concurrency:

OSDBA group: oinstall

OSOPER group: oinstall

Database instances: RACDB1,RACDB2

Configured nodes: oratest,oratest2

CSS critical: no

CPU count: 0

Memory target: 0

Maximum memory: 0

Default network number for database services:

Database is administrator managed


                        Validate PDB Status

           

SQL> set lines 300 colsep '|'

SQL> col name for a40

SQL> col restricted for a20

SQL> col open_mode for a20

SQL> col open_time for a35

SQL>  select inst_id,name,con_id,open_mode,open_time,restricted from gv$pdbs order by name,inst_id;

 

   INST_ID|NAME                        |     CON_ID|OPEN_MODE       |OPEN_TIME                   |RESTRICTED

    ----------|----------------------------------------|----------|--------------------|-----------------------------------|--------------------

  1|ORAPDB                        |      3|MOUNTED         |                       |

  2|ORAPDB                        |      3|MOUNTED         |                       |

 1|PDB$SEED         |         2|READ ONLY       |26-FEB-24 04.22.17.367 PM +05:30   |NO

 2|PDB$SEED                       |      2|READ ONLY    |26-FEB-24 04.22.16.446 PM +05:30   |NO

 

 

                        START & STOP PDB IN ALL NODES OF RAC

 

SQL> alter pluggable database ORAPDB open instances=all;

Pluggable database altered.

 

SQL> select inst_id,name,con_id,open_mode,open_time,restricted from gv$pdbs order by name,inst_id;

 

   INST_ID|NAME                                          |            CON_ID|OPEN_MODE        |OPEN_TIME                                       |RESTRICTED

----------|----------------------------------------|----------|--------------------|-----------------------------------|--------------------

             1|ORAPDB                                          |             3|READ WRITE              |26-FEB-24 04.28.24.284 PM +05:30   |NO

             2|ORAPDB                                          |             3|READ WRITE              |26-FEB-24 04.28.24.214 PM +05:30   |NO

 

SQL> alter pluggable database ORAPDB close immediate instances=all;

Pluggable database altered.


SQL> select inst_id,name,con_id,open_mode,open_time,restricted from gv$pdbs order by name,inst_id;

 

   INST_ID|NAME                                          |            CON_ID|OPEN_MODE        |OPEN_TIME                                       |RESTRICTED

----------|----------------------------------------|----------|--------------------|-----------------------------------|--------------------

             1|ORAPDB                                          |             3|MOUNTED                           |26-FEB-24 04.31.05.540 PM +05:30   |

             2|ORAPDB                                          |             3|MOUNTED                           |26-FEB-24 04.31.06.825 PM +05:30   |

 

           

START & STOP PDB only in specific instance

 

SQL> alter pluggable database ORAPDB open instances=('RACDB2');

Pluggable database altered.

 

SQL> select inst_id,name,con_id,open_mode,open_time,restricted from gv$pdbs order by name,inst_id;

 

   INST_ID|NAME                                          |            CON_ID|OPEN_MODE        |OPEN_TIME                                       |RESTRICTED

----------|----------------------------------------|----------|--------------------|-----------------------------------|--------------------

             1|ORAPDB                                          |             3|MOUNTED                           |26-FEB-24 04.31.05.540 PM +05:30   |

 

SQL> alter pluggable database ORAPDB close immediate instances=('RACDB2');

Pluggable database altered.

 

SQL> select inst_id,name,con_id,open_mode,open_time,restricted from gv$pdbs order by name,inst_id;

 

   INST_ID|NAME                                          |            CON_ID|OPEN_MODE        |OPEN_TIME                                       |RESTRICTED
----------|----------------------------------------|----------|--------------------|-----------------------------------|--------------------
             1|ORAPDB                                          |             3|MOUNTED                           |26-FEB-24 04.31.05.540 PM +05:30   |
             2|ORAPDB                                          |             3|MOUNTED                           |26-FEB-24 04.33.11.551 PM +05:30   |
 

 

NOTE: Mount is the close mode of PDB

 

                                                SAVE PDB STATE

 

SQL> alter pluggable database ORAPDB save state instances=all;

Pluggable database altered.

 

SQL>  select con_id,con_name,instance_name,state,restricted from dba_pdb_saved_states;

 

    CON_ID CON_NAME                               INSTANCE_NAME        STATE                  RESTRICTED

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

             3 ORAPDB                             RACDB2             OPEN            NO

             3 ORAPDB                             RACDB1              OPEN            NO




Post a Comment

Previous Post Next Post