最新Oracle 11g DataGuard 配置详细说明
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Oracle 11g DataGuard 配置详细说明
1
2
1.判断DataGuard是否安装
3
select * from v$option where parameter = 'Oracle Data Guard';
4
2. 数据库环境说明
5
主库配置:IP:192.168.228.133(Oracle11g1),数据库名:db1,监听服
6
务名:db1pri,网络服务名:pri
从库配置:IP:192.168.229.134(Oracle11g2),数据库名:db1,监听服
7
8
务名:db1dg ,网络服务名:dg
9
数据库程序安装路径:
/oracleapp/oinstall/oracle/product/11.2.0/dbhome_1/dbs
10
11
数据库存放路径:/oracledata/db1
12
3.监听配置
13
在做oracle dataguard主从库配置时候,一定要配置静态监听,否则可
14
能出现监听服务解析错误,不能连接的问题,监听配置如下:
15
主库配置如下:
16
[oracle@Oracle11g1 admin]$ pwd
17
/oracleapp/oinstall/oracle/product/11.2.0/dbhome_1/network/admin 18
[oracle@Oracle11g1 admin]$ cat listener.ora
19
# listener.ora Network Configuration File:
/oracleapp/oinstall/oracle/product/1.2.0/dbhome_1/network/admin/list
20
21
ener.ora
# Generated by Oracle configuration tools.
22
23
WU =
24
(DESCRIPTION_LIST =
25
(DESCRIPTION =
26
(ADDRESS = (PROTOCOL = TCP)(HOST = Oracle11g2)(PORT = 27
1521))
28
)
29
)
30
SID_LIST_WU =
31
(SID_LIST =
32
(SID_DESC =
33
(GLOBAL_DBNAME =db1pri)
34
(ORACLE_HOME =
35
/oracleapp/oinstall/oracle/product/11.2.0/dbhome_1)
36
(SID_NAME = db1)
37
)
38
)
39
ADR_BASE_WU = /oracleapp/oinstall/oracle
40
#注意这里的global_dbname=db1pri,SID_NAME=db1,这个SID_NAME 应与41
你对外提供服务的 $ORACLE_SID 一致,即数据库:db1
42
[oracle@Oracle11g1 admin]$ cat tnsnames.ora
43
# tnsnames.ora Network Configuration File:
44
/oracleapp/oinstall/oracle/product/11.2.0/dbhome_1/network/admin/tns 45
names.ora
46
# Generated by Oracle configuration tools.
47
pri =
48
(DESCRIPTION =
49
(ADDRESS = (PROTOCOL = TCP)(HOST = Oracle11g1)(PORT = 1521)) (CONNECT_DATA =
50
51
(SERVER = DEDICATED)
52
(SERVICE_NAME = db1pri)
)
53
54
)
55
dg =
56
(DESCRIPTION =
57
(ADDRESS = (PROTOCOL = TCP)(HOST = Oracle11g2)(PORT = 1521)) 58
(CONNECT_DATA =
59
(SERVER = DEDICATED)
60
(SERVICE_NAME = db1dg)
61
)
62
)
63
#tnsname pri 中的 SERVICE_NAME=db1pri ,这里的服务名为db1pri而64
不是通常的 db1,因为在 listener.ora 中已经注册了db1pri,lsnrctl 启动65
时会监听db1pri ,并对应到SID_NAME=db1上。此处的pri,dg为数据库参66
数文件中(initdb1.ora)的DB_UNIQUE_NAME的名字,即对外提供的服务名。
67
68
从库配置如下:
69
[oracle@Oracle11g2 admin]$ cat listener.ora
70
# listener.ora Network Configuration File:
71
/oracleapp/oinstall/oracle/product/11.2.0/dbhome_1/network/admin/lis 72
tener.ora
73
# Generated by Oracle configuration tools.
74
WU =
75
(DESCRIPTION_LIST =
76
(DESCRIPTION =
77
(ADDRESS = (PROTOCOL = TCP)(HOST = Oracle11g2)(PORT = 1521))
78
79
)