oracle 11g DataGuard online redo增加与修改大小

Wesley13
• 阅读 693

oracle 11g DataGuard online redo增加与修改大小

原创 作者:yjjuff 时间:2015-05-04 16:37:31 2977 0

在一个dg环境中,配置的是实时同步,需要增加主库的redo大小和组数,本来是一个很简单的问题,解决思路是:先备库增加standby redo删除老standby 

redo,然后主库增加redo删除老redo,备库增加新redo删除老redo,最后主库增加standby redo。但是在实施过程中,遇到了一些细节性的问题,主要是

学习到了log_file_name_convert如果不配置,将导致备库redo 文件不能被删除

---备库操作

1、取消日志恢复
alter database recover managed standby database cancel;

2、备库添加standby redolog组。

alter database add standby logfile group 11 ('/u01/app/oradata/orcl/stred11.log','/u01/app/oradata/orcl/stred11b.log') size 100M; 
alter database add standby logfile group 12 ('/u01/app/oradata/orcl/stred12.log','/u01/app/oradata/orcl/stred12b.log') size 100M; 
alter database add standby logfile group 13 ('/u01/app/oradata/orcl/stred13.log','/u01/app/oradata/orcl/stred13b.log') size 100M; 
alter database add standby logfile group 14 ('/u01/app/oradata/orcl/stred14.log','/u01/app/oradata/orcl/stred14b.log') size 100M; 

3、备库standby删除stnadby redo log
alter database drop logfile group 4;
alter database drop logfile group 5;
alter database drop logfile group 6;

SQL>  alter database drop logfile group 5;
 alter database drop logfile group 5
*
ERROR at line 1:
ORA-00261: log 5 of thread 1 is being archived or modified
ORA-00312: online log 5 thread 1: '/u01/app/oradata/orcl/stredo02.log'

--如在清除standby redo log组时出现上面出错信息执行下面的命令清理
alter database clear  logfile group 4;

4、主库online redo添加

alter database add logfile thread 1 group 7 ('/u01/app/oradata/orcl/redo07.log','/u01/app/oradata/orcl/redo07b.log') size 100m;

alter database add logfile thread 1 group 8 ('/u01/app/oradata/orcl/redo08.log','/u01/app/oradata/orcl/redo08b.log') size 100m;

alter database add logfile thread 2 group 9 ('/u01/app/oradata/orcl/redo09.log','/u01/app/oradata/orcl/redo09b.log') size 100m;

5、主库删除online redo组
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;

6、备库online redo组添加
刚开始删除的时候可能报错,执行以下命令:
alter system set standby_file_management='manual';

alter database add logfile thread 1 group 7 ('/u01/app/oradata/orcl/redo07.log','/u01/app/oradata/orcl/redo07b.log') size 100m;

alter database add logfile thread 1 group 8 ('/u01/app/oradata/orcl/redo08.log','/u01/app/oradata/orcl/redo08b.log') size 100m;

alter database add logfile thread 2 group 9 ('/u01/app/oradata/orcl/redo09.log','/u01/app/oradata/orcl/redo09b.log') size 100m;

7、备库删除老的online redo log

SQL> alter database drop logfile group 1;
alter database drop logfile group 1
*
ERROR at line 1:
ORA-01624: log 1 needed for crash recovery of instance wasudb (thread 1)
ORA-00312: online log 1 thread 1: '/data/oradata/wasudb/redo01.log'
 
SQL>  ALTER DATABASE CLEAR LOGFILE GROUP 1;
 ALTER DATABASE CLEAR LOGFILE GROUP 1
*
ERROR at line 1:
ORA-19527: physical standby redo log must be renamed
ORA-00312: online log 1 thread 1: '/data/oradata/wasudb/redo01.log'
 
SQL> show parameter NAME_CONVERT
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert                 string
log_file_name_convert                string

SQL> alter system set log_file_name_convert='/u01/app/oradata/orcl','/u01/app/oradata/orcl' scope=spfile;

System altered.

SQL> alter system set db_file_name_convert='/u01/app/oradata/orcl','/u01/app/oradata/orcl' scope=spfile;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup 
ORACLE instance started.

Total System Global Area  413372416 bytes
Fixed Size                  2213896 bytes
Variable Size             318769144 bytes
Database Buffers           88080384 bytes
Redo Buffers                4308992 bytes
Database mounted.
Database opened.
SQL> select open_mode,database_role from v$database;

OPEN_MODE            DATABASE_ROLE
-------------------- ----------------
READ ONLY            PHYSICAL STANDBY

SQL> show parameter file_name_convert

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert                 string      /u01/app/oradata/orcl, /u01/ap
                                                 p/oradata/orcl
log_file_name_convert                string      /u01/app/oradata/orcl, /u01/ap
                                                 p/oradata/orcl
SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIME   NEXT_CHANGE# 

NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ------------ ------------ 

------------
         1          1         25   52428800        512          1 YES CLEARING               1041620 04-MAY-15         1042334 04-

MAY-15
         2          1         20   52428800        512          1 YES CLEARING               1035102 20-JAN-15         1038445 04-

MAY-15
         3          1         21   52428800        512          1 YES CLEARING               1038445 04-MAY-15         1039447 04-

MAY-15
         7          1         28  104857600        512          2 YES CLEARING_CURRENT       1044189 04-MAY-15               0
         8          1         27  104857600        512          2 YES CLEARING               1042338 04-MAY-15         1044189 04-

MAY-15
         9          2          0  104857600        512          2 YES UNUSED                       0                         0

6 rows selected.

SQL> alter database drop logfile group 1;
alter database drop logfile group 1
*
ERROR at line 1:
ORA-01624: log 1 needed for crash recovery of instance orcl (thread 1)
ORA-00312: online log 1 thread 1: '/u01/app/oradata/orcl/redo01.log'

