Oracle10gdgmgrl Master/Slave Construction

Source: Internet
Author: User
Dgmrloracle10G? Dg configuration 1. Install the database version. Here, install www.itopers.com directly by clone? P7222. perform a full backup with rman. The backup script is provided as follows :#! Binbash # oraclefullbackup # date $ (date + % F) # backupdirdirhomeoracleba

Dgmrl oracle 10G? Dg configuration 1, install the database version, here the method of direct clone install http://www.itopers.com /? P = 722 2. perform a full backup with rman. The backup script is provided as follows :#! /Bin/bash # oracle full backup # date = "$ (date" + % F ")" # backup dirdir = "/home/oracle/ba

Dgmrl oracle 10G? Dg Configuration
1. Install the database version. clone the database to install it.

Http://www.itopers.com /? P = 722
2. perform a full backup with rman. The backup script is provided as follows:

#! /Bin/bash # oracle full backup # date = "$ (date" + % F ") "# backup dirdir ="/home/oracle/backup_stage/$ {date} "if [-d" $ dir "]; then for I in 'seq 10' do if [! -D "$ {dir }_$ {I}"]; then dir = "$ {dir }_$ {I}" break; else continue; fi donefi # create backup dir [! -D $ dir] & mkdir $ dir-pchown-R oracle. oinstall $ dir # check userif ["$ USER "! = "Oracle"]; then echo "please execute this shell to oracle" echo "" exit 1fi # begin backup rman target/log = $ dir/inre _ $ date. log append <
 

Copy the backup file to the slave database server. I am using nfs to mount the backup file directly.

3. Modify the initialization file. Modify db_unique_name, log_archive_dest _ *, and fal_server/fal_client parameters.

SQL> create spfile from pfile='/home/oracle/backup_stage/2014-11-04/init.ora';File created.SQL> startup nomount;ORACLE instance started.Total System Global Area 1.0737E+10 bytesFixed Size 2114144 bytesVariable Size 2298482080 bytesDatabase Buffers 8422162432 bytesRedo Buffers 14659584 bytes

4. After nomount is enabled, Start rman to restore the backup.

First restore the control file and then enable the mount status.

[oracle@statdb 2014-11-04]$ rman target /RMAN> restore controlfile from '/home/oracle/backup_stage/2014-11-04/ctl_2ppmpuql_1_1';Starting restore at 2014-11-04 22:35:41using channel ORA_DISK_1channel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:04output filename=/U01/app/oracle/oradata/nstatdb/control01.ctloutput filename=/U01/app/oracle/oradata/nstatdb/control02.ctloutput filename=/U01/app/oracle/oradata/nstatdb/control03.ctlFinished restore at 2014-11-04 22:35:46RMAN> alter database mount;database mountedreleased channel: ORA_DISK_1

5. view the backup.

RMAN>list backup;

6. Restore the database

RMAN>restore database;

8. Start configuring dg, Delete the existing configuration, remove configuration, and configure network and tnsname. Use tnsping to test connectivity.

Enable dg_broker on the Master/Slave Node

alter system set dg_broker_start =true;

9. Go to dgmgrl management and create dg

[oracle@statnew backup_stage]$ dgmgrl /           DGMGRL> show configuration;Error: ORA-16532: Data Guard broker configuration does not existConfiguration details cannot be determined by DGMGRLDGMGRL> DGMGRL> CREATE CONFIGURATION statdb_dg AS PRIMARY DATABASE IS nstatdb CONNECT IDENTIFIER IS nstatdb;Configuration "statdb_dg" created with primary database "nstatdb"DGMGRL> ADD DATABASE snstatdb2 AS CONNECT IDENTIFIER IS snstatdb2 MAINTAINED AS PHYSICAL;Database "snstatdb2" addedDGMGRL>  show configuration;Configuration  Name:                statdb_dg  Enabled:             NO  Protection Mode:     MaxPerformance  Fast-Start Failover: DISABLED  Databases:    nstatdb   - Primary database    snstatdb2 - Physical standby databaseCurrent status for "statdb_dg":DISABLEDDGMGRL> enable configuration;Enabled.DGMGRL> show configuration;Configuration  Name:                statdb_dg  Enabled:             YES  Protection Mode:     MaxPerformance  Fast-Start Failover: DISABLED  Databases:    nstatdb   - Primary database    snstatdb2 - Physical standby databaseCurrent status for "statdb_dg":SUCCESS

We can see that success has been created successfully.

See other common query statements for query:

View the database status:

select db_unique_name,database_role,open_mode,switchover_status from v$database;

View log application information

select sequence#,applied from v$archived_log order by sequence# desc;

Query whether the log has a gap

select * from v$archive_gap;

Manual Application Log

alter database register physical logfile '/home/oracle/backup_stage/arch/1_31026_742841399.dbf';

View the log application status on the slave server

SQL> select process,pid,status,thread#,group#,sequence#,delay_mins from v$managed_standby;PROCESS          PID STATUS          THREAD# GROUP#                                    SEQUENCE# DELAY_MINS--------- ---------- ------------ ---------- ---------------------------------------- ---------- ----------ARCH            2045 CONNECTED             0 N/A                                               0          0ARCH            2047 CONNECTED             0 N/A                                               0          0MRP0            2306 WAIT_FOR_GAP          1 N/A                                           31011          0

Problems

1. After the dg is added to the master node, the dg_broker_config_file2 configuration file is not synchronized, and the log prompt file is not found. Then, set the dg_broker_start parameter of the master node to false, set it to true, and then create the dg again.

2. show configuration in dg; when you view the status of dg, it is displayed as success. No task error logs are reported, but no synchronization logs are displayed.

Waiting for all non-current ORLs to be archived...Media Recovery Waiting for thread 1 sequence 31028Thu Nov 06 11:22:10 CST 2014Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE  THROUGH ALL SWITCHOVER DISCONNECT  NODELAYThu Nov 06 11:36:38 CST 2014

In the main alter system switch logfile; there is no response either.

Solution:

I don't know why. I used to put the log in the flash back. I just needed to specify a directory later.

StandbyArchiveLocation? ? ? ? ? = '/U01/app/oracle/admin/nstatdb/arch'

Then the logs can be transmitted normally. Because the previous logs are not transmitted, manually upload the logs again.

FAL[client]: Failed to request gap sequence  GAP - thread 1 sequence 31028-31068 DBID 1351766453 branch 742841399FAL[client]: All defined FAL servers have been attempted.-------------------------------------------------------------Check that the CONTROL_FILE_RECORD_KEEP_TIME initializationparameter is defined to a value that is sufficiently largeenough to maintain adequate log switch information to resolvearchivelog gaps.

Generates application log statements.

[oracle@statnew arch]$ for i in `seq 31028 31068`> do> echo "alter database register physical logfile '/home/oracle/backup_stage/arch/1_${i}_742841399.dbf';"     > done

Original article address: oracle 10g dgmgrl master-slave construction. Thank you for sharing it with me.

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.