oracle .ctl 是什么文件_Oracle 手工建库,Rman恢复

7b118972c4335e440095105e18ab272d.png

概述:

Rman备份完毕,需要在异机恢复进行备份的校验,今天拿Rman实例的spfile手工建立TEST实例,操作步骤如下:

1、建立相应目录

[oracle@gstest /]$ cd u01/app/oracle/product/11gR2/db/dbs/[oracle@gstest dbs]$ cp -ap spfilerman.ora spfiletest.ora$ mkdir -p /u01/app/oracle/oradata/TEST/controlfile$ mkdir -p /u01/app/oracle/oraarch/test$ mkdir -p /u01/app/oracle/admin/test/adump

2、初始化参数文件

$ export ORACLE_SID=test$ sqlplus / as sysdbaSQL> shutdown abort;SQL> startup nomountSQL> alter system set sga_target=5G scope=spfile;SQL> alter system set control_files='/u01/app/oracle/oradata/TEST/controlfile/control01.ctl' scope=spfile;SQL> alter system set db_unique_name=test scope=spfile;SQL> alter system set log_archive_dest_1='location=/u01/app/oracle/oraarch/test' scope=spfile;SQL> alter system set audit_file_dest='/u01/app/oracle/admin/test/adump' scope=spfile;SQL> shutdown abortSQL> startup nomount

3、恢复控制文件:

nomount状态

rman target /

RMAN> restore controlfile from '/u01/rman/c-1920773739-20200418-09';

0e5ea455a897b376a4cf276461c7da3b.png

4、恢复数据文件

mount状态下

RMAN> alter database mount;RMAN> crosscheck backup;RMAN> crosscheck copy;RMAN> delete noprompt expired backup;RMAN> delete noprompt expired copy;RMAN> catalog start with '/u01/rman';RMAN> list backup;RMAN> run{allocate channel c1 device type disk;allocate channel c2 device type disk;set newname for database to new;set newname for tempfile 1 to new;set newname for tempfile 2 to new;set newname for tempfile 3 to new;restore database;switch datafile all;switch tempfile all;release channel c1;release channel c2;}

recover database;

eaef796ac4352c149607c72645ee7a30.png

RMAN> alter database open resetlogs;

database opened

5、搞定

ca62780a0949e2517c14a6dc9bb53283.png
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值