Restoring an entire Oracle database

Hi,

I'm working in an POC of NBU with Oracle environment. I made the backup and it's working fine.

Now I need to make a restore and I'm lost for begin these tests. 

The database is in restore state. I made the script but I'm not sure how do start this process.

Below, I will show the images that I have.

 

 

C:\Program Files\Veritas\NetBackup\bin>bplist -C sdbora10h1-vip.sesisenaisp.org.br -t 4 -l -R /
 
-rw-rw---- oracle    oinstall     15466496 ago 02 15:52 ctrl_u1umj0a2i_s62_p1_t758130770:\
-rw-rw---- oracle    oinstall     1588224K ago 02 15:46 arch_u1tmj09ma_s61_p1_t758130378:\
-rw-rw---- oracle    oinstall     15466496 ago 02 15:45 bk_u1smj09k0_s60_p1_t758130304:\
-rw-rw---- oracle    oinstall    890241024 ago 02 15:41 bk_u1rmj09e6_s59_p1_t758130118:\
 
C:\Program Files\Veritas\NetBackup\bin>
 
How can I restore these images on the client?
 
Regards.
1 Solution

Accepted Solutions
Accepted Solution!

Hi Anderson, The Database was

Hi Anderson,

The Database was open ?.(DBID=1834298670, not open)

This script from Netbackup Admin Guide For Oracle 7.1 page 104

Start up the database in a nomount state.

 

On UNIX and Linux, the following is the output:
SQL> startup nomount pfile=$ORACLE_HOME/dbs/inittest.ora
%rman catalog rman/rman@rcat
RMAN> set dbid=<dbid of source database on camel
RMAN> connect target/
RMAN> run {
RMAN> ALLOCATE CHANNEL CH00 TYPE 'SBT_TAPE';
RMAN> SEND 'NB_ORA_SERV=lion, NB_ORA_CLIENT=camel';
RMAN> restore controlfile;
RMAN> }
 
 
SQL> alter database mount;
%orapwd file=$ORACLE_HOME/dbs/orapwtest password=<oracle>
%rman catalog rman/rman@RCVCAT
RMAN>set dbid=<Saved dbID of Source Target>
RMAN>connect target/
RMAN>run {
RMAN> ALLOCATE CHANNEL CH00 TYPE 'SBT_TAPE';
RMAN> ALLOCATE CHANNEL CH01 TYPE 'SBT_TAPE';
RMAN> SEND 'NB_ORA_SERV=lion, NB_ORA_CLIENT=camel';
RMAN> restore database;
RMAN> restore archivelog all;
RMAN> }
SQL>recover database until cancel using backup controlfile;
 
Regards
 
 

View solution in original post

14 Replies

Oracle recovery shell script on the client

The operating system shell starts the database restore by running the Oracle shell

script file. The Oracle shell script file contains commands to run RMAN.

The NetBackup installation script writes sample scripts to the following location:

/usr/openv/netbackup/ext/db_ext/oracle/samples/rman

Ok wrobbins, I made an script

Ok wrobbins,

I made an script based int this example. 

But how can I run this script and track the status?

Because, if I can do that after I can troubleshooting the erros.

 

Tks,

I'm running the script with

I'm running the script with this command.

 

[root@sdbora10h1 netbackup]# sh restore.tpl
: command not found0: 
: command not found5: 
: command not found7: 
: command not found1: 
: command not found3: 
: command not found8: 
restore.tpl: line 188: syntax error: unexpected end of file
 
It's returne that errors.
 
Line 188 Don't exist in script.
 
I attached the script in this topic.
 
Tks.

Using bpdbsbora

The bpdbsbora command lets you run a recovery template that is created by the

NetBackup Recovery wizard.

At the command prompt, type this command and the following options:

bpdbsbora -restore -r -t templ_name [-L progress_file]

 

where:

-restore Specifies the template type.

-r Runs the template.

Specifies the full-path name of the template you want to use.

Unlike backup templates, restore templates do not reside in a

predetermined location on the master server. They are

considered to be temporary in nature and should reside on the

client. If the full path is not specified as part of the restore

template name, the file might not be found.

-t templ_name

Optional. Specifies a run-time process log. Enclose progress_file

in quotation marks (" ") if it contains space characters.

-L progress_file

For example:

bpdbsbora -restore -r -t /oracle/restore_templs/ORCL_MON_Full.tpl

I create an script by

I create an script by wizard... 

The following message appear to me after run it.

./bpdbsbora -restore -r -t /usr/openv/netbackup/rst_SGIH.tpl

