Total System Global Area 1.1358E+10 bytes
Fixed Size 2216744 bytes
Variable Size 8589937880 bytes
Database Buffers 2751463424 bytes
Redo Buffers 13946880 bytes
Database mounted.
Database opened.
SQL>
/*取代下面的过程,数据库本来就是归档的,所以关闭之后再重启,数据库也是归档的
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;*/
2.3 启动备库应用
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
这个命令是死命令,会一直卡在这,但是后台其实归档日志已经在同步了,除非人为的关闭 否则 一直是这样的。
ALTER DATABASE OPEN; --备库不是必须处于OPEN状态,启动归档被应用即可,这个命令可以不用执行。
2.4 check,查看归档是否及时应用
先检查备库的归档日志同步情况
SQL> SELECT NAME,applied FROM v$archived_log;
......
NAME
--------------------------------------------------------------------------------
APPLIED
---------
/data/oracle/oradgdata/standby_archive/1_20866_821708334.dbf
YES
/data/oracle/oradgdata/standby_archive/1_20867_821708334.dbf
YES
/data/oracle/oradgdata/standby_archive/1_20868_821708334.dbf
YES
NAME
--------------------------------------------------------------------------------
APPLIED
---------
/data/oracle/oradgdata/standby_archive/1_20869_821708334.dbf
YES
2800 rows selected.
SQL>
如果发现全部都是YES,证明归档日志已经在同步。
在主库执行check:
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oracle/app/oracle/flash_recovery_area/archivelog
Oldest online log sequence 20869
Next log sequence to archive 20871
Current log sequence 20871
SQL>