Common statements for routine management of Oracle logical standby

Source: Internet
Author: User

// Skip the execution. The skipped result is displayed in
Execute dbms_logstdby.skip (stmt => 'dml', Schema_name => '%', object_name => '% ');
The value of stmt can be:
Http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10802/d_lsbydb.htm#997290
// The skipped content is recorded below
Select * From dba_logstdby_skip
// Stop apply

Alter database stop logical standby apply;
Alter database abort logical standby apply;
// Execute apply
Alter database start logical standby apply;
// Real-time apply
Alter database start logical standby apply immediate;
// Skip the error. In the dba_logstdby_skip table, the error column is Y.
Execute dbms_logstdby.skip_error ('non _ schema_ddl ');

// Execute apply to skip failed transactions

Alter database start logical standby apply skip failed transaction;
// Set the parameter to indicate whether the error is skipped.
Exec dbms_logstdby.apply_set ('record _ skip_errors ', 'false ');
// Set the parameter to whether to record and skip DDL
Exec dbms_logstdby.apply_set ('record _ skip_ddl ', 'false ');

// Turn off the slave uard on the slave database. The slave database can be written.
Alter database guard none;
// Enable writable uard on the slave database. The slave database cannot be written.
Alter database guard all;
// Official Document
Http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10823/toc.htm

// Execute a table that fails and synchronize the table manually
Alter database stop logical standby apply;
// Create a dblink pointing to the master database and then synchronously create a table
Exec dbms_logstdby.instantiate_table ('eygl', 'sales', 'dblink _ name ');
Alter database start logical standby apply;

// Manually add logs of the standby Database
$ CP/u01/ARCH/wending/1_22751_666200636.arc/u04/ARCH/wdstd/log_1_22751_666200636.arc
SQL> alter database register logical logfile '/u04/ARCH/wdstd/log_1_22751_666200636.arc ';
Or
SQL> alter database register or replace logical logfile '/u04/ARCH/wdstd/log_1_22751_666200636.arc ';

// View the final progress
Select latest_scn, mining_scn, applied_scn, latest_time, mining_time, applied_time from V $ logstdby_progress;

// Script for monitoring synchronization progress
Select * From dba_logstdby_log;
Select * From dba_logstdby_events order by event_time DESC;
Select latest_scn, mining_scn, applied_scn, latest_time, mining_time, applied_time from V $ logstdby_progress;
Select logstdby_id, type, status process_status from V $ logstdby_process;
Select * from V $ logstdby_state;
Select * from V $ dataguard_status order by timestamp DESC;

// Increase the number of apply Processes
Alter database stop logical standby apply; --- stop SQL apply
Execute dbms_logstdby.apply_set ('apply _ servers', 20); --- adjust the number of apply processes to 20. The default value is 5.
Alter database start logical standby apply immediate; --- start real-time apply

// When you stop apply, if the application is currently in progress, it will not stop until it is executed.
// The following command can be executed repeatedly. If the execution prompt is "stop", it means that the application is not finished. You can execute the command again after it is finished.
Alter database start logical standby apply;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.