【全过程】通过gc部署dataguard

环境:
【硬件和系统】
1、两台linux ole5
2、单台配置双核
3、单台2g内存
【配置】
1、主机名:edgzrip1.example.com、edgzrip2.example.com
2、数据库:edgzrip1: PROD1(已开启归档) edgzrip2:EMREP(配备gc12c)
均配置oracle 11.2.0.1实验库
【实验说明】
在2号机上通过gc部署1号机prod1的dg备库



配置步骤:
1、配置前gc准备
2、配置dg
3、校验
4、创建borker configuration



配置前gc准备
1、开启oms资源库(此为emrep)

[oracle@edgzrip2-PROD4 ~]$ export ORACLE_SID=EMREP
[oracle@edgzrip2-EMREP ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Oct 10 11:25:02 2017

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 523108352 bytes
Fixed Size 1346052 bytes
Variable Size 385877500 bytes
Database Buffers 121634816 bytes
Redo Buffers 14249984 bytes
Database mounted.
Database opened.

2、配置oraclenet

3、开启gc agent和oms资源管理器
[oracle@edgzrip2-PROD4 bin]$ pwd
/u01/app/oracle/middleware/agent11g/bin
[oracle@edgzrip2-PROD4 bin]$ ./emctl start agent
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
Starting agent ........ started.


[oracle@edgzrip2-PROD4 bin]$ pwd
/u01/app/oracle/middleware/oms11g/bin
[oracle@edgzrip2-PROD4 bin]$ ./emctl start oms
Oracle Enterprise Manager 11g Release 1 Grid Control
Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
Starting WebTier...
WebTier Successfully Started
Starting Oracle Management Server...
Oracle Management Server Successfully Started
Oracle Management Server is Up


检查agent状态
[oracle@edgzrip2-PROD4 bin]$ ./emctl status agent
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
Agent Version : 11.1.0.1.0
OMS Version : 11.1.0.1.0
Protocol Version : 11.1.0.0.0
Agent Home : /u01/app/oracle/middleware/agent11g
Agent binaries : /u01/app/oracle/middleware/agent11g
Agent Process ID : 5306
Parent Process ID : 5289
Agent URL : https://edgzrip2.example.com:3872/emd/main/
Repository URL : https://edgzrip2.example.com:4900/em/upload
Started at : 2017-10-10 11:33:27
Started by user : oracle
Last Reload : 2017-10-10 11:37:53
Last successful upload : 2017-10-10 11:39:15
Total Megabytes of XML files uploaded so far : 8.81
Number of XML files pending upload : 12
Size of XML files pending upload(MB) : 1.89
Available disk space on upload filesystem : 58.49%
Last successful heartbeat to OMS : 2017-10-10 11:38:36
---------------------------------------------------------------
Agent is Running and Ready

注意:这里的【Last successful heartbeat to OMS】一定要显示出时间gc才可用

2、在1号测试机上部署agent
传输文件
/u01/app/oracle/middleware/oms11g/sysman/agent_download/11.1.0.1.0/linux
[oracle@edgzrip2-PROD4 linux]$ scp agentDownload.linux edgzrip1:/home/oracle
The authenticity of host 'edgzrip1 (192.168.23.20)' can't be established.
RSA key fingerprint is 71:57:17:5c:6b:7e:ff:89:4a:b9:34:68:45:55:2d:8b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'edgzrip1,192.168.23.20' (RSA) to the list of known hosts.
oracle@edgzrip1's password:
agentDownload.linux 100% 38KB 37.6KB/s 00:00

在1号机上安装agent,输入以下命令
chmod u+x agentDownload.linux
./agentDownload.linux -b /u01/app/oracle/middleware/agent11g -y

最后面要运行一个脚本
[oracle@edgzrip1-PROD1 ~]$ sudo /u01/app/oracle/middleware/agent11g/agent11g/root.sh


3、打开gc
在以下文件中找到gc em地址
[oracle@edgzrip2-PROD4 install]$ pwd
/u01/app/oracle/middleware/oms11g/install
[oracle@edgzrip2-PROD4 install]$ cat setupinfo.txt

用firefox打开即可



配置dg
在prod1中的高可用配置页面中找到【add standby database】

输入prod1的用户名和密码,并以sysdba身份登入

点击【add standby database】

这里可以根据需求选择需要创建的备库类型(实验选择第一个)

选择数据文件的复制、备份方式(这里选择默认)

配置主库standby logfile路径,这里需要输入管理oracle软件的操作系统用户(oracle)

配置备库选项,设置备库实例名为SBDB1 , 采用文件系统, 备库目标库为1号机

配置备库文件的路径(这里用两种ofa和主库路径,ofa是最佳灵活体系结构,是一种oracle规范式的文件目录架构),配置监听

配置备库全局数据库名、归档地址、身份验证等,这里不启用broker,稍后手工配置

再次确认主备库配置信息

开始应用配置(几分钟时间,应用完成之后还要等3min左右才能使备库可用)

gc检查备库状态


发现此时备库还处在mount状态,且mrp和rfs服务已经打开。我们需要将备库开启到open状态

SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter database open;

Database altered.

再打开备库日志运用



校验



配置dg broker configuration
1、2号机启用dgbroker配置
SQL> alter system set dg_broker_start=true;

System altered.


开启dgmgrl命令行
[oracle@edgzrip1-PROD1 ~]$ dgmgrl sys/oracle@prod1
DGMGRL for Linux: Version 11.2.0.3.0 - Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected.

创建configuration,添加主库

DGMGRL> create configuration 'test' as
> primary database is 'PROD1'
> connect identifier is 'PROD1';
Configuration "test" created with primary database "PROD1"

添加备库

DGMGRL> add database 'SBDB1' as connect identifier is SBDB1;
Database "SBDB1" added

启用configuration
DGMGRL> enable configuration;
Enabled.

校验configuration
DGMGRL> show configuration

Configuration - test

Protection Mode: MaxPerformance
Databases:
PROD1 - Primary database
SBDB1 - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS




可能遇到的问题
在dgbroker中添加备库时,总是报01031,oraclenet均正常,现象如下

怀疑可能是口令文件不一致问题,故重建口令文件(使其忽略大小写)
[oracle@edgzrip1-PROD1 dbs]$ orapwd file=orapwPROD1 password=oracle ignorecase=y
[oracle@edgzrip2-PROD4 dbs]$ orapwd file=orapwSBDB1 password=oracle ignorecase=y

成功解决

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值