Alter database switch logfile

Hi friends,
Oracle DB 9i
I am making a standby database backup (hi-brid), and keep updating every hour on top of the hour sked it with the archive logs generated.
I am just confused a little. If I have 3 logfiles, and if I command "alter database switch log files", does the 3 logfiles
be converted to the backup archive logs ? or only one of them only, and I have to issue the command 3x so that I will be able to get all the latest transaction inside the 3 redo logfiles to be applied at the standby server.
Thanks a lot,
Ms Inday

crystal wrote:
oh i see :D , so at any time there is one and only one redo log group that has data? all the other 2 are empty?not empty, but already archived. When an online redo log fills, there is an automatic switch to the next group. As soon as the switch is complete, the archiver will start archiving the group that was just filled. Archiving does not wait until all redo groups are filled.
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2010.12.17 14:54:47 =~=~=~=~=~=~=~=~=~=~=~=
login as: oracle
oracle@vmlnx01's password:
Last login: Fri Dec 17 14:49:39 2010 from 192.168.160.1
[oracle@vmlnx01 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Fri Dec 17 14:55:08 2010
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select group#, archived, status from v$log order by 1;
alter system switch logfile;
    GROUP# ARC STATUS
1 YES INACTIVE
2 YES INACTIVE
3 NO  CURRENT
SQL>
System altered.
SQL> select group#, archived, status from v$log order by 1;
alter system switch logfile;
    GROUP# ARC STATUS
1 NO  CURRENT
2 YES INACTIVE
3 YES ACTIVE
SQL>
System altered.
SQL> select group#, archived, status from v$log order by 1;
alter system switch logfile;
    GROUP# ARC STATUS
1 YES ACTIVE
2 NO  CURRENT
3 YES ACTIVE
SQL>
System altered.
SQL> select group#, archived, status from v$log order by 1;
alter system switch logfile;
    GROUP# ARC STATUS
1 YES INACTIVE
2 YES INACTIVE
3 NO  CURRENT
SQL>
System altered.
SQL> select group#, archived, status from v$log order by 1;
alter system switch logfile;
    GROUP# ARC STATUS
1 NO  CURRENT
2 YES INACTIVE
3 YES ACTIVE
SQL>
System altered.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@vmlnx01 ~]$ exit
logout

