Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add redo log groups and redo log members for oracle

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article focuses on "how to add redo log group and redo log members to oracle". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to add redo log group and redo log members to oracle.

Add a redo log group:

SYS@orcl 08-SEP-14 > select group#,type,member from v$logfile

GROUP# TYPE MEMBER

-

3 ONLINE / u01/app/oracle/oradata/orcl/redo03.log

2 ONLINE / u01/app/oracle/oradata/orcl/redo02.log

1 ONLINE / u01/app/oracle/oradata/orcl/redo01.log

SYS@orcl 08-SEP-14 > alter database add logfile group 4

2 ('/ u01Accord oradata redo04.log')

3 size 50m

SYS@orcl 08-SEP-14 > select group#,sequence#,bytes/1024/1024 | | 'MB',status from v$log

GROUP# SEQUENCE# BYTES/1024/1024 | | 'MB' STATUS

-

1 25 50MB CURRENT

2 23 50MB INACTIVE

3 24 50MB INACTIVE

4 0 50MB UNUSED

Add a member to the log group:

SYS@orcl 09-SEP-14 > select group#,status,member from v$logfile

GROUP# STATUS MEMBER

-

3 / u01/app/oracle/oradata/orcl/redo03.log

2 / u01/app/oracle/oradata/orcl/redo02.log

1/ u01/app/oracle/oradata/orcl/redo01.log

4 / u01/app/oracle/oradata/orcl/redo04.log

SYS@orcl 09-SEP-14 > alter database add logfile member

2'/ u01qappandredologandredo01a.log' to group 1

3'/ u01 to group to group 2

4'/ u01 to group to group 3

5'/ u01 to group to group 4

Database altered.

SYS@orcl 09-SEP-14 > select group#,status,member,type from v$logfile

GROUP# STATUS MEMBER TYPE

-

3 / u01/app/oracle/oradata/orcl/redo03.log ONLINE

2 / u01/app/oracle/oradata/orcl/redo02.log ONLINE

1/ u01/app/oracle/oradata/orcl/redo01.log ONLINE

4 / u01/app/oracle/oradata/orcl/redo04.log ONLINE

1 INVALID / u01/app/redolog/redo01a.log ONLINE

2 INVALID / u01/app/redolog/redo02a.log ONLINE

3 INVALID / u01/app/redolog/redo03a.log ONLINE

4 INVALID / u01/app/redolog/redo04a.log ONLINE

8 rows selected.

After switching logs four times, the log group member with the status of invalid becomes null.

SYS@orcl 09-SEP-14 > select group#,status,member,type from v$logfile

GROUP# STATUS MEMBER TYPE

-

3 / u01/app/oracle/oradata/orcl/redo03.log ONLINE

2 / u01/app/oracle/oradata/orcl/redo02.log ONLINE

1/ u01/app/oracle/oradata/orcl/redo01.log ONLINE

4 / u01/app/oracle/oradata/orcl/redo04.log ONLINE

1/ u01/app/redolog/redo01a.log ONLINE

2 / u01/app/redolog/redo02a.log ONLINE

3 / u01/app/redolog/redo03a.log ONLINE

4 / u01/app/redolog/redo04a.log ONLINE

8 rows selected.

Delete log group members: (note that if there is only one member in this group, it cannot be deleted)

SYS@orcl 09-SEP-14 > alter database drop logfile member

2'/ u01qappandredologandredo01a.log'

3'/ u01qappActionRedologAccording to redo02a.log'

4'/ u01qappandredologandredo03a.log'

5'/ u01qappActionRedologUnique redo04a.log'

Alter database drop logfile member

*

ERROR at line 1:

ORA-01609: log 1 is the current log for thread 1-cannot drop members

ORA-00312: online log 1 thread 1:'/ u01 Grey App Grease oradata Universe oradata Greater redo01 log'

ORA-00312: online log 1 thread 1:'/ u01ActionApp RedologUnique redo01a.log'

You can see that the redo log being used by the instance cannot be deleted, so we first delete the members of other groups:

SYS@orcl 09-SEP-14 > alter database drop logfile member

2'/ u01qappandredologandredo02a.log'

3'/ u01qappActionRedologAccording to redo03a.log'

4'/ u01qappActionRedologAccording to redo04a.log'

Database altered.

Next, let's switch logs:

SYS@orcl 09-SEP-14 > select group#,sequence#,status from v$log

GROUP# SEQUENCE# STATUS

1 29 CURRENT

2 27 INACTIVE

3 28 INACTIVE

4 26 INACTIVE

SYS@orcl 09-SEP-14 > alter system switch logfile

System altered.

SYS@orcl 09-SEP-14 > select group#,sequence#,status from v$log

GROUP# SEQUENCE# STATUS

1 29 ACTIVE

2 27 INACTIVE

3 28 INACTIVE

4 30 CURRENT

Then delete redo01a.log, a member of log group 1:

SYS@orcl 09-SEP-14 > alter database drop logfile member

2'/ u01qappandredologandredo01a.log'

Database altered.

View log group and log group member information:

SYS@orcl 09-SEP-14 > select group#,status,type,member from v$logfile

GROUP# STATUS TYPE MEMBER

3 ONLINE / u01/app/oracle/oradata/orcl/redo03.log

2 ONLINE / u01/app/oracle/oradata/orcl/redo02.log

1 ONLINE / u01/app/oracle/oradata/orcl/redo01.log

4 ONLINE / u01/app/oracle/oradata/orcl/redo04.log

At this point, I believe you have a deeper understanding of "how to add redo log groups and redo log members to oracle". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report