Beruflich Dokumente
Kultur Dokumente
Standby Databases
To monitor the status of archived redo logs and obtain information on log apply services
on a logical standby database, query the fixed views described in this section. You can
also monitor the standby database using Data Guard Manager.
See Also:
If log apply services should stop unexpectedly, the reason for the problem is shown in
this view.
Note:
Errors that cause SQL apply operations to stop are always recorded in
the events table (unless there is insufficient space in the system
tablespace). These events are always put into the ALERT.LOG file as
well, with the phrase 'LOGSTDBY event' included in the text. When
querying the view, select the columns in order by EVENT_TIME,
COMMIT_SCN, and CURRENT_SCN. This ordering ensures that a shutdown
failure appears last in the view.
The view also contains other information, such as which DDL statements were applied
and which were skipped. For example:
EVENT_TIME STATUS
-----------------------------------------------------------------------
-------
EVENT
-----------------------------------------------------------------------
--------
23-JUL-02 18:20:12 ORA-16111: log mining and apply setting up
23-JUL-02 18:20:12 ORA-16128: User initiated shut down successfully
completed
23-JUL-02 18:20:12 ORA-16112: log mining and apply stopping
23-JUL-02 18:20:23 ORA-16111: log mining and apply setting up
23-JUL-02 18:55:12 ORA-16128: User initiated shut down successfully
completed
23-JUL-02 18:57:09 ORA-16111: log mining and apply setting up
23-JUL-02 20:21:47 ORA-16204: DDL successfully applied
create table mytable (one number, two varchar(30))
23-JUL-02 20:22:55 ORA-16205: DDL skipped due to skip setting create
database
link mydblink
8 rows selected.
This query shows that log apply services were started and stopped a few times. It also
shows what DDL was applied and skipped. If log apply services had stopped, the last
record in the query would have shown the cause of the problem.
For example:
The output from this query shows that a LogMiner dictionary build starts at log file
sequence number 5. The most recent archive log file is sequence number 13 and it was
received at the logical standby database at 01:02:41.
To quickly determine if all log file information was applied, issue the following query on
the logical standby database:
APPLIED_SCN NEWEST_SCN
----------- ----------
211301 211357
If the APPLIED_SCN matches the NEWEST_SCN, then all available log information was
applied. To determine how much progress was made through the available logs, join the
DBA_LOGSTDBY_PROGRESS view with the DBA_LOGSTDBY_LOG view, as shown in the
following example:
19 rows selected.
In the previous query, the computed APPLIED column displays YES, CURRENT, NO. The
logs with YES were completely applied and those files are no longer needed by the logical
standby database. The logs with CURRENT contain information that is currently being
worked on. Because logical standby applies transactions, and because transactions span
logs, it is common for log apply services to be applying changes from multiple logs. For
logs with NO, information from those files is not being applied. Although it is possible
that the files might have been open and read.
To inspect the process activity for SQL apply operations, query the V$LOGSTDBY fixed
view on the logical standby database. For example:
11 rows selected.
The previous query displays one row for each process involved in reading and applying
redo logs. The different processes perform different functions as described by the TYPE
column. The HIGH_SCN column is a progress indicator. As long as it keeps changing, from
query to query, you know progress is being made. The STATUS column gives a text
description of activity.
NAME VALUE
----------------------------------- -----------------------------------
coordinator state APPLYING
transactions ready 7821
transactions applied 7802
coordinator uptime 73
This query shows how long SQL apply operations have been running and how many
transactions have been applied in that time. It also shows how many transactions are
available to be applied, indicating that more work is necessary.