Oracle 11g two node RAC Setup Single Instance DG detailed steps and Considerations

Source: Internet
Author: User
Tags prepare reserved

Environment Introduction:

OS: both [[email protected] ~]# uname-a

Linux java3 2.6.18-308.el5 #1 SMP Tue 20:06:06 EST. x86_64 x86_64 x86_64 Gnu/linux

Main Library: Database version: 11.2.0.3.0 Two nodes of RAC node one: 192.168.15.26 node Two: 192.168.15.27

Standby database version: 11.2.0.3.0 IP 192.168.15.9

Repository installed only database software not built

Specific steps:

One: Install the database software on 192.168.15.9 This server, not much introduction.

Second: Modify the main library parameters

Parameters can be 11g official manual book list--dat--data Guard concepts and administration--3.1 Preparing the Primary Database for Standby Datab In the example in ASE creation--3.1.4, you see the parameters that should be in the main library's parameters file (if you don't want to add them), as follows:

Db_name=chicago #主库的数据库名
Db_unique_name=chicago #主库的数据库名备库 also has its own unique database name
Log_archive_config= ' dg_config= (Chicago,boston) ' #注意括号里主备库的位置
Control_files= '/arch1/chicago/control1.ctl ', '/arch2/chicago/control2.ctl ' #这个参数主库不需要改, prepare the library to be the path of their existence log_archive_ dest_1= #这个参数是制定本地 (main Library) archive log file location
' location=/arch1/chicago/
Valid_for= (All_logfiles,all_roles)
Db_unique_name=chicago ' # This is the repository database.
Log_archive_dest_2= #这个参数是说是作为主库的这一方要传递联机在线日志到数据库唯一名为boston的备库.
' Service=boston ASYNC #异步传输
Valid_for= (Online_logfiles,primary_role)
Db_unique_name=boston ' #此处填写备库数据库名,
Log_archive_dest_state_1=enable #开启传输日志的服务
Log_archive_dest_state_2=enable
Remote_login_passwordfile=exclusive #远程登录口令文件用于验证管理用户或重做传输会话时, must be set to EXCLUSIVE or shared
Log_archive_format=%t_%s_%r.arc #设置归档日志文件的格式

Fal_server=boston #此处是填写备库的数据库名, this parameter is only useful as a standby database, meaning that the repository takes the database name of the primary repository specified here as the server side and gets the request. For this parameter, it is not necessary to set this parameter in the main library if you do not intend to convert the master repository.
Db_file_name_convert= '/backup/', ' +data/jlprojct/datafile/' #该参数是个静态参数, The function is that the recovere process of performing duplicate in the main library is converted from the data file location of the main library to the appropriate location for the repository specified here, and the test is based on this parameter of the repository, which is not related to the main library. That is, executing duplicate in the main library produces a data file in the standby based on the location specified by this parameter of the repository. If you add a new data file to the main library, you must create the corresponding data file in the repository location.
Log_file_name_convert= #类似于上一个参数, note that when you modify this parameter, if you have several different paths to the log files of your main library, you must write them in.
'/arch1/boston/', '/arch1/chicago/', '/arch2/boston/', '/arch2/chicago/'

Standby_file_management=auto #这个参数是说当你设置成auto后, you add or delete data files in the main library, will be automatically in the repository to do the appropriate action, be careful not to overwrite the existing data files. Don't play the same name.


If the primary database cannot be shut down (that is, it cannot be restarted), then you can modify the parameters of the main library by using the following commands. After modification, create Pfile.ora = '/backup/pfile.ora from spfile= '/oracle/product/11.2.3/dbs/initjlprojct1.ora ';

sql> ALTER SYSTEM SET log_archive_dest_1= ' Location=+arch/jlprojct/archivelog valid_for= (all_logfiles,all_roles) Db_unique_name=jlprojct ';


System altered.

sql> ALTER SYSTEM SET log_archive_dest_2= ' service=jlprojct3 ASYNC valid_for= (online_logfiles,primary_role) DB_ Unique_name=jlprojct3 ';


System altered.


sql> ALTER SYSTEM SET log_archive_dest_state_1=enable scope=spfile;


System altered.


sql> ALTER SYSTEM SET log_archive_dest_state_2=enable scope=spfile;


