Toad for Oracle 12.1 onwards expand Oracle 12c support with the Pluggable DBs tab in Database | Monitor | Database Browser.
If you are using Oracle 12c multitenant / pluggable databases, you can create, drop, plug in, unplug, open and close Oracle 12c pluggable databases (PDB) via Toad. You must have access to the Oracle 12c container database (CDB) via Toad.
To open a PDB:
1. On the main toolbar in Toad, click ‘Database Browser’ or go to Database | Monitor | Database Browser
2. Select the container database (CDB) on the left
3. Click the pluggable DBs tab (only visible if you selected a CDB)
4. If a newly create PDB is Mounted, select it and click ‘Open…’ on the toolbar
To close a PDB:
1. Select one or more rows in the grid for each database to close
2. Click ‘Close…’ on the toolbar and click OK
To unplug and drop a PDB:
The database must be closed before it can be unplugged. Toad can close the database for you before unplugging. When you unplug a pluggable database, Toad specifies the XML file. Oracle puts information about the database into the XML file, so that when you want to plug the database back in, it can read the XML file to get the information it needs.
1. Select the database to umplug.
2. Click ’Unplug…’ on the toolbar.
3. Copy the path of the XML file for the PDB that is displayed, and save it for future reference
4. Click OK.
The PDB now indicates that it is in a Mounted state
The database was unplugged, but the container database still knows about it.
To completely remove the pluggable database from the container database, you must drop it.
5. To drop the PDB, select it and click ‘Drop…’ on the toolbar
6. Make your selection and click OK; “Keep datafiles” means “don’t delete them from the OS.” “Including datafiles” means delete them from the OS also.
To plug in a PDB:
1. Click ‘Plug in…’ on the toolbar
2. Use the default selection ‘Create from XML File (Plug in) | Next
3. Enter the path to the XML file for the PDB (If you are plugging in the PDB unplugged earlier, this is the XML file you copied in step 3 above)
4. Make your other selections (optional) | Next
5. Click ‘Execute’.
You can now start the PDB by selecting it and clicking ‘Start…’ on the toolbar.
To create a copy of a PDB:
If you have a PDB in a CDB, and you want to make a copy of it in the same container:
1. Click ‘Create pluggable database' on the toolbar
2. Select ‘Create from clone’ | Next
3. Select your source database. The path of the system tablespace of that database is populated. This is replaced as you name the new PDB
4. Enter the new PDB name | Next
5. Make the optional selections on the next window | Next
6. Click ‘Execute’
You can now start the PDB by selecting it and clicking ‘Start…’ on the toolbar.
To create a PDB from a seed:
A seed is an empty database that comes with your container database, so you can quickly create copies of it when you need a new, blank database
1. Click ‘Create pluggable database’ on the toolbar
2. Select ‘Create from seed’ | Next
3. Enter the new PDB name and tab to the next field. (The remaining fields are populated for you) | Next
4. Specify the admin username and password | Next
5. Make the optional selections on the next window | Next
6. Click ‘Execute’.
You can now start the PDB by selecting it and clicking ‘Start…’ on the toolbar
Note: You must edit your tnsnames.ora file to add the PDB to the Database Browser.
You will receive the following message when you create or plug in a PDB:
“PDB <PDB Name> has been successfully created
The TNSNames entry for this database should be the same as the entry for <CDB name> except the service name is <PDB name>.
To add it to the Database Browser:
- Make a connection to the new database,
- Then click the ‘Create Database' toolbar button.”
The last line of instructions above refers to the ‘New Database’ button on the Database Browser toolbar.