Oracle Online Redo LogFile Configuration __oracle

Source: Internet
Author: User

For more information, see Oracle Official Documentation:

Managing the Online Redo Log

Advice: Perform a database full backup prior to the following operations control file backup

Query logfile Related information:

Query log file location and status

Sql> select * from V$logfile;

group# STATUS TYPE Member

---------- ------- ------- --------------------------------------------------

3 Online/u01/app/oracle/oradata/knitter/redo03.log

2 Online/u01/app/oracle/oradata/knitter/redo02.log

1 Online/u01/app/oracle/oradata/knitter/redo01.log

4 Online/u01/app/oracle/oradata/knitter/redo04.rdo

4 INVALID Online/u01/app/oracle/oradata/knitter/redo04_02.rdo

Query log group ordinal and status

Sql> SELECT group#, archived, STATUS from V$log;

group# ARC STATUS

---------- --- ----------------

1 NO Current

2 YES INACTIVE

3 YES INACTIVE

4 YES INACTIVE

Query log History

Sql> select * from V$log_history;

RECID STAMP thread# sequence# first_change# First_tim

---------- ---------- ---------- ---------- ------------- --------- ------------

1 716304893 1 1 158900 01-apr-10 260498

2 716317218 1 2 260498 14-apr-10 296893

3 716317260 1 3 296893 14-apr-10 296990

4 716319163 1 4 296990 14-apr-10 303247

5 716319176 1 5 303247 14-apr-10 303252

6 716384800 1 6 303252 14-apr-10 332583

7 716384854 1 7 332583 15-apr-10 332775

8 716384882 1 8 332775 15-apr-10 332881

9 716384892 1 9 332881 15-apr-10 332889

============================================================================================

Add group (Specify logfile): Do not specify group number (group number will be used automatically: current maximum group number + 1)

ALTER DATABASE
ADD LOGFILE ('/oracle/dbs/log1c.rdo ', '/oracle/dbs/log2c.rdo ') SIZE 500K;

Specify group number

ALTER DATABASE
ADD LOGFILE GROUP ('/oracle/dbs/log1c.rdo ', '/oracle/dbs/log2c.rdo ')
SIZE 500K;

Increase group members to specify group numbers

ALTER DATABASE ADD LOGFILE Member

'/oracle/dbs/log2b.rdo '

to GROUP 2;

ALTER DATABASE ADD LOGFILE Member

'/u01/app/oracle/oradata/knitter/redo05_3.rdo ',

'/u01/app/oracle/oradata/knitter/redo05_4.rdo ' to GROUP 5;

Specify no group number, all group members

ALTER DATABASE ADD LOGFILE member '/oracle/dbs/log2c.rdo '
To ('/oracle/dbs/log2a.rdo ', '/oracle/dbs/log2b.rdo ');

Note: When adding group members, you cannot specify the size of the logfile file because all member files in the same group (Loggroup) are exactly the same (size, content), and Oracle will automatically determine their size based on the existing team. If you specify a size, an error occurs, such as:

sql> ALTER DATABASE Add logfile member '/oracle/dbs/log1f.rdo ' size 100k to Group 5;

ALTER DATABASE add logfile member '/oracle/dbs/log1f.rdo ' size 100k to Group 5

*

ERROR at line 1:

ora-00946:missing to keyword

Delete a group member

Prerequisite: Cannot delete the last member in the group the state of the group cannot be active or current, otherwise you must log switch (log switch) if the database is in archive mode, you must (by forcing log switching) ensure that the information in the members of the group being deleted is archived

Force Toggle Log

ALTER SYSTEM SWITCH LOGFILE;

The following statement is then queried to ensure that the pending action group is not active or current:

SELECT group#, archived, STATUS from V$log;

Delete a group member

ALTER DATABASE DROP LOGFILE member '/oracle/dbs/log3c.rdo ';

Note: When the above operation is completed, only the related record information in Oracle is deleted.

You should also use the operating system removal instructions to delete the corresponding log files on the hard disk

Delete a group

Prerequisites: At least two groups of group states cannot be active or current,

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.