赞
踩
搭建Oracle ADG(备份方式)
1.必要配置
1.1 查看是否开启归档
1.2 启库开启强制日志
1.3 添加standby logfile
2.主库步骤
2.1 主库创建备份
2.2 主库创建备库控制文件
2.3 创建pfile以及修改主备参数
2.4 传输主库备份,备库控制文件,pfile至备库
3.备库步骤
3.1 修改备库pfile文件
3.2 pfile创建spfile
3.3 关闭数据库重新启动(主要是让他使用spfile)
3.4 使用RMAN恢复数据文件
3.5 启动同步进程
1.必要配置
1.1 查看是否开启归档
SYS@PROD5 >startup mount;
ORACLE instance started.
Total System Global Area 1224736768 bytes
Fixed Size 2923824 bytes
Variable Size 838861520 bytes
Database Buffers 369098752 bytes
Redo Buffers 13852672 bytes
Database mounted.
SYS@PROD5 >archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 24
Next log sequence to archive 26
Current log sequence 26
我当前是已经开启归档的,如果没有开启归档,需要开启归档
SYS@PROD5 >alter database archivelog;
Database altered.
SYS@PROD5 >select group#,bytes/1024/1024 from v$log;
GROUP# BYTES/1024/1024
---------- ---------------
1 50
2 50
3 50
SQL> ALTER DATABASE ADD STANDBY LOGFILE ('/oracle/dbs/slog1.rdo') SIZE 50M;
SQL> ALTER DATABASE ADD STANDBY LOGFILE ('/oracle/dbs/slog2.rdo') SIZE 50M;
SQL> ALTER DATABASE ADD STANDBY LOGFILE ('/oracle/dbs/slog3.rdo') SIZE 50M;
SQL> ALTER DATABASE ADD STANDBY LOGFILE ('/oracle/dbs/slog4.rdo') SIZE 50M;
这一步需要将控制文件指定,也就是你从主库传输到备库的位置
*.control_files='/u01/app/oracle/oradata/orclsdg/ORCLSDG/controlfile/standby.ctl'
3.2 pfile创建spfile
startup nomount pfile='xxxx'
3.3 关闭数据库重新启动(主要是让他使用spfile)
shutdown immediate
startup nomount;
alter database mount;
3.4 使用RMAN恢复数据文件
rman target /
run{
set newname for datafile 1 to '/u01/app/oracle/oradata/orclsdg/datafile/system.dbf';
set newname for datafile 2 to '/u01/app/oracle/oradata/orclsdg/datafile/sysaux.dbf';
set newname for datafile 3 to '/u01/app/oracle/oradata/orclsdg/datafile/undotbs1.dbf';
set newname for datafile 4 to '/u01/app/oracle/oradata/orclsdg/datafile/undotbs2.dbf';
set newname for datafile 5 to '/u01/app/oracle/oradata/orclsdg/datafile/users.dbf';
set newname for datafile 6 to '/u01/app/oracle/oradata/orclsdg/datafile/zabbix.dbf';
restore database;
}
3.5 启动同步进程
sqlplus / as sysdba
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
————————————————
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/qq_40768088/article/details/134464063
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。