Restore Oracle database to another server

Source: Internet
Author: User
Tags sqlplus

1. Copy or remotely mount the Backupset folder from the source server to the target server

2. On the target server, export Oracle_sid as same as the source database and run "Rman Target/"

3. Restore SPFile from backup:

rman> startup Nomount;

Startup failed:ora-01078:failure in processing system parameters
Lrm-00109:could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initorcl01.ora '

Starting Oracle instance without parameter file for retrieval of SPFile
Oracle instance started

Total System Global area 158662656 bytes

Fixed Size 2211448 bytes
Variable Size 88080776 bytes
Database buffers 62914560 bytes
Redo buffers 5455872 bytes

rman> restore SPFile from '/u01/app/remote/flash_recovery_area/orcl01/backupset/2014_10_01/o1_mf_ncsn1_ Tag20141001t011809_b2q3ojl8_.bkp ';

Starting restore at 27-oct-14
Using target database control file instead of recovery catalog
Allocated Channel:ora_disk_1
Channel ORA_DISK_1:SID=18 Device Type=disk

Channel ora_disk_1:restoring SPFile from autobackup/u01/app/remote/flash_recovery_area/orcl01/backupset/2014_10_01 /o1_mf_ncsn1_tag20141001t011809_b2q3ojl8_.bkp
Channel Ora_disk_1:spfile Restore from Autobackup complete
Finished restore at 27-oct-14

4. Open another SSH session, export Oracle_sid and run "Sqlplus/as sysdba" and create Pfile from SPFile:

[Email protected] dbs]$ Sqlplus/as SYSDBA

Sql*plus:release 11.2.0.1.0 Production on Mon Oct 27 10:34:57 2014

Copyright (c) 1982, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
With the partitioning, OLAP, Data Mining and Real application testing options

Sql> create Pfile from SPFile;

File created.

Sql> exit

5. Review the pfile just created and mkdir all the file dests:

[email protected] dbs]$ cat Initorcl01.ora
orcl01.__db_cache_size=188743680
orcl01.__java_pool_size=4194304
orcl01.__large_pool_size=4194304
Orcl01.__oracle_base= '/u01/app/oracle ' #ORACLE_BASE set from environment
orcl01.__pga_aggregate_target=272629760
orcl01.__sga_target=515899392
Orcl01.__shared_io_pool_size=0
orcl01.__shared_pool_size=306184192
orcl01.__streams_pool_size=4194304
*.audit_file_dest= '/u01/app/oracle/admin/orcl01/adump '
*.audit_trail= ' DB '
*.compatible= ' 11.2.0.0.0 '
*.control_files= '/u01/app/oracle/oradata/orcl01/control01.ctl ', '/u01/app/oracle/flash_recovery_area/orcl01/ Control02.ctl '
*.db_block_size=8192
*.db_domain= "
*.db_name= ' Orcl01 '
*.db_recovery_file_dest= '/u01/app/oracle/flash_recovery_area '
*.db_recovery_file_dest_size=4070572032
*.diagnostic_dest= '/u01/app/oracle '
*.dispatchers= ' (protocol=tcp) (SERVICE=ORCL01XDB) '
*.memory_target=787480576
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile= ' EXCLUSIVE '
*.undo_tablespace= ' UNDOTBS1 '
[Email protected] dbs]$ mkdir-p/u01/app/oracle/admin/orcl01/adump

[Email protected] dbs]$ mkdir-p/u01/app/oracle/oradata/orcl01

[Email protected] dbs]$ mkdir-p/u01/app/oracle/flash_recovery_area/orcl01

6. In the RMAN session, restore the control files:

rman> restore Controlfile from '/u01/app/remote/flash_recovery_area/orcl01/backupset/2014_10_01/o1_mf_ncsn1_ Tag20141001t011809_b2q3ojl8_.bkp ';

7. Restart database in Mount mode. You cannot directly ALTER DATABASE mount because the SPFile have been restored:

Rman> ALTER DATABASE Mount;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE, STACK follows ===============
RMAN-00571: ===========================================================
Rman-03002:failure of Alter DB command at 10/27/2014 10:35:35
Ora-01103:database name ' ORCL01 ' in control file was not ' DUMMY '

rman> shutdown immediate;

Oracle instance shut down

rman> startup Mount;

8. Catalog the Backupsets:

rman> catalog start with '/u01/app/remote/flash_recovery_area/orcl01/backupset/2014_10_01 ';

9. In the Sqlplus session, check V$datafile and V$logfile and mkdir the directories.

Sql> select File#,name from V$datafile;

file#
----------
NAME
--------------------------------------------------------------------------------
1
/u01/app/oracle/oradata/orcl01/system01.dbf

2
/u01/app/oracle/oradata/orcl01/sysaux01.dbf

3
/u01/app/oracle/oradata/orcl01/undotbs01.dbf


file#
----------
NAME
--------------------------------------------------------------------------------
4
/u01/app/oracle/oradata/orcl01/user01.dbf

5
/u01/app/oracle/oradata/orcl01/example01.dbf

6
/u01/app/oracle/oradata/orcl01/index01


6 rows selected.

Sql> Select member from V$logfile;

MEMBER
----------------------------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl01/redo03.log
/u01/app/oracle/oradata/orcl01/redo02.log
/u01/app/oracle/oradata/orcl01/redo01.log

In this case,/u01/app/oracle/oradata/orcl01 have been created at step 5.

At RMAN session, restore database, recover database and open database with RESETLOGS option

rman> Restore Database;

...

rman> Recover database;

...

rman> ALTER DATABASE open resetlogs;

...

P.S.: If you want to restore datafiles to a different path, in step 10:

Rman> run{
2> set newname for datafile 1 to '/u01/app/oracle/oradata/newpath/system01.dbf ';

3> Restore Database;
4> switch datafile all;
5> Recover database;
6>}

Restore Oracle database to another server

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.