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 redo log files online with Oracle

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Oracle online how to redo log files, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

-Oracle online redo log file (ONLINE LOG FILE)

1. Several types of log files in Oracle

Redo log files

-- > online redo log

Archive log files

-- > Archive log

Alert log files

-- > alarm log

Trace files-- > trace log

User_dump_dest-- > user tracking log

Backupground_dump_dest-- > process trace log

-- View directories related to background processes

SQL > show parameter

Dump

NAME

TYPE VALUE

-

Background_core_dump string partial

Background_dump_dest string

/ u01/app/oracle/admin/orcl/bdump

Core_dump_dest string

/ u01/app/oracle/admin/orcl/cdump

Max_dump_file_size string UNLIMITED

Shadow_core_dump string partial

User_dump_dest string

/ u01/app/oracle/admin/orcl/udump

II. Planning and management of online redo logs

1. Online redo log

All changes to the data are recorded (structural changes made by DML,DDL or administrators to the data, etc.)

Provide recovery mechanism (for accidental deletion or downtime using log files for data recovery)

Can be managed in groups

two。 Online redo log group

An online redo log group consisting of one or more identical online log files

At least two log groups with one member in each group (it is recommended that two members in each group should be released to different disks)

The LGWR background process writes the log contents to all members of a group at the same time

Trigger conditions of LGWR

At the time of transaction commit (COMMIT)

Redo Log Buffer 1/3 full

Records of changes in Redo Log Buffer of more than one trillion

Before DBWn writes to the data file

3. Online redo log member

Each online log file in the redo log group is called a member.

Each member of a group has the same log serial number (log sequence number) and the same size

Each log switch, the Oracle server assigns a new LSN number to the log filegroup that will be written to the log

The LSN number is used to uniquely distinguish each online log group and archive log.

For online logs in archive mode, the LSN number is also written to the archive log when it is archived

4. How log files work

Log files are written in a circular sequence.

When one set of online log groups is full, LGWR writes the logs to the next group, and when the last group is full, it starts from the first group.

The process of writing to the next group is called log switching

Checkpoint process occurs during handover

Checkpoint information is also written to the control file

5. Planning of online log files

General principle

Decentralized release, multiplexing

The disk on which the log is located should have a higher Icano

General log group size should meet the business requirement of automatic switching interval of at least 15-20 minutes.

It is recommended to use the log file name at the end of rdo to avoid mistakenly deleting log files. Such as redo1.rdo,redo2.rdo

Planning example

Redo Log Group1 Redo

Log Group2 Redo

Log Group3

Member1 Member1 Member1

-> Physical Disk 1

Member2 Member2 Member2

-- > Physical Disk 2

Member3 Member3 Member3

-- > Physical Disk 3

6. Log switching and checkpoint switching

ALTER SYSTEM SWITCH LOGFILE

-- forced manual switching

ALTER SYSTEM CHECKPOINT

Force checkpoint interval

ALTER SYSTEM

SET FAST_START_MTTR_TARGET = n

7. Add log filegroup

ALTER

DATABASE ADD LOGFILE [GROUP n]

('$ORACLE_BASE/oradata/u01/logn1.rdo'

'$ORACLE_BASE/oradata/u01/logn2.rdo')

SIZE mM

8. Add log member

ALTER

DATABASE ADD LOGFILE MEMBER

'$ORACLE_BASE/oradata/u01/logn1.rdo'

TO GROUP 1

'$ORACLE_BASE/oradata/u01/logn2.rdo'

TO GROUP 2

9. Delete log member

Cannot delete the only member of a group

Members in active and current status groups cannot be deleted

Delete members in active and current status groups. Log switching should be used to make them in INACTIVE state before deletion

For a group, if one member is NULL, the other is INVALID, and the group enters INACTIVE, only INVALID status members can be deleted

Delete log members. Physical files are not really deleted. You need to delete them manually.

After deleting the log file, the control file is updated

