In this Article, we will see how we can open a Pluggable Database in different modes and changing the setting of particular pdb.
Pluggable Database Modes :
- Open Pluggable Database in Restricted Mode
First what is restricted mode : All user having create session privilege can connect to normally opened database. But when your database is opened in restricted mode you need special privilege called restricted session .
You need both Create a session and restricted session privilege to connect with the database if it is opened in restricted mode.
Generally only DBA have this permission.
Now to open a database in restricted mode use following steps.
SQL> alter session set container=pdb1; Session altered. SQL> alter pluggable database open restricted; Pluggable database altered.
After opening pdb in a restricted mode you can see in shows PDBs you can see YES in the Restricted state.
SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 3 PDB1 READ WRITE YES
Open Pluggable Database in Read-Only Mode
SQL> alter pluggable database open read only; Pluggable database altered.
Check open_mode of a pluggable database in v$pdbs
SQL> select name,open_mode from v$pdbs; NAME OPEN_MODE ------------------------------ ---------- PDB1 READ ONLY
To open a pluggable database in fully updatable mode use following command
SQL> alter pluggable database open; Pluggable database altered.
Above statement will open a pluggable database in read-write mode
SQL> select name,open_mode from v$pdbs; NAME OPEN_MODE ------------------------------ ---------- PDB1 READ WRITE
*Modifying PDB Settings
We can do the following task with PDBs.
- You can make datafile offline or online.
SQL> select file#,name from v$datafile where name like '%user%'; FILE# NAME ---------- -------------------------------------------------- 10 /u01/oracle/oradata/db121/pdb1/pdb1_users01.dbf
SQL> alter pluggable database datafile 10 offline; Pluggable database altered.
2. Changing the default tablespace
SQL> alter pluggable database default tablespace user1; Pluggable database altered.
3. Setting the storage limit for a pluggable database
SQL> alter pluggable database storage(maxsize 3g); Pluggable database altered.
Above are an example we can set in a pluggable database.
Stay tuned for More articles on Oracle Multitenant
Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Telegram Channel: https://t.me/helporacle
Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/
Joel Perez’s LinkedIn: Joel Perez’s Profile
LinkedIn Group: Oracle Cloud DBAAS
Facebook Page: OracleHelp