Similar Messages

  • Alter system switch logfile

    Hi all,
    As Oracle says, this command "lets you explicitly force Oracle Database to begin writing to a new redo log file group". But, how does Oracle Database 10g choose which redo log file group will be used next?
    I faced a situation where it follows a strange pattern:
    SQL> alter system switch logfile;
    System altered.
    SQL> select f.GROUP#, f.MEMBER, l.BYTES/1024/1024 MB, l.STATUS from v$logfile f, v$log l where f.group# = l.group#;
        GROUP# MEMBER                                   MB STATUS
             1 /redologs/MYDB/redoMYDB01.log             800 INACTIVE
             2 /redologs/MYDB/redoMYDB02.log             800 INACTIVE
             3 /redologs/MYDB/redoMYDB03.log             800 INACTIVE
             4 /redologs/MYDB/redoMYDB04.log             800 ACTIVE
             5 /redologs/MYDB/redoMYDB05.log             800 ACTIVE
             6 /oradata/dbf1/MYDB/redoMYDB06.log         800 INACTIVE
             7 /oradata/dbf1/MYDB/redoMYDB07.log         800 INACTIVE
             8 /oradata/dbf1/MYDB/redoMYDB08.log         800 INACTIVE
             9 /oradata/dbf1/MYDB/redoMYDB09.log         800 INACTIVE
            10 /oradata/dbf1/MYDB/redoMYDB10.log         800 INACTIVE
            11 /oradata/dbf1/MYDB/redoMYDB11.log         800 INACTIVE
            12 /oradata/dbf1/MYDB/redoMYDB12.log         800 INACTIVE
            13 /oradata/dbf1/MYDB/redoMYDB13.log         800 INACTIVE
            14 /oradata/dbf1/MYDB/redoMYDB14.log         800 INACTIVE
            15 /oradata/dbf1/MYDB/redoMYDB15.log         800 INACTIVE
            16 /oradata/dbf1/MYDB/redoMYDB16.log         800 CURRENT
    16 rows selected.
    SQL> alter system switch logfile;
    System altered.
    SQL> select f.GROUP#, f.MEMBER, l.BYTES/1024/1024 MB, l.STATUS from v$logfile f, v$log l where f.group# = l.group#;
        GROUP# MEMBER                                   MB STATUS
             1 /redologs/MYDB/redoMYDB01.log             800 INACTIVE
             2 /redologs/MYDB/redoMYDB02.log             800 INACTIVE
             3 /redologs/MYDB/redoMYDB03.log             800 INACTIVE
             4 /redologs/MYDB/redoMYDB04.log             800 ACTIVE
             5 /redologs/MYDB/redoMYDB05.log             800 ACTIVE
             6 /oradata/dbf1/MYDB/redoMYDB06.log         800 CURRENT
             7 /oradata/dbf1/MYDB/redoMYDB07.log         800 INACTIVE
             8 /oradata/dbf1/MYDB/redoMYDB08.log         800 INACTIVE
             9 /oradata/dbf1/MYDB/redoMYDB09.log         800 INACTIVE
            10 /oradata/dbf1/MYDB/redoMYDB10.log         800 INACTIVE
            11 /oradata/dbf1/MYDB/redoMYDB11.log         800 INACTIVE
            12 /oradata/dbf1/MYDB/redoMYDB12.log         800 INACTIVE
            13 /oradata/dbf1/MYDB/redoMYDB13.log         800 INACTIVE
            14 /oradata/dbf1/MYDB/redoMYDB14.log         800 INACTIVE
            15 /oradata/dbf1/MYDB/redoMYDB15.log         800 INACTIVE
            16 /oradata/dbf1/MYDB/redoMYDB16.log         800 ACTIVE
    16 rows selected.
    Thanks!

    Oracle doesn't use the GROUP# to identify the "next" redo log.
    It switched from Group#16 to Group#6.  This would happen if, in the past, Group#6 was added to the database when Group#16 was the CURRENT redolog.  At that time, the next SWITCH from Group#16 would have caused it to switch from Group#16 to the "newest" UNUSED group -- Group#6.  Thereafter, Oracle persists with the behaviour of switching from Group#16 to Group#6.
    Hemant K Chitale

  • Standby db: continue manualluy alter database register logfile

    Hi,
    in my standby db 10.2.0.4, on linux platform, some archive log are not register properly and i need to perform the register logfile manually.
    Which test a can i do to solve this problem?
    Thank you.

    This is my standby alert log:
    -- Connected User is Valid
    RFS[10]: Assigned to RFS process 26620
    RFS[10]: Identified database type as 'physical standby'
    Tue Sep 14 05:05:58 2010
    Errors in file /oracle/admin/orcl/udump/orcl1_rfs_26620.trc:
    ORA-16401: archivelog rejected by RFS
    Redo Shipping Client Connected as PUBLIC
    -- Connected User is Valid
    RFS[11]: Assigned to RFS process 26622
    RFS[11]: Identified database type as 'physical standby'
    Tue Sep 14 05:05:58 2010
    Errors in file /oracle/admin/orcl/udump/orcl1_rfs_26622.trc:
    ORA-16401: archivelog rejected by RFS
    Tue Sep 14 05:06:03 2010
    Media Recovery Log /database/arch/orcl/arc1_16195_326468442.ARC
    Media Recovery Waiting for thread 2 sequence 16536
    Tue Sep 14 05:20:46 2010
    alter database register logfile '/database/arch/orcl/arc2_16536_326468442.ARC'
    Tue Sep 14 05:20:46 2010
    There are 1 logfiles specified.
    ALTER DATABASE REGISTER [PHYSICAL] LOGFILE
    Resynchronizing thread 2 from sequence 16535 to 16536
    Completed: alter database register logfile '/database/arch/orcl/arc2_16536_326468442.ARC'
    Tue Sep 14 05:20:48 2010
    Media Recovery Log /database/arch/orcl/arc2_16536_326468442.ARC
    Tue Sep 14 05:21:07 2010
    Media Recovery Log /database/arch/orcl/arc1_16196_326468442.ARC
    Media Recovery Log /database/arch/orcl/arc1_16197_326468442.ARC
    Media Recovery Log /database/arch/orcl/arc1_16198_326468442.ARC
    Media Recovery Waiting for thread 1 sequence 16199
    Tue Sep 14 05:45:29 2010
    RFS[6]: Archived Log: '/database/arch/orcl/arc1_16199_326468442.ARC'
    Tue Sep 14 05:45:29 2010
    RFS[8]: Archived Log: '/database/arch/orcl/arc1_16200_326468442.ARC'
    Tue Sep 14 05:45:29 2010
    RFS[6]: Archived Log: '/database/arch/orcl/arc1_16201_326468442.ARC'
    Tue Sep 14 05:45:40 2010
    Media Recovery Log /database/arch/orcl/arc1_16199_326468442.ARC
    Media Recovery Waiting for thread 2 sequence 16537
    Tue Sep 14 06:00:05 2010
    alter database register logfile '/database/arch/orcl/arc2_16537_326468442.ARC'
    Tue Sep 14 06:00:05 2010
    There are 1 logfiles specified.
    ALTER DATABASE REGISTER [PHYSICAL] LOGFILE
    alter database register are performed from a scheduled shell script that check log from V$ARCHIVED_LOG

  • Importance of "alter system switch logfile"

    Hi,
    How important it is to give "alter system switch logfile" while we are taking a backup using rman.?
    how important is giving the above command before the backup? and
    how important is the same just after the backup?
    is it mandatory to give the command for archive log backups?
    I am using Oracle 8.1.5 on HP-UX 32 Bit.
    Regards,
    Ankit.

    Hi,
    this command has its own meaning,when you give alter system switch logfile in archivelog mode then all the contents of online redolog file has move to archivelog file.so all data upto specific time is available in archivelog file.and if you are using noarchivelog mode then it will move to next log group.
    1.in rman no need to give this command.
    but in user manage backup mode u should use this command.
    2.No need it after the backup.
    3.Not mandatory.
    Thanks
    Kuljeet Pal Singh

  • When i fire alter system switch logfile

    i got a problem in which,when i fire alter system switch logfile.it diden't execute,but the cursur just blink..
    why this is happening???
    with regards Alok
    thanks a lot....

    Perhaps you can problems with some Data Dictionary views. Apply this query and print here the answer:
    select * from v$sgastat where name='free memory';
    Joel Pérez
    http://otn.oracle.com/experts

  • SQL alter system switch logfile;

    Hi,
    RMAN after finishing backup job is waitin on alter system switch logfile;
    What might be the problem ?
    On another window on SQL I type the same SQL> alter system switch logfile but it is on wait yet.
    Many thanks for your help.
    channel t1: starting piece 1 at 24-AUG-06
    channel t1: finished piece 1 at 24-AUG-06
    piece handle=/d01/devdata/backup/df_DEV_599332470_7_1 comment=NONE
    channel t1: backup set complete, elapsed time: 00:04:05
    Finished backup at 24-AUG-06
    sql statement: alter system switch logfile

    Thank you.
    Arch directory is not full.
    This is end of alertlog :
    Beginning log switch checkpoint up to RBA [0x18f.2.10], SCN: 0x056c.dc3c881b
    Thread 1 advanced to log sequence 399
    Current log# 1 seq# 399 mem# 0: /d01/devdata/logs/log01a.dbf
    Current log# 1 seq# 399 mem# 1: /d01/devdata/logs/log01b.dbf
    Thu Aug 24 17:18:39 2006
    Completed checkpoint up to RBA [0x18f.2.10], SCN: 0x056c.dc3c881b
    Regards.

  • Alter database register logfile

    Hi,
    I just setup a dr site for our client for R/3 production system.
    I had two options to automatically apply the logfiles in standby system.
    Option 1: Wrote a script to automate the archive from primary to standby and then apply on standby.
    Option 2: Just moved the archive from primary to standby and fired the command alter database managed standby database;
    Here i had to fire one more command on different sql session to register the archive on standby system. Registering log file has to be done for all archive logs.
    Currently the standby system is running based on option1.
    My question is,
    why do i need to register these archive files?
    Is there any way, this registration can be skipped?
    Regards,
    Iyyappan

    Hello Iyyappan,
    at first we have to clarify: A logical or a physical standby database?
    For example:
    If the primary database is unavailable, you have to perform the register manually.
    It is described by the oracle dataguard concepts:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/log_transport.htm#i1148216
    And take a look at here what a "gap" is:
    http://www.dba-oracle.com/t_oracledataguard_37_archive_gap_sequence_.htm
    Regards
    Stefan

  • Oracle DataGuard  while switch logfile ora-01031 insuffcient previlage

    I have configured a simple data guard system. The physical standby database open in read only mode. when I issue the following command in the primary database it shows the following error
    SQL> alter system switch logfile;
    System altered.
    SQL> select status,error from v$archive_dest;
    STATUS ERROR
    VALID
    ERROR ORA-01031: insufficient privileges
    INACTIVE
    INACTIVE
    INACTIVE
    INACTIVE
    INACTIVE
    INACTIVE
    INACTIVE
    INACTIVE
    what may be the reasons?

    SQL> select status,error from v$archive_dest;
    STATUS ERROR
    VALID
    ERROR ORA-01031: insufficient privileges
    INACTIVE
    INACTIVEwhat above problem u got.....pl.z explain clear

  • Alter database create datafile as

    Hi
    T1-)shutdown immediate;
    T2-)Take full backup
    T3-)startup;
    T4-)move the objects in tablespace test1 to some other tablespace
    T5-)drop tablespace test1;
    T6-)create tablespace test1
    datafile 'C:\oraclexe\oradata\XE\test1.dbf' reuse;
    T7-)alter system switch logfile;
    In some other server;
    startup nomount;
    restore the backupset which was taken at T2.
    restore controlfile at T7.
    startup mount;
    alter database create datafile 'C:\oraclexe\oradata\XE\test1.dbf' as 'C:\oraclexe\oradata\XE\test1.dbf';
    ALTER DATABASE RECOVER automatic database until cancel using backup controlfile;
    Recovery performed succefully.
    What I wanna ask is;
    Since First I issue:
    "alter database create datafile as ...."
    The contents of this datafile should be deleted with this statement.
    Why oracle doesnt give error in recovery, during appliying the statement at T4 ?
    I have already deleted the contents of the datafile, how come oracle move the objects?
    I hope I am clear

    Hi,
    although it is beyound my imagination what kind of real world scenario you are trying to simulate with your test, I can tell you why no error gets returned:
    You create a new tablespace t1 after you dropped the old one. That gets stored in the current controlfile. The previous backup of the datafile of the old tablespace that incidentally has the same name is now useless for the new tablespace.
    You then restore that controlfile and create the datafile manually as it looked after you created the new tablespace (empty) and then recover that. RMAN does that (without complaining even about the uselessness of your doing). If you look into that tablespace, you will see that it is empty as it was after you created it - unless you have put any objects into it after the second creation of that tablespace t1.
    Kind regards
    Uwe
    http://uhesse.wordpress.com

  • Switch logfile VS Archive log current

    What is the difference between this two command?
    - SQL> alter system switch logfile;
    This command switch the current log and if in ARCHIVELOG mode, it will archive it as well. Am I rite?
    SQL> alter system archive log current;
    This command DID NOT switch to another log group, remain the same log group but archive the current log? Am I rite?
    Thanks

    You're right about your first question, not for the second. Here an extract from Oracle documentation :
    CURRENT Clause
    Specify CURRENT to manually archive the current redo log file group of the specified thread, forcing a log switch. If you omit the THREAD parameter, then Oracle Database archives all redo log file groups from all enabled threads, including logs previous to current logs. You can specify CURRENT only when the database is open.
    NOSWITCH
    Specify NOSWITCH if you want to manually archive the current redo log file group without forcing a log switch. This setting is used primarily with standby databases to prevent data divergence when the primary database shuts down. Divergence implies the possibility of data loss in case of primary database failure.
    You can use the NOSWITCH clause only when your instance has the database mounted but not open. If the database is open, then this operation closes the database automatically. You must then manually shut down the database before you can reopen it.

  • Alter database OR alter system?? what is the logic?

    Hi,
    this is just a general question not related to any particular issue. I seem to be missing the logic behind when we need to use the "alter system ... " statements and when we need to use the "alter database ..." statements. Is there a logic I can use to guess ? Or we only need to remember them (or look up for them)?
    Let's take an example.
    alter database archivelog; & alter system checkpoint;
    OR
    alter database add logfile; & alter system set undo_retention=800;
    If you have a key that can be generally applied please let me know as I am not able to find it. Thank you,
    enrico

    I am not sure if there is a general rule but this is what I use:
    alter database is about modifying the database architecture, like data files, archived log files etc.
    alter system is about modifying the instance. so, you are modifying the way oracle runs. Remember that all parameters should be done with alter system (like undo_retention)
    hope this will help you.

  • Backup Error:Could not switch logfile in 7200 seconds

    The scheduled backup of the oracle db in Unix fails after backing up all the tablespaces.
    During backup of the archived logs the error comes up:
    ERROR! Could not switch logfile in 7200 seconds!
    I have 7 log groups with 2 members each and a size of 26MB.
    I know I can increase the timeout but it shouldn't take that long anyway.

    No error code, that is the strange part.
    The last part from the log of ora_backup:
    Switching logfile (alter system switch logfile;)
    System altered.
    DONE backing up tablespaces.
    *** Sun Jan 8 21:58:14 2006
    *** Backing up archive log files:
    Archive log directory is .
    Switching from logfile myscript.sql...
    System altered.
    DONE.
    Waiting for new log file............................................................
    System altered.
    .ERROR! Could not switch logfile in 7200 seconds!
    Usually the normal behaviour is:
    Switching logfile (alter system switch logfile;)
    System altered.
    DONE backing up tablespaces.
    *** Fri Jan 6 21:56:33 2006
    *** Backing up archive log files:
    Archive log directory is /my_instance/arch/arc.
    Switching from logfile MY_INSTANCE_T0001S0000271170.arc...
    System altered.
    DONE.
    Waiting for new log file............................................................
    New log file is MY_INSATNCE_T0001S0000271172.arc.

  • Switch logfile

    hi
    all
    tell me what happens when we issue alter system switch logfile after realizing no arvhive logs generated in oraarch

    SQL> show parameter LOG_ARCHIVE_DEST;
    NAME TYPE VALUE
    log_archive_dest string /oracle/BP1/oraarch/BP1arch
    log_archive_dest_1 string
    log_archive_dest_10 string
    log_archive_dest_2 string
    log_archive_dest_3 string
    log_archive_dest_4 string
    log_archive_dest_5 string
    log_archive_dest_6 string
    log_archive_dest_7 string
    log_archive_dest_8 string
    log_archive_dest_9 string
    NAME TYPE VALUE
    log_archive_dest_state_1 string enable
    log_archive_dest_state_10 string enable
    log_archive_dest_state_2 string enable
    log_archive_dest_state_3 string enable
    log_archive_dest_state_4 string enable
    log_archive_dest_state_5 string enable
    log_archive_dest_state_6 string enable
    log_archive_dest_state_7 string enable
    log_archive_dest_state_8 string enable
    log_archive_dest_state_9 string enable
    that tis the directory for logfiles

  • Difference between switch logfile and checkpoint

    Hi All,
    what is the difference between
    Forcing log file switches:
    ALTER SYSTEM switch logfile;
    and
    ALTER SYSTEM checkpoint;
    when i should use one and not use the other
    Thanks very much

    I don't know that checkpoint will increase the scn. In a way it can be called correct but there are multitudes of SCN floating around. For example, for the matching of the datafiles and controlfles, there are two scn's which are used, stop scn and checkpoint scn. Than for the block, there can be , commit scn , transaction scn , High scn and low scn. There is one counter that is there for both checkpoint and SCN and checkpoint number is generated from SCN itself. I am sure that there is a missing link here some where but still, to some extent this is correct.
    Checkpointing is an event which happens at certain conditions and SCN is always there, just like in a clock, there is always a time.
    HTH
    Aman....

  • Alter database clear unarchived logfile group... who, what?

    I am the sole DBA for our site, all of them running RHEL 5, Oracle 11.2.0.3.
    I recently (within the last hour), received a text message from one of our databases that poll the alert.log...
    ORA-1031 signalled during: ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 3
    Unfortunately, the 'audit database' was not enabled (it is now!), and the trace file generated did not contain anything of use.
    I know someone has been loading data since 1:30pm up until near the time I received this text, and I'm wondering if he is mucking in the system, or if this command can somehow be generated automatically by Oracle. If so, I certainly wouldn't expect an ORA-1031insufficient permissions error....
    I checked my v$log, v$logfile, and did a log switch just to check if any possibility of redo log corruption, but all looks fine.
    Has anyone else ever had random Oracle errors like this?....

    Hi,
    That's someone manually doing something when they really don't know what they are doing. I've only had to run that command once in 16 years as a dba. Oracle wouldn't ever run that itself.
    Cheers,
    Harry

