12 November 2015

DROP DATABASE

Purpose

Use the DROP DATABASE command to delete the target database and, if RMAN is connected to a recovery catalog, unregister it. RMAN removes all datafiles, online redo logs, and control files belonging to the target database. By default, RMAN prompts for confirmation.

Prerequisites

Execute this command only at the RMAN prompt. You must be connected to a target database. The target database must be mounted exclusive and not open, and started in RESTRICT mode.

[914495421@683231-GCDLUSRSPCORA01 data]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 12 10:48:03 2015

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[914495421@683231-GCDLUSRSPCORA01 data]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Nov 12 10:48:27 2015

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

connected to target database (not started)

RMAN> STARTUP FORCE MOUNT

Oracle instance started
database mounted

Total System Global Area    4275781632 bytes

Fixed Size                     2260088 bytes
Variable Size               2281702280 bytes
Database Buffers            1979711488 bytes
Redo Buffers                  12107776 bytes

RMAN> SQL 'ALTER SYSTEM ENABLE RESTRICTED SESSION';

using target database control file instead of recovery catalog
sql statement: ALTER SYSTEM ENABLE RESTRICTED SESSION

RMAN> DROP DATABASE INCLUDING BACKUPS NOPROMPT;

database name is "MYVS_UAT" and DBID is 1292121009

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=197 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=391 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=585 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=6 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=198 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=392 device type=DISK
allocated channel: ORA_DISK_7
channel ORA_DISK_7: SID=587 device type=DISK
allocated channel: ORA_DISK_8
channel ORA_DISK_8: SID=7 device type=DISK
allocated channel: ORA_DISK_9
channel ORA_DISK_9: SID=199 device type=DISK
allocated channel: ORA_DISK_10
channel ORA_DISK_10: SID=393 device type=DISK
allocated channel: ORA_DISK_11
channel ORA_DISK_11: SID=588 device type=DISK
allocated channel: ORA_DISK_12
channel ORA_DISK_12: SID=8 device type=DISK
allocated channel: ORA_DISK_13
channel ORA_DISK_13: SID=200 device type=DISK
allocated channel: ORA_DISK_14
channel ORA_DISK_14: SID=394 device type=DISK
allocated channel: ORA_DISK_15
channel ORA_DISK_15: SID=589 device type=DISK
allocated channel: ORA_DISK_16
channel ORA_DISK_16: SID=9 device type=DISK
allocated channel: ORA_DISK_17
channel ORA_DISK_17: SID=201 device type=DISK
allocated channel: ORA_DISK_18
channel ORA_DISK_18: SID=395 device type=DISK
allocated channel: ORA_DISK_19
channel ORA_DISK_19: SID=590 device type=DISK
allocated channel: ORA_DISK_20
channel ORA_DISK_20: SID=10 device type=DISK

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
4421    4347    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_81qjme42_5377_20151014
4422    4348    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_8bqjmfoq_5387_20151014
4423    4349    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_82qjme42_5378_20151014
4424    4350    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_92qjmi4d_5410_20151014
4425    4351    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_7pqjme42_5369_20151014
4426    4352    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_9aqjmimt_5418_20151014
4427    4353    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_91qjmi4d_5409_20151014
4428    4354    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_85qjme43_5381_20151014
4429    4355    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_8mqjmi4d_5398_20151014
4430    4356    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_7qqjme42_5370_20151014
4431    4357    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_7oqjme42_5368_20151014
4432    4358    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_86qjme43_5382_20151014
4433    4359    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_7nqjme42_5367_20151014
4434    4360    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_8tqjmi4d_5405_20151014
4435    4361    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_8pqjmi4d_5401_20151014
4436    4362    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_8lqjmi4d_5397_20151014
4437    4363    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_7tqjme42_5373_20151014
4438    4364    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_7lqjme41_5365_20151014
4439    4365    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_8uqjmi4d_5406_20151014
4440    4366    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_96qjmi4e_5414_20151014
4441    4367    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_83qjme42_5379_20151014
4442    4368    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_8fqjmgfl_5391_20151014
4443    4369    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_97qjmikr_5415_20151014
4444    4370    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_9cqjmio6_5420_20151014
4445    4371    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_84qjme42_5380_20151014
4446    4372    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_7vqjme42_5375_20151014
4447    4373    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_7uqjme42_5374_20151014
4448    4374    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_8oqjmi4d_5400_20151014
4449    4375    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_8qqjmi4d_5402_20151014
4450    4376    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_80qjme42_5376_20151014
4451    4377    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_8dqjmgcg_5389_20151014
4452    4378    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_99qjmim4_5417_20151014
4453    4379    1   1   AVAILABLE   DISK        /owsci/rman/controlfile_PROD3_7jqj9ngd_5363_20151009
4454    4380    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_8kqjmi4c_5396_20151014
4455    4381    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_95qjmi4d_5413_20151014
4456    4382    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_93qjmi4d_5411_20151014
4457    4383    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_94qjmi4d_5412_20151014
4458    4384    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_90qjmi4d_5408_20151014
4459    4385    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_8cqjmfv7_5388_20151014
4460    4386    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_8nqjmi4d_5399_20151014
4461    4387    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_87qjme43_5383_20151014
4462    4388    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_88qjme43_5384_20151014
4463    4389    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_8sqjmi4d_5404_20151014
4464    4390    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_8jqjmi4c_5395_20151014
4465    4391    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_7rqjme42_5371_20151014
4466    4392    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_8vqjmi4d_5407_20151014
4467    4393    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_7sqjme42_5372_20151014
4468    4394    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_89qjmeph_5385_20151014
4469    4395    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_8aqjmf9k_5386_20151014
4470    4396    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_7mqjme42_5366_20151014
4471    4397    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_8gqjmgg4_5392_20151014
4472    4398    1   1   AVAILABLE   DISK        /owsci/rman/controlfile_PROD3_9dqjmj4v_5421_20151014
4473    4399    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_8eqjmger_5390_20151014
4474    4400    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_9bqjminn_5419_20151014
4475    4401    1   1   AVAILABLE   DISK        /owsci/rman/databasefiles_PROD3_8hqjmggt_5393_20151014
4476    4402    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_98qjmilb_5416_20151014
4477    4403    1   1   AVAILABLE   DISK        /owsci/rman/archivelogs_PROD3_8rqjmi4d_5403_20151014
deleted backup piece
backup piece handle=/owsci/rman/databasefiles_PROD3_81qjme42_5377_20151014 RECID=4421 STAMP=893597432
deleted backup piece

**(I have removed the long long list of progress here)**
removes the backup pieces
archived Log Copies for database
deleted control file copy
datafiles, logs, everything!!

database name is "MYVS_UAT" and DBID is 1292121009
database dropped

RMAN> exit


Recovery Manager complete.
[914495421@683231-GCDLUSRSPCORA01 data]$





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

No comments:

Post a Comment