cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Origlog files from Mirrlog

former_member759680
Contributor
0 Kudos

Hello,

While performing restore, we found that OriglogA and MirrlogB folders were not backed up(OFFLINE backup).

However, we do have OriglogB and MirrlogA. Now since

OriglogA=MirrlogA

and

MirrlogB=OriglogB

Can we just copy the available .dbf files into the missing directories, rename them accordingly?

will this work?

Thanks.

former_member188065
Participant
0 Kudos

Better not copy any files, but preferably do it like this

dbhost:orared 1> sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Jun 22 11:01:43 2021
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Data Mining and Real Application Testing options
SQL> select group#,status,member from v$logfile;

    GROUP# STATUS  MEMBER
---------- ------- ----------------------------------
         1         /oracle/RED/origlogA/log_g11m1.dbf
         1         /oracle/RED/mirrlogA/log_g11m2.dbf

         2         /oracle/RED/origlogB/log_g12m1.dbf
         2 INVALID /oracle/RED/mirrlogB/log_g12m2.dbf

         3         /oracle/RED/origlogA/log_g13m1.dbf
         3         /oracle/RED/mirrlogA/log_g13m2.dbf

         4         /oracle/RED/origlogB/log_g14m1.dbf
         4         /oracle/RED/mirrlogB/log_g14m2.dbf

8 rows selected.

SQL> ALTER DATABASE DROP LOGFILE MEMBER '/oracle/RED/mirrlogB/log_g12m2.dbf' ;
ALTER DATABASE DROP LOGFILE MEMBER '/oracle/RED/mirrlogB/log_g12m2.dbf'
*
ERROR at line 1:
ORA-01609: log 2 is the current log for thread 1 - cannot drop members
ORA-00312: online log 2 thread 1: '/oracle/RED/origlogB/log_g12m1.dbf'
ORA-00312: online log 2 thread 1: '/oracle/RED/mirrlogB/log_g12m2.dbf'

SQL> alter system switch logfile;
System altered.

SQL> ALTER DATABASE DROP LOGFILE MEMBER '/oracle/RED/mirrlogB/log_g12m2.dbf';
Database altered.

SQL> ALTER DATABASE ADD LOGFILE MEMBER '/oracle/RED/mirrlogB/log_g12m2.dbf' to group 2;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.

SQL> select group#,status,member from v$logfile;
    GROUP# STATUS  MEMBER
---------- ------- ----------------------------------
         1         /oracle/RED/origlogA/log_g11m1.dbf
         1         /oracle/RED/mirrlogA/log_g11m2.dbf
         2         /oracle/RED/origlogB/log_g12m1.dbf
         2         /oracle/RED/mirrlogB/log_g12m2.dbf
         3         /oracle/RED/origlogA/log_g13m1.dbf
         3         /oracle/RED/mirrlogA/log_g13m2.dbf
         4         /oracle/RED/origlogB/log_g14m1.dbf
         4         /oracle/RED/mirrlogB/log_g14m2.dbf
8 rows selected.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

If it is member of same group then it will work.you can also delete member and re-create

see below

Surendra Jain

former_member603052
Contributor
0 Kudos

Hi Gautam,

As per me, you can copy the files and paste in the missing directories and rename them according.

Kalyan

former_member759680
Contributor
0 Kudos

Yes Kalyan

I just read in Note - 491160 -

if the database is shut down
just copy the member that is still available to the locatation &          name of the missing member

So, in my case that should do it, because we have yet to start the DB.

Thanks!

Former Member
0 Kudos

Hi,

You will get answer of your question in the same sap note (491160)

SQL> ALTER DATABASE ADD LOGFILE GROUP <gropuid>

('<path & name member 1>'

'<path & name member 2>') size <size>;for logfile groups

SQL> ALTER DATABASE ADD LOGFILE '<path/filename>' ;for single logfiles.

Also see

Thanks

Sushil

Edited by: Sushil Suryawanshi on Jul 9, 2009 12:57 PM

former_member603052
Contributor
0 Kudos

Hi sushil,

I have a doubt.Is it required to execute those statements as he is not changing the location of log files or name of logfiles.

He is just replacing the files with the backup to the file locations already existing in the control file.

Kalyan

Former Member
0 Kudos

Hi Kalyan,

I think if its information is present in control file then no need to execute those sql's.

As per SAP Note 491160 it says if the database is shut down just copy the member that is still available to the locatation & name of the missing member

Thanks

Sushil

former_member759680
Contributor
0 Kudos

Hello,

I created the control files by running CONTROL.SQL and it created the Origlog and Mirrlog files by itself.

I did not restore any of the Origlog or Mirrlog files from the source, still they were created during creation of control file.

Could you please tell me the reason, how they were created?

Thanks.

former_member603052
Contributor
0 Kudos

hi,

Can you post whats is present in that CONTROL.SQL script.

Kalyan

anindya_bose
Active Contributor
0 Kudos

Dear Goutam

Just open your control.sql file. After reading few lines you will know which is creating yout orig.mirlog files..

Just read after "LOGFILE".

I will leave it to you to explore.

Thanks and Regards

Anindya

former_member759680
Contributor
0 Kudos

Yeah, there are entries of Online redo log files.

So the control.sql creates the Online redo log files?

But what data do these Online Redo log files contain? Are they blank now?

I thought we have to copy the online redo log files from the source as well.

0 Kudos

it has been mentioned several times regarding SAP note 491160.

if the database is shut down

just copy the member that is still available to the locatation &

name of the missing member

if the database is open

drop the member out of the group and recreate it

sqlplus '/ as sysdba'

SQL> ALTER DATABASE DROP LOGFILE MEMBER '<path/filename>';

SQL> ALTER DATABASE ADD LOGFILE MEMBER '<path/filename>' to group

X;

Former Member
0 Kudos

Gautam,

Check Note 491160 - Restore scenarios for lost files of oracle databases

Hope it helps

Thanks

Sushil

former_member759680
Contributor
0 Kudos

I saw the post -

<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1400634"></a>

However in my case, OriglogA and MirrlogB do not exist at all

Could you please confirm if the following commands will create OriglogA from MirrlogA

For ORIGLOGA -

SQL> ALTER DATABASE ADD LOGFILE MEMBER 'H:\ORACLE\SID\ORIGLOGA\LOG_G21M1.DBF' to group 1;

SQL> ALTER DATABASE ADD LOGFILE MEMBER 'H:\ORACLE\SID\ORIGLOGA\LOG_G23M1.DBF' to group 3;

and will this one create MirrlogB from OriglogB

For MIRRLOGB -

SQL> ALTER DATABASE ADD LOGFILE MEMBER 'H:\ORACLE\SID\MIRRLOGB\LOG_G22M2.DBF' to group 2;

SQL> ALTER DATABASE ADD LOGFILE MEMBER 'H:\ORACLE\SID\MIRRLOGB\LOG_G24M2.DBF' to group 4;

Edited by: Gautam Poddar on Jul 9, 2009 8:58 AM