1、环境信息:
系统:
oracle-linux 5.7
数据库版本:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
主库:192.168.12.31
备库:192.168.12.231 SID:yoon
2、查看DG是否已经安装:
SQL> select * from v$option where parameter = 'Oracle Data Guard';
PARAMETER
-------------------- --------------------
Oracle Data Guard
TRUE表示已经安装可以配置,否则需要安装相应软件
3、查看主库是否开启归档:
SQL> archive log list;
Database log mode
Automatic archival
Archive destination
Oldest online log sequence
Current log sequence
4、设置主库为归档模式:
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 2505338880 bytes
Fixed Size
Variable Size
Database Buffers
Redo Buffers
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list;
Database log mode
Automatic archival
Archive destination
Oldest online log sequence
Next log sequence to archive
Current log sequence
5、设置主库为强制记录日志:
SQL> alter database force logging;
Database altered.
6、创建standy log files:
SQL> select group#,member from v$logfile;
------- -----------------------------------
添加: