码迷,mamicode.com
首页 > 数据库 > 详细

【12c】DataGuard构建物理备用数据库(Cloud Control方式)

时间:2020-05-27 20:17:32      阅读:80      评论:0      收藏:0      [点我收藏+]

标签:cat   ping   gem   ott   control   sid_name   sping   oba   ati   

前面介绍了如何通过RMAN Duplicate方式构建物理备用数据库,本篇将演示如何利用Cloud Control构建物理备用数据库。

1 软件环境

  • Oracle Linux 6.9
  • Oracle 12.1.0.2
  • Oracle Enterprise Management Cloud Control 12.1.0.4
  • 主库:odd.oracle.com,IP:192.168.1.105
  • 备库:even.oracle.com,IP:192.168.1.106

2 使用Cloud Control创建备库

2.1 网络配置

2.1.1 主库网络配置

1)监听器配置

[oracle@odd admin]$ cat listener.ora

# listener.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora

# Generated by Oracle configuration tools.



SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = ORCL)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = ORCL)

)

)



LISTENER =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = odd.oracle.com)(PORT = 1521))

)



ADR_BASE_LISTENER = /u01/app/oracle

2)TNS配置

[oracle@odd admin]$ cat tnsnames.ora

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.



TNS_ODD =

(DESCRIPTION =

(ADDRESS_LIST =

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

)

(CONNECT_DATA =

(SERVICE_NAME = ORCL)

)

)



TNS_EVEN =

(DESCRIPTION =

(ADDRESS_LIST =

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

)

(CONNECT_DATA =

(SERVICE_NAME = ORCLDG)

)

)

2.1.2 备库网络配置

1)监听器配置

[oracle@even admin]$ cat listener.ora

# listener.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora

# Generated by Oracle configuration tools.



SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = ORCLDG)

(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

(SID_NAME = ORCLDG)

)

)



LISTENER =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = even.oracle.com)(PORT = 1521))

)



ADR_BASE_LISTENER = /u01/app/oracle

2)TNS配置

[oracle@even admin]$ cat tnsnames.ora

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.



TNS_ODD =

(DESCRIPTION =

(ADDRESS_LIST =

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

)

(CONNECT_DATA =

(SERVICE_NAME = ORCL)

)

)



TNS_EVEN =

(DESCRIPTION =

(ADDRESS_LIST =

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

)

(CONNECT_DATA =

(SERVICE_NAME = ORCLDG)

)

)

2.1.3 测试网络

1)主库测试

[oracle@odd ~]$ tnsping tns_odd

[oracle@odd ~]$ tnsping tns_even

2)备库测试

[oracle@even admin]$ tnsping tns_odd

[oracle@even admin]$ tnsping tns_even

2.2 图形界面创建备库

1)登录Cloud Control,进入目标>数据库实例ORCL

技术图片2)输入用户名和口令,点击登录技术图片3)添加备用数据库,点击继续

技术图片4)设置备份类型,点击下一步

技术图片5)备份选项,不勾选,点击下一步

技术图片6)备库配置页,点击检索按钮

技术图片7)选择目标备库所在主机

技术图片8)填写备库信息后,点击下一步

技术图片9)选择备库文件位置为OFA,点击定制

技术图片10)检查所有文件路径,确保ORCL置换为ORCLDG,点击确定

技术图片11)出现警告,点击继续

技术图片12)回到文件位置配置页,点击下一步

技术图片13)备库配置页面,更改备库参数,点击下一步

技术图片14)添加备库复查页面,如没问题,点击完成

技术图片15)点击检查作业链接

技术图片16)作业执行过程中

技术图片17)在Oracle数据库>作业活动页,可看到正在创建备库

技术图片2.3 搭建完毕,验证

2.3.1 主库操作

1)查询主库角色信息

SQL> select name,open_mode,database_role,db_unique_name,dataguard_broker from v$database;



NAME OPEN_MODE DATABASE_ROLE DB_UNIQUE_NAME DATAGUAR

--------- -------------------- ---------------- ------------------------------ --------

ORCL READ WRITE PRIMARY ORCL ENABLED

2)创建测试数据

SQL> create table scott.test(id number,name varchar2(100));



Table created.

SQL> insert into scott.test values(1,‘Alen‘);



1 row created.



SQL> commit;



Commit complete.

 3)查询数据

SQL> select * from scott.test;



ID NAME

---------- ----------------------------------------------------------------------------------------------------

1 Alen

 2.3.2 备库操作

1)查询主库角色信息

SQL> select name,open_mode,database_role,db_unique_name,dataguard_broker from v$database;



NAME OPEN_MODE DATABASE_ROLE DB_UNIQUE_NAME DATAGUAR

--------- -------------------- ---------------- ------------------------------ --------

ORCL READ ONLY WITH APPLY PHYSICAL STANDBY ORCLDG ENABLED

 2)查询数据

SQL> select * from scott.test;



ID NAME

---------- ----------------------------------------------------------------------------------------------------

1 Alen

综上,就是使用Cloud Control搭建物理备用数据库的整个过程

 

 

 

 

 

 

 

 

 

 

 

 

【12c】DataGuard构建物理备用数据库(Cloud Control方式)

标签:cat   ping   gem   ott   control   sid_name   sping   oba   ati   

原文地址:https://www.cnblogs.com/alen-liu-sz/p/12975545.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!