标签:color ble rman seq 链接 user shutdown ber cal
利用泠备份恢复standby数据库
先查好控制文件、redo、undo文件、数据文件的路径
SQL> ALTER system SETlog_archive_dest_state_2 =‘DEFER‘;
System altered.
SQL>
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
<版权全部,文章同意转载,但必须以链接方式注明源地址,否则追究法律责任!>
原博客地址: http://blog.csdn.net/mchdba/article/details/46622839
原作者:黄杉 (mchdba)
#建立一个泠备份文件夹
mkdir /data/oracle_cold/
開始泠备份控制文件
cp /data/oracle_cold/
cp /home/oradata/orcl/control01.ctlcontrol01.ctl
cp /oracle/app/oracle/flash_recovery_area/orcl/control02.ctlcontrol02.ctl
開始泠备份redo、undo文件
mkdir orcl_2
cp -r /home/oradata/orcl/*.log orcl_2
開始泠备份数据文件
cp -r /home/oradata/orcl/*.dbf orcl_2
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
查看原来的控制文件文件夹
[oracle@localhost oracle_cold]$ morecontrolfile.log
SQL> SELECT name FROMv$controlfile;
NAME
--------------------------------------------------------------------------------
/home/oradata/orcl/control01.ctl
/oracle/app/oracle/flash_recovery_area/orcl/control02.ctl
SQL>
開始复制覆盖
[oracle@localhost oracle_cold]$ cpcontrol02.ctl /oracle/app/oracle/flash_recovery_area/orcl/control02.ctl
[oracle@localhost oracle_cold]$ cpcontrol01.ctl /home/oradata/orcl/control01.ctl
[oracle@localhost oracle_cold]$
查看曾经的redo、undo文件路径
[oracle@localhost oracle_cold]$ morelogfile.log
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/home/oradata/orcl/redo03.log
/home/oradata/orcl/redo02.log
/home/oradata/orcl/redo01.log
/home/oradata/orcl/redo_dg_01.log
/home/oradata/orcl/redo_dg_02.log
/home/oradata/orcl/redo_dg_03.log
6 rows selected.
SQL>
開始覆盖redo、undo文件
[oracle@localhost oracle_cold]$ cp orcl_2/*.log/home/oradata/orcl/
[oracle@localhost oracle_cold]$
查看曾经的数据文件文件夹
[oracle@localhost oracle_cold]$ moredatafile.log
SELECT name FROM v$datafile;
1 /home/oradata/orcl/system01.dbf
2 /home/oradata/orcl/sysaux01.dbf
3 /home/oradata/orcl/undotbs01.dbf
4 /home/oradata/orcl/users01.dbf
5 /home/oradata/orcl/orclk01.dbf
6 /home/oradata/orcl/plas01.dbf
7 /home/oradata/orcl/pl01.dbf
8 /home/oradata/orcl/help01.dbf
9 /home/oradata/orcl/adobelc01.dbf
10 /home/oradata/orcl/sms01.dbf
11 /home/oradata/orcl/plcrm01.dbf
[oracle@localhost oracle_cold]$
開始覆盖曾经的数据文件文件夹
[oracle@localhost oracle_cold]$ cp orcl_2/*.dbf/home/oradata/orcl/
[oracle@localhost oracle_cold]$
SQL> startup
ORACLE instance started.
Total System Global Area 5344731136 bytes
Fixed Size 2213136 bytes
Variable Size 3355446000 bytes
Database Buffers 1946157056 bytes
Redo Buffers 40914944 bytes
Database mounted.
Database opened.
SQL>
SQL> ALTER system SET log_archive_dest_state_2=‘enable‘;
System altered.
SQL>
select sequence#,applied fromv$archived_log order by sequence# asc;
SQL> alter database recovermanagedstandby database disconnect from session;
Database altered.
SQL>
SQL> select open_modefromv$database;
OPEN_MODE
--------------------
READ ONLY WITH APPLY
SQL>
标签:color ble rman seq 链接 user shutdown ber cal
原文地址:http://www.cnblogs.com/gavanwanggw/p/6697558.html