<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-12583994</id><updated>2011-09-28T08:03:43.732-07:00</updated><title type='text'>Oracle Network</title><subtitle type='html'>The intention for this blog is to provide a forum to exchange information, ideas and expertise about relational database and application development products from Oracle. My goal is to provide a professional environment to share this knowledge and experience with individuals from around the world.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://oraclenetwork.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12583994/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://oraclenetwork.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jeffrey M. Hunter</name><uri>http://www.blogger.com/profile/05027814064743438987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_tlJZjTQuUw4/SNAvmF0GDyI/AAAAAAAAAAM/8ZsX9gXhFUk/S220/auth_pic_hunter.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-12583994.post-115724467629361295</id><published>2006-09-02T17:42:00.000-07:00</published><updated>2006-10-17T17:43:15.626-07:00</updated><title type='text'>Drop a Target Database using RMAN</title><content type='html'>&lt;p&gt;Starting with Oracle10&lt;i&gt;g&lt;/i&gt; Release 1, Oracle provides a method&lt;br /&gt;to completely drop a database with one simple statement. This&lt;br /&gt;method makes use of the &lt;tt&gt;DROP DATABASE&lt;/tt&gt; command in RMAN.&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);"&gt;NOTE&lt;/span&gt;: Although this should be obvious from the title of the article,&lt;br /&gt;the following will completely drop the target database including&lt;br /&gt;all datafiles, controlfiles, redo log files, SPFILE, and if you&lt;br /&gt;want, all backups and archived redo log files associated with the database. Consider yourself warned.&lt;/p&gt;&lt;b&gt;The DROP DATABASE Command&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;b&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;NOTE&lt;/span&gt;:&lt;/b&gt; Before the target database can be dropped, it must be mounted in EXCLUSIVE mode with RESTRICTED SESSION enabled.&lt;p&gt;&lt;/p&gt;Before dropping the database, let's take a look at the complete syntax for the RMAN &lt;tt&gt;DROP DATABASE&lt;/tt&gt; command:&lt;br /&gt;&lt;pre&gt;DROP DATABASE;&lt;br /&gt;DROP DATABASE NOPROMPT;&lt;br /&gt;DROP DATABASE INCLUDING BACKUPS;&lt;br /&gt;DROP DATABASE INCLUDING BACKUPS NOPROMPT;&lt;/pre&gt;When "NOPROMPT" is specified, RMAN will not prompt for confirmation&lt;br /&gt;before deleting the database. The default for RMAN is to prompt&lt;br /&gt;for confirmation.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Restrictions and Usage Notes&lt;/b&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This command can only be run from RMAN.&lt;br /&gt;  &lt;/li&gt; &lt;/ul&gt; &lt;ul&gt;&lt;li&gt; &lt;p&gt;You must be connected to the target database from RMAN while&lt;br /&gt;     the database is mounted in EXCLUSIVE mode with RESTRICTED SESSION enabled.&lt;br /&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt; When using the "&lt;tt&gt;DROP DATABASE&lt;/tt&gt;" command, RMAN drops the target&lt;br /&gt;      database including the following files at the operating system level:&lt;br /&gt;      &lt;ul&gt;&lt;br /&gt;     &lt;li&gt; Datafiles&lt;br /&gt;     &lt;/li&gt;&lt;li&gt; Online Redo Log Files&lt;br /&gt;     &lt;/li&gt;&lt;li&gt; Controlfiles&lt;br /&gt;     &lt;/li&gt;&lt;li&gt; SPFILE (if it exists)&lt;br /&gt; &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt; &lt;p&gt;When including the "INCLUDING BACKUPS" clause, RMAN will delete the&lt;br /&gt;      files listed above as well as the following files at the operating system level:&lt;br /&gt;      &lt;/p&gt;&lt;ul&gt;&lt;li&gt; Archive Redo Logs&lt;br /&gt;     &lt;/li&gt;       &lt;li&gt; Backup pieces generated by RMAN for the target database&lt;br /&gt; &lt;/li&gt; &lt;/ul&gt;&lt;/li&gt; &lt;li&gt; &lt;p&gt;When using the "&lt;tt&gt;DROP DATABASE&lt;/tt&gt;" command with RMAN connected&lt;br /&gt;     to a recovery catalog, RMAN will &lt;i&gt;unregister&lt;/i&gt; the target database.&lt;br /&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt; The "DROP DATABASE" command does not delete the following files:&lt;br /&gt;      &lt;ul&gt;&lt;br /&gt;     &lt;li&gt; init&lt;sid&gt;.ora  (text version of the Oracle initialization file)&lt;br /&gt;     &lt;/sid&gt;&lt;/li&gt;&lt;li&gt; password file&lt;br /&gt; &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;      &lt;p&gt;If the operating system is Windows NT/2000, then it does not delete&lt;br /&gt;      the Windows NT service for the target database instance.&lt;/p&gt;   &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;/p&gt; &lt;b&gt;DROP DATABASE EXAMPLE&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;In this article, I will be dropping a database named orcl. The orcl database is in archivelog mode and has several backups included in the Flash Recovery Area. I want to drop the target database along with all backup files.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ &lt;b&gt;sqlplus "/ as sysdba"&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; &lt;b&gt;shutdown immediate&lt;/b&gt;&lt;br /&gt;Database closed.&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;&lt;br /&gt;SQL&gt; &lt;b&gt;startup mount exclusive&lt;/b&gt;&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area  285212672 bytes&lt;br /&gt;Fixed Size                  1218992 bytes&lt;br /&gt;Variable Size             100664912 bytes&lt;br /&gt;Database Buffers          180355072 bytes&lt;br /&gt;Redo Buffers                2973696 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;&lt;br /&gt;SQL&gt; &lt;b&gt;alter system enable restricted session;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; &lt;b&gt;exit&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;$ &lt;b&gt;rman target /&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.2.0.1.0 - Production on Mon Aug 7 17:33:25 2006&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to target database: ORCL (DBID=1123903688, not open)&lt;br /&gt;&lt;br /&gt;RMAN&gt; &lt;b&gt;drop database including backups;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;database name is "ORCL" and DBID is 1123903688&lt;br /&gt;&lt;br /&gt;Do you really want to drop all backups and the database (enter YES or NO)? &lt;b&gt;YES&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=156 devtype=DISK&lt;br /&gt;&lt;br /&gt;List of Backup Pieces&lt;br /&gt;BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name&lt;br /&gt;------- ------- --- --- ----------- ----------- ----------&lt;br /&gt;51      31      1   1   AVAILABLE   DISK        /u02/flash_recovery_area/ORCL/backupset/2006_08_07/o1_mf_annnn_TAG20060807T164635_2fh9of4s_.bkp&lt;br /&gt;52      32      1   1   AVAILABLE   DISK        /u02/flash_recovery_area/ORCL/backupset/2006_08_07/o1_mf_nnndf_TAG20060807T164638_2fh9ogvf_.bkp&lt;br /&gt;53      33      1   1   AVAILABLE   DISK        /u02/flash_recovery_area/ORCL/backupset/2006_08_07/o1_mf_ncsnf_TAG20060807T164638_2fh9vzo0_.bkp&lt;br /&gt;54      34      1   1   AVAILABLE   DISK        /u02/flash_recovery_area/ORCL/backupset/2006_08_07/o1_mf_annnn_TAG20060807T165009_2fh9w2lm_.bkp&lt;br /&gt;deleted backup piece&lt;br /&gt;backup piece handle=/u02/flash_recovery_area/ORCL/backupset/2006_08_07/o1_mf_annnn_TAG20060807T164635_2fh9of4s_.bkp recid=51 stamp=597861997&lt;br /&gt;deleted backup piece&lt;br /&gt;backup piece handle=/u02/flash_recovery_area/ORCL/backupset/2006_08_07/o1_mf_nnndf_TAG20060807T164638_2fh9ogvf_.bkp recid=52 stamp=597861998&lt;br /&gt;deleted backup piece&lt;br /&gt;backup piece handle=/u02/flash_recovery_area/ORCL/backupset/2006_08_07/o1_mf_ncsnf_TAG20060807T164638_2fh9vzo0_.bkp recid=53 stamp=597862207&lt;br /&gt;deleted backup piece&lt;br /&gt;backup piece handle=/u02/flash_recovery_area/ORCL/backupset/2006_08_07/o1_mf_annnn_TAG20060807T165009_2fh9w2lm_.bkp recid=54 stamp=597862210&lt;br /&gt;Deleted 4 objects&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;released channel: ORA_DISK_1&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=156 devtype=DISK&lt;br /&gt;specification does not match any archive log in the recovery catalog&lt;br /&gt;&lt;br /&gt;database name is "ORCL" and DBID is 1123903688&lt;br /&gt;database dropped&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12583994-115724467629361295?l=oraclenetwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oraclenetwork.blogspot.com/feeds/115724467629361295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12583994&amp;postID=115724467629361295' title='50 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12583994/posts/default/115724467629361295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12583994/posts/default/115724467629361295'/><link rel='alternate' type='text/html' href='http://oraclenetwork.blogspot.com/2006/09/drop-target-database-using-rman.html' title='Drop a Target Database using RMAN'/><author><name>Jeffrey M. Hunter</name><uri>http://www.blogger.com/profile/05027814064743438987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://1.bp.blogspot.com/_tlJZjTQuUw4/SNAvmF0GDyI/AAAAAAAAAAM/8ZsX9gXhFUk/S220/auth_pic_hunter.jpg'/></author><thr:total>50</thr:total></entry></feed>
