Recovery from different machines based on one full backup of RMAN

Source: Internet
Author: User
Recovery from different machines based on one full backup of rman I. Target database preparation: Back up dbrun {allocatechannelch1devicetypediskmaxpiecesize10

Recovery from different machines according to one full backup of rman I. Target database preparation: Backup dbrun {allocate channel recovery device type disk maxpiecesize = 10

Homepage → Database Technology

Background:

Read News

Recovery from different machines based on one full backup of RMAN

[Date:] Source: Linux community Author: huiyang23 [Font:]

Recovery from different machines based on one full backup of rman

I. Preparations for the Target database:

Back up db

Run {

Allocate channel specified device type disk maxpiecesize = 10g;

SQL 'alter system archive log current ';

Change archivelog all crosscheck;

Backup full database tag = ora10gdbfullbk

Format '/u01/backup/% d_db _ % t _ % s _ % P'

Plus archivelog format'/u01/backup/% d_arch _ % t _ % s _ % P' delete all input;

Backup current controlfile

Format '/u01/backup/% d_ctlfile _ % t _ % s _ % P ';

Release channel identifier;

}

View backup files

-Bash-3.1 $ ll/u01/backup

Total 850468

-Rw-r -- 1 root 1277 Apr 20 21:53 initora10g. ora

-Rw-r -- 1 root 8484864 Apr 21 ORA10G_arch_749016313_41_1

-Rw-r -- 1 root 386560 Apr 21 ORA10G_arch_749016700_43_1

-Rw-r -- 1 root 7438336 Apr 21 ORA10G_ctlfile_749016703_44_1

-Rw-r -- 1 root 853688320 Apr 21 ora10g_db_7490163342642_1

Ii. Auxiliary database preparation:

1. Create a password file

$ Orapwd file =/u01/app/Oracle/product/10.2.0/db_1/dbs/orapwhy2 password = oracle

2. Create related directories

$ Mkdir oradata

$ Pwd

/U01/oradata

3. Copy the pfile of the target database and the backup database to the auxiliary database.

4. Use pfile to start the aupoliciary Library to the nomount state.

SQL> startup nomount pfile =/u01/app/oracle/product/10.2.0/db_1/dbs/orapwhy2;

5. Restore Control Files

$ Export ORACLE_SID = hy2

$ Rman target/

RMAN> restore controlfile from '/u01/backup/ORA10G_ctlfile_749016703_44_1 ';

6. Start the database to the mount status.

RMAN> alter database mount;

7. restore db

7.1 different directory recovery situations:

RMAN>

Run

{

Set newname for datafile 1 to "/u01/oradata/system01.dbf ";

Set newname for datafile 2 to "/u01/oradata/sysaux01.dbf ";

Set newname for datafile 3 to "/u01/oradata/undotbs01.dbf ";

Set newname for datafile 4 to "/u01/oradata/users01.dbf ";

Restore database;

Switch datafile all;

}

7.2 restore the same directory

RMAN> restore database;

8. recover db

RMAN> recover database;

$ Export ORACLE_SID = ora10g

9. Use open resetlogs? Open Database

SQL> alter database open resetlogs;

10. Run the NID command to modify the DBID and DBNAME of the mount database.

SQL> shutdown immediate

SQL> startup mount;

$ Nid target = sys/password dbname = hy2

SQL> alter system set db_name = hy2 scope = spfile;

SQL> shutdown immediate

SQL> startup

SQL> alter database open resetlogs;

Verification:

SQL> select name, dbid from v $ database;

NAME DBID

-------------------

HY2 2874673008

  • 0
  • Oracle constructs a table with the same structure as a known table

    MySQL Rename Table statement

    Oracle tutorial

    Image Information

    View All comments in this article (0)

    Comments

    Latest Information

    Popular this week

    Introduction to Linux community-advertisement service-website map-help Info-contact us
    The articles published on this site (LinuxIDC) do not mean that they agree with the statement or description. They only provide more information and do not constitute any suggestions.


    Copyright©2006-2011 Linux community All rights reserved Zhejiang ICP backup No. 06018118

    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.