System altered.


sql> ALTER SYSTEM SET remote_login_passwordfile=exclusive scope=spfile;


System altered.


sql> ALTER SYSTEM SET log_archive_format= '%t_%s_%r.arc ' scope=spfile; #静态参数, does not restart, does not work, so do not let the restart can not change it.


System altered.


sql> ALTER SYSTEM SET fal_client = jlprojct scope=spfile; # Fal_client is also set itself, Fal_server is the other side


System altered.


sql> ALTER SYSTEM SET fal_server = JLPROJCT3 scope=spfile;


System altered.


sql> ALTER SYSTEM SET standby_file_management=auto scope=spfile;


System altered.

sql> ALTER SYSTEM SET db_file_name_convert= '/backup/', +data/jlprojct/datafile/' scope =spfile; #静态参数, does not restart, does not work, so do not let the restart can not change it.


System altered.

sql> ALTER SYSTEM SET log_file_name_convert= ' +data/jlprojct/onlinelog/', '/backup/', ' +arch/jlprojct/onlinelog/',                          '/backup/' scope =spfile; #静态参数, does not restart, does not work, so do not let the restart can not change it.


System altered.

Modify the listening and Tnsname.ora files of the main library

1, main Library monitoring Listener.ora file Add (if there is not modified)

Sid_list_listener=

(sid_list=

(sid_desc=

(GLOBAL_DBNAME=JLPROJCT)

(oracle_home=/oracle/product/11.2.3)

(Sid_name=jlprojct1)))

LISTENER =

(Description_list =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.15.26) (PORT = 1521))

(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521))

)

)

2. Main library Tnsname.ora information about adding a repository.

JLPROJCT3 = #备库的相关信息

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.15.9) (PORT = 1521))

(Connect_data =

(SERVER = dedicated)

(service_name = JLPROJCT3)

(instance_name = JLPROJCT3)

)

)


Db26 = The connection string is used when Rman connects to the main and standby libraries at the same time before executing the duplicate, when connecting to the main library.

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.15.26) (PORT = 1521))

(Connect_data =

(SERVER = dedicated)

(service_name = jlprojct)


Four: In the main library with SCP Listener.ora, Tnsname.ora, Initjlprojct1.ora,pfile.ora to the repository and then make the corresponding changes (the parameter file does not need to modify the content, but to rename and the repository instance name corresponds to: [Email Protected] dbs]$ mv Orapwjlprojct orapwJLPROJCT3)

[Email protected] ~]$ SCP listener.ora tnsnames.ora Initjlprojct1.ora [email protected]: ' pwd '; #冒号后面的pwd means to upload the file to the current path of the repository (that is, the path that the PWD displays on the host computer at this time)

To change the listening information to the repository, Tnaname.ora add the information about the main library.

1. Standby monitoring Listener.ora content as follows:

Sid_list_listener=

(sid_list=

(sid_desc=

(GLOBAL_DBNAME=JLPROJCT3)

(oracle_home=/opt/oracle/product/11.2.0/dbhome_1)

(SID_NAME=JLPROJCT3)))

LISTENER =

(Description_list =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.15.9) (PORT = 1521)) #主机IP

(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521))

)

)

Adr_base_listener =/opt/oracle

2. Prepare the contents of the Library Tnsname.ora:

JLPROJCT = #主库相关信息 The connection string here is not the same as the main library Tnsname.ora, it does not affect the name of the random

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.15.26) (PORT = 1521))

(Connect_data =

(SERVER = dedicated)

(service_name = jlprojct)


JLPROJCT3 = #备库的相关信息 If you just do standby database, do not fill in his own this is OK.

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.15.9) (PORT = 1521))

(Connect_data =

(SERVER = dedicated)

(service_name = JLPROJCT3)

(instance_name = JLPROJCT3)

)

)

Repository parameter File modification:

Db_name=jlprojct #因为就一个数据库 So it doesn't change here.

Db_unique_name=jlprojct3 #这里要写成了备库数据库唯一名 makes it easy to differentiate the master repository, even if the conversion role is not renamed.

Log_archive_config= ' dg_config= (jlprojct3,jlprojct) ' #括号里面和主库括号里面的前后位置改变.

log_archive_dest_1=

