Pavan DBA's Blog

The DBA Knowledge Store

Archive for the ‘Bkp n Recovery’ Category

which process updates controlfile, when doing complete recovery of it?

Posted by Pavan DBA on October 12, 2010

Long back i posted a voting question in my blog…

which process updates controlfile, when doing complete recovery of it?

I got results as follows

 

But unfortunately max votes got for a incorrect option. The correct answer is Server process.

Many DBA’s don’t know that we can perform complete recovery when we lost controlfile. (even i had some good argument with a friend on my blog on this)

If you want to know how to do complete recovery, see below link

http://pavandba.wordpress.com/2010/03/18/how-to-do-complete-recovery-if-controlfiles-are-lost/
By reading above post, you might have got the point that we are creating new controlfile. In such cases, to open the database we require latest SCN to be there in controlfile to match it with datafiles and redolog files.

If it doesn’t match, it will fail to open. So server process will take that responsibility to update the controlfile with latest SCN and this info will be taken from datafiles

Posted in Bkp n Recovery | Leave a Comment »

why it is not necessary to take undo backup?

Posted by Pavan DBA on September 29, 2010

Folks,

really long time to see you…here is the new post of mine

You know…it is not necessary to take undo tablespace backup either in cold backup or hot backup. But ofcourse many of DBA’s will include that in their script…

Now a big question…if undo is not being backed up and lets say i need to do instance recovery or database recovery and need to rollback a transaction, how that will happen.

Here is the answer…

when you do some transaction, redo entries will be generated..accepted ! Just like that whenever some changes happend to undo tablespace (or more clearly undo segments) oracle will generate redo entries.

So even though you doesn’t backup undo, you have the redo entries through which you can recover or rollback the transactions.

Wann to read more…just check here http://kr.forums.oracle.com/forums/thread.jspa?messageID=4703118

Posted in Bkp n Recovery | Tagged: , | Leave a Comment »

How to resolve rman: can’t open target?

Posted by Pavan DBA on June 26, 2010

Sometimes we may get “rman: can’t open target” error while trying to connect to rman.

we would be wondering because our database will be up and running and listener also when checked.

The cause to the above problem is having “/usr/X11R6/bin” in the PATH variable. If we remove that, it will work.

1) echo $PATH
2) export PATH=<specify entire path, but remove the above mentioned path>
or
3) edit .bash_profile file and enter the path without “/usr/X11R6/bin”
4) save the .bash_profile file

Now start your rman, it will start working … :-)

Posted in Bkp n Recovery | Tagged: , , | Leave a Comment »

Database cloning using hot backup (if directory structure is different)

Posted by Pavan DBA on March 26, 2010

Below steps helps you in performing database cloning using hot backup
Assumptions:
1. directory structure is different in both source and target servers
2. Oracle version : 10.2.0.4
3. OS version : Linux 5
4. target database name is same as source database name

step 1 :  Take the hot backup of source database
sql> alter database begin backup;
$ copy datafiles to backup location
sql> alter database end backup;

step 2 : Take controlfile trace and pfile or spfile (that was using by the source database)

step 3 : Install Oracle software on another machine (choose “Install only” option in OUI). Don’t create any database

step 4 : Copy all the files (including trace file and pfile or spfile) from source server to target server either using FTP or rcp
Note: Not necessary in copying control files and redologfiles

step 5 : Place pfile or spfile in “dbs” directory on target

step 6 : Copy the remaining files to their respective locations (If any directories are missing, do create them)

step 7 : Connect as sysdba and Startup the database in nomount stage

step 8 : Edit the trace file (that was copied) and generate a create controlfile script from it. Modify the script and specify the new locations of  the files.

step 9 : Execute the controlfile script which will create controlfiles in the location specified in CONTROL_FILES parameter. Once control files are created, database will be forwarded to MOUNT state.
sql> @create_controlfile.sql

step 10 : Finally, Open the database with resetlogs option
sql> alter database open resetlogs;

Posted in cloning | Tagged: , , | 1 Comment »

Database cloning with hot backup (if directory structure is same)

Posted by Pavan DBA on March 26, 2010

Here are the steps for performing database cloning using hot backup to a different server. I am assuming you are using same directory structure in the target server also.
Assumed Oracle version : 10.2.0.4, OS version : Linux 5

Step 1 : Take database hot backup as follows
sql> alter system switch logfile;
sql> alter database begin backup;
$ cp *.dbf to backup location (as it is hot backup, we will not take backup of redolog files)
sql> alter database end backup;
sql> alter system switch logfile;
$ cp *.ctl to backup location
Note: If you are using 9i database, use “tablespace begin backup/end backup” clauses

step 2 : Take backup of spfile or pfile of source database and also archives

step 3 : Install oracle software in target server (select “software only” option in OUI)

step 4 : copy the files to target server either using FTP or any methods

step 5 : place pfile or spfile in dbs directory

step 6 : copy all files (datafiles, controlfiles and archives) to respective locations

step 7 : do the following
sql> startup nomount
sql> alter database mount;
sql> recover database using backup controlfile until cancel;
here it will ask to apply archives and will give suggestion as file name and path. apply required archives

step 8 : finally, open your database with resetlogs option
sql> alter database open resetlogs;

Sometimes you may get following error while doing hot backup cloning

ORA-01194 file 1 needs more recovery to be consistent error

in such cases, do a switch logfile in source server and copy & apply that archive logfile in target server

Posted in cloning | Tagged: , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 1,272 other followers