Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

   
 

v$dataguard_status script

Oracle Database Tips by Donald Burleson

<

Data Guard

Donald K. Burleson

v$dataguard_status

In this case, only the stdby.1_232.dbf file was available on the standby archive destination, and the stdby.1_231.dbf was required to complete the media recovery, so the MRP process re-fetched it. The MRP log file in the BACKGROUP_DUMP_DEST directory can be checked to verify this. 

Here are basic v$dataguard statistics in the v$dataguard_stats view:

set lines 120
column value format a20
select * from v$dataguard_stats;

Also, the alert log file on the standby site can be checked to see if the database is in managed recovery mode.  It will show that the archived log name has been applied to the Oracle instance by MRP process.

-- Extract from alert log file from standby site
alter database recover managed Oracle instance disconnect from session
Wed Sep 17 16:39:47 2003
Attempt to start background Managed Standby Recovery process
MRP0 started with pid=13
MRP0: Background Managed Standby Recovery process started

Moreover, v$dataguard_status and v$managed_standby views give information about the processes involved in media recovery on the standby site. The following shows the output of the dg_stats.sql script from the code depot. For a complete description of the Data Guard v$ views, get the "free 11g poster".

The script has been executed on the standby database.

            dg_stats.sql script to display v$dataguard_status

Set linesize 140
column Timestamp Format a20
column Facility  Format a24
column Severity  Format a13
column Message   Format a60 trunc
 
Select
   to_char(timestamp,'YYYY-MON-DD HH24:MI:SS') Timestamp,
   Facility,
   Severity,
   Message
   see code depot for full script
From
   v$dataguard_status
Order by
   Timestamp;

Here is a sample of the output from this script:

TIMESTAMP            FACILITY                 SEVERITY      MESSAGE
-------------------- ------------------------ ------------- ---------------------
2003-SEP-26 17:00:08 Log Transport Services   Informational ARC0: Archival started
2003-SEP-26 17:00:08 Log Transport Services   Informational ARC1: Archival started
2003-SEP-26 17:00:39 Log Apply Services       Control       Attempt to start background Managed
Standby Recovery process
2003-SEP-26 17:00:45 Log Apply Services       Warning       Media Recovery Waiting for thread 1 seq# 237
2003-SEP-26 17:03:15 Log Apply Services       Informational Media Recovery Log /oracle/appsdb/arch/appsdb_1_237.dbf
2003-SEP-26 17:03:15 Log Apply Services       Warning       Media Recovery Waiting for thread 1 seq# 238
2003-SEP-26 17:03:45 Log Apply Services       Informational Media Recovery Log /oracle/appsdb/arch/appsdb_1_238.dbf
2003-SEP-26 17:03:45 Log Apply Services       Warning       Media Recovery Waiting for thread 1 seq# 239
2003-SEP-26 17:04:00 Log Apply Services       Informational Media Recovery Log /oracle/appsdb/arch/appsdb_1_239.dbf
2003-SEP-26 17:04:00 Log Apply Services       Warning       Media Recovery Waiting for thread 1 seq# 240

Here is another script with v$dataguard_status:

select *
  from (select TIMESTAMP,
               completion_time "ArchTime",
               SEQUENCE#,
               round((blocks * block_size) / (1024 * 1024), 1) "Size Meg",
               round((TIMESTAMP - lag(TIMESTAMP, 1, TIMESTAMP)
                      OVER(order by TIMESTAMP)) * 24 * 60 * 60,
                     1) "Diff(sec)",
               round((blocks * block_size) / 1024 /
                     decode(((TIMESTAMP - lag(TIMESTAMP, 1, TIMESTAMP)
                             OVER(order by TIMESTAMP)) * 24 * 60 * 60),
                            0,
                            1,
                            (TIMESTAMP - lag(TIMESTAMP, 1, TIMESTAMP)
                             OVER(order by TIMESTAMP)) * 24 * 60 * 60),
                     1) "KB/sec",
               round((blocks * block_size) / (1024 * 1024) /
                     decode(((TIMESTAMP - lag(TIMESTAMP, 1, TIMESTAMP)
                             OVER(order by TIMESTAMP)) * 24 * 60 * 60),
                            0,
                            1,
                            (TIMESTAMP - lag(TIMESTAMP, 1, TIMESTAMP)
                             OVER(order by TIMESTAMP)) * 24 * 60 * 60),
                     3) "MB/sec",
               round(((lead(TIMESTAMP, 1, TIMESTAMP) over(order by TIMESTAMP)) -
                     completion_time) * 24 * 60 * 60,
                     1) "Lag(sec)"
          from v$archived_log a, v$dataguard_status dgs
         where a.name = replace(dgs.MESSAGE, 'Media Recovery Log ', '')
           and dgs.FACILITY = 'Log Apply Services'
         order by TIMESTAMP desc)
 where rownum < 10;

 


The above text is an excerpt from the book: Oracle Data Guard Handbook


��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.