How to Open Seed Database to Read Write Mode

In CDB database environment, the seed database is always in “READ ONLY” mode. The mode changes only by applying patches using “datapatch”.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 TESTPDB                        READ WRITE NO

Under the guidance of Oracle Support for specific purpose, the following instructions can be followed to open seed database “PDB$SEED” in “READ WRITE” mode.

Set hidden parameter “_oracle_script” at session level

SQL> alter session set "_oracle_script"=TRUE;

Session altered.

Close and then open seed database

SQL> alter pluggable database pdb$seed close immediate instances=all;

Pluggable database altered.

SQL>  alter pluggable database pdb$seed open read write instances=all;

Pluggable database altered.

Run the script Oracle support provided

SQL> alter session set container=PDB$SEED;

Session altered.

SQL>  @?/rdbms/admin/catclust.sql
...
..
.

Close and then open seed database in READ ONLY mode

SQL> connect / as sysdba
SQL> alter session set "_oracle_script"=TRUE;

Session altered.

SQL> alter pluggable database pdb$seed close immediate instances=all;

Pluggable database altered.

SQL> connect / as sysdba
SQL> alter session set "_oracle_script"=TRUE;

SQL>  alter pluggable database pdb$seed open read only instances=all;

Pluggable database altered.
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 TESTPDB                        READ WRITE NO

Per Development, setting _ORACLE_SCRIPT to TRUE is something to be used only by Oracle internally.  There may be a case where a note says to use it explicitly, but you should not use it outside the context of that note.  In general is not to be set explicitly by users.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.