Could not execute /u01/app/oracle/product/10.2.0/db_1/bin/rman  target 'orabackup/*****@SGIH_TAF' rcvcat 'rman_user/*****@rmancat'

Anderson

For POC ...

can you install X on client & start BAR GUI ?? ./jbpSA

you can do backup & restore by easy way

Yogesh9881

Yes, X is installed on the client...

But, this script was generated from BAR GUI.

How more easy can be this?

Highlighted

are you restoring to the same

are you restoring to the same client? the source client should be the 'NB_ORA_SERV' value in your script.

Is the media server the same? you may need to change ownership of the tapes if it is a different one.

 

We restore our Oracle database every month and it works fine.

All done via command line shell scripts from the destination client.

Trace from progress of restore

 

INF - Begin progress logging for process: (21068)
INF - Starting Oracle Recovery Manager.
INF - Using: /u01/app/oracle/product/10.2.0/db_1/bin/rman 
INF - Connection info: target 'orabackup/*****@SGIH1' rcvcat 'rman_user/*****@rmancat'
INF - Start of Recovery Manager input.
INF - # -----------------------------------------------------------------
INF - # RMAN command section
INF - # -----------------------------------------------------------------
INF - RUN {
INF - ALLOCATE CHANNEL ch00 
INF -     TYPE 'SBT_TAPE';
INF - SEND 'NB_ORA_SERV=snetbackupp3.sp.local';
INF - RESTORE
INF -     TABLESPACE
INF -         'CPMBRAXIS';
INF - RECOVER
INF -     TABLESPACE
INF -         'CPMBRAXIS';
INF - RELEASE CHANNEL ch00;
INF - }
INF - End of Recovery Manager input.
INF - Start of Recovery Manager output.
INF - Begin progress logging for process: (21199)
INF - Start restore of backup piece: (bk_u2dmj5cah_s77_p1_t758296913)
INF - Backup id: sdbora10h1-vip.sesisenaisp.org.br_1312477322
INF - Policy: POL-SESI-ORACLE
INF - Master server: snetbackupp3.sp.local
INF - Restore id: 109.001
INF - Beginning restore from server snetbackupp3.sp.local to client sdbora10h1.
INF - Server status = 0
INF - End restore of backup piece: (bk_u2dmj5cah_s77_p1_t758296913)
INF - Recovery Manager: Release 10.2.0.4.0 - Production on Thu Aug 4 15:18:04 2011
INF - connected to target database: SGIH (DBID=1834298670, not open)
INF - connected to recovery catalog database
INF - allocated channel: ch00
INF - Starting restore at 04-AUG-11
INF - channel ch00: starting datafile backupset restore
INF - restoring datafile 00006 to /ud70/oradata/SGIH/CPM1.dbf
INF - channel ch00: reading from backup piece bk_u2dmj5cah_s77_p1_t758296913
INF - released channel: ch00
INF - RMAN-00571: ===========================================================
INF - RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
INF - RMAN-00571: ===========================================================
INF - RMAN-03002: failure of restore command at 08/04/2011 15:18:49
INF - ORA-19870: error reading backup piece bk_u2dmj5cah_s77_p1_t758296913
INF - ORA-19573: cannot obtain exclusive enqueue for datafile 6
INF - Recovery Manager complete.
INF - End of Recovery Manager output.
INF - End Oracle Recovery Manager.

David

Yes, I'm trying to restor in the same client. The media server is snetbackupp3.sp.local.

The images are in snetbackupp3.sp.local. Need I to change the owner?

Tks.

Try setting the NB_ORA values

Try setting the NB_ORA values to the source, you should not need the media server name.

90% of my DBA restore issues are typo in name of client or policy, lol...

 

Here is our restore script, runs on the client, edited for space and security:

 

connect target /
run
{
  allocate channel t1 type 'SBT_TAPE';
  allocate channel t2 type 'SBT_TAPE';

  send 'NB_ORA_POLICY=original RMAN policy name';
  send 'NB_ORA_CLIENT=original source client';

 

... oracle commands for what to restore...

  set until time "to_date('29-JUN-2009 01:33:00','DD-MON-YYYY HH24:MISmiley FrustratedS')";
  restore database;

  #Update control file with new database locations
  switch datafile all;
  switch tempfile all;

  recover database;
}
EXIT;

David

Follow the trace now...

 

