024_DG_42_START_Parmary
檢查開啟狀態
-- 請全貼
-- ===check===
select dbid,name from v$database;
select
log_mode , OPEN_MODE , DATABASE_ROLE
from v$database;
--DataGuard
select SWITCHOVER_STATUS , PROTECTION_MODE , PROTECTION_LEVEL
from
v$database;
Process
SELECT
PROCESS,STATUS,CLIENT_PROCESS,SEQUENCE#, BLOCK#,BLOCKS FROM
V$MANAGED_STANDBY;
-- ===check===
select dbid,name from v$database;
select
log_mode , OPEN_MODE , DATABASE_ROLE
from v$database;
--DataGuard
select SWITCHOVER_STATUS , PROTECTION_MODE , PROTECTION_LEVEL
from
v$database;
Process
SELECT
PROCESS,STATUS,CLIENT_PROCESS,SEQUENCE#, BLOCK#,BLOCKS FROM
V$MANAGED_STANDBY;
Process
SQL> -- 找 LNS
PROCESS,STATUS,CLIENT_PROCESS,SEQUENCE#, BLOCK#,BLOCKS FROM
V$MANAGED_STANDBY;
SQL> -- 傳送狀態
SELECT DEST_NAME,STATUS,TYPE,RECOVERY_MODE,GAP_STATUS
FROM V$ARCHIVE_DEST_STATUS WHERE DEST_ID=2;
SQL> --
log_archive_dest_2
alter system set
log_archive_dest_2='SERVICE=STANDBY compression=disable' scope=both;
SQL> -- # Deffer ENABLE
alter system set log_archive_dest_state_2=defer ;
alter system set
log_archive_dest_state_2=enable ;
SQL> --log switch
alter system switch logfile;
設定
1 lsnrctl 要先通
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)(HOST = 192.168.48.10 )(PORT = 1521)))
(CONNECT_DATA
=
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL )))
STANDBY2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL
= TCP)(HOST = 192.168.48.20 )(PORT = 1521)))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL )))
2 tnsping 測試看
[oracle]$
tnsping standby2
Used
TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION
= (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.48.20 )(PORT =
1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL )))
OK (10 msec)
4.9 調整Primary Database參數 這個很重要 最重要的一動
SQL> -- ## 11G 專用
alter system set log_archive_dest_2='SERVICE=STANDBY compression=disable'
scope=both;
SQL> -- 10G 專用
alter system set log_archive_dest_2=
'SERVICE=STANDBY LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=orcl';
SQL> show parameter
log_archive_dest_2 ;
SQL> -- #
Deffer ENABLE
alter system set
log_archive_dest_state_2=defer ;
alter system set
log_archive_dest_state_2=enable ;
4.10.3 確認log傳送的狀態
SQL> -- 11G 以上
SELECT
DEST_NAME,STATUS,TYPE,RECOVERY_MODE,GAP_STATUS FROM V$ARCHIVE_DEST_STATUS
WHERE DEST_ID=2;
SQL> -- 10G 專用
SELECT DEST_NAME,STATUS,TYPE,RECOVERY_MODE FROM
V$ARCHIVE_DEST_STATUS WHERE DEST_ID=2 ;
使用下列語法於Primary
Database確認Standby Database apply機制是否為real-time apply。
DEST_NAME
--------------------------------------------------------------------------------
STATUS TYPE RECOVERY_MODE GAP_STATUS
--------- --------------
----------------------- ------------------------
LOG_ARCHIVE_DEST_2
VALID PHYSICAL MANAGED REAL
TIME APPLY NO GAP
4.10.2 Primary Database switch logfile PROD
PROD使用下列語法於Primary Database switch logfile
SQL>
alter system switch logfile;
SQL> SELECT
PROCESS,STATUS,CLIENT_PROCESS,SEQUENCE#, BLOCK#,BLOCKS FROM
V$MANAGED_STANDBY;
PROCESS STATUS CLIENT_P SEQUENCE# BLOCK#
BLOCKS
--------- ------------ -------- ---------- ---------- ----------
ARCH CLOSING ARCH 20 1 149
ARCH CLOSING ARCH 21 43008 1546
ARCH
CLOSING ARCH 17 1 248
ARCH CLOSING ARCH 19 1 448
LNS WRITING
LNS 22
55382 1
ORACLE BASE 11G
https://oracle-base.com/articles/11g/data-guard-setup-11gr2
ORACLe 官網 11G
https://docs.oracle.com/cd/E11882_01/server.112/e41134/create_ps.htm#SBYDB00200
ORACLE 官網 10g
https://docs.oracle.com/cd/B19306_01/server.102/b14239/create_ps.htm#i68937
沒有留言:
張貼留言