SQL> alter database clear logfile group 1;

Database altered.

SQL> alter database clear logfile group 2;

Database altered.

SQL> alter database clear logfile group 3;

Database altered.

SQL> alter database drop logfile 1;
alter database drop logfile 1
                            *
ERROR at line 1:
ORA-02236: invalid file name

SQL> alter database drop logfile group 1;

Database altered.

SQL> alter database drop logfile group  2;

Database altered.

SQL> alter database drop logfile group  3;

Database altered.

SQL> 

8、主库删除standby redo log组
SQL> alter database drop logfile group 4;

Database altered.

SQL> alter database drop logfile group 5;

Database altered.

SQL> alter database drop logfile group 6;

Database altered.

9、主库添加standby redo log 组SQL> alter database add standby logfile group 11  
alter database add standby logfile group 12 ('/u01/app/oradata/orcl/stred12.log','/u01/app/oradata/orcl/stred12b.log') size 100M; 
alter database add standby logfile group 13 ('/u01/app/oradata/orcl/stred13.log','/u01/app/oradata/orcl/stred13b.log') size 100M; 
alter database add standby logfile group 14 ('/u01/app/oradata/orcl/stred14.log','/u01/app/oradata/orcl/stred14b.log') size 100M; 

Database altered.

SQL> 
Database altered.

SQL> 
Database altered.

SQL> 
Database altered.

10、启动时实恢复

然后在备库执行
alter database recover managed standby database using current logfile disconnect;
alter system set standby_file_management='auto';

 

0

0

分享到:

上一篇: linux tmpfs和swap介绍

下一篇: ORA-01756: quoted string not properly terminated

oracle 11g DataGuard online redo增加与修改大小

请登录后发表评论

全部评论

oracle 11g DataGuard online redo增加与修改大小

oracle 11g DataGuard online redo增加与修改大小

yjjuff

注册时间:2012-10-11

  • 博文量

    29

  • 访问量

    229562

博文推荐

oracle 11g DataGuard online redo增加与修改大小

Oracle OER 7451 in Load Indicator : Error Code = OSD-04500的问题处理

eric0435 oracle 11g DataGuard online redo增加与修改大小

Adaptive Cursor Sharing(第五篇)

wei-xh oracle 11g DataGuard online redo增加与修改大小

Oracle闪回恢复区(fast recovery area,FRA)

lhrbest oracle 11g DataGuard online redo增加与修改大小

事务隔离级别读书笔记分享

wei-xh oracle 11g DataGuard online redo增加与修改大小

LOG FILE SYNC概述(第六篇)

wei-xh oracle 11g DataGuard online redo增加与修改大小

迁移OCR和VotingDisk并删除原ASM磁盘组

tangyunoracle oracle 11g DataGuard online redo增加与修改大小

如何导出存储过程、函数、包和触发器的定义语句?如何导出表和索引的创建语句?

lhrbest oracle 11g DataGuard online redo增加与修改大小

修改/dev/shm大小造成Oracle 12c集群启动故障

eric0435 oracle 11g DataGuard online redo增加与修改大小

探索索引的奥秘 - 10053事件

bisal oracle 11g DataGuard online redo增加与修改大小

【RMAN】SPFILE的恢复方式有哪几种?

lhrbest

点赞
收藏
评论区
推荐文章
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Stella981 Stella981
3年前
Dataguard环境下的备份与恢复
Dataguard环境下的备份与恢复原创ylw6006(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fblog.51cto.com%2Fylw6006)2012102914:02:06评论(0)(https://www.oschi
Wesley13 Wesley13
3年前
Uber基于RNN的极端事件预测,解决交通问题
时间 2017061212:00:15  亿欧网(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.tuicool.com%2Fsites%2FAJj2Un)_原文_  http://www.iyiou.com/p/47628(https://www.oschina.n
Wesley13 Wesley13
3年前
ORACLE 11G 搭建dataguard详细步骤(所有操作总结)
ORACLE11G搭建dataguard详细步骤(所有操作总结)(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fblog.itpub.net%2F26230597%2Fviewspace1432637%2F)_2015021018:19:12_分类:Oracle
Wesley13 Wesley13
3年前
Oracle数据库高可用之Oracle Restart详细安装图文教程
Oracle数据库高可用之OracleRestart详细安装图文教程Oracle(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fblog.itpub.net%2Foracle%2F)作者:startay
Wesley13 Wesley13
3年前
Oracle更改redo log大小 or 增加redo log组
(1)redolog的大小可以影响DBWR和checkpoint;(2)argerredologfilesprovidebetterperformance.Undersizedlogfilesincreasecheckpointactivityandreduceperformance.大的logfile可以提
Easter79 Easter79
3年前
Swift项目兼容Objective
!456.jpg(http://static.oschina.net/uploads/img/201509/13172704_1KcG.jpg"1433497731426906.jpg")本文是投稿文章,作者:一叶(博客(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2F00red
Wesley13 Wesley13
3年前
Oracle 了解 DDL 操作与 REDO 的关系
了解DDL操作与REDO的关系\TOC\DDL是否会产生REDO用到的SQL:查看redo的大小SQLselectb.name,a.valuefromv$mystata,v$statnamebwherea.statistic
Wesley13 Wesley13
3年前
Oracle11g RAC下ASM 的管理与维护
Oracle11gRAC下ASM的管理与维护Oracle(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fblog.itpub.net%2Foracle%2F)作者:不一样的天空w(https://www.oschina.n
Easter79 Easter79
3年前
The Complete Guide To Rooting Any Android Phone
PhoneWhitsonGordon(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.lifehacker.com.au%2Fauthor%2Fwhitsongordon%2F)7April,20118:00AMShare(https://ww