复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66前期参数设置部分忽略,可参考其它文章介绍。 1、从主库创建备库控制文件备份 backup current controlfile for standby format '/home/oracle/standby_controlfile.bak'; 2、备份主库 run { allocate channel ch1 type disk; allocate channel ch2 type disk; allocate channel ch3 type disk; allocate channel ch4 type disk; backup database format '/home/oracle/DB0_%U.bak'; release channel ch1; release channel ch2; release channel ch3; release channel ch4; } 3、传输备份集到备库 scp xxxxxx.bak xxxxxx.bak oracle@xxx.xxx.xxx.xxx:/home/oracle/backup/ 4、备库启动到umount状态 startup nomount 5、恢复备库控制文件 restore standby controlfile from '/home/oracle/xxxxxx.bak'; 6、启动到mount状态 alter database mount; 7、注册备份集到控制文件 catalog start with '/home/oracle/backup/'; 8、批量生成set newname语句 select 'set newname for datafile '||file#||' to ''/u01/app/oracle/oradata/orcl/'||substr(name,21,100)||''';' from v$datafile; select 'set newname for tempfile '||file#||' to ''/u01/app/oracle/oradata/orcl/'||substr(name,21,100)||''';' from v$tempfile; 9、全库恢复 run { allocate channel ch1 type disk; allocate channel ch2 type disk; allocate channel ch3 type disk; allocate channel ch4 type disk; set newname for datafile 1 to '/u01/app/oracle/oradata/orclstd/system01.dbf'; set newname for datafile 2 to '/u01/app/oracle/oradata/orclstd/sysaux01.dbf'; set newname for datafile 3 to '/u01/app/oracle/oradata/orclstd/undotbs01.dbf'; set newname for datafile 4 to '/u01/app/oracle/oradata/orclstd/user01.dbf'; set newname for datafile 5 to '/u01/app/oracle/oradata/orclstd/test.dbf'; set newname for datafile 6 to '/u01/app/oracle/oradata/orclstd/testdg.dbf'; set newname for datafile 7 to '/u01/app/oracle/oradata/orclstd/testdg01.dbf'; set newname for datafile 8 to '/u01/app/oracle/oradata/orclstd/test02.dbf'; set newname for datafile 9 to '/u01/app/oracle/oradata/orclstd/testdg03.dbf'; restore database; switch datafile all; release channel ch1; release channel ch2; release channel ch3; release channel ch4; } 10、追加归档 recover database; 11、启用实时应用 alter database recover managed standby database using current logfile disconnect from session; 12、关闭实时应用 alter database recover managed standby database cancel; 13、打开数据库 alter database open; 14、开启实时应用 alter database recover managed standby database using current logfile disconnect from session; 15、测试是否同步 ———————————————— 版权声明:本文为CSDN博主「Mr.Lpp」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/u012232730/article/details/86229003
最后
以上就是烂漫小懒虫最近收集整理的关于rman备份搭建DataGuard的全部内容,更多相关rman备份搭建DataGuard内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复