Sunday, December 2, 2012

droping a standalone database using RMAN


[oracle@subhen-db01 dbs]$ echo $ORACLE_SID
RENAMEDB
[oracle@subhen-db01 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Dec 3 14:41:07 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 2355015680 bytes
Fixed Size                  2230592 bytes
Variable Size             536872640 bytes
Database Buffers         1795162112 bytes
Redo Buffers               20750336 bytes
Database mounted.
Database opened.
SQL> show parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA01/renamedb/spfilerenamed
                                                 b.ora
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
***********************************************
Connect to RMAN to the intended database to be dropped
************************************************
[oracle@subhen-db01 dbs]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Dec 3 14:41:47 2012

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

connected to target database: RENAMEDB (DBID=257482690)

RMAN> report schema
2> ;

using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name RENAMEDB

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    710      SYSTEM               ***     +DATA01/testdb/datafile/system.278.800725811
2    520      SYSAUX               ***     +DATA01/testdb/datafile/sysaux.394.800725811
3    75       UNDOTBS1             ***     +DATA01/testdb/datafile/undotbs1.838.800725811
4    5        USERS                ***     +DATA01/testdb/datafile/users.463.800725811

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    29       TEMP                 32767       +DATA01/testdb/tempfile/temp.555.800725895

RMAN> STARTUP FORCE MOUNT

Oracle instance started
database mounted

Total System Global Area    2355015680 bytes

Fixed Size                     2230592 bytes
Variable Size                536872640 bytes
Database Buffers            1795162112 bytes
Redo Buffers                  20750336 bytes

RMAN> SQL 'ALTER SYSTEM ENABLE RESTRICTED SESSION';

sql statement: ALTER SYSTEM ENABLE RESTRICTED SESSION

RMAN> DROP DATABASE INCLUDING BACKUPS NOPROMPT;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of drop db & bck command at 02/06/2013 12:31:16
ORA-01507: database not mounted

RMAN> SQL 'alter database mount'
2> ;

sql statement: alter database mount


RMAN> DROP DATABASE INCLUDING BACKUPS NOPROMPT;

database name is "RENAMEDB" and DBID is 257482690

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=387 device type=DISK
specification does not match any backup in the repository

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=387 device type=DISK
specification does not match any datafile copy in the repository
specification does not match any control file copy in the repository
specification does not match any control file copy in the repository
specification does not match any archived log in the repository

database name is "RENAMEDB" and DBID is 257482690
database dropped

RMAN> exit


Recovery Manager complete.

1 comment: