<?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-8703328815196419304</id><updated>2011-07-31T00:38:11.726-07:00</updated><category term='Create Schema stmt'/><category term='max_enabled_roles error in all the versions including 10.2.0.3'/><category term='How to do database characterset migration'/><category term='Finding 64-bit or 32-bit at OS level'/><category term='Disabling the Recyclebin at session level and system level'/><category term='how to know whether 32-bit or 64-bit oracle s/w installed'/><category term='Starting Up with a Non-Default Server Parameter File'/><category term='How to find TOP SQL in a particular period.'/><category term='Migrating to Automatic Undo Management'/><category term='Using metadata'/><category term='How to backup the archivelogs which are not backed up already'/><category term='The simplest query for checking what’s happening in a database'/><title type='text'>palani vijay</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>30</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-7085644613963686399</id><published>2009-09-25T02:29:00.000-07:00</published><updated>2009-09-25T02:48:52.603-07:00</updated><title type='text'>Cloning Oracle Database - Cold Cloning, Hot Cloning</title><content type='html'>&lt;strong&gt;Clone an Oracle Database using Cold Physical BackupDatabase Name: troySource Database side:&lt;/strong&gt;&lt;br /&gt;(Troy database)&lt;br /&gt;Cold Backup Steps:&lt;br /&gt;1. Get the file path information using below query&lt;br /&gt;&lt;strong&gt;Select name from v$datafile;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;select member from v$logfile;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;select name from v$controlfile;&lt;/strong&gt;&lt;br /&gt;2. Parameter file backup If troy database running on spfile&lt;br /&gt;&lt;strong&gt;Create pfile=’/u01/backup/inittroy.ora’ from spfile;&lt;/strong&gt;&lt;br /&gt;If database running in pfile using os command to copy the pfile and placed in backup path.&lt;br /&gt;3.Taken the control file backup&lt;br /&gt;&lt;strong&gt;Alter database backup controlfile to trace as ‘/u01/backup/control01.ora’;&lt;/strong&gt;&lt;br /&gt;4.&lt;strong&gt;Shutdown immediate&lt;/strong&gt;&lt;br /&gt;5.&lt;strong&gt;Copy all the data files/log files using os command &amp;amp; placed in backup path.&lt;/strong&gt;&lt;br /&gt;6.&lt;strong&gt;Startup the database.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Clone Database side: (Clone database)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Database Name: Clone&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Clone Database Steps:&lt;/strong&gt;&lt;br /&gt;1.Create the appropriate folder in corresponding path &amp;amp; placed the backup files in corresponding folder.(&lt;strong&gt;bdump,udump,create,pfile,cdump,oradata)&lt;/strong&gt;&lt;br /&gt;2.&lt;strong&gt;Change the init.ora parameter like control file path, dbname, instance name etc...&lt;/strong&gt;&lt;br /&gt;3.&lt;strong&gt;Create the password file using orapwd utility&lt;/strong&gt;.(Database in windows we need to create the service id using oradim utility)&lt;br /&gt;4.&lt;strong&gt;Startup the Database in NOMOUNT stage.&lt;/strong&gt;&lt;br /&gt;5.Create the control file for cloning database.&lt;br /&gt;Using backup controlfile trace to generate the create controlfile scripts.Change the Database name &amp;amp; files path, also change 'REUSE' needs to be changed to 'SET'.&lt;br /&gt;&lt;strong&gt;CREATE CONTROLFILE SET DATABASE "clone" RESETLOGS FORCE LOGGING NOARCHIVELOG&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAXLOGFILES 50&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAXLOGMEMBERS 5&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAXDATAFILES 100&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAXINSTANCES 1&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAXLOGHISTORY 453&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;LOGFILE&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;GROUP 1 '/U01/oradata/clone/redo01.log' SIZE 200M,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;GROUP 2 '/U01/oradata/clone/redo02.log' SIZE 200M,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;GROUP 3 '/U01/oradata/clone/redo03.log' SIZE 200M&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;DATAFILE'/U01/oradata/clone/system01.dbf',&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;'/U01/oradata/clone/undotbs01.dbf',&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;'/U01/oradata/clone/users01.dbf',&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;CHARACTER SET WE8ISO8859P1;&lt;/strong&gt;&lt;br /&gt;Note: placed the script in sql prompt. Now controlfile created.&lt;br /&gt;6.Now open the database.&lt;br /&gt;&lt;strong&gt;Alter database open resetlogs;&lt;/strong&gt;&lt;br /&gt;Note: Check the logfile, datafiles &amp;amp; instance status&lt;br /&gt;**********************************************************************************&lt;br /&gt;&lt;strong&gt;Clone an Oracle Database using Hot Physical BackupDatabase Name:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;troyDatabase must be in Archive log mode.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Source Database side: (Troy database)&lt;/strong&gt;&lt;br /&gt;Hot Backup Steps:&lt;br /&gt;1.Get the file path information using below query.&lt;br /&gt;&lt;strong&gt;Select tablespace_name, file_name from dba_data_files order by 1;&lt;/strong&gt;&lt;br /&gt;2. Parameter file backup If troy database running on spfile&lt;br /&gt;&lt;strong&gt;Create pfile=’/u01/backup/inittroy.ora’ from spfile;&lt;/strong&gt;&lt;br /&gt;If database running in pfile using os command to copy the pfile and placed in backup path.&lt;br /&gt;3.&lt;strong&gt;Put the tablespace in begin backup mode&lt;/strong&gt; Using os command to copy the datafiles belongs to begin backup mode tablespace &amp;amp; placed in backup path. (Refer below example)&lt;br /&gt;4.&lt;strong&gt;Once copied the datafile, release the tablespace from begin backup mode to end backup&lt;/strong&gt;&lt;br /&gt;5.Repeat the steps 1-3 for all your tablespaces.&lt;br /&gt;6.Taken the controlfile backup&lt;br /&gt;&lt;strong&gt;Alter database backup controlfile to trace as ‘/u01/backup/control01.ora’;&lt;/strong&gt;&lt;br /&gt;7.&lt;strong&gt;Backup all your archive log files between the previous backup and the new backup as well.&lt;/strong&gt;&lt;br /&gt;Example:&lt;br /&gt;steps:&lt;br /&gt;2.&lt;strong&gt;Alter tablespace system begin backup;&lt;/strong&gt;&lt;br /&gt;To ensure the begin backup mode tablespace using below query&lt;br /&gt;&lt;strong&gt;Select * from v$backup; (refer the Change#, Time column)&lt;/strong&gt;&lt;br /&gt;3. &lt;strong&gt;Host cp /u01/oracle/raja/system1.DBF /u01/backup/system01.dbf à using os command to copy the datafile.&lt;/strong&gt;&lt;br /&gt;4. &lt;strong&gt;Alter tablespace system end backup;&lt;/strong&gt;&lt;br /&gt;To ensure the begin backup mode tablespace using below query&lt;br /&gt;&lt;strong&gt;Select * from v$backup;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Clone Database side: (Clone database)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Database Name: Clone&lt;/strong&gt;&lt;br /&gt;Clone Database Steps:&lt;br /&gt;1.Create the appropriate folder in corresponding path &amp;amp; placed the backup files in corresponding folder&lt;strong&gt;.(bdump,udump,create,pfile,cdump,oradata)&lt;/strong&gt;&lt;br /&gt;2.&lt;strong&gt;Change the init.ora parameter like control file path, dbname, instance name etc...&lt;/strong&gt;&lt;br /&gt;3.&lt;strong&gt;Create the password file using orapwd utility.(Database in windows we need to create the service id using oradim utility)&lt;/strong&gt;&lt;br /&gt;4.&lt;strong&gt;Startup the Database in NOMOUNT stage.&lt;/strong&gt;&lt;br /&gt;5.Create the control file for cloning database.&lt;br /&gt;Using backup controlfile trace to generate the create controlfile scripts.Change the Database name &amp;amp; files path, also change 'REUSE' needs to be changed to 'SET'.&lt;br /&gt;&lt;strong&gt;CREATE CONTROLFILE SET DATABASE "clone" RESETLOGS FORCE LOGGING NOARCHIVELOG&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAXLOGFILES 50&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAXLOGMEMBERS 5&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAXDATAFILES 100&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAXINSTANCES 1&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAXLOGHISTORY 453&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;LOGFILE&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;GROUP 1 '/U01/oradata/clone/redo01.log' SIZE 200M,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;GROUP 2 '/U01/oradata/clone/redo02.log' SIZE 200M,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;GROUP 3 '/U01/oradata/clone/redo03.log' SIZE 200M&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;DATAFILE&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;'/U01/oradata/clone/system01.dbf',&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;'/U01/oradata/clone/undotbs01.dbf',&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;'/U01/oradata/clone/users01.dbf',&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;CHARACTER SET WE8ISO8859P1;&lt;/strong&gt;&lt;br /&gt;Note: placed the script in sql prompt. Now controlfile created.&lt;br /&gt;6.Recover the database using controlfile.&lt;br /&gt;&lt;strong&gt;Recover database using backup controlfile until cancel;&lt;/strong&gt;&lt;br /&gt;7.Now open the database.&lt;br /&gt;&lt;strong&gt;Alter database open resetlogs;&lt;/strong&gt;&lt;br /&gt;Note: Check the logfile, datafiles status.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-7085644613963686399?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/7085644613963686399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/cloning-oracle-database-cold-cloning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/7085644613963686399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/7085644613963686399'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/cloning-oracle-database-cold-cloning.html' title='Cloning Oracle Database - Cold Cloning, Hot Cloning'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-8127098102151933306</id><published>2009-09-24T20:42:00.001-07:00</published><updated>2009-09-24T22:36:38.234-07:00</updated><title type='text'>Recovering a Lost Datafile Without a Backup: Example</title><content type='html'>RMAN can handle lost datafiles without user intervention during restore and recovery. When a datafile is lost, the possible cases can be classified as follows:&lt;br /&gt;The control file knows about the datafile, that is, the user backed up the control file after datafile creation, but the datafile itself is not backed up. If the datafile record is in the control file, then RESTORE creates the datafile in the original location or in a user-specified location (for example, with SET NEWNAME). The RECOVER command can then apply the necessary logs to the datafile.&lt;br /&gt;&lt;a name="1006846"&gt;&lt;/a&gt;The control file does not have the datafile record, that is, the user did not back up the control file after datafile creation. During recovery, the database will detect the missing datafile and report it to RMAN, which will create a new datafile and continue recovery by applying the remaining logs. If the datafile was created in a parent incarnation, it will be created during restore or recover as appropriate.&lt;a name="1006848"&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;In this example, the following sequence of events occurs:&lt;/strong&gt;&lt;br /&gt;&lt;a name="1006849"&gt;&lt;/a&gt;You make a whole database backup of your ARCHIVELOG mode database.&lt;br /&gt;&lt;a name="1006850"&gt;&lt;/a&gt;You create a tablespace history containing a single datafile called /mydb/history01.dbf.&lt;br /&gt;&lt;a name="1006851"&gt;&lt;/a&gt;You populate the newly created datafile with data.&lt;br /&gt;&lt;a name="1006852"&gt;&lt;/a&gt;You archive all the active online redo logs.&lt;br /&gt;&lt;a name="1006853"&gt;&lt;/a&gt;&lt;strong&gt;A user accidentally deletes the datafile history01.dbf from the operating system before you have a chance to back it up.&lt;/strong&gt;&lt;a name="1006854"&gt;&lt;/a&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;In this case, the current control file knows about the datafile. To restore and recover the datafile, start RMAN, connect to the target database, and then enter the following commands at the RMAN prompt:&lt;a name="1006855"&gt;&lt;/a&gt;# take the tablespace with the missing datafile offline&lt;br /&gt;&lt;a name="1006856"&gt;&lt;/a&gt;&lt;strong&gt;SQL "ALTER TABLESPACE history OFFLINE IMMEDIATE";&lt;/strong&gt;&lt;br /&gt;&lt;a name="1006857"&gt;&lt;/a&gt;# restore the tablespace even though you have no backup&lt;br /&gt;&lt;a name="1006858"&gt;&lt;/a&gt;&lt;strong&gt;RESTORE TABLESPACE history;&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006859"&gt;&lt;/a&gt;# recover tablespace&lt;br /&gt;&lt;a name="1006860"&gt;&lt;/a&gt;&lt;strong&gt;RECOVER TABLESPACE hisotry;&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006861"&gt;&lt;/a&gt;# bring the recovered tablespace back online&lt;br /&gt;&lt;a name="1006862"&gt;&lt;/a&gt;&lt;strong&gt;SQL "ALTER TABLESPACE history ONLINE";&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-8127098102151933306?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/8127098102151933306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/recovering-lost-datafile-without-backup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/8127098102151933306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/8127098102151933306'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/recovering-lost-datafile-without-backup.html' title='Recovering a Lost Datafile Without a Backup: Example'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-8726351613469871922</id><published>2009-09-24T20:39:00.002-07:00</published><updated>2009-09-24T22:39:54.620-07:00</updated><title type='text'>Recovering a Database in NOARCHIVELOG Mode: Example</title><content type='html'>You can recover a database running in NOARCHIVELOG mode with incremental backups. Note that the incremental backups must be consistent, like all backups of a database run in NOARCHIVELOG mode, so you cannot make backups of the database when it is open.&lt;a name="1006825"&gt;&lt;/a&gt;&lt;br /&gt;Assume the following scenario:&lt;br /&gt;&lt;a name="1006826"&gt;&lt;/a&gt;You run database trgt in NOARCHIVELOG mode.&lt;br /&gt;&lt;a name="1006827"&gt;&lt;/a&gt;You use a recovery catalog.&lt;br /&gt;&lt;a name="1006828"&gt;&lt;/a&gt;You shut down the database consistently and make a level 0 backup of database trgt to tape on Sunday afternoon.&lt;br /&gt;&lt;a name="1006829"&gt;&lt;/a&gt;You shut down the database consistently and make a level 1 differential incremental backup to tape at 3:00 a.m. on Wednesday and Friday.&lt;br /&gt;&lt;a name="1006830"&gt;&lt;/a&gt;The database has a media failure on Saturday, destroying half of the datafiles as well as the online redo logs.&lt;a name="1006831"&gt;&lt;/a&gt;&lt;br /&gt;In this case, you must perform an incomplete media recovery until Friday, since that is the date of the most recent incremental backup. RMAN uses the level 0 Sunday backup as well as the Wednesday and Friday level 1 backups.&lt;a name="1006832"&gt;&lt;/a&gt;&lt;br /&gt;Because the online redo logs are lost, you must specify the NOREDO option in the RECOVER command. You must also specify NOREDO if the online logs are available but the redo cannot be applied to the incrementals. If you do not specify NOREDO, then RMAN searches for redo logs after applying the Friday incremental backup, and issues an error message when it does not find them. If the correct online logs for the restored backup had been available, then you could have run RECOVER DATABASE without specifying NOREDO. The changes in the online logs would have been applied.&lt;a name="1006833"&gt;&lt;/a&gt;&lt;br /&gt;After connecting to trgt and the catalog database, recover the database with the following command:&lt;a name="1006834"&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;STARTUP FORCE MOUNT;&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006835"&gt;&lt;/a&gt;&lt;strong&gt;RESTORE CONTROLFILE;&lt;/strong&gt; # restore control file from consistent backup&lt;br /&gt;&lt;a name="1006836"&gt;&lt;/a&gt;&lt;strong&gt;ALTER DATABASE MOUNT;&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006837"&gt;&lt;/a&gt;&lt;strong&gt;RESTORE DATABASE;&lt;/strong&gt; # restore datafiles from consistent backup&lt;br /&gt;&lt;a name="1006838"&gt;&lt;/a&gt;&lt;strong&gt;RECOVER DATABASE NOREDO;&lt;/strong&gt; # specify NOREDO because online redo logs are lost&lt;br /&gt;&lt;a name="1006839"&gt;&lt;/a&gt;&lt;strong&gt;ALTER DATABASE OPEN RESETLOGS;&lt;br /&gt;&lt;/strong&gt;The recovered database reflects only changes up through the time of the Friday incremental backup. Because there are no archived redo logs, there is no way to recover changes made after the incremental backup.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-8726351613469871922?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/8726351613469871922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/recovering-database-in-noarchivelog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/8726351613469871922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/8726351613469871922'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/recovering-database-in-noarchivelog.html' title='Recovering a Database in NOARCHIVELOG Mode: Example'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-1522739556876544892</id><published>2009-09-24T20:39:00.001-07:00</published><updated>2009-09-24T23:07:12.383-07:00</updated><title type='text'>Restoring When Multiple Databases in the Catalog Share the Same Name: Example</title><content type='html'>As explained in the description for SET DBID in &lt;a class="xlinkSRC RCMRF153" href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10770/rcmsynta55.htm#RCMRF153"&gt;Oracle Database Recovery Manager Reference&lt;/a&gt;, you must run the SET DBID command to restore the control file when the target database is not mounted and multiple databases registered in the recovery catalog share the same name. In this case, do the following steps in order:&lt;br /&gt;&lt;a name="1006782"&gt;&lt;/a&gt;&lt;strong&gt;Start RMAN and connect to the target database.&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006783"&gt;&lt;/a&gt;&lt;strong&gt;Run the STARTUP FORCE NOMOUNT command.&lt;/strong&gt;&lt;br /&gt;&lt;a name="1006784"&gt;&lt;/a&gt;&lt;strong&gt;Run the SET DBID command&lt;/strong&gt; to distinguish this connected target database from other target databases that have the same name.&lt;br /&gt;&lt;a name="1006785"&gt;&lt;/a&gt;&lt;strong&gt;Run the RESTORE CONTROLFILE command&lt;/strong&gt;. After restoring the control file, you can &lt;strong&gt;mount the database to restore the rest of the database.&lt;/strong&gt;&lt;a name="1006786"&gt;&lt;/a&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;This procedure avoids the RMAN-20005 message when you attempt to restore the control file. This message occurs because more than one target database has the same name, so RMAN requires the unique DBID to distinguishes the databases from one another.&lt;a name="1006787"&gt;&lt;/a&gt;&lt;br /&gt;Obtaining the DBID of a Database That You Need to Restore&lt;a name="1006788"&gt;&lt;/a&gt;&lt;br /&gt;If you have saved the RMAN output log files, then refer to these logs to determine the database identifier. RMAN automatically provides the DBID whenever you connect to the database:&lt;a name="1006789"&gt;&lt;/a&gt;% &lt;strong&gt;rman TARGET /&lt;/strong&gt;&lt;br /&gt;Recovery Manager: Release 10.1.0.2.0 - Production&lt;br /&gt;&lt;strong&gt;connected to target database: RMAN (DBID=1231209694)&lt;/strong&gt;&lt;br /&gt;The &lt;strong&gt;output from RMAN jobs&lt;/strong&gt; is also stored persistently in &lt;strong&gt;V$RMAN_STATUS and RC_RMAN_STATUS. &lt;/strong&gt;&lt;br /&gt;The &lt;strong&gt;DBID&lt;/strong&gt; is also stored in the &lt;strong&gt;RC_DATABASE and RC_DATABASE_INCARNATION&lt;/strong&gt; recovery catalog views.&lt;a name="1006796"&gt;&lt;/a&gt;&lt;br /&gt;Because the names of the databases that are registered in the recovery catalog are presumed nonunique in this scenario, you must use some other unique piece of information to determine the correct DBID. If you know the filename of a datafile or online redo log associated with the database you wish to restore, and this filename is unique across all databases registered in the recovery catalog, then substitute this fully specified filename for filename_of_log_or_df in the following queries.&lt;br /&gt;&lt;strong&gt;Determine the DBID by performing one of the following queries:&lt;/strong&gt;&lt;a name="1006797"&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;SELECT DISTINCT DB_ID&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006798"&gt;&lt;/a&gt;&lt;strong&gt;FROM DB, DBINC, DFATT&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006799"&gt;&lt;/a&gt;&lt;strong&gt;WHERE DB.DB_KEY = DBINC.DB_KEY&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006800"&gt;&lt;/a&gt;&lt;strong&gt;AND DBINC.DBINC_KEY = DFATT.DBINC_KEY&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006801"&gt;&lt;/a&gt;&lt;strong&gt;AND DFATT.FNAME = 'filename_of_log_or_df';&lt;/strong&gt;&lt;br /&gt;&lt;a name="1006802"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006803"&gt;&lt;/a&gt;&lt;strong&gt;SELECT DISTINCT DB_ID&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006804"&gt;&lt;/a&gt;&lt;strong&gt;FROM DB, DBINC, ORL&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006805"&gt;&lt;/a&gt;&lt;strong&gt;WHERE DB.DB_KEY = DBINC.DB_KEY&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006806"&gt;&lt;/a&gt;&lt;strong&gt;AND DBINC.DBINC_KEY = ORL.DBINC_KEY&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006807"&gt;&lt;/a&gt;&lt;strong&gt;AND ORL.FNAME = 'filename_of_log_or_df';&lt;br /&gt;&lt;/strong&gt;Restoring a Backup Control File By Using the DBID&lt;a name="1006809"&gt;&lt;/a&gt;&lt;br /&gt;To set the DBID, connect RMAN to the target database and run the following SET command, where target_dbid is the value you obtained from the previous step:&lt;br /&gt;&lt;a name="1006810"&gt;&lt;/a&gt;&lt;strong&gt;SET DBID = target_dbid;&lt;/strong&gt;&lt;br /&gt;To restore the control file to its default location and then mount it, run:&lt;a name="1006813"&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;RESTORE CONTROLFILE;&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006814"&gt;&lt;/a&gt;&lt;strong&gt;ALTER DATABASE MOUNT;&lt;/strong&gt;&lt;br /&gt;To restore and recover the database, run:&lt;a name="1006817"&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;RESTORE DATABASE;&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006818"&gt;&lt;/a&gt;&lt;strong&gt;RECOVER DATABASE&lt;br /&gt;&lt;/strong&gt;&lt;a name="1006819"&gt;&lt;/a&gt;# optionally, delete logs restored for recovery and limit disk space used&lt;br /&gt;&lt;a name="1006820"&gt;&lt;/a&gt;&lt;strong&gt;DELETE ARCHIVELOG MAXSIZE 2M;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-1522739556876544892?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/1522739556876544892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/restoring-when-multiple-databases-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/1522739556876544892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/1522739556876544892'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/restoring-when-multiple-databases-in.html' title='Restoring When Multiple Databases in the Catalog Share the Same Name: Example'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-4845592640689769466</id><published>2009-09-24T20:38:00.001-07:00</published><updated>2009-09-24T23:15:48.645-07:00</updated><title type='text'>Restoring Datafile Copies to a New Host: Example</title><content type='html'>To move the database to a new host by means of datafile copies, you must transfer the copies manually to the new machine. This example assumes that you are using a recovery catalog.&lt;br /&gt;&lt;a name="1006750"&gt;&lt;/a&gt;After connecting to the target database and recovery catalog, run a LIST command to see a listing of datafile copies and their associated primary keys, as in the following example:&lt;br /&gt;&lt;a name="1006751"&gt;&lt;/a&gt;&lt;strong&gt;LIST COPY;&lt;/strong&gt;&lt;br /&gt;Copy the datafile copies to the new host with an operating system utility. For example, in UNIX: &lt;a name="1006754"&gt;&lt;/a&gt;&lt;strong&gt;% cp -r /tmp/*dbf /net/new_host/oracle/oradata/trgt&lt;br /&gt;&lt;/strong&gt;Start RMAN and then uncatalog the datafile copies on the old host. For example, enter: &lt;a name="1006757"&gt;&lt;/a&gt;&lt;strong&gt;CHANGE COPY OF DATAFILE 1,2,3,4,5,6,7,8 UNCATALOG;&lt;br /&gt;&lt;/strong&gt;Catalog the datafile copies, using their new filenames or CATALOG START WITH (if you know all the files are in directories with a common prefix easily addressed with a CATALOG START WITH). For example, run: &lt;a name="1012063"&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;CATALOG START WITH '?/oradata/trgt/';&lt;/strong&gt;&lt;br /&gt;Or this example specifies files individually:&lt;a name="1012071"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1012083"&gt;&lt;/a&gt;&lt;strong&gt;CATALOG DATAFILECOPY&lt;/strong&gt;&lt;br /&gt;&lt;a name="1012045"&gt;&lt;/a&gt;'?/oradata/trgt/system01.dbf', '?/oradata/trgt/undotbs01.dbf',&lt;br /&gt;&lt;a name="1006762"&gt;&lt;/a&gt;'?/oradata/trgt/cwmlite01.dbf', '?/oradata/trgt/drsys01.dbf',&lt;br /&gt;&lt;a name="1006763"&gt;&lt;/a&gt;'?/oradata/trgt/example01.dbf', '?/oradata/trgt/indx01.dbf',&lt;br /&gt;&lt;a name="1006764"&gt;&lt;/a&gt;'?/oradata/trgt/tools01.dbf', '?/oradata/trgt/users01.dbf';&lt;br /&gt;&lt;a name="1012046"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006768"&gt;&lt;/a&gt;Perform the restore and recovery operation described in &lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1007667"&gt;"Performing Disaster Recovery"&lt;/a&gt;&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1007667"&gt;&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-4845592640689769466?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/4845592640689769466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/restoring-datafile-copies-to-new-host.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/4845592640689769466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/4845592640689769466'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/restoring-datafile-copies-to-new-host.html' title='Restoring Datafile Copies to a New Host: Example'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-5731413366340134255</id><published>2009-09-24T20:36:00.001-07:00</published><updated>2009-09-24T20:36:45.406-07:00</updated><title type='text'>Recovering Blocks Listed in V$DATABASE_BLOCK_CORRUPTION</title><content type='html'>The V$DATABASE_BLOCK_CORRUPTION view indicates which blocks in a datafile were marked corrupt since the most recent BACKUP or BACKUP VALIDATE command was run. After a corrupt block is repaired, the row identifying this block is deleted from the view.&lt;a name="1006664"&gt;&lt;/a&gt;&lt;br /&gt;You can check for logical corruption in the database by running the BACKUP (with or without VALIDATE option) with the CHECK LOGICAL command. If RMAN finds corrupt blocks, then it populates V$DATABASE_BLOCK_CORRUPTION. The backup will stop if the number of corrupt blocks exceeds MAXCORRUPT. A historical record of block corruptions in RMAN backups is kept in V$BACKUP_CORRUPTION and V$COPY_CORRUPTION.&lt;a name="1006665"&gt;&lt;/a&gt;&lt;br /&gt;In this scenario, you identify the blocks that require recovery by querying V$DATABASE_BLOCK_CORRUPTION, and then instruct RMAN to recover all blocks listed in this view by means of the CORRUPTION LIST keyword.&lt;a name="1006666"&gt;&lt;/a&gt;&lt;br /&gt;To recover datablocks while limiting the type of backup:&lt;br /&gt;&lt;a name="1006667"&gt;&lt;/a&gt;Query V$DATABASE_BLOCK_CORRUPTION to determine whether corrupt blocks exist in the most recent backups of the datafiles: &lt;a name="1006668"&gt;&lt;/a&gt;SQL&gt; SELECT * FROM V$DATABASE_BLOCK_CORRUPTION;&lt;br /&gt;&lt;a name="1006669"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006670"&gt;&lt;/a&gt;Assuming that you have preallocated automatic channels, recover all blocks marked corrupt in V$DATABASE_BLOCK_CORRUPTION by running the BLOCKRECOVER CORRUPTION LIST command. For example, this command restores blocks from backups created more than 10 days ago: &lt;a name="1006671"&gt;&lt;/a&gt;BLOCKRECOVER CORRUPTION LIST&lt;br /&gt;&lt;a name="1006673"&gt;&lt;/a&gt;RESTORE UNTIL TIME 'SYSDATE-10';&lt;br /&gt;&lt;a name="1012021"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-5731413366340134255?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/5731413366340134255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/recovering-blocks-listed-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/5731413366340134255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/5731413366340134255'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/recovering-blocks-listed-in.html' title='Recovering Blocks Listed in V$DATABASE_BLOCK_CORRUPTION'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-4497363425393263375</id><published>2009-09-24T20:31:00.000-07:00</published><updated>2009-09-24T20:34:03.322-07:00</updated><title type='text'>Performing Disaster Recovery</title><content type='html'>If you are in a disaster recovery scenario, then presumably you have lost the target database, the recovery catalog database, all control files, all online redo logs, and all parameter files.&lt;a name="1011431"&gt;&lt;/a&gt;&lt;br /&gt;To perform a disaster recovery, the minimum required set of backups is backups of some datafiles, some archived redo logs generated after the time of the backup, and at least one autobackup of the control file.&lt;a name="1006468"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006460"&gt;&lt;/a&gt;See Also: &lt;a name="1006466"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmconc1.htm#1016427"&gt;"Control File and Server Parameter File Autobackups"&lt;/a&gt;&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmconc1.htm#1016427"&gt;&lt;/a&gt;&lt;a name="1006471"&gt;&lt;/a&gt;&lt;br /&gt;The basic procedure for disaster recovery is found in &lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1006247"&gt;"Performing Recovery with a Backup Control File"&lt;/a&gt;&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1006247"&gt;&lt;/a&gt;, with an additional first step of restoring an autobackup of the server parameter file as described in &lt;a class="xlinkSRC BRBSC005" href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10735/recov.htm#BRBSC005"&gt;Oracle Database Backup and Recovery Basics&lt;/a&gt;. After the instance is started, you can restore an autobackup of the control file, mount it, then restore and recover the datafiles. Because you are restoring to a new host, you should review the considerations described in &lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1009919"&gt;"Restoring the Database to a New Host"&lt;/a&gt;&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1009919"&gt;&lt;/a&gt;.&lt;a name="1006482"&gt;&lt;/a&gt;&lt;br /&gt;The following scenario restores and recovers the database to the most recently available archived log, which in this example is log 1124 in thread 1. It assumes that:&lt;br /&gt;&lt;a name="1006483"&gt;&lt;/a&gt;You are restoring the database to a new host with the same directory structure.&lt;br /&gt;&lt;a name="1006484"&gt;&lt;/a&gt;You have one tape drive containing backups of all the datafiles and archived redo logs through log 1124, as well as autobackups of the control file and server parameter file.&lt;br /&gt;&lt;a name="1006485"&gt;&lt;/a&gt;You do not use a recovery catalog.&lt;a name="1006486"&gt;&lt;/a&gt;&lt;br /&gt;In this scenario, perform the following steps:&lt;br /&gt;&lt;a name="1006487"&gt;&lt;/a&gt;If possible, restore all relevant network files such as tnsnames.ora and listener.ora by means of operating system utilities.&lt;br /&gt;&lt;a name="1006488"&gt;&lt;/a&gt;Start RMAN and connect to the target database. If you do not have the Oracle Net files, then connect through operating system authentication.&lt;br /&gt;&lt;a name="1006489"&gt;&lt;/a&gt;Specify the DBID for the target database with the SET DBID command, as described in &lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1006329"&gt;"Performing Recovery with a Backup Control File and No Recovery Catalog"&lt;/a&gt;&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1006329"&gt;&lt;/a&gt;.&lt;br /&gt;&lt;a name="1006496"&gt;&lt;/a&gt;Run the STARTUP NOMOUNT command. RMAN attempts to start the instance with a dummy server parameter file.&lt;br /&gt;&lt;a name="1006497"&gt;&lt;/a&gt;Allocate a channel to the media manager and then run the RESTORE SPFILE FROM AUTOBACKUP command.&lt;br /&gt;&lt;a name="1006498"&gt;&lt;/a&gt;Run STARTUP FORCE NOMOUNT mode so that the instance is restarted with the restored server parameter file.&lt;br /&gt;&lt;a name="1006499"&gt;&lt;/a&gt;Allocate a channel to the media manager and then restore a control file autobackup (refer to&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1006329"&gt;"Performing Recovery with a Backup Control File and No Recovery Catalog"&lt;/a&gt;&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1006329"&gt;&lt;/a&gt;).&lt;br /&gt;&lt;a name="1006506"&gt;&lt;/a&gt;Mount the restored control file.&lt;br /&gt;&lt;a name="1006507"&gt;&lt;/a&gt;Catalog any backups not recorded in the repository with the CATALOG command (refer to&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrepos.htm#1008811"&gt;"Removing Recovery Catalog Records with Status DELETED"&lt;/a&gt;&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrepos.htm#1008811"&gt;&lt;/a&gt;).&lt;br /&gt;&lt;a name="1006514"&gt;&lt;/a&gt;Restore the datafiles to their original locations. If volume names have changed, then run SET NEWNAME commands before the restore and perform a switch after the restore to update the control file with the new locations for the datafiles (refer to&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1007667"&gt;"Performing Disaster Recovery"&lt;/a&gt;&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1007667"&gt;&lt;/a&gt;).&lt;br /&gt;&lt;a name="1006521"&gt;&lt;/a&gt;Recover the datafiles. RMAN stops recovery when it reaches the log sequence number specified.&lt;br /&gt;&lt;a name="1006522"&gt;&lt;/a&gt;Open the database in RESETLOGS mode. Only complete this last step if you are certain that no other archived logs can be applied. &lt;a name="1006528"&gt;&lt;/a&gt;# Start RMAN and connect to the target database&lt;br /&gt;&lt;a name="1006529"&gt;&lt;/a&gt;% rman TARGET SYS/oracle@trgt&lt;br /&gt;&lt;a name="1006530"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006531"&gt;&lt;/a&gt;# Set the DBID for the target database&lt;br /&gt;&lt;a name="1006532"&gt;&lt;/a&gt;RMAN&gt; SET DBID 676549873;&lt;br /&gt;&lt;a name="1006533"&gt;&lt;/a&gt;RMAN&gt; STARTUP FORCE NOMOUNT; # rman starts instance with dummy parameter file&lt;br /&gt;&lt;a name="1006534"&gt;&lt;/a&gt;RUN&lt;br /&gt;&lt;a name="1006535"&gt;&lt;/a&gt;{&lt;br /&gt;&lt;a name="1006536"&gt;&lt;/a&gt;ALLOCATE CHANNEL t1 DEVICE TYPE sbt;&lt;br /&gt;&lt;a name="1006537"&gt;&lt;/a&gt;RESTORE SPFILE FROM AUTOBACKUP;&lt;br /&gt;&lt;a name="1006538"&gt;&lt;/a&gt;}&lt;br /&gt;&lt;a name="1008738"&gt;&lt;/a&gt;# Restart instance with restored server parameter file&lt;br /&gt;&lt;a name="1006539"&gt;&lt;/a&gt;RMAN&gt; STARTUP FORCE NOMOUNT;&lt;br /&gt;&lt;a name="1006540"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006541"&gt;&lt;/a&gt;RMAN&gt; RUN&lt;br /&gt;&lt;a name="1006542"&gt;&lt;/a&gt;{&lt;br /&gt;&lt;a name="1006543"&gt;&lt;/a&gt;# Manually allocate a channel to the media manager&lt;br /&gt;&lt;a name="1006544"&gt;&lt;/a&gt;ALLOCATE CHANNEL t1 DEVICE TYPE sbt;&lt;br /&gt;&lt;a name="1006545"&gt;&lt;/a&gt;# Restore autobackup of the control file. This example assumes that you have&lt;br /&gt;&lt;a name="1006546"&gt;&lt;/a&gt;# accepted the default format for the autobackup name.&lt;br /&gt;&lt;a name="1006547"&gt;&lt;/a&gt;RESTORE CONTROLFILE FROM AUTOBACKUP;&lt;br /&gt;&lt;a name="1006548"&gt;&lt;/a&gt;# The set until command is used in case the database&lt;br /&gt;&lt;a name="1006549"&gt;&lt;/a&gt;# structure has changed in the most recent backups, and you wish to&lt;br /&gt;&lt;a name="1006550"&gt;&lt;/a&gt;# recover to that point-in-time. In this way RMAN restores the database&lt;br /&gt;&lt;a name="1006551"&gt;&lt;/a&gt;# to the same structure that the database had at the specified time.&lt;br /&gt;&lt;a name="1011658"&gt;&lt;/a&gt;ALTER DATABASE MOUNT;&lt;br /&gt;&lt;a name="1011659"&gt;&lt;/a&gt;SET UNTIL SEQUENCE 1124 THREAD 1;&lt;br /&gt;&lt;a name="1011660"&gt;&lt;/a&gt;RESTORE DATABASE;&lt;br /&gt;&lt;a name="1006555"&gt;&lt;/a&gt;RECOVER DATABASE;&lt;br /&gt;&lt;a name="1006556"&gt;&lt;/a&gt;}&lt;br /&gt;&lt;a name="1006557"&gt;&lt;/a&gt;RMAN&gt; ALTER DATABASE OPEN RESETLOGS; # Reset the online logs after recovery&lt;br /&gt;completes&lt;br /&gt;&lt;a name="1006558"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006559"&gt;&lt;/a&gt;&lt;br /&gt;The following example of the RUN command shows the same scenario except with new filenames for the restored datafiles:&lt;a name="1006560"&gt;&lt;/a&gt;RMAN&gt; RUN&lt;br /&gt;&lt;a name="1006561"&gt;&lt;/a&gt;{&lt;br /&gt;&lt;a name="1006562"&gt;&lt;/a&gt;# If you need to restore the files to new locations, tell Recovery Manager&lt;br /&gt;&lt;a name="1006563"&gt;&lt;/a&gt;# to do this using SET NEWNAME commands:&lt;br /&gt;&lt;a name="1006564"&gt;&lt;/a&gt;SET NEWNAME FOR DATAFILE 1 TO '/dev/vgd_1_0/rlvt5_500M_1';&lt;br /&gt;&lt;a name="1006565"&gt;&lt;/a&gt;SET NEWNAME FOR DATAFILE 2 TO '/dev/vgd_1_0/rlvt5_500M_2';&lt;br /&gt;&lt;a name="1006566"&gt;&lt;/a&gt;SET NEWNAME FOR DATAFILE 3 TO '/dev/vgd_1_0/rlvt5_500M_3';&lt;br /&gt;&lt;a name="1006567"&gt;&lt;/a&gt;ALLOCATE CHANNEL t1 DEVICE TYPE sbt;&lt;br /&gt;&lt;a name="1006568"&gt;&lt;/a&gt;RESTORE CONTROLFILE FROM AUTOBACKUP;&lt;br /&gt;&lt;a name="1011645"&gt;&lt;/a&gt;ALTER DATABASE MOUNT;&lt;br /&gt;&lt;a name="1006569"&gt;&lt;/a&gt;SET UNTIL SEQUENCE 124 THREAD 1;&lt;br /&gt;&lt;a name="1006571"&gt;&lt;/a&gt;RESTORE DATABASE;&lt;br /&gt;&lt;a name="1006572"&gt;&lt;/a&gt;SWITCH DATAFILE ALL; # Update control file with new location of datafiles.&lt;br /&gt;&lt;a name="1006573"&gt;&lt;/a&gt;RECOVER DATABASE;&lt;br /&gt;&lt;a name="1006574"&gt;&lt;/a&gt;}&lt;br /&gt;&lt;a name="1006575"&gt;&lt;/a&gt;RMAN&gt; ALTER DATABASE OPEN RESETLOGS;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-4497363425393263375?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/4497363425393263375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/performing-disaster-recovery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/4497363425393263375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/4497363425393263375'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/performing-disaster-recovery.html' title='Performing Disaster Recovery'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-4791906642327911037</id><published>2009-09-24T20:29:00.000-07:00</published><updated>2009-09-24T20:30:07.096-07:00</updated><title type='text'>Testing the Restore of a Database to a New Host: Scenario</title><content type='html'>The DUPLICATE command is the preferred method of copying the target database. DUPLICATE creates a new DBID for the copied database, allowing it to be registered in the same recovery catalog as the original target database. However, you may wish to perform a test run of your disaster recovery scenarios that uses exactly the same steps that you would use in a genuine emergency. If so, then you should use the RESTORE and RECOVER commands rather than DUPLICATE.&lt;a name="1007835"&gt;&lt;/a&gt;&lt;br /&gt;This scenario assumes the following:&lt;br /&gt;&lt;a name="1007837"&gt;&lt;/a&gt;Two networked machines, hosta and hostb, are running Sun Solaris&lt;br /&gt;&lt;a name="1007838"&gt;&lt;/a&gt;A media management subsystem is accessible by both machines&lt;br /&gt;&lt;a name="1007839"&gt;&lt;/a&gt;The directory structure of hostb is different from hosta, so that trgta is located in /net/hosta/dev3/oracle/dbs, but you want to restore the database to /net/hostb/oracle/oradata/test&lt;br /&gt;&lt;a name="1007842"&gt;&lt;/a&gt;A target database named trgta is on hosta and uses a recovery catalog catdb&lt;br /&gt;&lt;a name="1007843"&gt;&lt;/a&gt;Database trgta uses a server parameter file (not a client-side initialization parameter file)&lt;br /&gt;&lt;a name="1007844"&gt;&lt;/a&gt;You want to test the restore and recovery of trgta on hostb, while keeping database trgta up and running on hosta&lt;br /&gt;&lt;a name="1007846"&gt;&lt;/a&gt;The ORACLE_SID for the trgta database is trgta and will not change for the restored database&lt;br /&gt;&lt;a name="1007848"&gt;&lt;/a&gt;You have recoverable backups on tape of all datafiles&lt;br /&gt;&lt;a name="1007849"&gt;&lt;/a&gt;You have backups of the archived logs required to recover the datafiles&lt;br /&gt;&lt;a name="1008274"&gt;&lt;/a&gt;You have control file and server parameter file autobackups on tape&lt;br /&gt;&lt;a name="1008279"&gt;&lt;/a&gt;You have a record of the DBID for trgta&lt;a name="1007877"&gt;&lt;/a&gt;&lt;br /&gt;To test the restore of the database to a new host:&lt;br /&gt;&lt;a name="1008340"&gt;&lt;/a&gt;Make backups of the target database available to hostb. To test disaster recovery, you need to have a recoverable backup of the target database. When preparing your disaster recovery strategy, ensure that the backups of the datafiles, control files, and server parameter file are restorable on hostb. Hence, you must configure the media management software so that hostb is a media manager client and can read the backup sets created on hosta. Consult the media management vendor for support on this issue.&lt;br /&gt;&lt;a name="1007918"&gt;&lt;/a&gt;Configure the ORACLE_SID on hostb. This case study assumes that you want to authenticate yourself through the operating system, which is much faster than configuring Oracle Net and creating a password file. However, you must be connected to hostb either locally or through telnet.&lt;br /&gt;&lt;a name="1008357"&gt;&lt;/a&gt;&lt;br /&gt;While connected to hostb with administrator privileges, edit the /etc/group file so that you are included:&lt;a name="1007931"&gt;&lt;/a&gt;dba:*:614:&lt;your_user_name&gt;&lt;br /&gt;&lt;a name="1007932"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1007935"&gt;&lt;/a&gt;&lt;br /&gt;Run the setenv command on hostb to set the ORACLE_SID. In this example, you set the SID to the same value that you used on hosta:&lt;a name="1007938"&gt;&lt;/a&gt;% setenv ORACLE_SID trgta&lt;br /&gt;&lt;a name="1007939"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1007942"&gt;&lt;/a&gt;&lt;br /&gt;Start RMAN and connect to the target instance without connecting to the recovery catalog.&lt;a name="1007945"&gt;&lt;/a&gt;% rman TARGET / NOCATALOG&lt;br /&gt;&lt;a name="1007946"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1007954"&gt;&lt;/a&gt;Start the instance without mounting it. To start the instance, you first need to set the DBID. The DBID is recorded in several places, including:&lt;br /&gt;&lt;a name="1007959"&gt;&lt;/a&gt;V$DATABASE in the target and RC_DATABASE in the catalog&lt;br /&gt;&lt;a name="1007960"&gt;&lt;/a&gt;The RMAN output (command-line and V$RMAN_STATUS)&lt;br /&gt;&lt;a name="1007961"&gt;&lt;/a&gt;The filename of the control file autobackups&lt;a name="1007963"&gt;&lt;/a&gt;&lt;br /&gt;Run SET DBID to set the DBID, then run STARTUP NOMOUNT:&lt;a name="1007965"&gt;&lt;/a&gt;SET DBID 1340752057;&lt;br /&gt;&lt;a name="1007966"&gt;&lt;/a&gt;STARTUP NOMOUNT&lt;br /&gt;&lt;a name="1007967"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1007968"&gt;&lt;/a&gt;&lt;br /&gt;RMAN will fail to find the server parameter file, which has not yet been restored, but will start the instance with a "dummy" file. Sample output follows:&lt;a name="1007971"&gt;&lt;/a&gt;startup failed: ORA-01078: failure in processing system parameters&lt;br /&gt;&lt;a name="1007972"&gt;&lt;/a&gt;LRM-00109: could not open parameter file&lt;br /&gt;'/net/hostb/oracle/dbs/inittrgta.ora'&lt;br /&gt;&lt;a name="1007973"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1007974"&gt;&lt;/a&gt;trying to start the Oracle instance without parameter files ...&lt;br /&gt;&lt;a name="1007975"&gt;&lt;/a&gt;Oracle instance started&lt;br /&gt;&lt;a name="1008416"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1007978"&gt;&lt;/a&gt;Restore and edit the server parameter file. Because you enabled the control file autobackup feature when making your backups, the server parameter file is included in the backup sets. Hence, you can allocate a channel to the media manager and restore the server parameter file to a new location as a client-side initialization parameter file. Then you can edit the client-side file and restart the instance with the edited client-side file. For example: &lt;a name="1007990"&gt;&lt;/a&gt;RUN&lt;br /&gt;&lt;a name="1008459"&gt;&lt;/a&gt;{&lt;br /&gt;&lt;a name="1007991"&gt;&lt;/a&gt;ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS='...';&lt;br /&gt;&lt;a name="1007992"&gt;&lt;/a&gt;RESTORE SPFILE TO PFILE '?/oradata/test/inittrgta.ora' FROM AUTOBACKUP;&lt;br /&gt;&lt;a name="1007993"&gt;&lt;/a&gt;SHUTDOWN ABORT;&lt;br /&gt;&lt;a name="1008458"&gt;&lt;/a&gt;}&lt;br /&gt;&lt;a name="1007994"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008004"&gt;&lt;/a&gt;&lt;br /&gt;Change any location-specific parameters, for example, those ending in _DEST and _PATH, to reflect the new directory structure. For example, edit the following parameters:&lt;a name="1008007"&gt;&lt;/a&gt; - IFILE&lt;br /&gt;&lt;a name="1008008"&gt;&lt;/a&gt;- *_DUMP_DEST&lt;br /&gt;&lt;a name="1008009"&gt;&lt;/a&gt;- LOG_ARCHIVE_DEST*&lt;br /&gt;&lt;a name="1008010"&gt;&lt;/a&gt;- CONTROL_FILES&lt;br /&gt;&lt;a name="1008464"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008014"&gt;&lt;/a&gt;&lt;br /&gt;Restart the instance, specifying the client-side initialization parameter file that you restored:&lt;a name="1008471"&gt;&lt;/a&gt;STARTUP FORCE NOMOUNT PFILE='?/oradata/test/inittrgta.ora';&lt;br /&gt;&lt;a name="1008478"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008019"&gt;&lt;/a&gt;Restore the control file from an autobackup and then mount the database. Because you edited the init.ora in the preceding step, RMAN restores the control file to whatever location you specified in the CONTROL_FILES initialization parameter. For example: &lt;a name="1008027"&gt;&lt;/a&gt;RUN&lt;br /&gt;&lt;a name="1008497"&gt;&lt;/a&gt;{&lt;br /&gt;&lt;a name="1008028"&gt;&lt;/a&gt;ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS='...';&lt;br /&gt;&lt;a name="1008029"&gt;&lt;/a&gt;RESTORE CONTROLFILE FROM AUTOBACKUP;&lt;br /&gt;&lt;a name="1008030"&gt;&lt;/a&gt;ALTER DATABASE MOUNT;&lt;br /&gt;&lt;a name="1008504"&gt;&lt;/a&gt;}&lt;br /&gt;&lt;a name="1008509"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008043"&gt;&lt;/a&gt;Query the database filenames recorded in the control file on the new host (hostb). Because the control file is from the trgta database, the recorded filenames use the original hosta filenames. You can query V$ views to obtain this information. Start a new SQL*Plus session and connect to the newly created instance on hostb: &lt;a name="1008050"&gt;&lt;/a&gt;% sqlplus '/ AS SYSDBA'&lt;br /&gt;&lt;a name="1008051"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008052"&gt;&lt;/a&gt;&lt;br /&gt;Run the following query in SQL*Plus:&lt;a name="1008054"&gt;&lt;/a&gt;SQL&gt; COLUMN NAME FORMAT a60&lt;br /&gt;&lt;a name="1008055"&gt;&lt;/a&gt;SQL&gt; SPOOL LOG 'db_filenames.out'&lt;br /&gt;&lt;a name="1008056"&gt;&lt;/a&gt;SQL&gt; SELECT FILE# AS "File/Grp#", NAME FROM V$DATAFILE&lt;br /&gt;&lt;a name="1008057"&gt;&lt;/a&gt;UNION&lt;br /&gt;&lt;a name="1008058"&gt;&lt;/a&gt;SELECT GROUP#,MEMBER FROM V$LOGFILE;&lt;br /&gt;&lt;a name="1008059"&gt;&lt;/a&gt;SQL&gt; SPOOL OFF&lt;br /&gt;&lt;a name="1008060"&gt;&lt;/a&gt;SQL EXIT&lt;br /&gt;&lt;a name="1008528"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008080"&gt;&lt;/a&gt;Restore and recover the database. At this point you are ready to write the RMAN recovery script. The script should do the following:&lt;br /&gt;&lt;a name="1008085"&gt;&lt;/a&gt;Run SET NEWNAME for each datafile so it is renamed to its new hostb path name&lt;br /&gt;&lt;a name="1008087"&gt;&lt;/a&gt;Run SQL commands to rename the online redo logs to their new hostb path names&lt;br /&gt;&lt;a name="1008089"&gt;&lt;/a&gt;Perform a SET UNTIL to limit media recovery to the end of the archived redo logs, as described in &lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1011954"&gt;"Determining the SCN for Incomplete Recovery After Restore"&lt;/a&gt;&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmrecov.htm#1011954"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1011948"&gt;&lt;/a&gt;Run SWITCH so that the control file recognizes the new path names as the official new names of the datafiles&lt;br /&gt;&lt;a name="1008091"&gt;&lt;/a&gt;Restore and recover the database&lt;a name="1008096"&gt;&lt;/a&gt;&lt;br /&gt;The following is an example of an RMAN script to perform these steps, which is contained in text file reco_test.rman:&lt;a name="1008099"&gt;&lt;/a&gt;RUN&lt;br /&gt;&lt;a name="1008100"&gt;&lt;/a&gt;{&lt;br /&gt;&lt;a name="1008101"&gt;&lt;/a&gt;# allocate a channel to the tape device&lt;br /&gt;&lt;a name="1008102"&gt;&lt;/a&gt;ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS='...';&lt;br /&gt;&lt;a name="1008103"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008104"&gt;&lt;/a&gt;# rename the datafiles and online redo logs&lt;br /&gt;&lt;a name="1008105"&gt;&lt;/a&gt;SET NEWNAME FOR DATAFILE 1 TO '?/oradata/test/system01.dbf';&lt;br /&gt;&lt;a name="1008106"&gt;&lt;/a&gt;SET NEWNAME FOR DATAFILE 2 TO '?/oradata/test/undotbs01.dbf';&lt;br /&gt;&lt;a name="1008107"&gt;&lt;/a&gt;SET NEWNAME FOR DATAFILE 3 TO '?/oradata/test/cwmlite01.dbf';&lt;br /&gt;&lt;a name="1008108"&gt;&lt;/a&gt;SET NEWNAME FOR DATAFILE 4 TO '?/oradata/test/drsys01.dbf';&lt;br /&gt;&lt;a name="1008109"&gt;&lt;/a&gt;SET NEWNAME FOR DATAFILE 5 TO '?/oradata/test/example01.dbf';&lt;br /&gt;&lt;a name="1008110"&gt;&lt;/a&gt;SET NEWNAME FOR DATAFILE 6 TO '?/oradata/test/indx01.dbf';&lt;br /&gt;&lt;a name="1008111"&gt;&lt;/a&gt;SET NEWNAME FOR DATAFILE 7 TO '?/oradata/test/tools01.dbf';&lt;br /&gt;&lt;a name="1008112"&gt;&lt;/a&gt;SET NEWNAME FOR DATAFILE 8 TO '?/oradata/test/users01.dbf';&lt;br /&gt;&lt;a name="1008113"&gt;&lt;/a&gt;SQL "ALTER DATABASE RENAME FILE ''/dev3/oracle/dbs/redo01.log''&lt;br /&gt;&lt;a name="1008114"&gt;&lt;/a&gt;TO ''?/oradata/test/redo01.log'' ";&lt;br /&gt;&lt;a name="1008115"&gt;&lt;/a&gt;SQL "ALTER DATABASE RENAME FILE ''/dev3/oracle/dbs/redo02.log''&lt;br /&gt;&lt;a name="1008116"&gt;&lt;/a&gt;TO ''?/oradata/test/redo02.log'' ";&lt;br /&gt;&lt;a name="1008117"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008118"&gt;&lt;/a&gt;# Do a SET UNTIL to prevent recovery of the online logs&lt;br /&gt;&lt;a name="1011947"&gt;&lt;/a&gt;SET UNTIL SCN 123456;&lt;br /&gt;&lt;a name="1011944"&gt;&lt;/a&gt;# restore the database and switch the datafile names&lt;br /&gt;&lt;a name="1008119"&gt;&lt;/a&gt;RESTORE DATABASE;&lt;br /&gt;&lt;a name="1008120"&gt;&lt;/a&gt;SWITCH DATAFILE ALL;&lt;br /&gt;&lt;a name="1008121"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008122"&gt;&lt;/a&gt;# recover the database&lt;br /&gt;&lt;a name="1008123"&gt;&lt;/a&gt;RECOVER DATABASE;&lt;br /&gt;&lt;a name="1008124"&gt;&lt;/a&gt;}&lt;br /&gt;&lt;a name="1008125"&gt;&lt;/a&gt;EXIT&lt;br /&gt;&lt;a name="1008573"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008127"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008583"&gt;&lt;/a&gt;Caution: &lt;a name="1008584"&gt;&lt;/a&gt;&lt;br /&gt;It is imperative that you not be connected with the recovery catalog when you run this script, so that you do not incorporate extraneous repository data about backups into the recovery catalog.&lt;br /&gt;&lt;a name="1008580"&gt;&lt;/a&gt;&lt;br /&gt;For example, connect and execute as follows:&lt;a name="1008131"&gt;&lt;/a&gt;% rman TARGET / NOCATALOG&lt;br /&gt;&lt;a name="1008132"&gt;&lt;/a&gt;RMAN&gt; @reco_test.rman&lt;br /&gt;&lt;a name="1008595"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008134"&gt;&lt;/a&gt;&lt;br /&gt;RMAN will apply as many of the archived redo logs as it can and leave the database in a state in which is can be opened.&lt;br /&gt;&lt;a name="1008941"&gt;&lt;/a&gt;Open the database. From the RMAN prompt, open the database with the RESETLOGS options: &lt;a name="1008942"&gt;&lt;/a&gt;RMAN&gt; ALTER DATABASE OPEN RESETLOGS;&lt;br /&gt;&lt;a name="1008144"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008146"&gt;&lt;/a&gt;Remove the test files from the operating system. If the test is successful, then shut down the instance and exit the RMAN session: &lt;a name="1008152"&gt;&lt;/a&gt;RMAN&gt; SHUTDOWN ABORT&lt;br /&gt;&lt;a name="1008153"&gt;&lt;/a&gt;RMAN&gt; EXIT&lt;br /&gt;&lt;a name="1008154"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1008155"&gt;&lt;/a&gt;&lt;br /&gt;Remove all test files. You can do this with an operating system utility or in RMAN. For example, in Unix you could perform the procedure this way:&lt;a name="1008157"&gt;&lt;/a&gt;% rm $ORACLE_HOME/oradata/test/*&lt;br /&gt;&lt;a name="1008158"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1012193"&gt;&lt;/a&gt;&lt;br /&gt;You can also use RMAN for a procedure that works ok all platforms. For example:&lt;a name="1012194"&gt;&lt;/a&gt;RMAN&gt; STARTUP FORCE NOMOUNT PFILE='?/oradata/test/inittrgta.ora';&lt;br /&gt;&lt;a name="1012202"&gt;&lt;/a&gt;RMAN&gt; DROP DATABASE;&lt;br /&gt;&lt;a name="1012203"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1012195"&gt;&lt;/a&gt;&lt;br /&gt;Because you did not perform the restore and recovery when connected to the recovery catalog, the recovery catalog contains no records for any of the restored files or the procedures performed during the test. Likewise, the control file of the trgta database is completely unaffected by the test.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-4791906642327911037?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/4791906642327911037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/testing-restore-of-database-to-new-host.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/4791906642327911037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/4791906642327911037'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/testing-restore-of-database-to-new-host.html' title='Testing the Restore of a Database to a New Host: Scenario'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-3812543475035411509</id><published>2009-09-24T20:27:00.001-07:00</published><updated>2009-09-24T20:27:30.144-07:00</updated><title type='text'>Determining the SCN for Incomplete Recovery After Restore</title><content type='html'>Because the restored database will not have the online redo logs of the production database, perform incomplete recovery up to the lowest SCN of the most recently archived log in each thread and then open with the RESETLOGS option. Obtain the SCN for recovery termination by finding the lowest SCN among the most recent archived logs for each thread.&lt;a name="1007775"&gt;&lt;/a&gt;&lt;br /&gt;Start SQL*Plus and use the following query to determine the necessary SCN:&lt;a name="1007776"&gt;&lt;/a&gt;SQL&gt; SELECT MIN(maxnc) FROM&lt;br /&gt;&lt;a name="1007777"&gt;&lt;/a&gt;(SELECT MAX(a.NEXT_CHANGE#) maxnc&lt;br /&gt;&lt;a name="1007778"&gt;&lt;/a&gt;FROM V$ARCHIVED_LOG a, V$THREAD t&lt;br /&gt;&lt;a name="1011932"&gt;&lt;/a&gt;WHERE a.THREAD# = t.THREAD#&lt;br /&gt;&lt;a name="1011937"&gt;&lt;/a&gt;AND a.ARCHIVED='YES'&lt;br /&gt;&lt;a name="1011938"&gt;&lt;/a&gt;AND t.ENABLED='DISABLED'&lt;br /&gt;&lt;a name="1007779"&gt;&lt;/a&gt;GROUP BY a.THREAD#);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-3812543475035411509?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/3812543475035411509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/determining-scn-for-incomplete-recovery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/3812543475035411509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/3812543475035411509'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/determining-scn-for-incomplete-recovery.html' title='Determining the SCN for Incomplete Recovery After Restore'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-3599398661091411955</id><published>2009-09-24T20:25:00.000-07:00</published><updated>2009-09-24T20:26:21.888-07:00</updated><title type='text'>Point-in-Time Recovery to a Previous Incarnation</title><content type='html'>RMAN can seamlessly restore and recover backups from previous incarnations to the current incarnation. To perform point-in-time recovery to a target time prior to the most recent RESETLOGS, however, you must run the RESET DATABASE command to reset the database to the incarnation current at the desired target time.&lt;a name="1011514"&gt;&lt;/a&gt;&lt;br /&gt;Assume the following situation:&lt;br /&gt;&lt;a name="1006198"&gt;&lt;/a&gt;You run RMAN with a recovery catalog.&lt;br /&gt;&lt;a name="1006199"&gt;&lt;/a&gt;You made a backup of target database trgt on October 2, 2002.&lt;br /&gt;&lt;a name="1006200"&gt;&lt;/a&gt;You performed incomplete recovery on this database and opened it with the RESETLOGS option on October 10, 2002. A new database incarnation was created.&lt;a name="1006201"&gt;&lt;/a&gt;&lt;br /&gt;On October 25, you discover that you need crucial data that was dropped from the database at 8:00 a.m. on October 8, 2002. You decide to reset trgt to the prior incarnation, restore the October 2 backup, and recover to 7:55 a.m. on October 8.&lt;a name="1006206"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006204"&gt;&lt;/a&gt;Note: &lt;a name="1006205"&gt;&lt;/a&gt;&lt;br /&gt;It is not possible to restore one datafile of a previous incarnation while the current database is in a different incarnation--you must restore the whole database.&lt;br /&gt;&lt;a name="1006207"&gt;&lt;/a&gt;&lt;br /&gt;To recover the database by means of a backup from the old incarnation:&lt;br /&gt;&lt;a name="1006208"&gt;&lt;/a&gt;Obtain the primary key of the prior incarnation with a LIST command: &lt;a name="1006209"&gt;&lt;/a&gt;# obtain primary key of old incarnation&lt;br /&gt;&lt;a name="1006210"&gt;&lt;/a&gt;LIST INCARNATION OF DATABASE trgt;&lt;br /&gt;&lt;a name="1006211"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006212"&gt;&lt;/a&gt;List of Database Incarnations&lt;br /&gt;&lt;a name="1006213"&gt;&lt;/a&gt;DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time&lt;br /&gt;&lt;a name="1006214"&gt;&lt;/a&gt;------- ------- ------- ------ ------- ---------- ----------&lt;br /&gt;&lt;a name="1006215"&gt;&lt;/a&gt;1 2 TRGT 1224038686 PARENT 1 02-OCT-02&lt;br /&gt;&lt;a name="1006216"&gt;&lt;/a&gt;1 582 TRGT 1224038686 CURRENT 59727 10-OCT-02&lt;br /&gt;&lt;a name="1006217"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006218"&gt;&lt;/a&gt;Make sure the database is started but not mounted: &lt;a name="1006219"&gt;&lt;/a&gt;SHUTDOWN FORCE NOMOUNT&lt;br /&gt;&lt;a name="1006221"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006222"&gt;&lt;/a&gt;Reset the incarnation to the primary key that you just obtained: &lt;a name="1006223"&gt;&lt;/a&gt;# reset database to old incarnation&lt;br /&gt;&lt;a name="1006224"&gt;&lt;/a&gt;RESET DATABASE TO INCARNATION 2;&lt;br /&gt;&lt;a name="1006225"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006226"&gt;&lt;/a&gt;Recover the database, performing the following actions in the RUN command:&lt;br /&gt;&lt;a name="1006227"&gt;&lt;/a&gt;Set the end time for recovery to the time just before the loss of the data.&lt;br /&gt;&lt;a name="1006228"&gt;&lt;/a&gt;If automatic channels are not configured, then manually allocate one or more channels.&lt;br /&gt;&lt;a name="1006229"&gt;&lt;/a&gt;Restore the control file and mount it.&lt;br /&gt;&lt;a name="1006230"&gt;&lt;/a&gt;Restore and recover the database.&lt;a name="1006231"&gt;&lt;/a&gt;&lt;br /&gt;For example, run the following commands:&lt;a name="1006232"&gt;&lt;/a&gt;RUN&lt;br /&gt;&lt;a name="1006233"&gt;&lt;/a&gt;{&lt;br /&gt;&lt;a name="1007080"&gt;&lt;/a&gt;# set time to just before data was lost.&lt;br /&gt;&lt;a name="1006234"&gt;&lt;/a&gt;SET UNTIL TIME 'Oct 8 2002 07:55:00';&lt;br /&gt;&lt;a name="1006235"&gt;&lt;/a&gt;RESTORE CONTROLFILE; # FROM AUTOBACKUP not needed in catalog mode&lt;br /&gt;&lt;a name="1006236"&gt;&lt;/a&gt;ALTER DATABASE MOUNT; # mount database after restoring control file&lt;br /&gt;&lt;a name="1006237"&gt;&lt;/a&gt;RESTORE DATABASE;&lt;br /&gt;&lt;a name="1006238"&gt;&lt;/a&gt;RECOVER DATABASE;&lt;br /&gt;&lt;a name="1006239"&gt;&lt;/a&gt;}&lt;br /&gt;&lt;a name="1006240"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006241"&gt;&lt;/a&gt;If recovery is successful, then reset the online redo logs: &lt;a name="1006242"&gt;&lt;/a&gt;# this command automatically resets the database so that this incarnation is&lt;br /&gt;&lt;a name="1007462"&gt;&lt;/a&gt;# the new incarnation&lt;br /&gt;&lt;a name="1007449"&gt;&lt;/a&gt;ALTER DATABASE OPEN RESETLOGS;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-3599398661091411955?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/3599398661091411955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/point-in-time-recovery-to-previous.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/3599398661091411955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/3599398661091411955'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/point-in-time-recovery-to-previous.html' title='Point-in-Time Recovery to a Previous Incarnation'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-3587870211372670734</id><published>2009-09-24T20:24:00.000-07:00</published><updated>2009-09-24T20:25:25.227-07:00</updated><title type='text'>Performing Point-in-Time Recovery with a Current Control File</title><content type='html'>The database must be closed to perform database point-in-time recovery. If you are recovering to a time, then you should set the time format environment variables before invoking RMAN. The following are sample Globalization Support settings:&lt;a name="1006158"&gt;&lt;/a&gt;NLS_LANG = american_america.us7ascii&lt;br /&gt;&lt;a name="1006159"&gt;&lt;/a&gt;NLS_DATE_FORMAT="Mon DD YYYY HH24:MI:SS"&lt;br /&gt;&lt;a name="1006160"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006162"&gt;&lt;/a&gt;&lt;br /&gt;To recover the database until a specified time, SCN, or log sequence number:&lt;br /&gt;&lt;a name="1006163"&gt;&lt;/a&gt;After connecting to the target database and, optionally, the recovery catalog database, ensure that the database is mounted. If the database is open, shut it down and then mount it: &lt;a name="1006164"&gt;&lt;/a&gt;SHUTDOWN IMMEDIATE;&lt;br /&gt;&lt;a name="1006165"&gt;&lt;/a&gt;STARTUP MOUNT;&lt;br /&gt;&lt;a name="1006166"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006167"&gt;&lt;/a&gt;Determine the time, SCN, or log sequence that should end recovery. For example, if you discover that a user accidentally dropped a tablespace at 9:02 a.m., then you can recover to 9 a.m.--just before the drop occurred. You will lose all changes to the database made after that time.&lt;br /&gt;&lt;a name="1006168"&gt;&lt;/a&gt;&lt;br /&gt;You can also examine the alert.log to find the SCN of an event and recover to a prior SCN. Alternatively, you can determine the log sequence number that contains the recovery termination SCN, and then recover through that log. For example, query V$LOG_HISTORY to view the logs that you have archived.&lt;a name="1006169"&gt;&lt;/a&gt;RECID STAMP THREAD# SEQUENCE# FIRST_CHAN FIRST_TIM NEXT_CHANG&lt;br /&gt;&lt;a name="1006170"&gt;&lt;/a&gt;---------- ---------- ---------- ---------- ---------- --------- ----------&lt;br /&gt;&lt;a name="1006171"&gt;&lt;/a&gt;1 344890611 1 1 20037 24-SEP-02 20043&lt;br /&gt;&lt;a name="1006172"&gt;&lt;/a&gt;2 344890615 1 2 20043 24-SEP-02 20045&lt;br /&gt;&lt;a name="1006173"&gt;&lt;/a&gt;3 344890618 1 3 20045 24-SEP-02 20046&lt;br /&gt;&lt;a name="1006174"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006175"&gt;&lt;/a&gt;Perform the following operations within a RUN command:&lt;br /&gt;&lt;a name="1006176"&gt;&lt;/a&gt;Set the end recovery time, SCN, or log sequence. If specifying a time, then use the date format specified in the NLS_LANG and NLS_DATE_FORMAT environment variables.&lt;br /&gt;&lt;a name="1006177"&gt;&lt;/a&gt;If automatic channels are not configured, then manually allocate one or more channels.&lt;br /&gt;&lt;a name="1006178"&gt;&lt;/a&gt;Restore and recover the database.&lt;a name="1006179"&gt;&lt;/a&gt;&lt;br /&gt;The following example performs an incomplete recovery until November 15 at 9 a.m.&lt;a name="1006180"&gt;&lt;/a&gt;RUN&lt;br /&gt;&lt;a name="1006181"&gt;&lt;/a&gt;{&lt;br /&gt;&lt;a name="1006182"&gt;&lt;/a&gt;SET UNTIL TIME 'Nov 15 2002 09:00:00';&lt;br /&gt;&lt;a name="1006183"&gt;&lt;/a&gt;# SET UNTIL SCN 1000; # alternatively, specify SCN&lt;br /&gt;&lt;a name="1006184"&gt;&lt;/a&gt;# SET UNTIL SEQUENCE 9923; # alternatively, specify log sequence number&lt;br /&gt;&lt;a name="1006185"&gt;&lt;/a&gt;RESTORE DATABASE;&lt;br /&gt;&lt;a name="1006186"&gt;&lt;/a&gt;RECOVER DATABASE;&lt;br /&gt;&lt;a name="1006187"&gt;&lt;/a&gt;}&lt;br /&gt;&lt;a name="1006188"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1006189"&gt;&lt;/a&gt;If recovery was successful, then open the database and reset the online logs: &lt;a name="1006190"&gt;&lt;/a&gt;ALTER DATABASE OPEN RESETLOGS;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-3587870211372670734?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/3587870211372670734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/performing-point-in-time-recovery-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/3587870211372670734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/3587870211372670734'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/performing-point-in-time-recovery-with.html' title='Performing Point-in-Time Recovery with a Current Control File'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-5366109014218707876</id><published>2009-09-24T20:23:00.001-07:00</published><updated>2009-09-24T20:23:48.635-07:00</updated><title type='text'>Performing Database Point-In-Time Recovery</title><content type='html'>RMAN can perform recovery of the whole database to a specified past time, SCN, or log sequence number. This type of recovery is sometimes called incomplete recovery because it does not completely use all of the available redo. Incomplete recovery of the whole database is also called database point-in-time recovery (DBPITR).&lt;a name="1011573"&gt;&lt;/a&gt;&lt;br /&gt;If you have enabled the collectionof flashback logs, you may be able to use Oracle Flashback Database instead of performing DBPITR. Flashback Database is generally faster and simpler to use, when it is available, because it does not require restoring a past backup. Depending upon your situation, you may also find one of the other Oracle flashback features can meet your data recovery need. See &lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmflash.htm#1011396"&gt;"Oracle Flashback Technology: Overview"&lt;/a&gt;&lt;a href="http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10734/rcmflash.htm#1011396"&gt;&lt;/a&gt; for more details about these alternatives before deciding whether to use DBPITR.&lt;a name="1011570"&gt;&lt;/a&gt;&lt;br /&gt;DBPITR requires restoring your database from an older backup, then performing media recovery until your specified target time, SCN or log sequence number. Note that because you need your archived redo log files to perform this process, you cannot perform database point-in-time recovery if you have been running your database in NOARCHIVELOG mode.&lt;a name="1011430"&gt;&lt;/a&gt;&lt;br /&gt;After database point-in-time recovery, you must open the database with the RESETLOGS option. Using the RESETLOGS option archives the current online redo logs, resets the log sequence to 1, and then gives the online redo logs a new time stamp and SCN. In this way, the database eliminates the possibility of corrupting datafiles by the application of obsolete archived redo logs.&lt;a name="1011183"&gt;&lt;/a&gt;&lt;br /&gt;You have to recover all datafiles: you cannot recover some datafiles before the RESETLOGS and others after the RESETLOGS.&lt;a name="1011188"&gt;&lt;/a&gt;&lt;br /&gt;The OPEN RESETLOGS operation will fail if a datafile is off-line, unless the datafile went offline normally or is read-only. You can bring files in read-only or offline normal tablespaces online after the RESETLOGS because they do not need any redo.&lt;a name="1006153"&gt;&lt;/a&gt;&lt;br /&gt;When performing DBPITR, consider using the SET UNTIL command to set the target time at the beginning of the process, rather than specifying the UNTIL clause on the RESTORE and RECOVER commands individually. SET UNTIL sets the desired time for any subsequent RESTORE, SWITCH, and RECOVER commands in the same RUN job.&lt;a name="1011195"&gt;&lt;/a&gt;&lt;br /&gt;Note that if you specify a SET UNTIL command after a RESTORE and before a RECOVER, you may not be able to recover the database to the point in time required because the restored files may already have time stamps more recent than the set time. Hence, it is recommended that you specify the SET UNTIL command before the RESTORE command.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-5366109014218707876?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/5366109014218707876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/performing-database-point-in-time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/5366109014218707876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/5366109014218707876'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/performing-database-point-in-time.html' title='Performing Database Point-In-Time Recovery'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-4039942610186124601</id><published>2009-09-24T20:03:00.001-07:00</published><updated>2009-09-24T20:03:27.971-07:00</updated><title type='text'>To recover the database with a backup control file and a recovery catalog:</title><content type='html'>After connecting to the target database and recovery catalog database, start the instance without mounting the database: &lt;a name="1007299"&gt;&lt;/a&gt;STARTUP NOMOUNT&lt;br /&gt;&lt;a name="1010304"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1009914"&gt;&lt;/a&gt;Restore the backup control file, then restore and recover the database. Do the following:&lt;br /&gt;&lt;a name="1007302"&gt;&lt;/a&gt;Run the RESTORE CONTROLFILE command to restore the control file to all default locations specified in the CONTROL_FILES initialization parameter. To restore a control file from an older backup, you can run SET UNTIL or specify the UNTIL clause on the RESTORE CONTROLFILE command.&lt;br /&gt;&lt;a name="1007303"&gt;&lt;/a&gt;Mount the database using the restored control file.&lt;br /&gt;&lt;a name="1008930"&gt;&lt;/a&gt;Optionally, run a SET UNTIL command for incomplete recovery. Note that you can also specify the UNTIL clause on the RESTORE and RECOVER commands.&lt;br /&gt;&lt;a name="1007304"&gt;&lt;/a&gt;Restore and recover the database as described in &lt;a href="http://download.oracle.com/docs/cd/B10501_01/server.920/a96566/rcmrecov.htm#1014957"&gt;"Performing Basic RMAN Media Recovery"&lt;/a&gt;&lt;a href="http://download.oracle.com/docs/cd/B10501_01/server.920/a96566/rcmrecov.htm#1014957"&gt;&lt;/a&gt;. &lt;a name="1007305"&gt;&lt;/a&gt;&lt;br /&gt;This example restores the control file to its default location, then restores and completely recovers the database:&lt;a name="1007306"&gt;&lt;/a&gt;RESTORE CONTROLFILE;&lt;br /&gt;&lt;a name="1007307"&gt;&lt;/a&gt;ALTER DATABASE MOUNT;&lt;br /&gt;&lt;a name="1007308"&gt;&lt;/a&gt;RESTORE DATABASE;&lt;br /&gt;&lt;a name="1007309"&gt;&lt;/a&gt;RECOVER DATABASE;&lt;br /&gt;&lt;a name="1007310"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1007311"&gt;&lt;/a&gt;If recovery was successful, then open the database and reset the online logs: &lt;a name="1007312"&gt;&lt;/a&gt;ALTER DATABASE OPEN RESETLOGS;&lt;br /&gt;&lt;a name="1007313"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1007314"&gt;&lt;/a&gt;If the database uses locally-managed temporary tablespaces, then add new tempfiles to these tablespaces. For example: &lt;a name="1012957"&gt;&lt;/a&gt;SQL "ALTER TABLESPACE temp ADD TEMPFILE ''?/oradata/trgt/temp01.dbf'' REUSE";&lt;br /&gt;&lt;a name="1012958"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1012956"&gt;&lt;/a&gt;It is recommended that you immediately back up the database, preferably with the database mounted (to avoid possible data loss in an open database). Because the database is a new incarnation, the backups made prior to the RESETLOGS are not easily usable. For example, run the following to back up the database: &lt;a name="1007315"&gt;&lt;/a&gt;SHUTDOWN IMMEDIATE&lt;br /&gt;&lt;a name="1007316"&gt;&lt;/a&gt;STARTUP MOUNT&lt;br /&gt;&lt;a name="1007317"&gt;&lt;/a&gt;BACKUP DATABASE;&lt;br /&gt;&lt;a name="1007318"&gt;&lt;/a&gt;ALTER DATABASE OPEN;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-4039942610186124601?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/4039942610186124601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/to-recover-database-with-backup-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/4039942610186124601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/4039942610186124601'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/to-recover-database-with-backup-control.html' title='To recover the database with a backup control file and a recovery catalog:'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-4367179087977612776</id><published>2009-09-24T19:59:00.001-07:00</published><updated>2009-09-24T19:59:42.508-07:00</updated><title type='text'>To recover the database with an autobackup of the control file without a recovery catalog:</title><content type='html'>&lt;a name="1007324"&gt;&lt;/a&gt;Start RMAN and connect to the target database. For example, run: &lt;a name="1007325"&gt;&lt;/a&gt;CONNECT TARGET /&lt;br /&gt;&lt;a name="1009769"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1009763"&gt;&lt;/a&gt;Start the target instance without mounting the database. For example: &lt;a name="1014374"&gt;&lt;/a&gt;STARTUP NOMOUNT;&lt;br /&gt;&lt;a name="1014375"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1014373"&gt;&lt;/a&gt;Set the database identifier for the target database with SET DBID. RMAN displays the DBID whenever you connect to the target. You can also obtain it by running LIST, querying the catalog, or looking at the filenames of control file autobackup. (refer to &lt;a href="http://download.oracle.com/docs/cd/B10501_01/server.920/a96566/rcmrecov.htm#1008229"&gt;"Restoring When Multiple Databases in the Catalog Share the Same Name: Example"&lt;/a&gt;&lt;a href="http://download.oracle.com/docs/cd/B10501_01/server.920/a96566/rcmrecov.htm#1008229"&gt;&lt;/a&gt;). For example, run: &lt;a name="1009832"&gt;&lt;/a&gt;SET DBID 676549873;&lt;br /&gt;&lt;a name="1009833"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1009834"&gt;&lt;/a&gt;Restore the autobackup control file, then perform recovery. Do the following:&lt;br /&gt;&lt;a name="1007328"&gt;&lt;/a&gt;Optionally, specify the most recent backup time stamp that RMAN can use when searching for a control file autobackup to restore.&lt;br /&gt;&lt;a name="1007330"&gt;&lt;/a&gt;If a nondefault format was used to create the control file, then specify a nondefault format for the restore of the control file.&lt;br /&gt;&lt;a name="1007331"&gt;&lt;/a&gt;If the channel that created the control file autobackup was device type sbt, then you must allocate one or more sbt channels. Because no repository is available, you cannot use automatic channels. If the autobackup was created on a disk channel, however, then you do not need to manually allocate a channel.&lt;br /&gt;&lt;a name="1007332"&gt;&lt;/a&gt;Restore the autobackup of the control file, optionally setting the maximum number of days backward that RMAN can search (up to 366) and the initial sequence number that it should use in its search for the first day.&lt;br /&gt;&lt;a name="1007333"&gt;&lt;/a&gt;Mount the database. Note that because the repository is now available, any automatic channels that you configured are also available.&lt;br /&gt;&lt;a name="1007334"&gt;&lt;/a&gt;If the online logs are inaccessible, then restore and recover the database as described in &lt;a href="http://download.oracle.com/docs/cd/B10501_01/server.920/a96566/rcmrecov.htm#1008597"&gt;"Performing Incomplete Restore and Recovery"&lt;/a&gt;&lt;a href="http://download.oracle.com/docs/cd/B10501_01/server.920/a96566/rcmrecov.htm#1008597"&gt;&lt;/a&gt;. You must terminate recovery by setting the UNTIL clause to a time, log sequence, or SCN before the online redo logs. If the online logs are usable, then restore and recover the database as described in &lt;a href="http://download.oracle.com/docs/cd/B10501_01/server.920/a96566/rcmrecov.htm#1008603"&gt;"Performing Complete Restore and Recovery"&lt;/a&gt;&lt;a href="http://download.oracle.com/docs/cd/B10501_01/server.920/a96566/rcmrecov.htm#1008597"&gt;&lt;/a&gt;. &lt;a name="1007335"&gt;&lt;/a&gt;&lt;br /&gt;In this example, the online redo logs have been lost. This example limits the restore of the control file autobackup, then performs recovery of the database to log sequence 13243, which is the most recent archived log:&lt;a name="1007338"&gt;&lt;/a&gt;RUN&lt;br /&gt;&lt;a name="1010569"&gt;&lt;/a&gt;{&lt;br /&gt;&lt;a name="1007339"&gt;&lt;/a&gt;# Optionally, set upper limit for eligible time stamps of control file backups&lt;br /&gt;&lt;a name="1007340"&gt;&lt;/a&gt;# SET UNTIL TIME '09/10/2000 13:45:00';&lt;br /&gt;&lt;a name="1007341"&gt;&lt;/a&gt;# Specify a nondefault autobackup format only if required&lt;br /&gt;&lt;a name="1009581"&gt;&lt;/a&gt;# SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '?/oradata/%F.bck';&lt;br /&gt;&lt;a name="1009582"&gt;&lt;/a&gt;ALLOCATE CHANNEL c1 DEVICE TYPE sbt; # manually allocate one or more channels&lt;br /&gt;&lt;a name="1009583"&gt;&lt;/a&gt;RESTORE CONTROLFILE FROM AUTOBACKUP&lt;br /&gt;&lt;a name="1007344"&gt;&lt;/a&gt;MAXSEQ 100 # start at sequence 100 and count down&lt;br /&gt;&lt;a name="1007345"&gt;&lt;/a&gt;MAXDAYS 180; # start at UNTIL TIME and search back 6 months&lt;br /&gt;&lt;a name="1007346"&gt;&lt;/a&gt;ALTER DATABASE MOUNT DATABASE;&lt;br /&gt;&lt;a name="1008935"&gt;&lt;/a&gt;}&lt;br /&gt;&lt;a name="1009980"&gt;&lt;/a&gt;# uses automatic channels configured in restored control file&lt;br /&gt;&lt;a name="1007347"&gt;&lt;/a&gt;RESTORE DATABASE UNTIL SEQUENCE 13243;&lt;br /&gt;&lt;a name="1009987"&gt;&lt;/a&gt;RECOVER DATABASE UNTIL SEQUENCE 13243; # recovers to most recent archived log&lt;br /&gt;&lt;a name="1007350"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1007351"&gt;&lt;/a&gt;If recovery was successful, then open the database and reset the online logs: &lt;a name="1007352"&gt;&lt;/a&gt;ALTER DATABASE OPEN RESETLOGS;&lt;br /&gt;&lt;a name="1007353"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="1007354"&gt;&lt;/a&gt;It is recommended that you immediately back up the database, preferably with the database mounted (to avoid possible data loss in an open database). Because the database is a new incarnation, the backups made before the RESETLOGS are not easily usable. For example, enter: &lt;a name="1007355"&gt;&lt;/a&gt;SHUTDOWN IMMEDIATE&lt;br /&gt;&lt;a name="1007356"&gt;&lt;/a&gt;STARTUP MOUNT&lt;br /&gt;&lt;a name="1007357"&gt;&lt;/a&gt;BACKUP DATABASE;&lt;br /&gt;&lt;a name="1007358"&gt;&lt;/a&gt;ALTER DATABASE OPEN;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-4367179087977612776?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/4367179087977612776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/to-recover-database-with-autobackup-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/4367179087977612776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/4367179087977612776'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/to-recover-database-with-autobackup-of.html' title='To recover the database with an autobackup of the control file without a recovery catalog:'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-372058530564067246</id><published>2009-09-24T19:15:00.000-07:00</published><updated>2009-09-24T19:16:43.819-07:00</updated><title type='text'>Oracle Database Block corruption</title><content type='html'>Oracle Database Block corruption“Block corruption is rare but it does happen. As databases get larger and larger – the probability of it happening at some point nears 100%.”--Mr. Tom Kyte Oracle ExpertBlock corruption is while the data is being written to the data blocks, if the write to the block fails abruptly, I mean that there is a partial write in the block, may be because of power disruption or I/O problem, leaving no time for header to be updated, or row data to be populated, oracle leaves the block corrupt.In case of block corruption you can normally use the database unless you try to read that particular block, against which it shoots up the block corruption error.Generally block corruption occurs if write fails on the block, when the transaction is being committedORA-01578:ORACLE data block corrupted (file # string, block # string)Whenever we encounter above error message mean we have BLOCK CORRUPTION.NOTE: We can find detail information about block corruption in alert.log fileTwo types of block corruption can happens- Physical corruption (media corrupt)- Logical corruption (soft corrupt)Physical corruption can be caused by defected memory boards, controllers or broken sectors on a hard disk;Logical corruption can among other reasons be caused by an attempt to recover through a NOLOGGING action.Difference between logical and physical corruption Logical corruption is header - footer - that is one of the checks, yes (it is looking for fractured blocks and when it hits one, it'll re-read it, that is why there is no need for "alter tablespace begin backup" with rman) Physical corruption is "we cannot read the block from disk, something is physically preventing us from doing so”.How to detect block corruption?1. DBVERIFY utilityDBVERIFY is an external command-line utility that performs a physical &lt;a href="http://dbataj.blogspot.com/2007/04/offline-database-verification-utility.html" target="_top"&gt;data structure&lt;/a&gt; integrity check. It can be used on offline or online databases, as well on &lt;a href="http://dbataj.blogspot.com/2007/04/offline-database-verification-utility.html" target="_top"&gt;backup files&lt;/a&gt;. You use DBVERIFY primarily when you need to ensure that a backup database (or datafile) is valid before it is restored.&lt;a href="http://dbataj.blogspot.com/2007/04/offline-database-verification-utility.html"&gt;http://dbataj.blogspot.com/2007/04/offline-database-verification-utility.html&lt;/a&gt;2. Block checking parametersThere are two initialization parameters for dealing with block corruption:- DB_BOCK_CHECKSUM (calculates a checksum for each block before it is written to disk, every time)causes 1-2% performance overhead- DB_BLOCK_CHECKING (serverprocess checks block for internal consistency after every DML)causes 1-10% performance overheadNote: In10g db_block_checksum value TYPICAL is implying TRUE and db_block_checking value FULL implying TRUE.DB_BLOCK_CHECKING Initialization Parameter&lt;a href="http://www.blogger.com/DB_BLOCK_CHECKING%20Initialization%20Parameter"&gt;http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/repair.htm#sthref3176&lt;/a&gt;3. ANALYZE TABLE tablename VALIDATE STRUCTURE CASCADE SQL statementValidate the structure of an index or index partition, table or table partition, index-organized table, cluster, or object reference (REF).ANALYZE: Reporting Corruption&lt;a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/repair.htm#sthref3173"&gt;http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/repair.htm#sthref3173&lt;/a&gt;4. RMAN BACKUP command with THE VALIDATE optionYou can use the VALIDATE option of the BACKUP command to verify that database files exist and are in the correct locations, and have no physical or logical corruptions that would prevent RMAN from creating backups of them. When performing a BACKUP... VALIDATE, RMAN reads the files to be backed up in their entirety, as it would during a real backup. It does not, however, actually produce any backup sets or image copies.Detection of Logical Block Corruption&lt;a name="sthref364"&gt;&lt;/a&gt;&lt;a name="sthref365"&gt;&lt;/a&gt;&lt;a name="sthref366"&gt;&lt;/a&gt;Besides testing for media corruption, the database can also test data and index blocks for logical corruption, such as corruption of a row piece or index entry. If RMAN finds logical corruption, then it logs the block in the alert.log. If CHECK LOGICAL was used, the block is also logged in the server session trace file. By default, error checking for logical corruption is disabled.For BACKUP commands the MAXCORRUPT parameter sets the total number of physical and logical corruptions permitted in a file. If the sum of physical and logical corruptions for a file is less than its MAXCORRUPT setting, the RMAN command completes successfully. If MAXCORRUPT is exceeded, the command terminates and RMAN does not read the rest of the file. V$DATABASE_BLOCK_CORRUPTION is populated with corrupt block ranges if the command succeeds. Otherwise, you must set MAXCORRUPT higher and re-run the backup to find out the corrupt block ranges.RMAN found any block corruption in database then following Data Dictionary view populated.V$COPY_CORRUPTIONV$BACKUP_CORRUPTIONV$DATABASE_BLOCK_CORRUPTIONUsing RMAN to Validate Database Files&lt;a href="http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/bkup005.htm#i1006673"&gt;http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/bkup005.htm#i1006673&lt;/a&gt;5. EXPORT/IMPORT command line utilityFull database EXPORT/IMPORT show=y is another method.. about to export SCOTT's tables via Conventional Path .... . exporting table BONUSEXP-00056: ORACLE error 1578 encounteredORA-01578: ORACLE data block corrupted (file # 4, block # 43)ORA-01110: data file 4: 'C:\ORA10GHOME\ORADATA\ORCL10G\USERS01.DBF'6. DBMS_REPAIR packagedbms_repair is a utility that can detect and repair block corruption within Oracle. It is provided by Oracle as part of the standard database installation.&lt;a href="http://www.oracleutilities.com/Packages/dbms_repair.html"&gt;http://www.oracleutilities.com/Packages/dbms_repair.html&lt;/a&gt;How to Repair &amp;amp; Fix block corruption?We can recover everything but we have valid database backup.Whenever we found block corruption then first need to find out which type of block corruption occurred because block corruption recovery depends on block corruption type.Like Corrupted block related to TABLE segment, INDEX segment, TABLE PARTITION segment, INDEX PARTITION segment, ROLLBACK segment, LOB segment.Through below query we can find out corrupted block typeselect segment_type,owner'.'segment_namefrom dba_extentswhere file_id = [&amp;amp;file_id] and [&amp;amp;block] between block_id and block_id+blocks -1; Below is example with RMAN BLOCK MEDIA RECOVERY. SQL&gt; conn scott/tigerConnected.SQL&gt; select * from test;select * from test *ERROR at line 1:ORA-01578: ORACLE data block corrupted (file # 5, block # 11)ORA-01110: data file 5: 'C:\INDEXDATA01.DBF'First check which type of block corruption happened through above mentioned query. RMAN&gt; blockrecover datafile 5 block 11; Starting recover at 29-APR-08using channel ORA_DISK_1 starting media recoverymedia recovery complete, elapsed time: 00:00:00 Finished recover at 29-APR-08If you are not using rman then applying below procedure- if it is index then drop and recreate index- if it is table and you have backup of that table then restore backup on another database and exp/imp the table.&lt;br /&gt;Same Reference:&lt;a href="http://sysdba.wordpress.com/2006/04/05/how-to-check-for-and-repair-block-corruption-with-rman-in-oracle-9i-and-oracle-10g/"&gt;http://sysdba.wordpress.com/2006/04/05/how-to-check-for-and-repair-block-corruption-with-rman-in-oracle-9i-and-oracle-10g/&lt;/a&gt;&lt;a href="https://metalink.oracle.com/metalink/plsql/f?p=130:14:9078646664761954784::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,28814.1,1,1,1,helvetica"&gt;NOTE: Find more information “Handling Oracle Block Corruptions in Oracle7/8/8i/9i/10g” Metalink Note: 28814.1&lt;/a&gt;How to corrupt database block for practice purpose?On Unix:Use dd command$man ddOn Windows:Use Editor and open datafile write some junk character at middle of file and save it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-372058530564067246?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/372058530564067246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/09/oracle-database-block-corruption.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/372058530564067246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/372058530564067246'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/09/oracle-database-block-corruption.html' title='Oracle Database Block corruption'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-1936072330279872585</id><published>2009-07-10T01:40:00.001-07:00</published><updated>2009-09-24T23:53:59.662-07:00</updated><title type='text'>Undo Block Corruption</title><content type='html'>Alert Log&lt;br /&gt;========&lt;br /&gt;&lt;strong&gt;Tue Jul 7 20:11:04 2009 #Database Crashed Time&lt;/strong&gt;&lt;br /&gt;Errors in file&lt;strong&gt; /opt/oracle/admin/LM_PROD/udump/lm_prod_ora_9948.trc:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;ORA-01578:&lt;/strong&gt; ORACLE data block corrupted &lt;strong&gt;(file # 92, block # 121)&lt;br /&gt;ORA-01110:&lt;/strong&gt; data file 92: '/wamu/lms/db/LM_PROD/d601/LM_PRODundotbs_01.dbf'&lt;br /&gt;Tue Jul 7 20:11:25 2009&lt;br /&gt;&lt;strong&gt;Error 1578 happened during db open, shutting down databaseScenario&lt;/strong&gt;&lt;br /&gt;Abnormal terminating of instance occurred in our production server on Tue Jul 7 20:11:04 2009 due to the Undo block corruption which occurred in the filesystem `/wamu/lms/db/LM_PROD/d601/LM_PRODundotbs_01.dbf ` . We were unable to open up the database. The database is running in archive log mode and the RMAN hot backup was taken at Tue Jul 7 00:30:03 PDT 2009. The current log sequence # 26300&lt;br /&gt;&lt;br /&gt;Step 1&lt;br /&gt;&lt;br /&gt;To do Media Recovery&lt;br /&gt;&lt;br /&gt;SQL&gt; recover databaseMedia recovery complete.SQL&gt; alter database open;alter database open*ERROR at line 1:ORA-01092: ORACLE instance terminated. Disconnection forcedWe found there was a fractured block error on the Undo block while doing crash recovery. The block was fractured which means the head and tail portion of the block had issues, normally occurs due to missed writes from OS crash&lt;br /&gt;Step 2&lt;br /&gt;To find number of corrupt block&lt;br /&gt;&lt;br /&gt;$ dbv file=/wamu/lms/db/LM_PROD/d601/LM_PRODundotbs_01.dbf blocksize=8192DBVERIFY: Release 10.2.0.3.0 - Production on Tue Jul 7 22:35:26 2009Copyright (c) 1982, 2005, Oracle. All rights reserved.DBVERIFY - Verification starting : FILE = /wamu/lms/db/LM_PROD/d601/LM_PRODundotbs_01.dbfDBV-00200: Block, dba 385876089, already marked corruptedDBVERIFY - Verification completeTotal Pages Examined : 512000Total Pages Processed (Data) : 0Total Pages Failing (Data) : 0Total Pages Processed (Index): 0Total Pages Failing (Index): 0Total Pages Processed (Other): 512000Total Pages Processed (Seg) : 0Total Pages Failing (Seg) : 0Total Pages Empty : 0Total Pages Marked Corrupt : 1Total Pages Influx : 0Highest block SCN : 2640445773 (34.2640445773)[LM_PROD: /wamu/lms/db/LM_PROD/d601]oracle@dbsu01r ]&lt;br /&gt;Result&lt;br /&gt;We found 1 block has been corrupted in the filesystem `/wamu/lms/db/LM_PROD/d601/LM_PRODundotbs_01.dbf ` .&lt;br /&gt;Step 3&lt;br /&gt;&lt;br /&gt;To list backup of datafile 92&lt;br /&gt;&lt;br /&gt;$ rmanRecovery Manager: Release 10.2.0.3.0 - Production on Tue Jul 7 22:57:11 2009Copyright (c) 1982, 2005, Oracle. All rights reserved.RMAN&gt; connect target /connected to target database: LM_PROD (DBID=1610502646, not open)RMAN&gt; list backup of datafile 92;using target database control file instead of recovery catalogList of Backup Sets===================BS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------60639 Incr 0 3.73G DISK 00:02:04 07-JUL-09 BP Key: 60639 Status: AVAILABLE Compressed: NO Tag: HOT_DB_BK_LEVEL0Piece Name: /wamu/lms/db/LM_PROD/orabkp/rman/hot_bkplvl0_LM_PROD_60692_1_691547487List of Datafiles in backup set 60639File LV Type Ckp SCN Ckp Time Name---- -- ---- ---------- --------- ----92 0 Incr 148661915022 07-JUL-09 /wamu/lms/db/LM_PROD/d601/LM_PRODundotbs_01.dbf&lt;br /&gt;Step 4&lt;br /&gt;&lt;br /&gt;To do RMAN Block recovery for corrupt Undo Blocks&lt;br /&gt;RMAN&gt; blockrecover datafile 92 block 121;Starting blockrecover at 07-JUL-09allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=542 devtype=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: sid=1100 devtype=DISKallocated channel: ORA_DISK_3channel ORA_DISK_3: sid=541 devtype=DISKallocated channel: ORA_DISK_4channel ORA_DISK_4: sid=1099 devtype=DISKchannel ORA_DISK_1: restoring block(s)channel ORA_DISK_1: specifying block(s) to restore from backup setrestoring blocks of datafile 00092channel ORA_DISK_1: reading from backup piece "/wamu/lms/db/LM_PROD/orabkp/rman/hot_bkplvl0_LM_PROD_60692_1_691547487"ORA-27037: unable to obtain file statusSVR4 Error: 2: No such file or directoryAdditional information: 3failover to previous backupRMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of blockrecover command at 07/07/2009 22:59:24RMAN-06026: some targets not found - aborting restoreRMAN-06023: no backup or copy of datafile 92 found to restore&lt;br /&gt;Block recovery failed indicating no backup of datafile 92 found.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 5&lt;br /&gt;&lt;br /&gt;To Bring Datafile 92 offline&lt;br /&gt;&lt;br /&gt;$ sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.3.0 - Production on Tue Jul 7 22:56:39 2009Copyright (c) 1982, 2006, Oracle. All Rights Reserved.Connected to an idle instance.SQL&gt; startup mountORACLE instance started.Total System Global Area 6878658560 bytesFixed Size 2138752 bytesVariable Size 4060175744 bytesDatabase Buffers 2751463424 bytesRedo Buffers 64880640 bytesDatabase mounted.SQL&gt; alter database datafile 92 offline;Database altered.&lt;br /&gt;Step 6&lt;br /&gt;&lt;br /&gt;To Rename Undo Datafile&lt;br /&gt;$ mv LM_PRODundotbs_01.dbf LM_PRODundotbs_01.dbf_old[LM_PROD: /wamu/lms/db/LM_PROD/d601]oracle@dbsu01r ]$ ls -ltrtotal 8806496drwxr-xr-x 2 oracle dba 96 Aug 2 2007 lost+found-rw-r----- 1 oracle dba 4194312192 Jul 7 20:47 LM_PRODundotbs_01.dbf_old[LM_PROD: /wamu/lms/db/LM_PROD/d601]oracle@dbsu01r ]&lt;br /&gt;We have restored datafile 92 from the RMAN Backup on Tue Jul 7 00:30:03 PDT 2009&lt;br /&gt;Step 7&lt;br /&gt;&lt;br /&gt;To restore Datafile 92&lt;br /&gt;RMAN&gt; restore datafile 92;Finished restore at 07-JUL-09&lt;br /&gt;$ ls -ltrtotal 8806496drwxr-xr-x 2 oracle dba 96 Aug 2 2007 lost+found-rw-r----- 1 oracle dba 4194312192 Jul 7 20:47 LM_PRODundotbs_01.dbf_old-rw-r----- 1 oracle dba 4194312192 Jul 7 23:02 LM_PRODundotbs_01.dbf[LM_PROD: /wamu/lms/db/LM_PROD/d601]&lt;br /&gt;Step 8&lt;br /&gt;&lt;br /&gt;To recover Datafile 92&lt;br /&gt;SQL&gt; recover datafile 92;SQL&gt;Alter database open ;&lt;br /&gt;&lt;br /&gt;SQL&gt;Alter database datafile 92 online ;&lt;br /&gt;&lt;br /&gt;SQL&gt;archive log list&lt;br /&gt;&lt;br /&gt;SQL&gt;Alter system switch logfile;&lt;br /&gt;&lt;br /&gt;SQL&gt;archive log list&lt;br /&gt;Database log mode Archive ModeAutomatic archival EnabledArchive destination /wamu/lms/db/LM_PROD/d802/archOldest online log sequence 26303Next log sequence to archive 26305Current log sequence 26305&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$logfile;SQL&gt; select * from v$log;SQL&gt; select * from v$recover_file;SQL&gt; select checkpoint_change# from v$datafile_header where file#=92;CHECKPOINT_CHANGE#------------------178822645DBVERIFY came out with no corrupt blocks&lt;br /&gt;&lt;br /&gt;$ dbv file=/wamu/lms/db/LM_PROD/d601/LM_PRODundotbs_01.dbf blocksize=8192DBVERIFY: Release 10.2.0.3.0 - Production on Tue Jul 7 22:35:26 2009Copyright (c) 1982, 2005, Oracle. All rights reserved.DBVERIFY - Verification starting : FILE = /wamu/lms/db/LM_PROD/d601/LM_PRODundotbs_01.dbfDBV-00200: Block, dba 385876089, already marked corruptedDBVERIFY - Verification completeTotal Pages Examined : 512000Total Pages Processed (Data) : 0Total Pages Failing (Data) : 0Total Pages Processed (Index): 0Total Pages Failing (Index): 0Total Pages Processed (Other): 512000Total Pages Processed (Seg) : 0Total Pages Failing (Seg) : 0Total Pages Empty : 0Total Pages Marked Corrupt : 0&lt;br /&gt;Total Pages Influx : 0Highest block SCN : 2640445773 (34.2640445773)[LM_PROD: /wamu/lms/db/LM_PROD/d601]oracle@dbsu01r ]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-1936072330279872585?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/1936072330279872585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/07/undo-block-corruption.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/1936072330279872585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/1936072330279872585'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/07/undo-block-corruption.html' title='Undo Block Corruption'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-7376446072276256197</id><published>2009-07-09T01:39:00.000-07:00</published><updated>2009-09-24T22:28:02.824-07:00</updated><title type='text'>UNDO TABLESPACE CORRUPTION</title><content type='html'>&lt;div&gt;&lt;br /&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-7376446072276256197?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/7376446072276256197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/07/undo-tablespace-corruption.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/7376446072276256197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/7376446072276256197'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/07/undo-tablespace-corruption.html' title='UNDO TABLESPACE CORRUPTION'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-483829431689063143</id><published>2009-05-25T11:34:00.001-07:00</published><updated>2009-05-25T11:34:45.988-07:00</updated><title type='text'>To find total size of the database</title><content type='html'>clear breaks clear computes clear columns set pagesize 50 set linesize 120 set heading on column tablespace_name heading 'Tablespace' justify left format a20 truncated column tbsize heading 'Size(Mb) ' justify left format 9,999,999.99 column tbused heading 'Used(Mb) ' justify right format 9,999,999.99 column tbfree heading 'Free(Mb) ' justify right format 9,999,999.99 column tbusedpct heading 'Used % ' justify left format a8 column tbfreepct heading 'Free % ' justify left format a8 break on report compute sum label 'Totals:' of tbsize tbused tbfree on report select t.tablespace_name, round(a.bytes,2) tbsize, nvl(round(c.bytes,2),'0') tbfree, nvl(round(b.bytes,2),'0') tbused, to_char(round(100 * (nvl(b.bytes,0)/nvl(a.bytes,1)),2))  '%' tbusedpct, to_char(round(100 * (nvl(c.bytes,0)/nvl(a.bytes,1)),2))  '%' tbfreepct from dba_tablespaces t, (select tablespace_name, round(sum(bytes)/1024/1024,2) bytes from dba_data_files group by tablespace_name union select tablespace_name, round(sum(bytes)/1024/1024,2) bytes from dba_temp_files group by tablespace_name ) a, (select e.tablespace_name, round(sum(e.bytes)/1024/1024,2) bytes from dba_segments e group by e.tablespace_name union select tablespace_name, sum(max_size) bytes from v$sort_segment group by tablespace_name) b, (select f.tablespace_name, round(sum(f.bytes)/1024/1024,2) bytes from dba_free_space f group by f.tablespace_name union select tmp.tablespace_name,  (sum(bytes/1024/1024) - sum(max_size)) bytes from dba_temp_files tmp, v$sort_segment sort where tmp.tablespace_name = sort.tablespace_name group by tmp.tablespace_name) c where t.tablespace_name = a.tablespace_name (+) and t.tablespace_name = b.tablespace_name (+) and t.tablespace_name = c.tablespace_name (+) order by t.tablespace_name /&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-483829431689063143?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/483829431689063143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/05/to-find-total-size-of-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/483829431689063143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/483829431689063143'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/05/to-find-total-size-of-database.html' title='To find total size of the database'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-232662293242136567</id><published>2009-05-20T01:05:00.002-07:00</published><updated>2009-05-20T01:06:06.306-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='The simplest query for checking what’s happening in a database'/><title type='text'>The simplest query for checking what’s happening in a database</title><content type='html'>select event, state, count(*) from v$session_wait group by event, state order by 3 desc;SQL&gt; select sql_hash_value, count(*) from v$sessionwhere status = 'ACTIVE' group by sql_hash_value order by 2 desc;select sql_text,users_executing from v$sql where hash_value = &amp;amp;hash_value;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-232662293242136567?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/232662293242136567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/05/simplest-query-for-checking-whats.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/232662293242136567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/232662293242136567'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/05/simplest-query-for-checking-whats.html' title='The simplest query for checking what’s happening in a database'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-3583154758204450657</id><published>2009-05-20T01:05:00.001-07:00</published><updated>2009-05-20T01:05:28.757-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Starting Up with a Non-Default Server Parameter File'/><title type='text'>Starting Up with a Non-Default Server Parameter File</title><content type='html'>Create a one-line text initialization parameter file that contains only the SPFILEparameter. The value of the parameter is the non-default server parameter filelocation.For example, create a text initialization parameter file/u01/oracle/dbs/spf_init.ora that contains only the following parameter:SPFILE = /u01/oracle/dbs/test_spfile.oraSTARTUP PFILE = /u01/oracle/dbs/spf_init.ora&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-3583154758204450657?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/3583154758204450657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/05/starting-up-with-non-default-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/3583154758204450657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/3583154758204450657'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/05/starting-up-with-non-default-server.html' title='Starting Up with a Non-Default Server Parameter File'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-7520888949497410414</id><published>2009-05-20T01:04:00.002-07:00</published><updated>2009-05-20T01:05:06.779-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How to backup the archivelogs which are not backed up already'/><title type='text'>How to backup the archivelogs which are not backed up already</title><content type='html'>rman &gt; BACKUP ARCHIVELOG UNTIL TIME 'SYSDATE' NOT BACKED up;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-7520888949497410414?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/7520888949497410414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/05/how-to-backup-archivelogs-which-are-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/7520888949497410414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/7520888949497410414'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/05/how-to-backup-archivelogs-which-are-not.html' title='How to backup the archivelogs which are not backed up already'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-3750418708185082394</id><published>2009-05-20T01:04:00.001-07:00</published><updated>2009-05-20T01:04:38.826-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Migrating to Automatic Undo Management'/><title type='text'>Migrating to Automatic Undo Management</title><content type='html'>DECLAREutbsiz_in_MB NUMBER;BEGINutbsiz_in_MB := DBMS_UNDO_ADV.RBU_MIGRATION;end;/The function returns the sizing information directly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-3750418708185082394?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/3750418708185082394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/05/migrating-to-automatic-undo-management.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/3750418708185082394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/3750418708185082394'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/05/migrating-to-automatic-undo-management.html' title='Migrating to Automatic Undo Management'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-5944871574464582019</id><published>2009-05-20T01:03:00.002-07:00</published><updated>2009-05-20T01:04:15.652-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Create Schema stmt'/><title type='text'>Create Schema stmt</title><content type='html'>Example: CREATE SCHEMA AUTHORIZATION scottCREATE TABLE dept (deptno NUMBER(3,0) PRIMARY KEY,dname VARCHAR2(15),loc VARCHAR2(25))CREATE TABLE emp (empno NUMBER(5,0) PRIMARY KEY,ename VARCHAR2(15) NOT NULL,job VARCHAR2(10),13-2 Oracle Database Administrator’s Guidemgr NUMBER(5,0),hiredate DATE DEFAULT (sysdate),sal NUMBER(7,2),comm NUMBER(7,2),deptno NUMBER(3,0) NOT NULLCONSTRAINT dept_fkey REFERENCES dept)CREATE VIEW sales_staff ASSELECT empno, ename, sal, commFROM empWHERE deptno = 30WITH CHECK OPTION CONSTRAINT sales_staff_cnstGRANT SELECT ON sales_staff TO human_resources;Specifically, the CREATE SCHEMA statement can include only CREATE TABLE,CREATE VIEW, and GRANT statements&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-5944871574464582019?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/5944871574464582019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/05/create-schema-stmt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/5944871574464582019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/5944871574464582019'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/05/create-schema-stmt.html' title='Create Schema stmt'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-7937178722689027357</id><published>2009-05-20T01:03:00.001-07:00</published><updated>2009-05-20T01:03:43.388-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Disabling the Recyclebin at session level and system level'/><title type='text'>Disabling the Recyclebin at session level and system level</title><content type='html'>alter session set recyclebin = off;&lt;br /&gt;alter system set recyclebin = off&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-7937178722689027357?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/7937178722689027357/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/05/disabling-recyclebin-at-session-level.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/7937178722689027357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/7937178722689027357'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/05/disabling-recyclebin-at-session-level.html' title='Disabling the Recyclebin at session level and system level'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-3233418887230947887</id><published>2009-05-20T01:02:00.000-07:00</published><updated>2009-05-20T01:03:12.102-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='how to know whether 32-bit or 64-bit oracle s/w installed'/><title type='text'>how to know whether 32-bit or 64-bit oracle s/w installed</title><content type='html'>select * from v$version;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-3233418887230947887?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/3233418887230947887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/05/how-to-know-whether-32-bit-or-64-bit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/3233418887230947887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/3233418887230947887'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/05/how-to-know-whether-32-bit-or-64-bit.html' title='how to know whether 32-bit or 64-bit oracle s/w installed'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-4920008272718092258</id><published>2009-05-20T01:01:00.004-07:00</published><updated>2009-05-20T01:02:37.063-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='max_enabled_roles error in all the versions including 10.2.0.3'/><title type='text'>max_enabled_roles error in all the versions including 10.2.0.3</title><content type='html'>Today I got a mail from one of the end user that he is not able to login and he is getting the ORA-28031 error while logging.As the parameter is already set to 150 and we can not increase anymore. After doing a little search I came to know that this is a bug and resolved in 10.2.0.4.So as a work around is set role none to the user who is getting the error by usingalter user username default role none;But I am not sure is this was the way to resolve the issue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-4920008272718092258?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/4920008272718092258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/05/maxenabledroles-error-in-all-versions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/4920008272718092258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/4920008272718092258'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/05/maxenabledroles-error-in-all-versions.html' title='max_enabled_roles error in all the versions including 10.2.0.3'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-8448748554225724124</id><published>2009-05-20T01:01:00.003-07:00</published><updated>2009-05-20T01:01:54.771-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How to find TOP SQL in a particular period.'/><title type='text'>How to find TOP SQL in a particular period.</title><content type='html'>SELECT SQL_TEXT,X.CPU_TIME FROM DBA_HIST_SQLTEXT DHST, (SELECT DHSS.SQL_ID SQL_ID,SUM(DHSS.CPU_TIME_DELTA) CPU_TIMEFROM DBA_HIST_SQLSTAT DHSSWHERE DHSS.SNAP_ID IN(SELECT SNAP_ID FROM DBA_HIST_SNAPSHOTWHERE BEGIN_INTERVAL_TIME&gt;=TO_DATE('09/08/2008','MM/DD/YYYY')AND END_INTERVAL_TIME&lt;=TO_DATE('09/09/2008','MM/DD/YYYY'))GROUP BY DHSS.SQL_ID) X WHERE X.SQL_ID=DHST.SQL_ID ORDER BY X.CPU_TIME DESC;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-8448748554225724124?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/8448748554225724124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/05/how-to-find-top-sql-in-particular.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/8448748554225724124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/8448748554225724124'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/05/how-to-find-top-sql-in-particular.html' title='How to find TOP SQL in a particular period.'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-684433506902996664</id><published>2009-05-20T01:01:00.001-07:00</published><updated>2009-05-20T01:01:28.967-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How to do database characterset migration'/><title type='text'>How to do database characterset migration</title><content type='html'>The link http://sabdarsyed.blogspot.com/2008/09/how-we-used-oracle-csscan-utility-and.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-684433506902996664?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/684433506902996664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/05/how-to-do-database-characterset.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/684433506902996664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/684433506902996664'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/05/how-to-do-database-characterset.html' title='How to do database characterset migration'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-2981378319961670723</id><published>2009-05-20T01:00:00.001-07:00</published><updated>2009-05-20T01:00:57.518-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Using metadata'/><title type='text'>Using metadata</title><content type='html'>pl/sql block which helps us in getting DDL easily for many database objects.&lt;br /&gt;example:&lt;br /&gt;begin&lt;br /&gt;for objects in&lt;br /&gt;(select object_name,owner,object_type&lt;br /&gt;from dba_objects&lt;br /&gt;where owner=’&amp;amp;schema_name’ and object_type='INDEX'&lt;br /&gt;)&lt;br /&gt;loop&lt;br /&gt;dbms_output.put_line(dbms_metadata.get_ddl(objects.object_type,objects.object_name,objects.owner));&lt;br /&gt;end loop;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-2981378319961670723?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/2981378319961670723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/05/using-metadata.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/2981378319961670723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/2981378319961670723'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/05/using-metadata.html' title='Using metadata'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8703328815196419304.post-5122889841452806236</id><published>2009-05-19T00:02:00.001-07:00</published><updated>2009-05-19T00:02:54.525-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Finding 64-bit or 32-bit at OS level'/><title type='text'>Finding 64-bit or 32-bit at OS level</title><content type='html'>getconf KERNEL_BITS&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8703328815196419304-5122889841452806236?l=palanivijay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://palanivijay.blogspot.com/feeds/5122889841452806236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://palanivijay.blogspot.com/2009/05/finding-64-bit-or-32-bit-at-os-level.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/5122889841452806236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8703328815196419304/posts/default/5122889841452806236'/><link rel='alternate' type='text/html' href='http://palanivijay.blogspot.com/2009/05/finding-64-bit-or-32-bit-at-os-level.html' title='Finding 64-bit or 32-bit at OS level'/><author><name>Palani Vijay</name><uri>http://www.blogger.com/profile/13894765456298775409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
