Summary build oracle11g DG tread of the Pit

Source: Internet
Author: User

The operating environment is oracle11g Single instance, OS Linux, using duplicate online to create a physical standby library

Setting relevant parameters on primary

ALTERSYSTEMSETLog_archive_config='dg_config= (ORA11G,STDB)';AlterSystemSetLog_archive_dest_2='service=db_dg2 lgwr Async valid_for= (online_logfiles,primary_role) Db_unique_name=stdb'; ALTERSYSTEMSETLog_archive_dest_state_2=ENABLE;ALTERSYSTEMSETFal_server=ora11g02;ALTERSYSTEMSETFal_client=ora11g01;ALTERSYSTEMSETStandby_file_management=AUTO;AlterSystemSetLog_archive_dest_1=                  'location=/data0/u01/app/oracle/arch valid_for= (all_logfiles,all_roles) db_unique_name=ora11g'Scope=SPFile; AlterSystemSetLog_archive_format='%t_%s_%r.arch'Scope=SPFile

Add Standby Redo Log

Alter Database AddStandby logfile Thread1 Group 4('/data0/u01/app/oracle/oradata/ora11g/standby_redo04.log') size 50m; Alter Database AddStandby logfile Thread1 Group 5('/data0/u01/app/oracle/oradata/ora11g/standby_redo05.log') size 50m; Alter Database AddStandby logfile Thread1 Group 6('/data0/u01/app/oracle/oradata/ora11g/standby_redo06.log') size 50m; Alter Database AddStandby logfile Thread1 Group 7('/data0/u01/app/oracle/oradata/ora11g/standby_redo07.log') size 50m;

Ready-to-install software configure environment variables

Then configure the listener files Listener.ora and Tnsnames.ora

The command to create a standby is

DUPLICATE TARGETDATABASE   forSTANDBY fromACTIVEDATABASEDorecover SPFILESET"Db_unique_name"="Jjdb"SETLog_archive_dest_2=The service=ora11g02 ASYNC REGISTER valid_for=(online_logfile,primary_role) "SETFal_client="Ora11g02"SETFal_server="Ora11g01" Nofilenamecheck;

For the above process, Rman will automatically copy the server-side parameter file to the standby end, then boot to the Nomount state, restore the control file, and copy all the data files, temporary tablespace and archive log to the repository. Then proceed to recovery

When the standby is booted to the Nomount state, the pfile is used: Startup Nomount Pfile=initorcl11g.ora

Otherwise due to SPFile being occupied: Rman-05537:duplicate without TARGET connection when auxiliary instance was started with SPFile cannot use SPFILE clause
Then log in to Rman at the primary end (both standby)

Rman Target SYS/oracle@ORA11G01 Auxiliary sys/oracle@ORA11G02   

During the creation of the repository, after changing the parameters, from the library will be restarted, error:

Rman-04006:error from auxiliary database:ora-01017:invalid Username/password; Logon denied

First make sure that the password file is copied from the main library side, the file name and user name and password are correct

Using tnsping to check the network is also interoperable

Last view from the library listening state, only one orcl11g instance (corresponding to $oracle_sid)

However, the sid_name specified in Linstener.ora is not $oracle_sid

After correcting the listening file, start to create the standby library

View the database status of the standby after the creation is complete

Sql> SELECTDatabase_role,open_mode,protection_mode fromv$DATABASE;D atabase_role open_mode protection_mode---------------- -------------------- --------------------Physical STANDBY mounted MAXIMUM performance
# Standby
Sql> select Group#,status,type,member from V$logfile;

---------- ------- ------- --------------------------------------------------------------------------------
3 Online/data0/u01/app/oracle/fast_recovery_area/stdb/onlinelog/o1_mf_3_d8byvvoq_.log
2 Online/data0/u01/app/oracle/fast_recovery_area/stdb/onlinelog/o1_mf_2_d8byvvn0_.log
1 Online/data0/u01/app/oracle/fast_recovery_area/stdb/onlinelog/o1_mf_1_d8byvvl6_.log

At this time confused my problem occurred, Rman will not copy redo log file, then see the Redo log file is control file record, but the Lord's redo log path is not this, the visual host opened the Flash back zone, so redo log in the Flash zone also exists

So it can be inferred that the path to the redo log of the control file record is: The Flashback zone path/db_uniq_name/onlinelog, which actually does not exist on the standby redo log file

Redo log and Standby redo log are created by the standby library

Start repository to live Application log

Sql> ALTER DATABASE OPEN READ  only;Databasealtered. SQL> SELECTDatabase_role,open_mode,protection_mode fromv$DATABASE;D atabase_role open_mode protection_mode---------------- -------------------- --------------------Physical STANDBYREAD  onlyMAXIMUM Performancesql>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;Databasealtered. SQL> SELECTDatabase_role,open_mode,protection_mode fromv$DATABASE;D atabase_role open_mode protection_mode---------------- -------------------- --------------------Physical STANDBYREAD  only  withAPPLY MAXIMUM Performance

View archive log list on the standby library

Archive path status exception, view using Log_archive_dest_3

Sql>Col dest_name format A30sql>Col DESTINATION format A30sql> SELECTDest_name, status, destination fromv$archive_dest;dest_name STATUS DESTINATION------------------------------ --------- ------------------------------Log_archive_dest_1 Bad PARAM/Data0/U01/App/Oracle/archlog_archive_dest_2 Bad PARAM ora11g02log_archive_dest_3 VALID use_db_recovery_file_des T

The official documentation on the state for bad Param is interpreted as a parameter error occurred; Refer to Error data.

Select Dest_id,status,error from V$archive_dest; # no error information found
View parameter discovery is db_uniq_name Setup error
After you correct the database restart
The States of paths 1 and 2 are valid
But the archive log list still sees
Archive Destination Use_db_recovery_file_dest
Official document Explanation: If You configure a Fast Recovery area (by setting the Db_recovery_file_dest and Db_recovery_file_dest_size paramete RS) and do no specify any local archive destinations, the database automatically selects the Fast Recovery area as a loca L Archive destination and sets Log_archive_dest_1 to Use_db_recovery_file_dest.
However, the archive log file is generated under the path and log_archive_dest_1 of the view Discovery Flashback area

The building is complete.

Summary Build oracle11g DG step of the pit

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: 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.