在standby database上运行:
- Start databse as read only model.
SQL> startup mount;
SQL> alter database open read only;
- Start real-time apply.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
Database altered.
- show database status
SQL> select db_unique_name,database_role,open_mode from v$database;
DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE
-------------- ----------------- --------------------
shenzhen_un PHYSICAL STANDBY READ ONLY WITH APPLY
- Stop Redo Apply.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Database altered.
- Check the Redo Apply service status.
SQL> SELECT THREAD#,SEQUENCE#,PROCESS,CLIENT_PROCESS,STATUS,BLOCKS FROM V$MANAGED_STANDBY;
- Check the status of the latest log sequence.
SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
- last archived sequence(can use also in primary)
SQL> SELECT MAX(SEQUENCE#) FROM V$ARCHIVED_LOG;
- last applied sequence
SQL> SELECT MAX(SEQUENCE#) FROM V$ARCHIVED_LOG WHERE APPLIED='YES';