**oracle12c rman异机恢复测试**

本文详细介绍了如何进行Oracle 12c数据库的RMAN异地恢复测试。首先,在源库上检查控制文件、参数文件和备份的位置,并将必要的文件复制到目标库。接着,在目标库上创建相同目录,设置 oracle_sid 并启动数据库至nomount状态。然后,使用RMAN恢复参数文件和控制文件,逐一恢复控制文件,并在控制文件中注册备份和归档日志。最后,完成整个数据库的恢复并启动数据库。需要注意的是,如果监听器未启动,可能需要强制注册。
摘要由CSDN通过智能技术生成

源库:10.20.20.*
查看控制文件、参数文件、备份文件所在位置


```bash
[oracle@redhat6 gxerp]$ rman target /

Recovery Manager: Release 12.2.0.1.0 - Production on Fri Aug 21 11:01:24 2020

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database: GXERP (DBID=2558337661)

RMAN> list backup of spfile;

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1559    Full    18.13M     DISK        00:00:01     18-AUG-20      
        BP Key: 1559   Status: AVAILABLE  Compressed: NO  Tag: TAG20200818T230208
        Piece Name: /u01/app/oracle/product/12.2.0/db_1/dbs/c-2558337661-20200818-00
  SPFILE Included: Modification time: 21-APR-20
  SPFILE db_unique_name: GXERP
  
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1559    Full    18.13M     DISK        00:00:01     18-AUG-20      
        BP Key: 1559   Status: AVAILABLE  Compressed: NO  Tag: TAG20200818T230208
        Piece Name: /u01/app/oracle/product/12.2.0/db_1/dbs/c-2558337661-20200818-00
  Control File Included: Ckp SCN: 49351405     Ckp time: 18-AUG-20

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1560    Full    18.13M     DISK        00:00:00     19-AUG-20      
        BP Key: 1560   Status: AVAILABLE  Compressed: NO  Tag: TAG20200819T174020
        Piece Name: /u01/app/oracle/GXERP/autobackup/2020_08_19/o1_mf_s_1048873220_hmsww4v1_.bkp
  Control File Included: Ckp SCN: 49584715     Ckp time: 19-AUG-20

拷贝密码文件、创办pfile、控制文件备份、数据文件备份到目标库
密码文件

[oracle@redhat6 dbs]$ scp orapwgxerp oracle@10.20.20.163:/u01/app/oracle/product/12.2.0/db_1/dbs/
oracle@10.20.20.163's password: 
orapwgxerp                                                                                            100% 3584     3.5KB/s   00:00  

pfile

oracle@redhat6 dbs]$ sqlplus / as sysdba;

SQL*Plus: Release 12.2.0.1.0 Production on Fri Aug 21 11:26:02 2020

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> create pfile='/tmp/pfile' from spfile;

File created.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@redhat6 dbs]$ scp /tmp/p
pfile               pulse-Fq7to1EQ9iqp/ pulse-RgkuwUEUQmRg/ 
[oracle@redhat6 dbs]$ scp /tmp/pfile oracle@10.20.20.163:/tmp/
oracle@10.20.20.163's password: 
pfile

控制文件

[oracle@redhat6 dbs]$ scp c-2558337661-20200818-00 oracle@10.20.20.163:/u01/app/oracle/product/12.2.0/db_1/dbs/
oracle@10.20.20.163's password: 
c-2558337661-20200818-00                                                                              100%   18MB  18.1MB/s   00:00

数据备份、归档文件并在目标库解压

   [root@storage1 10.20.20.147]# scp rmanbk20200818.tar.gz oracle@10.20.20.163:/u01/bk
oracle@10.20.20.163's password: 
rmanbk20200818.tar.gz                                                                                 100% 2069MB 111.5MB/s   00:18 
[root@redhat6 ~]# su - oracle 
[oracle@redhat6 ~]$ cd /u01/app/oracle/backup/
[oracle@redhat6 backup]$ ls
arch_GXERP_20200818_1651_1  full_GXERP_20200818_1645_1  full_GXERP_20200818_1648_1
full_GXERP_20200818_1643_1  full_GXERP_20200818_1646_1  full_GXERP_20200818_1649_1
full_GXERP_20200818_1644_1  full_GXERP_20200818_1647_1  full_GXERP_20200818_1650_1

目标库:
创建和源库相同的目录

[oracle@redhat6 adump]$ mkdir -p /u01/app/oracle/admin/gxerp/adump
[oracle@redhat6 adump]$ mkdir -p /u01/app/oracle/admin/gxerp/dpdump
[oracle@redhat6 adump]$ mkdir -p /u01/app/oracle/admin/gxerp/pfile
[oracle@redhat6 adump]$ mkdir -p /u01/app/oracle/admin/gxerp/xdb_wallet
[oracle@redhat6 gxerp]$ mkdir -p /u01/app/oracle/oradata/gxerp
[oracle@redhat6 gxerp]$ mkdir -p /u01/app/oracle/arch
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值