OCP Blog
Super DBA
Restore database to Asm from type backup to different server
by Vazha Mantua Friday, April 20, 2012 12:04 PM

Today I show you step by step procedure, how we can restore database from UFS file system to ASM file system, if backup was done on type device and in different server. In your example we use VERITAS Netbackup soft.

We should change some parameters in our PFILEor SPFILE  for using ASM .

This parameters are:

control_files='+DG01/orcl1/controlfile/ctl.f' 

db_create_file_dest='+DG01'

You should install VERITAS Netbackup client and configure it for using. Also in your case we use Oracle RDBMS version 11.2. and OS Linux.

Then we should run RMAN script and set appropriate environment for restoring backup set from type.

ORACLE_SID=ORCL1
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
NB_ORA_SERV=mastersrv   (This is master server for backuping)
NB_ORA_CLIENT=testmachine (This is source server, from this server we have made backup) 
export ORACLE_SID NLS_LANG NB_ORA_SERV NB_ORA_CLIENT
echo $ORACLE_SID
echo $NLS_LANG
echo $NB_ORA_SERV
echo $NB_ORA_CLIENT

rman target /

---- Startup Database on nomount Stage
run
{  
startup nomount;
}

--- Restore Controlfile from autobackup

SET DBID=295123130 (This is DBID of source database. you can find DBID on v$database view, or on controlfile format in netbackup catalog)

run
{
allocate channel ch1_tape type sbt;
set controlfile autobackup format for device type sbt to '%F';
restore controlfile  from autobackup;
RELEASE CHANNEL ch1_tape;
}

--- Mount database
alter database mount;

--- Restore and Recover database with new ASM Storage.

In our database we have only 4 datafile. for your case you should add all datafiles in this script. In ASM  file system datafiles will be created with automatically generated name

run 
{
allocate channel t1 device type 'sbt_tape';
SET  NEWNAME FOR DATAFILE 1 TO NEW;
SET  NEWNAME FOR DATAFILE 2 TO NEW;
SET  NEWNAME FOR DATAFILE 3 TO NEW;
SET  NEWNAME FOR DATAFILE 4 TO NEW;
restore database;
SWITCH DATAFILE ALL;
recover database;
}

---- Rename Redo log files:
On source database redo logs were in location /u4/oradata/ORCL1.

SQL "ALTER DATABASE RENAME FILE ''/u4/oradata/ORCL1/redo01.log'' TO ''+DG01/ORCL1/ONLINELOG/redo01.log'' ";
SQL "ALTER DATABASE RENAME FILE ''/u4/oradata/ORCL1/redo02.log'' TO ''+DG01/ORCL1/ONLINELOG/redo02.log'' ";
SQL "ALTER DATABASE RENAME FILE ''/u4/oradata/ORCL1/redo03.log'' TO ''+DG01/ORCL1/ONLINELOG/redo03.log'' ";
SQL "ALTER DATABASE RENAME FILE ''/u4/oradata/ORCL1/redo04.log'' TO ''+DG01/ORCL1/ONLINELOG/redo04.log'' ";
SQL "ALTER DATABASE RENAME FILE ''/u4/oradata/ORCL1/redo05.log'' TO ''+DG01/ORCL1/ONLINELOG/redo05.log'' ";
SQL "ALTER DATABASE RENAME FILE ''/u4/oradata/ORCL1/redo06.log'' TO ''+DG01/ORCL1/ONLINELOG/redo06.log'' ";

 

--- Open database with resetlogs clause and recreate temporary tablespace.

ALTER DATABASE OPEN RESETLOGS;

CREATE TEMPORARY TABLESPACE TEMP1;
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP1;
DROP TABLESPACE TEMP INCLUDING CONTENTS AND DATAFILES;
CREATE TEMPORARY TABLESPACE TEMP;
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP;
DROP TABLESPACE TEMP1 INCLUDING CONTENTS AND DATAFILES;

In your case we restore database, but not configure it for archiving.

for archiving you should simple set these parameters and then enable it.

alter system set db_recovery_file_dest_size = '400G';
alter system set db_recovery_file_dest = '+DG01' ;

Good Luck!

Comments (5) -

4/20/2012 2:51:25 PM #

Raheel Syed

Refresher !!
Regards
Raheel Syed

Raheel Syed India

5/12/2012 8:58:52 PM #

Custom Magnetic Lapel Pins

<a href=""></a>
Hi there, I was searching the same content in google and I am here to your site by chance and I found your site too good with content as well as with the design, keep coming with such ideas.

Custom Magnetic Lapel Pins United States

6/6/2012 7:02:22 AM #

Iraqi Dinar

In our database we have only 4 datafile. for your case you should add all datafiles in this script. In ASM  file system datafiles will be created with automatically generated name

Iraqi Dinar United Kingdom

6/20/2012 2:35:08 PM #

Diminished Value

You should install VERITAS Netbackup client and configure it for using. Also in your case we use Oracle RDBMS version 11.2. and OS Linux.

Diminished Value United Kingdom

6/21/2012 11:39:48 PM #

Custom Challenge Coins

you have to do good work buddy i m looking good blog site for post my comment now i got it i m very happy to your blog site

Custom Challenge Coins United States

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Filter by APML

Calendar

<<  October 2017  >>
MoTuWeThFrSaSu
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345

View posts in large calendar

TextBox