How to Drop a Pluggable Oracle Database in Vagrant Centos 8
To drop a Pluggable Database (PDB) in an Oracle database running on a CentOS virtual machine managed by Vagrant, you can use SQL*Plus or SQL Developer, which are common tools for managing Oracle databases. Here's a general outline of the steps to drop a PDB:
1. Connect to the Oracle Database:
- Open a terminal in your CentOS VM.
- Launch SQL*Plus by running the following command and providing the necessary login information when prompted:
```bash
sqlplus / as sysdba
```
- This command connects you to the Oracle Database as a superuser (SYSDBA).
2. Switch to the Container Database (CDB) Context:
- Before you can drop a PDB, you need to switch to the CDB context. Use the following SQL*Plus command:
```sql
ALTER SESSION SET CONTAINER = CDB_NAME;
```
- Replace `CDB_NAME` with the actual name of your CDB.
3. Drop the Pluggable Database:
- To drop the PDB, you can use the following SQL command:
```sql
DROP PLUGGABLE DATABASE PDB_NAME INCLUDING DATAFILES;
```
Replace `PDB_NAME` with the name of the PDB you want to drop.
- The `INCLUDING DATAFILES` clause ensures that the data files associated with the PDB are also deleted.
4. Confirm and Commit:
- SQL*Plus will ask you to confirm the drop operation. Type 'yes' or 'y' to confirm and proceed.
5. Exit SQL*Plus:
- Once the PDB is dropped, you can exit SQL*Plus by typing:
```sql
exit
```
That's it! The specified PDB should now be dropped from your Oracle database. Please be extremely cautious when performing such operations in a production environment, as dropping a PDB permanently deletes its data and cannot be undone. Always ensure you have backups and confirm that you are working with the correct PDB before executing the DROP command.
Comments
Post a Comment