This forum is currently locked. You can't register or post questions at this time. (read more)

RMAN full backup restore to another server

All posts relating to Oracle database administration.

Moderator: Tim...

safazaurs
Member
Posts: 7
Joined: Mon Mar 04, 2013 1:05 pm

RMAN full backup restore to another server

Postby safazaurs » Mon Mar 04, 2013 4:02 pm

Hei.
I have questions about RMAN and full backup.
I have serverA and serverB, and I need to restore database from TSM to serverB with different DBNAME,SID,etc.
What I did so far:
1) Copied from serverA to serverB all configuration files to make environment the same;
2) Created new database instance;
3) Added in tnsnames.ora rman catalog DB connecting info
4) After that I shutdowned database
5) Started to run the rman:

Code: Select all

rman target /
connect catalog rman/cat@cat
set dbid source_db_id

run {
allocate channel ch1 type 'SBT' parms'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
restore database;
recover database;
}

After that restore started and after a while I get error:

Code: Select all

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/04/2013 17:22:10
ORA-00210: cannot open the specified control file


What I have to do? I don't have any clues

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: RMAN full backup restore to another server

Postby Tim... » Mon Mar 04, 2013 8:44 pm

Hi.

I'm not sure what you mean by "2) Created new database instance;"

Do you mean you used DBCA to create a new instance, or do you just mean you used the parameter file and did a "startup nomount"?

As for the error, in order to restore the database you need a controlfile. You either have to use a backup controlfile from the source server, or you need to restore the controlfile from the backup, assuming you've done an auto-backup of the controlfile.

Code: Select all

RMAN> SET DBID 320066378;
RMAN> RUN {
    SET CONTROLFILE AUTOBACKUP FORMAT
          FOR DEVICE TYPE DISK TO 'autobackup_format';
    RESTORE CONTROLFILE FROM AUTOBACKUP;
    }


Only when you have the controlfile restored (or from a controlfile backup) can you proceed with the restore and recovery of the database.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog

safazaurs
Member
Posts: 7
Joined: Mon Mar 04, 2013 1:05 pm

Re: RMAN full backup restore to another server

Postby safazaurs » Tue Mar 05, 2013 6:28 am

Hi.
Yes I created new instance with DBCA with different SID,DBNAME as it is on other server.
Your solution didn't work:

Code: Select all

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/05/2013 08:24:37
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece


But in general when I execute:

Code: Select all

run {
allocate channel ch1 type 'SBT' parms'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
RESTORE CONTROLFILE FROM AUTOBACKUP;
restore database;
recover database;
}


And this what I get:

Code: Select all

allocated channel: ch1
channel ch1: sid=151 instance=itvs1 devtype=SBT_TAPE
channel ch1: Data Protection for Oracle: version 5.5.1.0

Starting restore at 05-MAR-13

channel ch1: looking for autobackup on day: 20130305
channel ch1: autobackup found: c-1553557478-20130305-00
channel ch1: control file restore from autobackup complete
output filename=+DARBA_DG/itvs/controlfile/current.462.809251597
output filename=+BACKUP_DG/itvs/controlfile/current.14813.809251597
Finished restore at 05-MAR-13

Starting restore at 05-MAR-13

channel ch1: starting datafile backupset restore
channel ch1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +DARBA_DG/itms/datafile/system.5276.708362983
restoring datafile 00002 to +DARBA_DG/itms/datafile/undotbs1.5294.708362983
restoring datafile 00003 to +DARBA_DG/itms/datafile/sysaux.5282.708362983
restoring datafile 00004 to +DARBA_DG/itms/datafile/users.5298.708362983
restoring datafile 00005 to +DARBA_DG/itms/datafile/undotbs2.5278.708363073
restoring datafile 00006 to +DARBA_DG/itms/datafile/itmsidx.5322.708366113
restoring datafile 00007 to +DARBA_DG/itms/datafile/itmstbs.5326.708366117
channel ch1: reading from backup piece 7ao3iff3_1_1
channel ch1: restored backup piece 1
piece handle=7ao3iff3_1_1 tag=TAG20130303T021544
channel ch1: restore complete, elapsed time: 00:12:57
Finished restore at 05-MAR-13

Starting recover at 05-MAR-13
released channel: ch1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/05/2013 08:19:48
ORA-00210: cannot open the specified control file


I don't have any ideas what to do next.

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: RMAN full backup restore to another server

Postby Tim... » Tue Mar 05, 2013 6:37 pm

Hi.

My point was you should not create a new database with the DBCA. It will only confuse matters. It will generate an SPFILE which contains the wrong information, like the wrong control files etc.

If you are doing a clone you should either use the RMAN DUPLICATE command, or do a manual restore. In either case you do not create a database on the second machine using the DBCA.

To manually restore a DB in its entirety, you need to do something like this:

1) Create basic initSID.ora file. Just enough to start up an instance.
2) Restore the SPFILE from the autobackup. Modify it's contents if things have changed between the source and destination server.
3) Restore the controlfile from the autobackup into the correct location, based on the contents of the SPFILE.
4) Restore the database.
5) Recover the database.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog

safazaurs
Member
Posts: 7
Joined: Mon Mar 04, 2013 1:05 pm

Re: RMAN full backup restore to another server

Postby safazaurs » Fri Mar 08, 2013 8:32 am

