Restoring Backups Created Using Older Versions of RMAN

使用旧版本RMAN备份要求目标与源数据库be a supported upgrade path

You can restore backups that were created using older versions of RMAN, up to Oracle Database 9i Release 2 (9.2.0.8). There must be a supported upgrade path between the Oracle Database version on which the backups were created and the Oracle software version on which you want to run the restored database.

In this example, the source database is an Oracle Database 11g Release 2 database and it is configured to use a server parameter file (spfile). The database runs in ARCHIVELOG mode and uses a fast recovery area. Control file autobackups are also configured. You then create RMAN backups of the source database, including the archived redo logs.

The destination host on which these backups are restored has Oracle Database 12c Release 1 installed.

To restore RMAN backups that were created using an RMAN version that is older than the current target database version:

  1. Verify that there is a supported upgrade path from the database version on which the backups were created to the Oracle server version on which you plan to restore the database.

For example, if your RMAN backups were created on Oracle Database 11g Release 2 (11.2.0.3) and you want to run the restored database on Oracle Database 12c Release 1 (12.1), then you must verify that there is a supported upgrade path from release 11.2.0.3 to release 12.1.

  1. Ensure that the source database backups are available at the destination host on which they must be restored.

You can either use an operating system utility to copy the backups to the destination host or store the backups in a shared location that is accessible to the destination host.

  1. Shut down the destination database.
  2. On the destination host, set the ORACLE_SID to the same value that was used on the source database.

$ setenv ORACLE_SID db112

  1. Start RMAN on the destination host and connect to the target database using operating system authentication and without a recovery catalog.

$ rman target / NOCATALOG

  1. Set the DBID to the same value as the source database.

RMAN> set DBID 699892390;

  1. Start the target database in nomount mode.

RMAN> startup nomount;

RMAN fails to find the server parameter file, which has not yet been restored. However, the instance is started with a “dummy” file

  1. Restore the server parameter file from the source database autobackup.

run {

    set controlfile autobackup format for device type disk to '/scratch/fra/cf/%F.bck';

    restore spfile to pfile '/dev3/oracle/network/init_db112.ora' from autobackup recovery area '/scratch /fra/cf' db_name 'DB112';

    shutdown abort; }

  1. Edit the restored initialization parameter file and modify the required initialization parameters.

主要是配置相同compatible参数、deprecated参数以及一些路径相关参数

This includes the COMPATIBLE parameter, if the compatibility requirement for the target database is different from that set in the source database, and parameters that are deprecated in the target database release. Also update any location-specific parameters such as those ending with _DEST to reflect the new directory structure.

  1. Restart the instance with the edited initialization parameter file.

RMAN> startup force nomount pfile='/dev3/oracle/network/init_db112.ora';

  1. Restore the control file from an autobackup and then mount the database.

run {

    set controlfile autobackup format for device type disk to '/scratch/fra/cf/%F.bck';

    restore controlfile from autobackup recovery area '/scratch/fra/cf' db_name 'DB112';

    alter database mount; }

  1. Catalog data file copies of the source database that were made available to the destination host.

RMAN> catalog start with '/scratch/fra/DB112/backupset';

  1. Restore and recover the source database.

run

{

    set newname for database to '/ade/b/1885631999/oracle/dbs/%U.f';

    alter database rename file '/dev1/oracle/dbs/redo01.log' to '/dev3/oracle/dbs/redo1.log';

    alter database rename file '/dev1/oracle/dbs/redo02.log' to '/dev3/oracle/dbs/redo2.log';

    set until scn 1092435;

    restore database;

    switch datafile all;

    recover database;

}

  1. Open the restored database with the RESETLOGS and UPGRADE options.

RMAN> alter database open resetlogs upgrade;

Statement processed

RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row

RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows

ORACLE error from target database:

ORA-04023: Object SYS.STANDARD could not be validated or authorized

The error is caused by database packages that need to be revalidated as part of the upgrade process.

  1. Exit RMAN.
  2. Upgrade the target database to the desired Oracle release by performing the steps required to upgrade a database.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值