For databases in archive mode, make sure the logs have been archived when deleting members, and view the v$log view for archived information

ALTER

DATABASE DROP LOGFILE MEMBER

'$ORACLE_BASE/oradata/u01/logn1.rdo'

10. Delete log group

An instance requires at least two online log filegroups

The active or current log group cannot be deleted

Members in the group have NULL value or INVALID status at the same time. The group cannot be deleted.

After the log group is deleted, the physical file needs to be deleted manually (for non-OMF)

ALTER

DATABASE DROP LOGFILE

GROUP n

11. Relocation and renaming of logs

Required permissions

ALTER

DATABASE system permissions

Copy files to the destination operating system permissions (write permissions)

Members of the CURRENT status group cannot be renamed

It is recommended that you back up the database before this behavior

It is recommended that you back up the control file immediately after renaming or relocation

Two methods of repositioning and renaming

Add a new member to the log group, and then delete an old member

Use ALTER

DATABASE RENAME FILE command (does not distinguish between archived and non-archived modes)

Copy online log files to a new path: ho cp

Execute ALTER

DATABASE RENAME FILE

'' TO''

If you are in the CURRENT state, you need to change your name and do not switch.

The way to do this is to switch to MOUNT and then do the above.

twelve。 Clear log filegroup

ALTER

DATABASE CLEAR LOGIFLE GROUP n

ALTER

DATABASE CLEAR UNARCHIVED LOGFILE GROUP n

-- use unarchived to avoid archiving

13. Log cycle cycle and switching Analysis

Group 1

Group 2 Group 3

Current Inactive Inactive

-Log Switch-

Active Current Inactive

-Log Switch-

Active Active Current

-Log Switch-

Current Inactive Inactive

-- Active and Current

Call it within a cycle (write logs sequentially)

-- Inactive calls it outside of a cycle (a new cycle)

-- if you start a new cycle, if you are in the archived state, you will first archive and then empty, otherwise you will directly empty the log.

-- Active when the database starts

The logs of and Current status cannot be lost, otherwise there will be an error.

14. Log monitoring

Check whether the physical log file in the log view exists, location, size, etc.

SELECT

'ho cp' | | member

FROM v$logfile

Check whether the disk space where the log file is located is sufficient

SQL > ho df

-h

Check whether there are multiple members in the group. If you are a single member, you should consider adding log members.

The interval for log switching should meet the business requirements of 15-20 minutes. If the switching interval is very short, the size of the log file should be increased.

Add a method to delete the log group and then rebuild it (switch between current and active before processing)

-- View the switching interval (manual switching time is not considered in the following example)

SQL >

SELECT TO_CHAR (first_time,'yyyy-mm-dd hh34:mi:ss'), group#

FROM v$log

