Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install oracle dg

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to install oracle dg, the text is very detailed, has a certain reference value, interested friends must read!

Both primary and backup libraries are in archive mode and force logging

== Enable archiving and set to forced logging mode ==

select log_mode,force_logging from v$database;

alter database archivelog;

alter database force logging;

=== Modify main library parameters ===

alter system set log_archive_config="dg_config=(db01,dg01)" scope=both;

alter system set standby_file_management=auto scope=both;

alter system set log_archive_dest_1="location=/oracle/app/oracle/oradata/arch/ valid_for=(all_logfiles,all_roles) db_unique_name=db01" scope=both;

alter system set log_archive_dest_state_1="enable";

alter system set log_archive_dest_2="service=dg01 lgwr async valid_for=(online_logfile,primary_role) db_unique_name=dg01" scope=both;

alter system set log_archive_dest_state_2="enable";

alter system set fal_server=dg01 scope=both;

alter system set fal_client=db01 scope=both;

alter system set db_file_name_convert="/oracle/app/oracle/oradata/dg01/","/oracle/app/oracle/oradata/db01/" scope=spfile;

alter system set log_file_name_convert="/oracle/app/oracle/oradata/dg01/","/oracle/app/oracle/oradata/db01/" scope=spfile;

=== Create parameter file, modify it for backup library ===

create pfile='/tmp/tt/initdg01.ora' from spfile;

===tnsnames.ora and listening (static listening on both ends)===

=== Copy the parameter file and password file prepared by the master library to the backup library ===

When the environment is ready:

=== Backup database uses modified parameter file to start database to nomount state ===

=== Main Library Operation ===

rman target / auxiliary sys/oracle@dg01

duplicate target database for standby from active database;

or

duplicate target database for standby nonamefilecheck from active database;

=== Establish a standy log (redolog+1)===

alter database add standby logfile thread 1 group 11 '/oracle/app/oracle/oradata/dg01/standby_group_11.log' size 52428800;

alter database add standby logfile thread 1 group 12 '/oracle/app/oracle/oradata/dg01/standby_group_12.log' size 52428800;

alter database add standby logfile thread 1 group 13 '/oracle/app/oracle/oradata/dg01/standby_group_13.log' size 52428800;

===dg Verification ===

Verify that the physical backup is working:

Check for errors:

select error,destination from v$archive_dest;

(1)Check existing archive logs on the backup repository

select sequence# , first_time , next_time from v$archived_log order by sequence#;

(2)Forcing log switching on the master repository, manual archiving

alter system switch logfile;

(3)Check archive logs on backup repository (if new archive logs appear)

select sequence# , first_time , next_time from v$archived_log order by sequence#;

(4)Check whether archived logs are "applied"

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

=== Boot backup to read-only mode when backup is applying logs

Stop logging apps

alter database recover managed standby database cancel;

Open backup library as read-only

alter database open;

When the database is in read-only mode, switch the backup database to Redo Apply

1. Get all active sessions out of the repository

2. log application

alter database recover managed standby database disconnect from session;

or (start real-time apply)

alter database recover managed standby database using current logfile disconnect from session;

==== Active/standby switching ===

1. Switch from main library to backup library

View the master library status:

select database_role,switchover_status from v$database;

to standby

alter database commit to switchover to physical standby;

Remarks:

A: switchover_status appears session active/not allow

active session

alter database commit to switchover to physical standby with session shut down;

B:not allow,ora-01153:an incompatible media recovery is active

alter database recover managed standby database finish;

or

alter database recover managed standby database finish force;

Restart the main library

shutdown immediate

startup mount

alter database recover managed standby database disconnect from session;

select database_role,switchover_status from v$database;

to primary

2. Switch the backup library to the main library

select database_role,switchover_status from v$database;

to primary

alter database commit to switchover to primary;

shutdown immediate;

startup

alter system switch logfile;

Repeat validation dg.

=================

Note:

General switchover is planned switchover, characterized by no loss of data after switchover, and this process is

Reversible, the entire data guard environment will not be destroyed, all standbys in the original data guard environment

Everyone can continue to work.

Before switching the physical standby of the data guard:

1) Confirm that the network connection between master and slave libraries is smooth;

2) Confirm that there are no active session connections in the database;

3) The primary database is open and the standby database is mounted.

The above is "oracle dg how to install" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report