DATAGUARD 添加修改REDOLOG大小

DATAGUARD 添加修改REDOLOG大小

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

DG在线日志组大小修改

环境(单实例,Centos 6.5 X64,oracle 10.2.0.5,filesystem存储)

REDO ONLINE LOG

select * from v$logfile where type='STANDBY'; #查询为standby log 三组

STANDBY LOG

select * from v$logfile where type<>'STANDBY'; #查询ONLINE LOG 为四组

 

1.备库standby log 添加

alter database recover managed standby database cancel;#取消APPLIED

alter database add standby logfile group

('/u01/app/oracle/oradata/netdata/st_redo08a.log','/u01/app/oracle/oradata/netdata/st_redo08b.log') size 300M;

alter database add standby logfile group 9

('/u01/app/oracle/oradata/netdata/st_redo09a.log','/u01/app/oracle/oradata/netdata/st_redo09b.log') size 300M;

alter database add standby logfile group 10

('/u01/app/oracle/oradata/netdata/st_redo10a.log','/u01/app/oracle/oradata/netdata/st_redo10b.log') size 300M;

alter database add standby logfile group 11

('/u01/app/oracle/oradata/netdata/st_redo11a.log','/u01/app/oracle/oradata/netdata/st_redo11b.log') size 300M;

 

2.删除备库standby log

alter database drop logfile group 4;

alter database drop logfile group 5;

alter database drop logfile group 6;

alter database drop logfile group 7;

 

如果出现以下错误,在主库上切换一下日志

ERROR at line 1:

ORA-00261: log 4 of thread 1 is being archived or modified

ORA-00312: online log 4 thread 1: '/u01/app/oracle/oradata/netdata/st_redo04b.log'

 

3.主库standbylog添加

alter database add standby logfile group

('/u01/app/oracle/oradata/netdata/st_redo08a.log','/u01/app/oracle/oradata/netdata/st_redo08b.log') size 300M;

alter database add standby logfile group 9

('/u01/app/oracle/oradata/netdata/st_redo09a.log','/u01/app/oracle/oradata/netdata/st_redo09b.log') size 300M;

alter database add standby logfile group 10

('/u01/app/oracle/oradata/netdata/st_redo10a.log','/u01/app/oracle/oradata/netdata/st_redo10b.log') size 300M;

alter database add standby logfile group 11

('/u01/app/oracle/oradata/netdata/st_redo11a.log','/u01/app/oracle/oradata/netdata/st_redo11b.log') size 300M;

 

4.删除主库旧的standby log

alter database drop logfile group 4;

alter database drop logfile group 5;

alter database drop logfile group 6;

alter database drop logfile group 7;

 

5.主库添加新的ONLINE REDO LOG

alter database add standby logfile group 12

('/u01/app/oracle/oradata/netdata/st_redo12a.log','/u01/app/oracle/oradata/netdata/st_redo12b.log') size 300M;

alter database add standby logfile group 13

('/u01/app/oracle/oradata/netdata/st_redo13a.log','/u01/app/oracle/oradata/netdata/st_redo13b.log') size 300M;

alter database add standby logfile group 14

('/u01/app/oracle/oradata/netdata/st_redo14a.log','/u01/app/oracle/oradata/netdata/st_redo14b.log') size 300M;

 

6.主库删除旧的ONLINE REDOLOG

删除之前切文档,首先查看是不是ACTIVE或者是INACTIVE

不是INACTIVE 多切几次归档

alter system logfile switch

alter system checkpoint

alter database drop logfile group 1;

alter database drop logfile group 2;

alter database drop logfile group 3;

 

7.备库添加新的ONLINE REDO LOG

alter system set standby_file_management='MANUAL';

 

alter database add standby logfile group 12

('/u01/app/oracle/oradata/netdata/st_redo12a.log','/u01/app/oracle/oradata/netdata/st_redo12b.log') size 300M;

alter database add standby logfile group 13

('/u01/app/oracle/oradata/netdata/st_redo13a.log','/u01/app/oracle/oradata/netdata/st_redo13b.log') size 300M;

alter database add standby logfile group 14

('/u01/app/oracle/oradata/netdata/st_redo14a.log','/u01/app/oracle/oradata/netdata/st_redo14b.log') size 300M;

 

8.删除备库旧的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 netdata (thread 1)

ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/netdata/redo01.log'

 

[oracle@oracle10g-dg1-213-100 ~]$ oerr ora 01624

01624, 00000, "log %s needed for crash recovery of instance %s (thread %s)"

// *Cause:  A log cannot be dropped or cleared until the thread's checkpoint

//          has advanced out of the log.

// *Action: If the database is not open, then open it. Crash recovery will

//          advance the checkpoint. If the database is open force a global

//          checkpoint. If the log is corrupted so that the database cannot

//          be opened, it may be necessary to do incomplete recovery until

//          cancel at this log.

 

尝试clean logfile

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: '/u01/app/oracle/oradata/netdata/redo01.log'

 

[oracle@oracle10g-dg1-213-100 netdata]$ oerr ora 19527

19527, 00000, "physical standby redo log must be renamed"

// *Cause:  The CLEAR LOGFILE command was used at a physical standby

//          database.  This command cannot be used at a physical standby

//          database unless the LOG_FILE_NAME_CONVERT initialization

//          parameter is set.  This is required to avoid overwriting

//          the primary database's logfiles.

// *Action  Set the LOG_FILE_NAME_CONVERT initialization parameter.

LOG_FILE_NAME_CONVERT参数未初始化

 

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

 

System altered.

 

SQL> shutdown immediate;

ORA-01109: database not open

 

 

Database dismounted.

ORACLE instance shut down.

SQL> startup nomount;

ORACLE instance started.

 

Total System Global Area  704643072 bytes

Fixed Size          2098912 bytes

Variable Size         184551712 bytes

Database Buffers      511705088 bytes

Redo Buffers            6287360 bytes

SQL> alter database mount standby database;

 

Database altered.

 

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 group 1;

 

Database altered.

 

SQL> alter database drop logfile group 2;

 

Database altered.

 

SQL> alter database drop logfile group 3;

 

Database altered.

 

 

SQL> alter system set standby_file_management='AUTO' scope=both;

 

System altered.

 

SQL> alter database recover managed standby database disconnect from session;

 

Database altered.

 

转载于:https://my.oschina.net/rootliu/blog/1864895

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值