<?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-1181197225198609440</id><updated>2011-06-30T11:45:26.025-07:00</updated><category term='Oracle11g'/><category term='RMAN'/><category term='Troubleshooting'/><title type='text'>Yadu's Oracle Junction</title><subtitle type='html'>" I accept Failure, but I won't accept not trying "</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://oraclejunction.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://oraclejunction.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Yadu</name><uri>http://www.blogger.com/profile/05250637578379069892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_vxR2lKY04x8/SBD_z0W6BCI/AAAAAAAAABo/DHnqlnqsV78/S220/11042008071.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1181197225198609440.post-891504816028308146</id><published>2009-03-20T11:54:00.000-07:00</published><updated>2009-03-20T11:55:53.954-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>How I solved the ORA-08103: object no longer exists problem</title><content type='html'>Applies to:&lt;br /&gt;&lt;br /&gt;Oracle Enterprise Edition 9.2.0.7.0&lt;br /&gt;Any platform&lt;br /&gt;&lt;br /&gt;Problem:&lt;br /&gt;&lt;br /&gt; I had migrated an Oracle database from one server to another using the cold backup. The database came up clean. But the user had complaints saying his select count (*) on some tables gives the error ORA-08103: object no longer exists. But the select * for the same tables was giving the rows! There were around 3000 tables out of which 30 tables where giving the error. All these tables belonged to the same tablespace.&lt;br /&gt; &lt;br /&gt;I tried the following.&lt;br /&gt;&lt;br /&gt;SQL&gt;Select * from test;&lt;br /&gt;NAME&lt;br /&gt;-------------- &lt;br /&gt;India&lt;br /&gt;Australia&lt;br /&gt;England&lt;br /&gt;Srilanka&lt;br /&gt;USA&lt;br /&gt;5 rows selected&lt;br /&gt;&lt;br /&gt;SQL&gt; Select count (*) from test;&lt;br /&gt;     Select count (*) from test&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-08103: object no longer exist &lt;br /&gt;&lt;br /&gt;Initially I thought there could be some problem with the indexes of these tables. I picked up one of the tables. And I tried validating the indexes by the below command&lt;br /&gt;&lt;br /&gt;SQL&gt;Analyze table test validate structure cascade;&lt;br /&gt;     Analyze table test validate structure cascade&lt;br /&gt;*&lt;br /&gt;ERROR at line 1: &lt;br /&gt;ORA-08103: object no longer exists &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And then I tried skipping the indexes by using the following command.&lt;br /&gt;I used “no index” hint to execute “select count (*) from table”, command failed with the same error.&lt;br /&gt;SQL&gt;Select /*+NO INDEX*/ count (*) from test;&lt;br /&gt;Select /*+NO INDEX*/ count (*) from test&lt;br /&gt;*&lt;br /&gt;ERROR at line 1: &lt;br /&gt;ORA-08103: object no longer exists&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then I did the following.&lt;br /&gt;&lt;br /&gt;1) Got the DDL of the table.&lt;br /&gt;SQL&gt;SELECT dbms_metadata.get_ddl(‘TABLE’, ‘TEST’,’USER’) FROM DUAL;&lt;br /&gt;&lt;br /&gt;2) Create new table using above DDL&lt;br /&gt;&lt;br /&gt;3) Execute the following statement.&lt;br /&gt;&lt;br /&gt;SQL&gt;INSERT INTO testr SELECT * FROM test;&lt;br /&gt; INSERT INTO testr SELECT * FROM test;&lt;br /&gt;*&lt;br /&gt;ERROR at line 1: &lt;br /&gt;ORA-08103: object no longer exists&lt;br /&gt;&lt;br /&gt;Even this failed with the error ora-08103.&lt;br /&gt;One of the solutions I tried was.&lt;br /&gt;&lt;br /&gt;-For a table, truncate or drop it and reload the data from export dump&lt;br /&gt;&lt;br /&gt;I dropped the tables having this error and took an export dump from the server (A) and imported the tables back into the server (B).For my surprise this time I faced the same problem with some other tables. &lt;br /&gt;&lt;br /&gt;Cause: &lt;br /&gt;&lt;br /&gt;Here, I had copied the database files (Cold backup) from Solaris server (A) -&gt;windows server Solaris server (B) in the binary mode. This was done because I had a better network speed this way. This method had worked me for the same kind of restoration of the databases before. But this time it failed with the corruption of the data blocks. This could be because of &lt;br /&gt;&lt;br /&gt;- The header block has an invalid block type or the block type inside the block is not expected. i.e.  A data block (Type=6) was expected but the actual block information is not a data block.&lt;br /&gt;&lt;br /&gt;      Or&lt;br /&gt;&lt;br /&gt;- The data_object_id (seg/obj) stored in the block is different than the data_object_id stored in the segment header.&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;This time I copied the database files (cold backup) from solaris server (A) to solaris server (B) directly without the windows server in the middle. And I restored the whole database again. I had no problems with any of the tables and the database is running fine now.&lt;br /&gt;&lt;br /&gt;The solution was to copy the files directly from the UNIX server to the UNIX server to avoid block corruptions of the data blocks.&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;br /&gt;Note.268302.1 ORA-8103 Diagnostics and Solution&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1181197225198609440-891504816028308146?l=oraclejunction.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oraclejunction.blogspot.com/feeds/891504816028308146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1181197225198609440&amp;postID=891504816028308146' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/891504816028308146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/891504816028308146'/><link rel='alternate' type='text/html' href='http://oraclejunction.blogspot.com/2009/03/how-i-solved-ora-08103-object-no-longer.html' title='How I solved the ORA-08103: object no longer exists problem'/><author><name>Yadu</name><uri>http://www.blogger.com/profile/05250637578379069892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_vxR2lKY04x8/SBD_z0W6BCI/AAAAAAAAABo/DHnqlnqsV78/S220/11042008071.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1181197225198609440.post-1464218727637858525</id><published>2008-12-04T05:38:00.000-08:00</published><updated>2008-12-04T05:51:59.340-08:00</updated><title type='text'>Read Write Oracle10g Standby database</title><content type='html'>Of all the database features of Oracle,the one which I feel interesting is the STANDBY or DATAGUARD feature.Long back I had posted a topic on Oracle11g standby database,which enables us to open a standby database in read write mode and put it back to standby(open read-only) mode.&lt;br /&gt;&lt;br /&gt;I was going through a blog by one Mr.Syed Jaffar Hussain(http://jaffardba.blogspot.com) who has explained how we can open read write a Oracle10g physical standby database and put it back to the standby mode(open read-only).Below is the link to the document.&lt;br /&gt;http://jaffardba.blogspot.com/search/label/Standby%20Database&lt;br /&gt;&lt;br /&gt;The blog by Mr.Hussain is itself very informative.And thanks Hussain for sharing with us.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Yadu&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1181197225198609440-1464218727637858525?l=oraclejunction.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oraclejunction.blogspot.com/feeds/1464218727637858525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1181197225198609440&amp;postID=1464218727637858525' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/1464218727637858525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/1464218727637858525'/><link rel='alternate' type='text/html' href='http://oraclejunction.blogspot.com/2008/12/read-write-oracle10g-standby-database.html' title='Read Write Oracle10g Standby database'/><author><name>Yadu</name><uri>http://www.blogger.com/profile/05250637578379069892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_vxR2lKY04x8/SBD_z0W6BCI/AAAAAAAAABo/DHnqlnqsV78/S220/11042008071.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1181197225198609440.post-777296177058551625</id><published>2008-11-14T10:47:00.000-08:00</published><updated>2008-11-14T10:52:20.182-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>VNI-4026 : Discovery failed : Error while transferring services.ora from agent : 4009.</title><content type='html'>I am BACK after a LOOOOOOONG break...!!&lt;br /&gt;&lt;br /&gt;I was not able to update my blog all these days but not anymore..Anyways,let me come to the point..&lt;br /&gt;&lt;br /&gt;We have been migrating databases from one datacenter to another..Migration of the databases were pretty simple..Just take the cold backup of the database and restore it.We had to build a new server for the migration and the Unix consulatnt had installed the Oracle for us on the new server..Actually,he had not installed Oracle as such..He copied the Oracle home from the old server to the new server.Since the volumes on the server were identical,we had no issues in bringing up the database on the other server.&lt;br /&gt;&lt;br /&gt;But when we tried to discover the new server on the OEM,there was this error &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;VNI-4026 : Discovery failed : Error while transferring services.ora from agent : 4009.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The intelligent agent was up and running.We stopped the agent and started the Intelligent agent  after deleting *.q files in $ORACLE_HOME/network/agent/ location.Even then we had the same problem.&lt;br /&gt;&lt;br /&gt;The above issue got resolved only after REINSTALLING the entire Oracle Home on the new server.It is recommended not to copy the Oracle Home from one server to another.Some components may work and some may not!!So always go with the fresh installations while taking such kind of activities.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1181197225198609440-777296177058551625?l=oraclejunction.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oraclejunction.blogspot.com/feeds/777296177058551625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1181197225198609440&amp;postID=777296177058551625' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/777296177058551625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/777296177058551625'/><link rel='alternate' type='text/html' href='http://oraclejunction.blogspot.com/2008/11/vni-4026-discovery-failed-error-while.html' title='VNI-4026 : Discovery failed : Error while transferring services.ora from agent : 4009.'/><author><name>Yadu</name><uri>http://www.blogger.com/profile/05250637578379069892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_vxR2lKY04x8/SBD_z0W6BCI/AAAAAAAAABo/DHnqlnqsV78/S220/11042008071.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1181197225198609440.post-1624831303357556388</id><published>2007-09-20T00:58:00.000-07:00</published><updated>2007-09-20T01:05:49.364-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle11g'/><title type='text'>Oracle11g SNAPSHOT standby database</title><content type='html'>Till now you have come across two types of standby databases namely Physical standby database and Logical standby database. From Oracle 11g onwards there is one more addition to this. It is called Snapshot standby database.&lt;br /&gt;&lt;br /&gt;Snapshot standby is updatable version of the standby database. It is created from the existing standby database .You can modify the database and again you can convert it back to the physical standby database. The snapshot standby database receives the archive logs(redo) from the primary database but does not apply the redo in standby .It is automatically applied when you convert the snapshot standby database back to physical standby database and the conversion can be done at any point of time! So data from the primary database is always protected .It gives data protection and disaster recovery exactly like the physical standby database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Why you need a snapshot standby database??&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; As told earlier snapshot standby database is updatable. It provides the replicated version of the primary database which can be used for development, testing and reporting purposes. You can always refresh the snapshot standby database to be in sync with the primary by converting it to physical standby database. Again you can convert to snapshot version do the testing and resynchronize with primary. This cycle can be repeated any number of times!&lt;br /&gt;&lt;br /&gt;The conversion from physical standby to snapshot standby database and vice versa can be done in three ways.&lt;br /&gt;1.Dataguard Broker(If the physical standby is managed by DGMGRL)&lt;br /&gt;2.Enterprise Manager(If the physical standby is managed by DGMGRL)&lt;br /&gt;3.Manual method.&lt;br /&gt;&lt;br /&gt;Let us see how you can convert the physical standby database to snapshot standby database manually. This can be done by issuing the below SQL command in the physical standby database.&lt;br /&gt;&lt;br /&gt;Sql&gt;alter database convert to snapshot standby;&lt;br /&gt;&lt;br /&gt;If the standby database is a RAC setup then you need to shutdown all the instances except one on which you will be using the conversion commands.&lt;br /&gt;&lt;br /&gt;You may wonder how you will be able to get back to the original state .Here Oracle uses its own features within, nothing else! Oracle uses restore point and flashback feature to accomplish this. If you remember, restore point and flashback database concepts were first introduced in Oracle10g.&lt;br /&gt;&lt;br /&gt;When you convert the physical standby database to snapshot standby database a guaranteed restore point is created. This guaranteed restore point is used to flashback a snapshot standby database to its original state. The name of this guaranteed restore points begins with ‘SNAPSHOT_STANDBY_REQUIRED_’. The database is dismounted during this conversion and you have to restart the database (which will be the snapshot standby database).&lt;br /&gt;&lt;br /&gt;Once it is converted the database can be opened in read/write mode, you can update the database. Meanwhile you will be receiving the redo from the primary, which will be automatically applied when snapshot standby database is converted back to physical standby database.&lt;br /&gt;&lt;br /&gt;Now, to convert the snapshot standby back to the physical standby state use the following SQL command:&lt;br /&gt;&lt;br /&gt;Sql&gt;alter database convert to physical standby;&lt;br /&gt;&lt;br /&gt;Using the guaranteed restore point the snapshot standby database will be flashed back to its original state and subsequently the restore point will be dropped. After the conversion the redo will be applied which were received by the snapshot standby database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Note:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When you convert a physical standby database to snapshot standby database, Then&lt;br /&gt;&lt;br /&gt;• Redo gap detection and resolution will work as before.&lt;br /&gt;• You cannot perform switchover or failover on a snapshot standby database. To perform role transitions you have to convert the snapshot standby database back to physical standby database.&lt;br /&gt;• If the primary database has a new incarnation (because of Flashback database or Open resetlogs ),the snapshot database continue to receive the redo from the primary.&lt;br /&gt;• In case of role transition of one of the standby database (like failover or switchover), the snapshot standby database continues to receive the redo from the new primary.&lt;br /&gt;&lt;br /&gt;Comments are always welcome :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1181197225198609440-1624831303357556388?l=oraclejunction.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oraclejunction.blogspot.com/feeds/1624831303357556388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1181197225198609440&amp;postID=1624831303357556388' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/1624831303357556388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/1624831303357556388'/><link rel='alternate' type='text/html' href='http://oraclejunction.blogspot.com/2007/09/oracle11g-snapshot-standby-database.html' title='Oracle11g SNAPSHOT standby database'/><author><name>Yadu</name><uri>http://www.blogger.com/profile/05250637578379069892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_vxR2lKY04x8/SBD_z0W6BCI/AAAAAAAAABo/DHnqlnqsV78/S220/11042008071.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1181197225198609440.post-4402443424817638678</id><published>2007-08-17T09:43:00.000-07:00</published><updated>2007-08-21T08:57:17.223-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>Listener hangs in Oracle 10g and no new connections are allowed</title><content type='html'>Just when I was thinking how boring my job as DBA was (doing the same routine work and nothing new to implement until you convince everyone and take approvals from them!!) I was made to feel that DBA work is not at all boring if you are at the receiving end :-) . I was suddenly bombarded with mails from the users saying that they are not able to connect to the database. As usual I checked the listener status and replied to some of them saying that there is no problem with the listener as such but would get back to them with a solution. It was a production database, the pressure on me was mounting every second. I was not sure what to do? Reply to the users or solve the problem :-)&lt;br /&gt;&lt;br /&gt;The database version was of Oracle 10.2.0.1 running on Linux RHEL 4..The listener seemed to be in hung state and moreover there were no errors in the listener log file.&lt;br /&gt;&lt;br /&gt;I don’t know what came to my mind I thought of checking the listener process using the&lt;strong&gt; ps&lt;/strong&gt; command. I was surprised to see a child process forked automatically with the same name of the current listener.&lt;br /&gt;&lt;br /&gt;$ ps -ef |grep tns&lt;br /&gt;oracle 2310 1 0 Jul 17 ? 72:00 /oracle/ora10g/db/bin/tnslsnr oprem -inherit&lt;br /&gt;oracle 6573 2310 0 14:19:23 ? 0:00 /oracle/ora10g/db/bin/tnslsnr oprem –inherit&lt;br /&gt;&lt;br /&gt;I killed the child process and then reloaded the listener. Phew!!...it worked.The users were able to connect to the database now.&lt;br /&gt;&lt;br /&gt;Later I found that this is an Oracle bug (No.4518443).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Some of the possible solutions for the above problem are:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. Kill the child process using kill command and then reload the listener process.&lt;br /&gt;&lt;br /&gt;2. Add the following parameter in the listener.ora file and restart the listener process.&lt;br /&gt;&lt;br /&gt;SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER_NAME&lt;listener_name&gt;=OFF&lt;br /&gt;&lt;br /&gt;Where listener_name is the listener name (here it would be oprem)&lt;br /&gt;&lt;br /&gt;3. Apply Patch.&lt;br /&gt;&lt;br /&gt;4. Rename the ons.config file and restart the listener. (path:$ORACLE_HOME/opmn/conf)&lt;br /&gt;&lt;br /&gt;This problem is fixed in 10.2.0.3&lt;br /&gt;&lt;br /&gt;Note: If you add the above parameter for a listener.ora in RAC setup, then Fast Application Notification (FAN) will not work.&lt;br /&gt;&lt;br /&gt;For patch and more details on this refer to metalink note: 340091.1&lt;br /&gt;&lt;br /&gt;Hope this was useful to you guys.&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1181197225198609440-4402443424817638678?l=oraclejunction.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oraclejunction.blogspot.com/feeds/4402443424817638678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1181197225198609440&amp;postID=4402443424817638678' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/4402443424817638678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/4402443424817638678'/><link rel='alternate' type='text/html' href='http://oraclejunction.blogspot.com/2007/08/listener-process-in-oracle-10g-hangs.html' title='Listener hangs in Oracle 10g and no new connections are allowed'/><author><name>Yadu</name><uri>http://www.blogger.com/profile/05250637578379069892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_vxR2lKY04x8/SBD_z0W6BCI/AAAAAAAAABo/DHnqlnqsV78/S220/11042008071.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1181197225198609440.post-1348672465401995793</id><published>2007-08-13T06:54:00.000-07:00</published><updated>2007-08-17T10:36:47.693-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Troubleshooting'/><title type='text'>Sometimes something goes unnoticed...</title><content type='html'>&lt;div align="left"&gt;&lt;strong&gt;ORA-01194: File 5 needs media recovery to be consistent&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;When you get the above error if you decide that you have to recover the datafile (or database), think twice. Always you may not have to recover the file. I had faced this scenario in one of the client places. Though the initial plan was to restore the datafile from the backup and recover, I had to change my mind.&lt;br /&gt;&lt;br /&gt;Now the scenario…I was informed that a guy at the client site had restarted the database (on windows) and they could not open the database because of the datafile inconsistency. After some searching I could find that the problem was with the backup process!!&lt;br /&gt;&lt;br /&gt;It happened so that when the hot backup (user-managed) of the database was being taken, that guy had shutdown the database. Now, while restarting the database a particular datafile was asking for media recovery. When checked I found that the datafile was still in backup mode. i.e. the database was shutdown when the backup was going on. Now, the solution is simple. Mount the database and use alter database datafile 5 end backup command and open the database. There is absolutely no need to recover the datafile!! J&lt;br /&gt;&lt;br /&gt;So what exactly happened here?!? Well, nothing strange happened. It is a normal oracle behavior, nothing else. When the instance was restarted, the datafile which was in the backup mode will look old because the datafile header is freezed with older SCN. So it will (and it shouldJ) ask for recovery. That’s it!&lt;br /&gt;&lt;br /&gt;Generally on unix servers if you issue normal shutdown commands (except abort!!) on the database when the hot backup is going on, shutdown wont happen. It will throw an error saying that the datafile is in backup mode. So there is very less chance of facing this scenario on unix servers.&lt;br /&gt;&lt;br /&gt;But in windows, it is general practice to shutdown the database using the OracleService on the services window. In this case even if the backup is happening database goes down with shutdown abort command internally. You won’t come to know that shutdown abort has happened.&lt;br /&gt;&lt;br /&gt;You can even face this scenario when the instance crashes during backup (hot backup).You try to restart the instance without knowing that backup was active during the instance crash and end up with the same error.&lt;br /&gt;&lt;br /&gt;So, don’t panic… Take it easy!!!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1181197225198609440-1348672465401995793?l=oraclejunction.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oraclejunction.blogspot.com/feeds/1348672465401995793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1181197225198609440&amp;postID=1348672465401995793' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/1348672465401995793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/1348672465401995793'/><link rel='alternate' type='text/html' href='http://oraclejunction.blogspot.com/2007/08/sometimes-something-goes-unnoticed_13.html' title='Sometimes something goes unnoticed...'/><author><name>Yadu</name><uri>http://www.blogger.com/profile/05250637578379069892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_vxR2lKY04x8/SBD_z0W6BCI/AAAAAAAAABo/DHnqlnqsV78/S220/11042008071.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1181197225198609440.post-5748637032372106139</id><published>2007-08-13T06:51:00.000-07:00</published><updated>2007-08-14T07:48:17.168-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RMAN'/><title type='text'>How to recover a table using RMAN backup</title><content type='html'>This article is about recovering a particular table (which was dropped or truncated) using RMAN backup. I assume that logical backup is not planned as the size of the database is in Terabytes (TB) and RMAN is used for backing up the database. Here tablespace point in time recovery (TSPITR) does not come into picture because we want to recover a single table and not all the objects in the tablespace.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;It is assumed that&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;- The target database is on host A and the RMAN full backup was taken before the table TEST which is to be recovered was dropped.&lt;br /&gt;- The database is to be restored onto host B&lt;br /&gt;- The directory structure of host B is different to host A&lt;br /&gt;- The ORACLE_SID will not change for the restored database&lt;br /&gt;- The backups were carried out to disk&lt;br /&gt;- TEST table to be recovered is in the tablespace TEST_DATA&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The following steps are required:&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;- make the backup available to host B&lt;br /&gt;- make a copy of the init.ora available to host B&lt;br /&gt;- edit the init.ora to reflect directory structure changes&lt;br /&gt;- set up a password file for the duplicated database&lt;br /&gt;- mount the database&lt;br /&gt;- restore and rename the datafiles&lt;br /&gt;- recover and open the database&lt;br /&gt;-export and import the table to the target database&lt;br /&gt;&lt;br /&gt;These steps are explained further below.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1.Backup the latest controlfile&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;sqlplus&gt;alter database backup controlfile to ‘/oracle/control.ctl’;&lt;br /&gt;&lt;br /&gt;Note: Backup the archived logs&lt;br /&gt;Move all the archive logs to the Host B from the time backup was taken.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. List Datafile Locations on Host A&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The datafile numbers and location on host A are required. These datafile locations will change on host B&lt;br /&gt;&lt;br /&gt;sqlplus&gt; select file#, name from v$datafile;&lt;br /&gt;&lt;br /&gt;file# name&lt;br /&gt;----- ------------------------------&lt;br /&gt;1 /oracle/orcl/oradata/system01.dbf&lt;br /&gt;2 /oracle/ orcl/oradata/users..dbf&lt;br /&gt;3 /oracle/orcl/oradata/undo01.dbf&lt;br /&gt;4 /oracle/orcl/oradata/tools01.dbf&lt;br /&gt;5 /oracle/orcl/oradata/test01.dbf&lt;br /&gt;6 /oracle/orcl/oradata/test02.dbf&lt;br /&gt;7 /oracle/orcl/oradata/undo02.dbf&lt;br /&gt;8 /oracle/orcl/oradata/rcvcat.dbf&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Make the Backups Available to Host B&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;During restore, RMAN will expect the backup sets to be located in the same directory as written to during the backup. For disk backups, this can be accomplished in many ways:&lt;br /&gt;&lt;br /&gt;- set up an NFS directory, mounted on both host A and host B&lt;br /&gt;- use of symbolic links on host B&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. init.ora on Host B&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The "init.ora" needs to be made available on host B. Any location specific&lt;br /&gt;parameters must be ammended. For example,&lt;br /&gt;- *_dump_dest&lt;br /&gt;- log_archive_dest*&lt;br /&gt;- control_files=(control file backup taken on Host A)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. Setup PASSWORD File&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;In order to allow RMAN remote connections, a password file must be setup for the duplicated database. For example,&lt;br /&gt;&lt;br /&gt;$orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=oracle&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. Recover the Database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;On Host B perform the following steps.&lt;br /&gt;&lt;br /&gt;6.1 Startup nomount the database&lt;br /&gt;&lt;br /&gt;sqlplus&gt; startup nomount pfile=&lt;location&gt;&lt;br /&gt;&lt;br /&gt;6.2 Mount the database&lt;br /&gt;&lt;br /&gt;sqlplus&gt; alter database mount;&lt;br /&gt;&lt;br /&gt;6.3 Rename and restore the datafiles, and perform database recovery&lt;br /&gt;&lt;br /&gt;RMAN can be used to change the location of the datafiles from the location on host A to the new location on host B. Here rename the datafiles of SYSTEM,UNDOTBS1 and TEST_DATA tablespaces only.&lt;br /&gt;&lt;br /&gt;Note: If you have two undo tablespaces in your database and you keep switching between these undo tablespaces it is necessary to restore both the undo tablespaces.&lt;br /&gt;&lt;br /&gt;RMAN&gt; run {&lt;br /&gt;&lt;br /&gt;allocate channel c1 type disk;&lt;br /&gt;allocate channel c2 type disk;&lt;br /&gt;allocate channel c3 type disk;&lt;br /&gt;&lt;br /&gt;set newname for datafile 1 to '/oracle/datafiles/system01.dbf';&lt;br /&gt;set newname for datafile 3 to '/oracle/datafiles/undo01.dbf';&lt;br /&gt;set newname for datafile 5 to '/oracle/datafiles/test01.dbf';&lt;br /&gt;set newname for datafile 6 to '/oracle/datafiles/test02.dbf';&lt;br /&gt;set newname for datafile 7 to '/oracle/datafiles/undo02.dbf';&lt;br /&gt;&lt;br /&gt;restore tablespace SYSTEM;&lt;br /&gt;restore tablespace UNDOTBS1;&lt;br /&gt;restore tablespace TEST_DATA;&lt;br /&gt;switch datafile all;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;6.4 Recover and open the database&lt;br /&gt;&lt;br /&gt;Perform incomplete recovery and take the datafiles of the tablespaces other that SYSTEM,UNDOTBS1,TEST_DATA to offline. This makes our restore work easier. i.e. you don’t have to restore the whole database backup. When you issue offline drop command, controlfile assumes that it does not need these files for recovery(so need to restore!!).This is helpful when you have a database of say 1 TB and the tablespace in which the table to be recovered is present is of say 10 GB. By skipping the restoration of other tablespaces you save lot of time and space also.&lt;br /&gt;&lt;br /&gt;sqlplus&gt;alter database datafile 2 offline drop;&lt;br /&gt;alter database datafile 4 offline drop;&lt;br /&gt;alter database datafile 8 offline drop;&lt;br /&gt;&lt;br /&gt;sqlplus&gt; recover database using backup controlfile until cancel; (or until time)&lt;br /&gt;&lt;br /&gt;Forward the database applying archived redo log files to the point just before the table was dropped and stop the recovery process by typing cancel at the prompt (assuming that you have required archived redo log files in the log_archive_dest directory)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6.5 Rename the logfiles prior to opening the database&lt;br /&gt;&lt;br /&gt;sqlplus&gt; alter database rename file '&lt;host&gt; /oracle/orcl/oradata/redo1.log' to '/oracle/redologs/redo1.log&lt;host&gt;';&lt;br /&gt;&lt;br /&gt;sqlplus&gt; alter database rename file ' /oracle/orcl/oradata/redo2.log' to '/oracle/redologs/redo2.log';&lt;br /&gt;&lt;br /&gt;sqlplus&gt; alter database open resetlogs;&lt;br /&gt;&lt;br /&gt;Now you can query the table TEST to find out the data.&lt;br /&gt;&lt;br /&gt;Once you are confirmed that the table TEST is recovered, export the table and import to the target database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1181197225198609440-5748637032372106139?l=oraclejunction.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oraclejunction.blogspot.com/feeds/5748637032372106139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1181197225198609440&amp;postID=5748637032372106139' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/5748637032372106139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1181197225198609440/posts/default/5748637032372106139'/><link rel='alternate' type='text/html' href='http://oraclejunction.blogspot.com/2007/08/how-to-recover-table-using-rman-backup.html' title='How to recover a table using RMAN backup'/><author><name>Yadu</name><uri>http://www.blogger.com/profile/05250637578379069892</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_vxR2lKY04x8/SBD_z0W6BCI/AAAAAAAAABo/DHnqlnqsV78/S220/11042008071.jpg'/></author><thr:total>4</thr:total></entry></feed>
