Steps To Drop 19c Oracle Database Manually
In this document ,we will see how to drop an Oracle database.
Prerequisite Steps
Find the location of the data files ,control files and online redo logs of the database to be dropped. Later point , we will cross verify.
SQL> select name from v$datafile;
SQL> select name from v$controlfile;
SQL> select member from v$logfile;
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/STAGE/system01.dbf
/u01/app/oracle/oradata/STAGE/sysaux01.dbf
/u01/app/oracle/oradata/STAGE/undotbs01.dbf
/u01/app/oracle/oradata/STAGE/pdbseed/system01.dbf
/u01/app/oracle/oradata/STAGE/pdbseed/sysaux01.dbf
/u01/app/oracle/oradata/STAGE/users01.dbf
/u01/app/oracle/oradata/STAGE/pdbseed/undotbs01.dbf
/u01/app/oracle/oradata/STAGE/pdb1/system01.dbf
/u01/app/oracle/oradata/STAGE/pdb1/sysaux01.dbf
/u01/app/oracle/oradata/STAGE/pdb1/undotbs01.dbf
/u01/app/oracle/oradata/STAGE/pdb1/users01.dbf
NAME
---------------------------------------------------------------------------------------------------------------
/u01/app/oracle/oradata/STAGE/pdb2/ORADB/E05E9736941377ACE0537C01A8C0C540/datafile/o1_mf_system_k9g4g13f_.dbf
/u01/app/oracle/oradata/STAGE/pdb2/ORADB/E05E9736941377ACE0537C01A8C0C540/datafile/o1_mf_sysaux_k9g4g142_.dbf
/u01/app/oracle/oradata/STAGE/pdb2/ORADB/E05E9736941377ACE0537C01A8C0C540/datafile/o1_mf_undotbs1_k9g4g143_.dbf
/u01/app/oracle/oradata/STAGE/pdb2/ORADB/E05E9736941377ACE0537C01A8C0C540/datafile/o1_mf_users_k9g4g145_.dbf
NAME
---------------------------------------------------------------------------------------------------------------
15 rows selected.
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/STAGE/control01.ctl
/u01/app/oracle/fra/STAGE/control02.ctl
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/STAGE/redo03.log
/u01/app/oracle/oradata/STAGE/redo02.log
/u01/app/oracle/oradata/STAGE/redo01.log
SQL>
--> Stop Database and start in Exclusive mode
SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup mount exclusive restrict;
ORACLE instance started.
Total System Global Area 1073738888 bytes
Fixed Size 9143432 bytes
Variable Size 616562688 bytes
Database Buffers 440401920 bytes
Redo Buffers 7630848 bytes
Database mounted.
SQL>
SQL> select name,open_mode,database_role from v$database;
NAME OPEN_MODE DATABASE_ROLE
--------- -------------------- ----------------
STAGE MOUNTED PRIMARY
SQL>
--> Drop Database
SQL> drop database;
Database dropped.
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.8.0.0.0
SQL>
--> Manually verify the file
[oracle@srv1 ~]$ ls -lrth /u01/app/oracle/oradata/STAGE/system01.dbf
ls: cannot access /u01/app/oracle/oradata/STAGE/system01.dbf: No such file or directory
[oracle@srv1 ~]$
[oracle@srv1 ~]$ ls -lrth /u01/app/oracle/oradata/STAGE/pdb2/ORADB/E05E9736941377ACE0537C01A8C0C540/datafile/o1_mf_system_k9g4g13f_.dbf
ls: cannot access /u01/app/oracle/oradata/STAGE/pdb2/ORADB/E05E9736941377ACE0537C01A8C0C540/datafile/o1_mf_system_k9g4g13f_.dbf: No such file or directory
[oracle@srv1 ~]$
[oracle@srv1 ~]$ ls -lrth /u01/app/oracle/oradata/STAGE/control01.ctl
ls: cannot access /u01/app/oracle/oradata/STAGE/control01.ctl: No such file or directory
[oracle@srv1 ~]$
[oracle@srv1 ~]$ ls -lrth /u01/app/oracle/oradata/STAGE/redo03.log
ls: cannot access /u01/app/oracle/oradata/STAGE/redo03.log: No such file or directory
[oracle@srv1 ~]$
No comments:
Post a Comment