TO_CHAR (FIRST_TIME, GROUP#

--

2010-07-20 09:43:18 1

2010-07-19 22:44:30 2

2010-07-19 22:44:32 3

15. Exception handling of logs (see section 9 of the demo)

Inconsistencies (at startup)

ALTER

DATABASE CLEAR LOGFILE GROUP n

ALTER

DATABASE CLEAR UNARCHIVED LOGFILE GROUP n

III. Dynamic performance views related to logs

V$LOG

V$LOGFILE

Status value of STATUS in V$LOG

UNUSED: never writes anything to this online log, usually after adding a new online log file or using resetlog

CURRENT: the current redo log file, indicating that the redo log file is active and can be opened and closed

ACTIVE: active, not part of the current log, required for crash recovery, can be used for block recovery, may or may not be archived

CLEARING: indicates that alter is being executed

The log is being rebuilt into an empty log after the database clear logfile command, and the status changes to unused after reconstruction.

CLEARING_CURRENT: the current log is in the purging state of the off thread. Such as some failure of the log or an Ipicuro error occurs when writing a new log header

INACTIVE: the online redo file log group is no longer required for instance recovery, and may or may not be archived.

Status value of STATUS in V$LOGFILE

INVALID: indicates that the file is not accessible

STALE: indicates that the content of the file is incomplete

DELETED: indicates that the file is no longer in use

NULL: indicates that the file is in use

IV. Demonstration

-1. View the log of the current database

SQL >

SELECT * FROM v$log

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

-

1 1 5 52428800 1

NO CURRENT 2758062 19-JUL-10

2 1 3 52428800 2 YES INACTIVE 2695010 16-JUL-10

3 1 4 104857600 2 YES INACTIVE 2716552 18-JUL-10

SQL >

SELECT * FROM v$logfile

ORDER BY group#

GROUP# STATUS TYPE MEMBER IS_

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

NO

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

NO

2 STALE ONLINE / u01/app/oracle/oradata/orcl/redo2.log

NO

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

NO

3 STALE ONLINE / u01/app/oracle/oradata/orcl/redo3.log

NO

-- 2. Add log group

SQL >

SELECT * FROM v$logfile

GROUP# STATUS TYPE MEMBER IS_

2 STALE ONLINE / u01/app/oracle/oradata/orcl/redo2.log

NO

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

NO

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

NO

3 STALE ONLINE / u01/app/oracle/oradata/orcl/redo3.log

NO

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

NO

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

NO

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

NO

-3. Add log member

SQL >

ALTER DATABASE ADD LOGFILE MEMBER

'/ u01Gap appUnitionoracleandoradataUniplicateorclUnipledredo1.log'

TO GROUP 1

Database altered.

SQL >

SELECT * FROM v$logfile

WHERE group# = 1

GROUP# STATUS TYPE MEMBER IS_

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

NO

1 INVALID ONLINE / u01/app/oracle/oradata/orcl/redo1.log

NO

-- 4. Delete log member

SQL >

ALTER DATABASE DROP LOGFILE MEMBER

'/ u01 apprenticeship oracleplicoradata 'redo01.log'

ALTER

DATABASE DROP LOGFILE MEMBER

'/ u01 apprenticeship oracleplicoradata 'redo01.log'

*

ERROR at line 1:

-- redo01.log is in NULL state and the log group is in current state and cannot be deleted

ORA-00362: member

Is required to form a valid logfile

In group 1

ORA-01517:

Log member:

'/ u01 apprenticeship oracleplicoradata 'redo01.log'

SQL >

ALTER DATABASE DROP LOGFILE MEMBER

'/ u01 apprenticeship oracleplicoradata 'redo04.log'

Database altered.

SQL >

ALTER DATABASE DROP LOGFILE MEMBER

'/ u01 apprenticeship oracleUniplicoradataUniplicateorclago redo4.log'

ALTER

DATABASE DROP LOGFILE MEMBER

'/ u01 apprenticeship oracleUniplicoradataUniplicateorclago redo4.log'

*

ERROR at line 1:

-- the last log member cannot be deleted

ORA-00361: cannot remove last

Log member / u01/app/oracle/oradata/orcl/redo4.log

For group 4

-5. Log switching

SQL >

SELECT * FROM v$log

-- the current log group is in CURRENT state

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

-

1 1 5 52428800 2

NO CURRENT 2758062 19-JUL-10

2 1 3 52428800 2 YES INACTIVE 2695010 16-JUL-10

3 1 4 104857600 2 YES INACTIVE 2716552 18-JUL-10

4 1 0 31457280 1 YES UNUSED 0

SQL >

ALTER SYSTEM SWITCH LOGFILE

-- switch logs

System altered.

SQL >

SELECT * FROM v$log

-- the unused status of the original log group 4 is changed to current.

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

-

1 1 5 52428800 2 YES ACTIVE 2758062 19-JUL-10

2 1 3 52428800 2 YES INACTIVE 2695010 16-JUL-10

3 1 4 104857600 2 YES INACTIVE 2716552 18-JUL-10

4 1 6 31457280 1

NO CURRENT 2759277 19-JUL-10

SQL >

ALTER SYSTEM SWITCH LOGFILE

-- switch logs again

System altered.

SQL >

SELECT * FROM v$log

-- Log group 1 becomes current and group 4 becomes active

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

-

1 1 5 52428800 2 YES ACTIVE 2758062 19-JUL-10

2 1 7 52428800 2

NO CURRENT 2759293 19-JUL-10

3 1 4 104857600 2 YES INACTIVE 2716552 18-JUL-10

4 1 6 31457280 1 YES ACTIVE 2759277 19-JUL-10

As can be seen from above, when switching logs, the unused group will be given priority as the next group of switching objects.

-- delete redo01.log again or receive an error message

SQL >

ALTER DATABASE DROP LOGFILE MEMBER

'/ u01 apprenticeship oracleplicoradata 'redo01.log'

ALTER

DATABASE DROP LOGFILE MEMBER

'/ u01 apprenticeship oracleplicoradata 'redo01.log'

*

ERROR at line 1:

ORA-00362: member

Is required to form a valid logfile

In group 1

ORA-01517:

Log member:

'/ u01 apprenticeship oracleplicoradata 'redo01.log'

SQL >

ALTER SYSTEM SWITCH LOGFILE

-- switch logs again

System altered.

SQL >

SELECT * FROM v$log

-- group1 becomes inactive

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

-

1 1 5 52428800 2 YES INACTIVE 2758062 19-JUL-10

2 1 7 52428800 2 YES ACTIVE 2759293 19-JUL-10

3 1 8 104857600 2

NO CURRENT 2759420 19-JUL-10

4 1 6 31457280 1 YES INACTIVE 2759277 19-JUL-10

-- after repeatedly cutting the log several times, redo01.log is deleted successfully

SQL >

ALTER DATABASE DROP LOGFILE MEMBER

'/ u01 apprenticeship oracleplicoradata 'redo01.log'

Database altered.

-6. Delete log groups (CURRENT and ACTIVE status cannot be deleted)

SQL >

SELECT * FROM v$log

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

-

1 19 52428800 1 YES ACTIVE 2759487 19-JUL-10

2 1 11 52428800 2

NO CURRENT 2759502 19-JUL-10

3 1 8 104857600 2 YES ACTIVE 2759420 19-JUL-10

4 1 10 31457280 1 YES ACTIVE 2759499 19-JUL-10

SQL >

ALTER DATABASE DROP LOGFILE

GROUP 4

ALTER

DATABASE DROP LOGFILE

GROUP 4

*

ERROR at line 1:

-- active group4 is used for disaster recovery and cannot be deleted

ORA-01624:

Log 4 needed for crash recovery

Of instance orcl (thread 1)

ORA-00312: online

Log 4 thread 1:

'/ u01 apprenticeship oracleUniplicoradataUniplicateorclago redo4.log'

SQL >

ALTER SYSTEM SWITCH LOGFILE

-- switch logs

System altered.

SQL >

/

System altered.

SQL >

SELECT * FROM vault log;-- the state of group 4 changes to inactvie

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

-

1 1 13 52428800 1

NO CURRENT 2759720 19-JUL-10

2 1 11 52428800 2 YES ACTIVE 2759502 19-JUL-10

3 1 12 104857600 2 YES ACTIVE 2759718 19-JUL-10

4 1 10 31457280 1 YES INACTIVE 2759499 19-JUL-10

SQL >

ALTER DATABASE DROP LOGFILE

GROUP 4

-- group 4 was deleted successfully

Database altered.

SQL > ho ls

/ u01Applicable oracleandoradataUniplicateorclplash redo*

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

/ u01/app/oracle/oradata/orcl/redo1.log

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

/ u01/app/oracle/oradata/orcl/redo2.log

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

/ u01/app/oracle/oradata/orcl/redo3.log

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

/ u01/app/oracle/oradata/orcl/redo4.log

SQL > ho rm

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

-- Delete physical files

SQL > ho rm

/ u01/app/oracle/oradata/orcl/redo4.log

-- Delete physical files

-7. Relocation and renaming of logs (demonstrate ALTER DATABASE RENAME FILE command only)

SQL >

SELECT name,log_mode

FROM v$database

NAME LOG_MODE

--

ORCL ARCHIVELOG

SQL >

SELECT * FROM v$logfile

ORDER BY group#

GROUP# STATUS TYPE MEMBER IS_

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

NO

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

NO

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

NO

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

NO

3 STALE ONLINE / u01/app/oracle/oradata/orcl/redo3.log

NO

SQL > ho cp

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

/ u01/app/oracle/oradata/redo01.rdo

SQL >

ALTER DATABASE RENAME

FILE'/ u01qqappActionoradata'oradata 'redo01.log'

2 TO

'/ u01Accord' / u01qapapax oradata 'redo01.rdo'

Database altered.

SQL >

SELECT * FROM v$logfile

WHERE group# = 1

GROUP# STATUS TYPE MEMBER IS_

1 ONLINE / u01/app/oracle/oradata/redo01.rdo

NO

-8. Empty log filegroups (only groups in non-active and non-current states can be emptied)

SQL >

SELECT * FROM v$log

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

-

1 1 13 52428800 1 YES ACTIVE 2759720 19-JUL-10

2 1 14 52428800 2

NO CURRENT 2761383 19-JUL-10

3 1 12 104857600 2 YES INACTIVE 2759718 19-JUL-10

SQL >

ALTER DATABASE CLEAR LOGFILE

GROUP 1

ALTER

DATABASE CLEAR LOGFILE GROUP 1

*

ERROR at line 1:

-- active status cannot be emptied

ORA-01624:

Log 1 needed for crash recovery

Of instance orcl (thread 1)

ORA-00312: online

Log 1 thread 1:

'/ u01ActionActionoradata' redo1.rdo'

SQL >

ALTER DATABASE CLEAR LOGFILE

GROUP 2

ALTER

DATABASE CLEAR LOGFILE GROUP 2

*

ERROR at line 1:

-- current status cannot be emptied

ORA-01624:

Log 2 needed for crash recovery

Of instance orcl (thread 1)

ORA-00312: online

Log 2 thread 1:

'/ u01 apprenticeship oracleUniplicoradataUniplicateorclago redo2.log'

ORA-00312: online

Log 2 thread 1:

'/ u01 apprenticeship oracleplicoradata 'redo02.log'

SQL >

ALTER DATABASE CLEAR LOGFILE

GROUP 3

Database altered.

SQL >

SELECT * FROM v$log

-- group 3 becomes unused after being emptied

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

-

1 1 13 52428800 1 YES INACTIVE 2759720 19-JUL-10

2 1 14 52428800 2

NO CURRENT 2761383 19-JUL-10

3 10 104857600 2 YES UNUSED 2759718 19-JUL-10

-- 9. Log exception handling

-- prompt log inconsistency at startup

SQL > startup

ORACLE instance started.

Total System Global Area 251658240 bytes

Fixed Size 1218796 bytes

Variable Size 83887892 bytes

Database Buffers 163577856 bytes

Redo Buffers 2973696 bytes

Database mounted.

ORA-00341:log 1

Of thread 1,wrong

Log # in header

ORA-00312:online

Log 1 thread 1 velcro plank u01 apprenticeship oracleplicoradataUnix orclpletredo1a.rdo'

ORA-00312:online

Log 1 thread 1 velcro plank u01 apprenticeship oracleplicoradata'orclscarp redo1b.rdo'

SQL >

ALTER DATABASE CLEAR LOGFILE

GROUP 1

Database altered.

SQL >

ALTER DATABASE OPEN

Database opened.

-- Log file missing (non-current status log group)

SQL > startup

ORACLE instance started.

Total System Global Area 251658240 bytes

Fixed Size 1218796 bytes

Variable Size 88082196 bytes

Database Buffers 159383552 bytes

Redo Buffers 2973696 bytes

Database mounted.

ORA-00313:

Open failed for members

Of log

Group 1 of thread 1

ORA-00312: online

Log 1 thread 1:

'/ u01 apprenticeship oracleplains oradata'orclplains redo1a.rdo'

ORA-00312: online

Log 1 thread 1:

'/ u01 apprenticeship oracleplains oradata 'redo1b.rdo'

SQL >

ALTER DATABASE CLEAR LOGFILE

GROUP 1

Database altered.

SQL >

ALTER DATABASE OPEN

Database altered.

-- Log file missing (current status log group)

SQL > startup

ORACLE instance started.

Total System Global Area 251658240 bytes

Fixed Size 1218796 bytes

Variable Size 83887892 bytes

Database Buffers 163577856 bytes

Redo Buffers 2973696 bytes

Database mounted.

ORA-00313:

Open failed for members

Of log

Group 3 of thread 1

ORA-00312: online

Log 3 thread 1:

'/ u01 apprenticeship oracleplains oradata'orclplains redo3a.rdo'

ORA-00312: online

Log 3 thread 1:

'/ u01 apprenticeship oracleplains oradata 'redo3b.rdo'

-- check the alarm log

SQL > ho tail

-n 30 / u01/app/oracle/admin/orcl/bdump/alert_orcl.log

ORA-27037: unable

To obtain file status

Linux Error: 2:

No such file

Or directory

Additional information: 3

ORA-00312: online

Log 3 thread 1:

'/ u01 apprenticeship oracleplains oradata'orclplains redo3a.rdo'

ORA-27037: unable

To obtain file status

Linux Error: 2:

No such file

Or directory

Additional information: 3

Tue Jul 2010: 45:58 2010

Errors in

File / u01/app/oracle/admin/orcl/bdump/orcl_lgwr_4112.trc:

ORA-00313:

Open failed for members

Of log

Group 3 of thread 1

ORA-00312: online

Log 3 thread 1:

'/ u01 apprenticeship oracleplains oradata 'redo3b.rdo'

ORA-27037: unable

To obtain file status

Linux Error: 2:

No such file

Or directory

Additional information: 3

ORA-00312: online

Log 3 thread 1:

'/ u01 apprenticeship oracleplains oradata'orclplains redo3a.rdo'

ORA-27037: unable

To obtain file status

Linux Error: 2:

No such file

Or directory

Additional information: 3

Tue Jul 2010: 45:58 2010

ARC0: STARTING ARCH PROCESSES

Tue Jul 2010: 45:58 2010

ARC1: Becoming the

'no FAL' ARCH

ARC1: Becoming the

'no SRL' ARCH

Tue Jul 2010: 45:58 2010

ARC2: Archival started

ARC0: STARTING ARCH PROCESSES COMPLETE

ARC0: Becoming the heartbeat ARCH

ARC2 started with pid=18, OS id=4137

Tue Jul 2010: 45:58 2010

ORA-313 signalled during:

ALTER DATABASE

OPEN...

-- check whether the physical log file exists

SQL > ho ls

/ u01/app/oracle/oradata/orcl/redo3a.rdo

Ls:

/ u01/app/oracle/oradata/orcl/redo3a.rdo:

No such file

Or directory

SQL > ho ls

/ u01/app/oracle/oradata/orcl/redo3b.rdo

Ls:

/ u01/app/oracle/oradata/orcl/redo3b.rdo:

No such file

Or directory

-try using the empty log group command

SQL >

ALTER DATABASE CLEAR LOGFILE

GROUP 3

ALTER

DATABASE CLEAR LOGFILE GROUP 3

*

ERROR at line 1:

-- the system is in non-archive mode and the group 3 status is CURRENT

ORA-00350:

Log 3 of instance orcl

(thread 1) needs

To be archived

ORA-00312: online

Log 3 thread 1:

'/ u01 apprenticeship oracleplains oradata'orclplains redo3a.rdo'

ORA-00312: online

Log 3 thread 1:

'/ u01 apprenticeship oracleplains oradata 'redo3b.rdo'

-- try to empty the log using non-return files

SQL >

ALTER DATABASE CLEAR UNARCHIVED LOGFILE

GROUP 3

ALTER

DATABASE CLEAR UNARCHIVED LOGFILE GROUP 3

*

ERROR at line 1:

ORA-00313:

Open failed for members

Of log

Group 3 of thread 1

ORA-00312: online

Log 3 thread 1:

'/ u01 apprenticeship oracleplains oradata 'redo3b.rdo'

ORA-27037: unable

To obtain file status

Linux Error: 2:

No such file

Or directory

Additional information: 3

ORA-00312: online

Log 3 thread 1:

'/ u01 apprenticeship oracleplains oradata'orclplains redo3a.rdo'

ORA-27037: unable

To obtain file status

Linux Error: 2:

No such file

Or directory

Additional information: 3

-- restore using media with control files

SQL > RECOVER

DATABASE USING BACKUP CONTROLFILE

ORA-00279: change 2835232 generated at 07/20/2010 10:40:23

Needed for thread 1

ORA-00289: suggestion

: / u01/app/oracle/flash_recovery_area/ORCL/archivelog/2010_07_20/o1_mf_1_39_%u_.arc

ORA-00280: change 2835232

For thread 1 is

In sequence # 39

Specify log:

{= suggested

| | filename |

AUTO | CANCEL}

ORA-00308: cannot

Open archived log

'/ u01 apprenticespact oracleash flashbacks recoveryarchivelogAccording to ORCLARAVOGULAR on October 07, 2010, December 20, 2011, on the 1st, 7th, 4th, 7th, 6th, 7th, 6th, 20th, May, December, 2010, December, 2010, July, December, and December, 2010, 2010, 2007, December, 2010, December 20, 2010, April 7, 2010, April 20, 2010, April 10, 2010, December 20, 2010, October 10, 2007, December 20, 2010, October 10, 2010, March 10, 2010, October 20, 2010, March 10, 2010, March 10, 2010, October 20, 2010, April 7, 2010, March 20

ORA-27037: unable

To obtain file status

Linux Error: 2:

No such file

Or directory

Additional information: 3

-- Open the database using the resetlogs option

SQL >

ALTER DATABASE OPEN RESETLOGS

Database altered.

SQL >

SELECT * FROM v$log

-- system Reconstruction group 3

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

-

1 1 2 31457280 2

NO CURRENT 2835234 20-JUL-10

2 1 1 31457280 2 YES INACTIVE 2835233 20-JUL-10

31 0 31457280 2 YES UNUSED 0

SQL >

SELECT * FROM v$logfile

-- added two members redo3a.rdo and redo3b.rdo to group 3

GROUP# STATUS TYPE MEMBER IS_

2 ONLINE / u01/app/oracle/oradata/orcl/redo2a.rdo

NO

2 ONLINE / u01/app/oracle/oradata/orcl/redo2b.rdo

NO

1 ONLINE / u01/app/oracle/oradata/orcl/redo1a.rdo

NO

3 ONLINE / u01/app/oracle/oradata/orcl/redo3a.rdo

NO

3 ONLINE / u01/app/oracle/oradata/orcl/redo3b.rdo

NO

1 ONLINE / u01/app/oracle/oradata/orcl/redo1b.rdo

NO

For CURRENT groups, you can also use hidden parameters to solve the

Steps:

Alter system

Set "_ allow_resetlogs_corruption" = true scope

= spfile

Recover database using bakcup controlfile

Alter

Database open resetlogs

Shutdown immediate

Startup mount

Alter

Database open resetlogs

Alter system reset "_ allow_resetlogs_corruption" scope

= spfile sid =

'*'

For the loss of log files in archive mode, you can also follow the above steps

After reading the above, have you mastered how to redo log files online with Oracle? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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