INF - Begin progress logging for process: (7469)
INF - Starting Oracle Recovery Manager.
INF - Using: /u01/app/oracle/product/10.2.0/db_1/bin/rman 
INF - Connection info: target 'orabackup/*****@SGIH1' rcvcat 'rman_user/*****@rmancat'
INF - Start of Recovery Manager input.
INF - # -----------------------------------------------------------------
INF - # RMAN command section
INF - # -----------------------------------------------------------------
INF - RUN {
INF - ALLOCATE CHANNEL ch00 
INF -     TYPE 'SBT_TAPE';
INF - SEND 'NB_ORA_SERV=snetbackupp3.sp.local';
INF - RESTORE
INF -     TABLESPACE
INF -         'CPMBRAXIS';
INF - RECOVER
INF -     TABLESPACE
INF -         'CPMBRAXIS';
INF - RELEASE CHANNEL ch00;
INF - }
INF - End of Recovery Manager input.
INF - Start of Recovery Manager output.
INF - Begin progress logging for process: (7647)
INF - Start restore of backup piece: (bk_u2lmj5ni9_s85_p1_t758308425)
INF - Backup id: sdbora10h1-vip.sesisenaisp.org.br_1312488833
INF - Policy: POL-SESI-ORACLE
INF - Master server: snetbackupp3.sp.local
INF - Restore id: 134.001
INF - Beginning restore from server snetbackupp3.sp.local to client sdbora10h1.
INF - Server status = 0
INF - End restore of backup piece: (bk_u2lmj5ni9_s85_p1_t758308425)
INF - Recovery Manager: Release 10.2.0.4.0 - Production on Thu Aug 4 17:26:13 2011
INF - connected to target database: SGIH (DBID=1834298670, not open)
INF - connected to recovery catalog database
INF - allocated channel: ch00
INF - Starting restore at 04-AUG-11
INF - channel ch00: starting datafile backupset restore
INF - restoring datafile 00006 to /ud70/oradata/SGIH/CPM1.dbf
INF - channel ch00: reading from backup piece bk_u2lmj5ni9_s85_p1_t758308425
INF - channel ch00: restored backup piece 1
INF - piece handle=bk_u2lmj5ni9_s85_p1_t758308425 tag=FULL_SGIH
INF - channel ch00: restore complete, elapsed time: 00:00:25
INF - Finished restore at 04-AUG-11
INF - Starting recover at 04-AUG-11
INF - starting media recovery
INF - media recovery complete, elapsed time: 00:00:03
INF - Finished recover at 04-AUG-11
INF - released channel: ch00
INF - Recovery Manager complete.
INF - End of Recovery Manager output.
INF - End Oracle Recovery Manager.
 
 
 
It's appear that is working fine... But The table in tablespace it was not restored.
 
Steps:
1 - First I had an table TEST_BKP in tablespace CPMBRAXIS
2 - I made an full backup that instance
3 - The table TEST_BKP in tablespace was excluded
4 - The instance was placed in mount state
5 - The restore to CPMBRAXIS work fine 
6 - The instance was place in online state
7 - The table don't appear on tablespace CPMBRAXIS.
 
 
Some idea of that is happening?
Accepted Solution!

Hi Anderson, The Database was

Hi Anderson,

The Database was open ?.(DBID=1834298670, not open)

This script from Netbackup Admin Guide For Oracle 7.1 page 104

Start up the database in a nomount state.

 

On UNIX and Linux, the following is the output:
SQL> startup nomount pfile=$ORACLE_HOME/dbs/inittest.ora
%rman catalog rman/rman@rcat
RMAN> set dbid=<dbid of source database on camel
RMAN> connect target/
RMAN> run {
RMAN> ALLOCATE CHANNEL CH00 TYPE 'SBT_TAPE';
RMAN> SEND 'NB_ORA_SERV=lion, NB_ORA_CLIENT=camel';
RMAN> restore controlfile;
RMAN> }
 
 
SQL> alter database mount;
%orapwd file=$ORACLE_HOME/dbs/orapwtest password=<oracle>
%rman catalog rman/rman@RCVCAT
RMAN>set dbid=<Saved dbID of Source Target>
RMAN>connect target/
RMAN>run {
RMAN> ALLOCATE CHANNEL CH00 TYPE 'SBT_TAPE';
RMAN> ALLOCATE CHANNEL CH01 TYPE 'SBT_TAPE';
RMAN> SEND 'NB_ORA_SERV=lion, NB_ORA_CLIENT=camel';
RMAN> restore database;
RMAN> restore archivelog all;
RMAN> }
SQL>recover database until cancel using backup controlfile;
 
Regards
 
 

View solution in original post

Hi, After many tests, DBA

 

Hi,
 
After many tests, DBA explained to me that the recovery come back the logs until the table is deleted. 
 
Everything is OK, all the restores that is working now.
 
TKS.