oracle数据库集群与热备,Oracle 11gR2 搭建Data Guard 数据库热备份集群

目的

搭建一个Oracle 11gR2支持数据热备份的验证环境,对应用系统进行集群部署验证。

准备

安装CentOS 7 64位系统上的Oracle 11gR2服务器两台(primary、standby)

确定主从数据库全局唯一名称(db_unique_name):primary(xiaoji)、standby(xiaoji_standby)

开始安装

1 打开Forced Logging模式

操作对象:primary

操作用户:oraclesqlplus xiaoji as sysdba

archive log list;

确认归档模式SQL> archive log list;

Database log mode              No Archive Mode

Automatic archival            Disabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence    7

Current log sequence          9

启动归档模式SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount;

ORACLE instance started.

Total System Global Area  534462464 bytes

Fixed Size                  2215064 bytes

Variable Size            402654056 bytes

Database Buffers          121634816 bytes

Redo Buffers                7958528 bytes

Database mounted.

SQL> alter database archivelog;

Database altered.

确认归档模式SQL> archive log list;

Database log mode              Archive Mode

Automatic archival            Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence    14

Next log sequence to archive  16

Current log sequence          16

确认强制归档SQL> select force_logging from v$database;

FOR

---

YES

强制归档alter database force logging;

执行结果SQL> alter database force logging;

Database altered.

确认归档模式SQL> select force_logging from v$database;

FOR

---

YES

2 添加standby日志文件

操作对象:primary

操作用户:oraclesqlplus xiaoji as sysdba

alter database add standby logfile group 4 ('/home/oracle/tools/oracle11g/oradata/xiaoji/redo_standby_01.log') size 20M;

alter database add standby logfile group 5 ('/home/oracle/tools/oracle11g/oradata/xiaoji/redo_standby_02.log') size 20M;

alter database add standby logfile group 6 ('/home/oracle/tools/oracle11g/oradata/xiaoji/redo_standby_03.log') size 20M;

alter database drop standby logfile group 4;

alter database drop standby logfile group 5;

alter database drop standby logfile group 6;

select * from v$logfile order by 1;

确认日志文件[oracle@vmco0240 xiaoji]$ pwd

/home/oracle/tools/oracle11g/oradata/xiaoji

[oracle@vmco0240 xiaoji]$ ls -la

total 1418624

drwxr-x---. 2 oracle asmadmin      4096 Jan  5 16:31 .

drwxr-x---. 5 oracle asmadmin      4096 Jan  4 11:40 ..

-rw-r-----. 1 oracle asmadmin  9748480 Jan  4 13:01 control01.ctl

-rw-r-----. 1 oracle asmadmin  52429312 Jan  4 11:18 redo01.log

-rw-r-----. 1 oracle asmadmin  52429312 Jan  4 11:18 redo02.log

-rw-r-----. 1 oracle asmadmin  52429312 Jan  4 13:00 redo03.log

-rw-r-----. 1 oracle asmadmin 20972032 Jan 7 13:17 redo_standby_01.log

-rw-r-----. 1 oracle asmadmin 20972032 Jan 7 13:17 redo_standby_02.log

-rw-r-----. 1 oracle asmadmin 20972032 Jan 7 13:18 redo_standby_03.log

-rw-r-----. 1 oracle asmadmin 482353152 Jan  4 13:00 sysaux01.dbf

-rw-r-----. 1 oracle asmadmin 702554112 Jan  4 12:58 system01.dbf

-rw-r-----. 1 oracle asmadmin  20979712 Jan  4 12:18 temp01.dbf

-rw-r-----. 1 oracle asmadmin  31465472 Jan  4 12:53 undotbs01.dbf

-rw-r-----. 1 oracle asmadmin  5251072 Jan  4 11:18 users01.dbf

3 准备参数文件

生成pfileSQL> create pfile from spfile;

File created.

关闭数据库SQL> shutdown immediate

修改pfile

参考资料ORACLE 11G 搭建dataguard详细步骤(所有操作总结)

http://blog.itpub.net/26230597/viewspace-1432637/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值