- 概要步驟
#關(guān)閉順序:
1:先關(guān)閉主庫
2:暫停備庫redo應(yīng)用
3:后關(guān)閉備庫
4:關(guān)閉OS
#啟動順序:
1:先啟動備庫
2:后啟動主庫
3:啟動備庫redo應(yīng)用
- 具體步驟如下(關(guān)閉)
#關(guān)閉順序:
1:先關(guān)閉主庫
[oracle@XAG191 ~]$ sqlplus / as sysdba
SQL> shutdown immediate;
SQL> exit
[oracle@XAG191 ~]$ lsnrctl stop
[oracle@XAG191 ~]$ systemctl poweroff -i
2:暫停備庫redo應(yīng)用
[oracle@XAG192 ~]$ sqlplus / as sysdba
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
3:后關(guān)閉備庫
SQL> SHUTDOWN IMMEDIATE;
SQL> exit
[oracle@XAG192 ~]$ lsnrctl stop
4:關(guān)閉OS
[oracle@XAG192 ~]$ systemctl poweroff -i
- 具體步驟如下(啟動)
1:先啟動備庫
[oracle@XAG192 ~]$ lsnrctl start
[oracle@XAG192 ~]$ sqlplus / as sysdba
SQL> startup
2:后啟動主庫
[oracle@XAG191 ~]$ lsnrctl start
[oracle@XAG191 ~]$ sqlplus / as sysdba
SQL> startup;
3:啟動備庫應(yīng)用
[oracle@XAG192 ~]$ sqlplus / as sysdba
#開啟實(shí)時日誌應(yīng)用
SQL> alter database recover managed standby database using current logfile disconnect from session;
SQL> select database_role,protection_mode,open_mode from v$database;
DATABASE_ROLE PROTECTION_MODE OPEN_MODE
---------------- -------------------- --------------------
PHYSICAL STANDBY MAXIMUM PERFORMANCE READ ONLY WITH APPLY
#check,查看歸檔是否及時應(yīng)用 (備庫)
SQL> SELECT sequence#,applied FROM v$archived_log;
SEQUENCE# APPLIED
---------- ---------
9 YES
8 YES
10 YES
11 YES
12 YES
13 YES
15 YES
14 YES
8 rows selected.
#如果發(fā)現(xiàn)全部都是YES麻掸,證明歸檔日志已經(jīng)在同步
#檢查主庫
[oracle@XAG191 ~]$ sqlplus / as sysdba
SQL> select database_role,protection_mode,open_mode from v$database;
DATABASE_ROLE PROTECTION_MODE OPEN_MODE
---------------- -------------------- --------------------
PRIMARY MAXIMUM PERFORMANCE READ WRITE