' Location=/opt/oracle #填上备库有的目录, guaranteed to have free space, and have permission to read and write,

Valid_for= (All_logfiles,all_roles)

Db_unique_name=jlprojct3 ' #备库名字

Log_archive_dest_2=

' Service=jlprojct ASYNC #主库的名字

Valid_for= (Online_logfiles,primary_role)

Db_unique_name=jlprojct ' #主库名字

Log_archive_dest_state_1=enable

Log_archive_dest_state_2=enable

Remote_login_passwordfile=exclusive

Log_archive_format=%t_%s_%r.arc

FAL_SERVER=JLPROJCT #主库名字

Db_file_name_convert= ' +data/jlprojct/datafile/', '/backup/' #等号后的两个路径换位置

log_file_name_convert=

' +data/jlprojct/onlinelog/', '/backup/', ' +arch/jlprojct/onlinelog/', '/backup/' #等号后的两个路径换位置

Standby_file_management=auto
Five: In the preparation of the revised pfile created SPFile, and then renamed, and the standby instance to boot to nomount status [email protected]> create pfile from SPFile;
File created.

Six: Add standby log Group on the main library add the number of: (The main library original number n+1) * Number of threads, here the number of threads can be understood as the number of instances, there are 10 log groups, so to add (10+1) *2=22 Group. The size and path are best aligned with the original,
DG has two ways to pass the log, one is a common ARCHIVR log, from the arch of the background process Control passed to the standby database, there is a redo log the same way, by generating redo log background process LGWR control, The latter requires standby log
In the maximum available and maximum protection mode, because it is redo with lgwr Sync, it is necessary to use standby logfile, but it is recommended to add standby logfile in the maximum performance mode, it is said that more data can be recovered when the failover is unsuccessful.

Add the following command:


ALTER DATABASE ADD standby logfile Group (' +data/jlprojct/onlinelog/group_15 ') size 2000M;


Six: The main library after the successful test to continue, open the main repository of monitoring, shut down the firewall,

[Email protected] ~]$ tnsping JLPROJCT3

TNS Ping Utility for linux:version 11.2.0.3.0-production on 05-mar-2015 17:45:23

Copyright (c) 1997, Oracle. All rights reserved.

Used parameter files:


Used TNSNames Adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.15.9) (PORT = 1521)) (Connect_data = (SERVE R = dedicated) (service_name = JLPROJCT3) (instance_name = JLPROJCT3)))
OK (0 msec)

[Email protected] ~]$ tnsping db26

TNS Ping Utility for linux:version 11.2.0.3.0-production on 05-mar-2015 17:46:43

Copyright (c) 1997, Oracle. All rights reserved.

Used parameter files:


Used TNSNames Adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.15.26) (PORT = 1521)) (Connect_data = (SERV ER = dedicated) (service_name = jlprojct)))
OK (Ten msec)
Seven: The main repository is connected to the master repository with Rman at the same time.
[[email protected] ~]$ Rman target Sys/[email protected] auxiliary sys/[email protected]

Recovery manager:release 11.2.0.3.0-production on Thu Mar 5 17:51:23 2015

Copyright (c) 1982, Oracle and/or its affiliates. All rights reserved.

Connected to target DATABASE:JLPROJCT (dbid=2115662724)
Connected to auxiliary database:jlprojct (not mounted)


Eight: In the main library to execute the duplicate command, the most critical step, back up the main library control files, data files, log files, and then passed to the repository, and in the repository recover, if there is no error, the repository will open.

Rman> duplicate target database for standby from active database Nofilenamecheck;

Nine: Read only the way to open the standby db instance.

[Email protected]> ALTER DATABASE open read only;

Database altered.

Ten: Open the MRP process in the standby, apply the log, repeat the changes. Note: Make sure that the standby instance is open in Read only mode, otherwise it cannot be synchronized.

[Email protected]> ALTER database RECOVER MANAGED STANDBY database DISCONNECT from SESSION;

Database altered.
11: Test Results: Create a user in the main library, and create a table under this user, found that the repository will also have to prove that DG build success.

Ext.: http://www.linuxidc.com/Linux/2015-03/115167.htm

Oracle 11g two node RAC Setup Single Instance DG detailed steps and Considerations

Related Article

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.