Maybe you are looking for

  • Is there a way to enforce the use of sequences

    is there a way to stop someone from inserting an id without using the sequence? CREATE SEQUENCE id_seq    START WITH 1; CREATE TABLE test_table (id_seq NUMBER (4) PRIMARY KEY); INSERT INTO test_table      VALUES (id_seq.NEXTVAL); INSERT INTO test_tab

  • NLS_LANG with Instant Client and MS Access

    Hello Everybody. Recently I downloaded Oracle Instant Client 10.1.0.3. I made a custom instalation for my little Access (ODBC)application. In the begining the installation had not any other configuration than PATH Environment variable and ODBC basic

  • Order of elements - how to get position of child ?

    Hi, I would like to check, if the name of the second element of root is "youngestSon". Is it possible to query this with xpath (I use xquery with xpath-expressions, in fact I already know the name of the element but want to get sure with an exist-sta

  • Error when lauch automatic for installation JRE

    Hi all, I have just read an article on this site: http://java.sun.com/j2se/1.4.2/docs/guide/jws/developersguide/launch.html#intro my code HTML : <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D935" �� width="730" height="520" align="middle"

  • IDVD archive failing to capture all files

    I understand the difference between saving a iDVD project vs. creating an archive. I have a project that includes movie, photo and music assets. This project is archived. When I open this archive in iDVD and then go 'Project -> Project Info', sure en