Drop Database Don’t Clean All

Today I was performing housekeeping, I have drop a database (Version 12.1.0.2), below post the command;

 
SQLPLUS / AS SYSDBA
STARTUP MOUNT RESTRICT
SET LINES 1000 PAGES 1000
REM
REM Make sure which database you want to drop 
REM 
SELECT INSTANCE_NAME, HOST_NAME FROM V$INSTANCE;
DROP DATABASE;

The “drop databae” drop the datafiles, redo, CF, passwd file, etc. but not all, archives are not deleted (backup are not deleted too, you need use the “including backups” with the drop database command), you need drop them by hand, in a way similar to this using asmcmd;

 

 
ASMCMD [+DB_PROD_ARCH_DG/VANTIVE/ARCHIVELOG] > cd 2017_05_25/
ASMCMD [+DB_PROD_ARCH_DG/VANTIVE/ARCHIVELOG/2017_05_25] > ls
thread_1_seq_558.323.944877607
thread_1_seq_559.322.944892039
ASMCMD [+DB_PROD_ARCH_DG/VANTIVE/ARCHIVELOG/2017_05_25] >
ASMCMD [+DB_PROD_ARCH_DG/VANTIVE/ARCHIVELOG/2017_05_25] > rm *
You may delete multiple files and/or directories.
Are you sure? (y/n) y
ASMCMD [+DB_PROD_ARCH_DG/VANTIVE/ARCHIVELOG/2017_05_25] > ls
ASMCMD-8002: entry '2017_05_25' does not exist in directory '+DB_PROD_ARCH_DG/VANTIVE/ARCHIVELOG/'

HTH – Antonio NAVARRO

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s