1.啟動(dòng)/停止MRP進(jìn)程
為平潭等地區(qū)用戶提供了全套網(wǎng)頁(yè)設(shè)計(jì)制作服務(wù),及平潭網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站制作、外貿(mào)網(wǎng)站建設(shè)、平潭網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!
log_archive_dest 為L(zhǎng)GWR時(shí)需要?jiǎng)?chuàng)建standby redolog,為arch時(shí)無(wú)須設(shè)置standby redolog
--必須設(shè)置standby redolog,數(shù)據(jù)實(shí)時(shí)同步
alter database recover managed standby database using current controlfile disconnect;
--數(shù)據(jù)異步同步,當(dāng)主庫(kù)切換歸檔時(shí)進(jìn)行數(shù)據(jù)同步
alter database recover managed standby database disconnect from session;
--關(guān)閉MRP進(jìn)程
alter database recover managed standby database cancel;
2.檢查主備庫(kù)狀態(tài)
select OPEN_MODE,PROTECTION_MODE,ACTIVATION#,DATABASE_ROLE,SWITCHOVER#,SWITCHOVER_STATUS FROM V$DATABASE;
確認(rèn)主庫(kù)狀態(tài)為to standby或者為sessions active、保護(hù)模式應(yīng)該maximum performance、角色為PRIMARY
在備庫(kù)查詢時(shí)通常為not allowed 或者sessions active,角色為PHYSICAL STANDBY
3.檢查數(shù)據(jù)同步情況
-查看應(yīng)用日志延遲時(shí)間:
select value from v$dataguard_stats where name='apply lag';
-查看接收日志延遲時(shí)間:
select value from v$dataguard_stats where name='transport lag';
-查看主庫(kù)歸檔
Primary: SQL> select thread#, max(sequence#) "Last Primary Seq Generated"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
group by thread# order by 1;
-查看備庫(kù)已接收歸檔
PhyStdby:SQL> select thread#, max(sequence#) "Last Standby Seq Received"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
group by thread# order by 1;
-查看備庫(kù)已應(yīng)用歸檔
PhyStdby:SQL>select thread#, max(sequence#) "Last Standby Seq Applied"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
and val.applied in ('YES','IN-MEMORY')
group by thread# order by 1;
-查看歸檔應(yīng)用詳細(xì)情況
select first_time,sequence#,applied from v$archived_log;
-查看主備庫(kù)GAP
select * from v$archive_gap;
4.查詢ASM Diskgroup 使用率
SET LINES 300 PAGES 9999
COL name FOR a15
COL USED_PERCENT FOR a15
SELECT GROUP_NUMBER,
NAME,
TOTAL_MB / 1024 total_gb,
FREE_MB / 1024,
USABLE_FILE_MB / 1024,
ROUND ( (TOTAL_MB - USABLE_FILE_MB) * 100 / TOTAL_MB) || '%'
USED_PERCENT
FROM V$ASM_DISKGROUP
ORDER BY 1;
5.檢查進(jìn)程
-
主庫(kù)(確認(rèn)ARCH進(jìn)程正常)
-
SQL> SELECT PROCESS, CLIENT_PROCESS, SEQUENCE#, STATUS FROM V$MANAGED_STANDBY;
-
PROCESS CLIENT_PROCESS SEQUENCE# STATUS
-
------------------ ---------------- ---------- ------------------------
-
ARCH ARCH 731 CLOSING
-
DGRD N/A 0 ALLOCATED
-
DGRD N/A 0 ALLOCATED
-
ARCH ARCH 732 CLOSING
-
ARCH ARCH 733 CLOSING
-
ARCH ARCH 734 CLOSING
-
LNS LNS 735 WRITING
-
DGRD N/A 0 ALLOCATED
-
DGRD N/A 0 ALLOCATED
-
-
備庫(kù)(要確認(rèn)存在MRP、ARCH、RFS進(jìn)程)
-
SQL> SELECT PROCESS, CLIENT_PROCESS, SEQUENCE#, STATUS FROM V$MANAGED_STANDBY;
-
PROCESS CLIENT_PROCESS SEQUENCE# STATUS
-
------------------ ---------------- ---------- ------------------------
-
ARCH ARCH 735 CLOSING
-
DGRD N/A 0 ALLOCATED
-
DGRD N/A 0 ALLOCATED
-
ARCH ARCH 731 CLOSING
-
ARCH ARCH 693 CLOSING
-
ARCH ARCH 692 CLOSING
-
RFS LGWR 736 IDLE
-
RFS UNKNOWN 0 IDLE
-
RFS UNKNOWN 0 IDLE
-
RFS Archival 0 IDLE
-
RFS LGWR 694 IDLE
-
PROCESS CLIENT_PROCESS SEQUENCE# STATUS
-
------------------ ---------------- ---------- ------------------------
-
MRP0 N/A 736 APPLYING_LOG
-
RFS UNKNOWN 0 IDLE
-
RFS Archival 0 IDLE
6.查詢,添加standby log
-
select GROUP#, DBID db_id, THREAD#, SEQUENCE#, BYTES, USED, ARCHIVED, STATUS, FIRST_CHANGE#, NEXT_CHANGE#,LAST_CHANGE# from v$standby_log ;
-
alter database add standby logfile thread 1 group 7 size xxx ,group 8 size xxx ,group 9 size xxx,group 10 size xxx ;
網(wǎng)站名稱:DG日常管理命令匯總
轉(zhuǎn)載來(lái)于:
http://weahome.cn/article/pgsgsj.html