Database Reference
In-Depth Information
Opening a PDB
The next option is to use the ALTER PLUGGABLE DATABASE statement to open one or more
PDBs. You can open one or more PDBs as a common user with privileges previously described:
SQL> ALTER SESSION SET CONTAINER=CDB$ROOT;
Session altered.
SQL> SHOW USER
USER is "SYS"
SQL>
SQL> ALTER PLUGGABLE DATABASE pdb1 OPEN;
Pluggable database altered.
SQL> ALTER PLUGGABLE DATABASE pdb2 OPEN READ ONLY;
Pluggable database altered.
SQL> select name, open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDB1 READ WRITE
PDB2 READ ONLY
PDB3 MOUNTED
SQL>
The default open mode is read-write. Specify READ ONLY after you have opened the PDB
at least once prior in read-write mode. Read-write is the default when RESTRICT is not speci-
fied. To issue the ALTER PLUGGABLE DATABASE command when the current container is a PDB,
the current user must have SYSDBA, SYSOPER, SYSBACKUP, or SYSDG administrative
privilege, which must be either commonly granted or locally granted in the PDB. The user
must connect using AS SYSDBA , AS SYSOPER , AS SYSBACKUP , or AS SYSDG . The PDB must be
mounted before opening unless the OPEN FORCE option is used.
Shutting Down or Closing a PDB
As with starting up a PDB, you can use the SHUTDOWN command in SQL*Plus or alter the
PDB and CLOSE it. The same privileges and scope apply as with starting up a PDB.
Shutting Down a PDB
You can shut down a PDB using the SHUTDOWN command, similar to the way you would shut
down a CDB; however, the scope would be local, shutting down only the local PDB. If you
Search WWH ::




Custom Search