Saturday, January 5, 2013

Drop database using RMAN

As you know using DBCA (Database Configuration Assistant) we can easily delete database. Alternatively we can drop database using RMAN utility. Before to do that, database should be opened as restricted mode.

[oracle@localhost bin]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jan 5 22:10:40 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN> startup nomount

Oracle instance started

Total System Global Area     146472960 bytes

Fixed Size                     1335080 bytes
Variable Size                 92274904 bytes
Database Buffers              50331648 bytes
Redo Buffers                   2531328 bytes

RMAN> alter database mount;

using target database control file instead of recovery catalog
database mounted

RMAN> SQL 'ALTER SYSTEM ENABLE RESTRICTED SESSION';

sql statement: ALTER SYSTEM ENABLE RESTRICTED SESSION

RMAN> drop database noprompt;

database name is "MYDB" and DBID is 2718904503
database dropped

RMAN>

Also we can database with backup option

RMAN> drop database including backups noprompt;

Source: http://docs.oracle.com/cd/B28359_01/backup.111/b28273/rcmsynta019.htm

No comments:

Post a Comment

Cannot access dba_directories inside procedure

 Recently I faced one of familiar Oracle error ORA -00942 : table or view does not exist   I got it in while compiling procedure, becaus...