How can I do the first point? I just don'know how to do that, it seems unclear for me. I made init.ora (took from completly fresh instance from another server, sent it to my host B server, and what's next, how can I startup up an instance? Because I have to connect with rman to target database, and after that I could do other actions like restoring spfile from autobackup.
It would be nice, if you help me with this point as soon as possible.

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: RMAN full backup restore to another server

Postby Tim... » Fri Mar 08, 2013 11:26 am

Hi.

"took from completly fresh instance from another server". I don't understand what this means.

OK. Let's explain it this way.

- I do a software-only installation of Oracle on a server, so there are no databases/instances present at all.
- I then create an initORCL.ora file in the $ORACLE_HOME/dbs directory. (ORCL is the SID on my database). The minimum requirement for this is one line, as shown below, but you can add more stuff if you want.

Code: Select all

DB_NAME=ORCL


- I then do:

Code: Select all

export ORACLE_SID=ORCL
sqlplus / as sysdba
startup nomount


I have started an instance. It has no controlfiles or datafiles, but it is a perfectly valid instance. Just like ASM instance have no controlfiles or datafiles.

- Using this instance, I can now consider recovering spfiles and controlfiles from RMAN auto backups.
- Once I have them I can consider restoring and recovering database files.

This is the standard approach to disaster recovery or manually cloning whole databases from backups. I think you are getting confused between what an instance is and what a database is. The instance is just the memory structures and the processes. The database is the data etc.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog

safazaurs
Member
Posts: 7
Joined: Mon Mar 04, 2013 1:05 pm

Re: RMAN full backup restore to another server

Postby safazaurs » Mon Mar 11, 2013 9:11 am

Thanks for that, it was really informative.
But now I have question about this "spfile content changing".
I don't have much space on hard disk drive, but on disk array enough for this DB, I would like to ask what I have to change in spfile to assign the disk array and make this new DB as RAC.

Code: Select all

        ^B^B^G^]0^X7iitms1.__db_cache_size=1174405120
itms2.__db_cache_size=1711276032
itms1.__java_pool_size=50331648
itms2.__java_pool_size=33554432
itms1.__large_pool_size=33554432
itms2.__large_pool_size=33554432
itms1.__shared_pool_size=1912602624
itms2.__shared_pool_size=1426063360
itms1.__streams_pool_size=33554432
itms2.__streams_pool_size=0
*.archive_lag_target=1200
*.audit_file_dest='/home/oracle/product/admin/itms/adump'
*.background_dump_dest='/home/oracle/product/admin/itms/bdump'
*.backup_tape_io_slaves=TRUE
*.cluster_database_instances=2
*.cluster_database=TRUE
*.compatible='10.2.0.3.0'
*.control_file_record_keep_time=31
*.control_files='+DARBA_DG/itms/controlfile/current.5306.708363047'
*.core_dump_dest='/home/oracle/product/admin/itms/cdump'
*.db_block_size=8192
*.db_create_file_dest='+DARBA_DG'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='itms'
*.db_recovery_file_dest_size=32212254720
*.db_recovery_file_dest='+BACKUP_DG'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=itmsXDB)'
*.fast_start_mttr_target=30
itms1.instance_number=1
itms2.instance_number=2
*.job_queue_processes=10
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST'
itms1.log_archive_dest_2=''
itms2.log_archive_dest_2=''
*.log_archive_dest_2='LOCATION=USE_DB_RECOVERY_FILE_DEST'
itms1.log_archive_dest_3='location=+DARBA_DG'
*.log_archive_dest_3=''
itms2.log_archive_dest_3=''
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=500
*.optimizer_index_cost_adj=45
*.pga_aggregate_target=805306368
*.processes=500
*.remote_listener='LISTENERS_ITMS'
*.remote_login_passwordfile='exclusive'
*.sessions=555
*.sga_max_size=3221225472
*.sga_target=3221225472
itms2.thread=2
itms1.thread=1
*.undo_management='AUTO'
itms1.undo_tablespace='UNDOTBS1'
itms2.undo_tablespace='UNDOTBS2'
*.user_dump_dest='/home/oracle/product/admin/itms/udump'

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: RMAN full backup restore to another server

Postby Tim... » Mon Mar 11, 2013 9:31 am

Hi.

The location of datafiles is not in the SPFILE. It is in the controlfile. You move/rename files like this:

http://www.oracle-base.com/articles/mis ... -files.php

If you need to alter the location as part of an RMAN DUPLICATE, you set the convert parameters.

DB_FILE_NAME_CONVERT=(/u01/app/oracle/oradata/DB11G/,/u01/app/oracle/oradata/NEWSID/)
LOG_FILE_NAME_CONVERT=(/u01/app/oracle/oradata/DB11G/,/u02/app/oracle/oradata/NEWSID/)

As explained in my DUPLICATE article.

http://www.oracle-base.com/articles/11g ... uplication

Converting a single instance to RAC is more complicated. I don't have any sample articles for that, but you can read the documentation about it here:

http://docs.oracle.com/cd/E11882_01/ins ... rt2rac.htm

I don't know what your level of RAC experience is. I'm guessing not much as you are asking for how to do the conversion. RAC is not a straight forward product, so spend some time getting used to administering it before attempting to do something real with it.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog


Return to “Oracle Database Administration”

Who is online

Users browsing this forum: No registered users and 8 guests

cron