当前位置:Gxlcms > mysql > OracleDataGuard创建物理Standby数据库

OracleDataGuard创建物理Standby数据库

时间:2021-07-01 10:21:17 帮助过:19人阅读

Oracle Data Guard创建物理Standby数据库 创建物理备库 机器名 a1 a2 IP: 192.168.1.10 192.168.1.20 Net_Name a1 a2 SID a1 a2 DB_UNIQUE_NAME a1 a2 注:主节点上创建数据库a1,备节点上只安装oracle软件不创建任何数据库; 1.配置listener.ora 主节点listen

  Oracle Data Guard创建物理Standby数据库

  创建物理备库

  机器名 a1 a2

  IP: 192.168.1.10 192.168.1.20

  Net_Name a1 a2

  SID a1 a2

  DB_UNIQUE_NAME a1 a2

  注:主节点上创建数据库a1,备节点上只安装oracle软件不创建任何数据库;

  1.配置listener.ora

  主节点listener.ora:

  SID_LIST_LISTENER=

  (SID_LIST=

  (SID_DESC=

  (GLOBAL_DBNAME=a1)

  (ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)

  (SID_NAME=a1)

  )

  )

  LISTENER =

  (ADDRESS_LIST=

  (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.10)(PORT=1521))

  (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))

  )

  备节点listener.ora:

  SID_LIST_LISTENER=

  (SID_LIST=

  (SID_DESC=

  (GLOBAL_DBNAME=a1)

  (ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)

  (SID_NAME=a1)

  )

  )

  LISTENER =

  (ADDRESS_LIST=

  (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.20)(PORT=1521))

  (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))

  )

  2.配置tnsnames.ora(主备节点的tnsname.ora内容一样:)

  a1=

  (DESCRIPTION =

  (ADDRESS_LIST =

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

  )

  (CONNECT_DATA =

  (SERVICE_NAME = a1)

  )

  )

  a2=

  (DESCRIPTION =

  (ADDRESS_LIST =

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

  )

  (CONNECT_DATA =

  (SERVICE_NAME = a2)

  )

  )

  3.在主库启用归档并且启用强制归档

  步骤1:alter database force logging;

  archive log list;

  步骤2:在mount状态下

  alter database archivelog;

  步骤3:alter database open;

  archive log list;

  4.在主库上创建密码文件

  orapwd file='/u01/app/oracle/product/11.2.0/db_1/dbs/orapwa1.ora' password=xyc entries=10

  5.创建standby redo log

  alter database add standby logfile

  group 4 ('/u01/app/oracle/oradata/a1/standby_redo04a.log','/u01/app/oracle/oradata/a1/standby_redo04b.log') size 50m,

  group 5 ('/u01/app/oracle/oradata/a1/standby_redo05a.log','/u01/app/oracle/oradata/a1/standby_redo05b.log') size 50m,

  group 6 ('/u01/app/oracle/oradata/a1/standby_redo06a.log','/u01/app/oracle/oradata/a1/standby_redo06b.log') size 50m,

  group 7 ('/u01/app/oracle/oradata/a1/standby_redo07a.log','/u01/app/oracle/oradata/a1/standby_redo07b.log') size 50m;

  注意:Oracle 建议你在创建 standby 时就考虑 standby redolog 配置的问题。standby redologs 与 online redologs

  非常类似,应该说两者只是服务对象不同,,其它参数属性甚至操作的命令格式几乎都一样,你在设计 standby

  redologs 的时候完全可以借鉴创建 online redologs 的思路,比如多个文件组啦,每组多个文件冗余之类的。

  除些之外呢,oracle 提供了一些标准的建议如下:

  

人气教程排行