Dataguard (Standby) 相關的檢視(View)

tolywang發表於2008-07-10

先介紹下managed_standby和日誌應用有關   [Standby上]

desc v$managed_standby;
 Name                                      Null?    Type
 —————————————– ——– —————————-
 PROCESS                                            VARCHAR2(9)
 PID                                                NUMBER
 STATUS                                             VARCHAR2(12)
 CLIENT_PROCESS                                     VARCHAR2(8)
 CLIENT_PID                                         VARCHAR2(40)
 CLIENT_DBID                                        VARCHAR2(40)
 GROUP#                                             VARCHAR2(40)
 RESETLOG_ID                                        NUMBER
 THREAD#                                            NUMBER
 SEQUENCE#                                          NUMBER
 BLOCK#                                             NUMBER
 BLOCKS                                             NUMBER
 DELAY_MINS                                         NUMBER
 KNOWN_AGENTS                                       NUMBER
 ACTIVE_AGENTS                                      NUMBER

透過我們都會檢視PROCESS,STATUS

SQL> select process,status from v$managed_standby; 

PROCESS   STATUS——— ————

ARCH      CLOSING

ARCH      CLOSING

RFS       IDLE

MRP0      WAIT_FOR_LOG

RFS       IDLE

RFS       IDLE

其中process列如下選項:

·         RFS - Remote file server(負責接收遠端日誌檔案)·         MRP0 - Detached recovery server process(負責應用恢復接收的日誌·         MR(fg) - Foreground recovery session·         ARCH - Archiver process·         FGRD·         LGWR·         RFS(FAL)·         RFS(NEXP)·         LNS network server processSTATUS列有如下選項:·         UNUSED - No active process·         ALLOCATED - Process is active but not currently connected to a primary database·         CONNECTED - Network connection established to a primary database·         ATTACHED - Process is actively attached and communicating to a primary database·         IDLE - Process is not performing any activities·         ERROR - Process has failed·         OPENING - Process is opening the archived redo log·         CLOSING - Process has completed archival and is closing the archived redo log(標示當前沒有可應用歸檔日誌)·         WRITING - Process is actively writing redo data to the archived redo log·         RECEIVING - Process is receiving network communication·         ANNOUNCING - Process is announcing the existence of a potential dependent archived redo log·         REGISTERING - Process is registering the existence of a completed dependent archived redo log·         WAIT_FOR_LOG - Process is waiting for the archived redo log to be completed(一般正常狀態)·         WAIT_FOR_GAP - Process is waiting for the archive gap to be resolved·         APPLYING_LOG - Process is actively applying the archived redo log to the standby databasesequence#列:如果日誌應用出現什麼問題,可以檢視在等待那個日誌應用

 和資料檔案管理相關的檢視

v$archive_gap 主要可以用來檢視備庫丟失了那些日誌

desc v$archive_gap;
 Name                                      Null?    Type
 —————————————– ——– —————————-
 THREAD#                                            NUMBER
 LOW_SEQUENCE#                                      NUMBER
 HIGH_SEQUENCE#                                     NUMBER

如果有GAP可以手動註冊日誌,alter database register logfile ‘檔名’

配置了FAL_SERVER FAL_CLIENT就沒問題

shou

如果日誌無法傳送,可以檢視 v$archive_dest;  

 select dest_name,status,error from v$archive_dest

DEST_NAME            STATUS     ERROR
——————– ———- ——————————
LOG_ARCHIVE_DEST_1   VALID
LOG_ARCHIVE_DEST_2   VALID
LOG_ARCHIVE_DEST_3   INACTIVE
LOG_ARCHIVE_DEST_4   INACTIVE
LOG_ARCHIVE_DEST_5   INACTIVE
LOG_ARCHIVE_DEST_6   INACTIVE
LOG_ARCHIVE_DEST_7   INACTIVE
LOG_ARCHIVE_DEST_8   INACTIVE
LOG_ARCHIVE_DEST_9   INACTIVE
LOG_ARCHIVE_DEST_10  INACTIVE
STANDBY_ARCHIVE_DEST VALID

如果狀態 為VALID說明沒問題 ,如果有錯誤則更具ERROR裡資訊處理:

 

v$archive_dest_status 檢視可以檢視備庫的狀態,保護模式,歸檔日誌路徑狀態

  select dest_name,status,database_mode,recovery_mode,protection_mode from v$archive_dest_status

DEST_NAME            STATUS     DATABASE_MODE        RECOVERY_MODE        PROTECTION_MODE
——————– ———- ——————– ——————– ——————–
LOG_ARCHIVE_DEST_1   VALID      MOUNTED-STANDBY      MANAGED              MAXIMUM PERFORMANCE
LOG_ARCHIVE_DEST_2   VALID      MOUNTED-STANDBY      MANAGED              MAXIMUM PERFORMANCE
LOG_ARCHIVE_DEST_3   INACTIVE   MOUNTED-STANDBY      MANAGED              MAXIMUM PERFORMANCE
LOG_ARCHIVE_DEST_4   INACTIVE   MOUNTED-STANDBY      MANAGED              MAXIMUM PERFORMANCE
LOG_ARCHIVE_DEST_5   INACTIVE   MOUNTED-STANDBY      MANAGED              MAXIMUM PERFORMANCE
LOG_ARCHIVE_DEST_6   INACTIVE   MOUNTED-STANDBY      MANAGED              MAXIMUM PERFORMANCE
LOG_ARCHIVE_DEST_7   INACTIVE   MOUNTED-STANDBY      MANAGED              MAXIMUM PERFORMANCE
LOG_ARCHIVE_DEST_8   INACTIVE   MOUNTED-STANDBY      MANAGED              MAXIMUM PERFORMANCE
LOG_ARCHIVE_DEST_9   INACTIVE   MOUNTED-STANDBY      MANAGED              MAXIMUM PERFORMANCE
LOG_ARCHIVE_DEST_10  INACTIVE   MOUNTED-STANDBY      MANAGED              MAXIMUM PERFORMANCE
STANDBY_ARCHIVE_DEST VALID      MOUNTED-STANDBY      MANAGED              MAXIMUM PERFORMANCE

v$archived_log可以檢視日誌的一些資訊 ,包括日誌名字,應用時間,是否應用

select first_time,applied,sequence#,status,next_time from v$archived_log

FIRST_TIM APP  SEQUENCE# STATUS     NEXT_TIME
——— — ———- ———- ———
06-DEC-07 YES         37 A          06-DEC-07
06-DEC-07 YES         38 A          06-DEC-07
06-DEC-07 YES         39 A          06-DEC-07
06-DEC-07 YES         40 A          07-DEC-07
07-DEC-07 YES         41 A          07-DEC-07
07-DEC-07 YES         42 A          07-DEC-07
07-DEC-07 YES         43 A          07-DEC-07
07-DEC-07 YES         44 A          07-DEC-07
07-DEC-07 YES         45 A          07-DEC-07

9 rows selected.

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-374905/,如需轉載,請註明出處,否則將追究法律責任。

相關文章