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

Similar Messages

  • 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 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

  • 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

  • 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 system trigger - substitution

    Hello.
    By the documentation, there is restriction for trigger on alter command: "The trigger will not be fired by an ALTER DATABASE statement".
    I'm trying to use BEFORE SHUTDOWN and AFTER STARTUP triggers to database and I'd need also cover situations:
    - alter system quiesce restricted
    - alter system suspend
    - alter system enable restricted session
    - alter system unquiesce
    - alter system disable restricted session
    - alter system resume
    I'm using ALTER SYSTEM command (not ALTER DATABASE), but trigger isn't fired too. Is there any way how to catch and do some PL/SQL pre/post processing events described above?
    Thanks.

    Oracle Version ?
    if ur on 10.x.x.x.x
    Check
    sql> select space_limit/1024/1024 "Limit MB",round(space_used/1024/1024) "Used MB"
    2* from v$recovery_file_dest
    SQL> /
    Limit MB Used MB
    2048 1681
    If limit and used field equal then increase db_recovery_file_dest_size parameter size
    SQL> show parameter db_recovery_file_dest_size
    NAME TYPE VALUE
    db_recovery_file_dest_size big integer 2G
    SQL> alter system set db_recovery_file_dest_size = 3g;
    System altered.
    Also check below link.
    >>>Re: Switch logfile hangs
    [b]>>>SQL> alter system switch logfile;

  • Alter System command

    Hi all,
    I am just bit confused in the following two commands
    SQL> ALTER SYSTEM SWITCH LOGFILE;
    SQL> ALTER SYSTEM CHECKPOINT;
    So what is the main difference between the first and second cmds?
    Why seniors/books suggest to use first command instead of the second one ?

    372211, if you run manual hot backups then at the conclusion of copying the files for the last tablespace in your hot backup and issueing the "end backup" command you generally issue the ALTER SYSTEM SWITCH LOGFILE command to force all redo necessary to bring the backups to a consistent point in time during forward recovery.
    The archived redo logs and backup copies just made can be duplicated for sending off-site and provide a consistet image in the event of a diaster that results in the loss of archieved redo logs made after the backup.
    Also, to add to what was said about checkpoints - The header blocks for the database files must also be updated with the checkpoint information.
    HTH -- Mark D Powell --

  • ALTER SYSTEM  ARCHIVELOG CURRENT

    Greeting to all ;
    I am trying to froce log switch but i am getting error.
    My db version is 10.2.0.4 on Oracle Linux 5.5.
    SQL> select GROUP# , ARCHIVED , MEMBERS , STATUS , FIRST_CHANGE# from v$LOG;
        GROUP# ARC    MEMBERS STATUS          FIRST_CHANGE#
             1 YES          1 INACTIVE              1499347
             2 NO           1 CURRENT               1499349
             3 YES          1 INACTIVE              1499344
    SQL> ALTER SYSTEM ARCHIVELOG CURRENT;
    ALTER SYSTEM ARCHIVELOG CURRENT
    ERROR at line 1:
    ORA-02065: illegal option for ALTER SYSTEM
    SOURCE_LINK :  ALTER SYSTEM SWITCH LOGFILE vs ALTER SYSTEM ARCHIVELOG CURRENT
    Question 2 :
    Each online or archived redo log file is uniquely identified by its log sequence number
    Online redo log  file LSN  and  archived redo log  LSN -  should be  same or  may different ?
    For ex : 
    Suppose , online redo logfile  have  bunch of redo entries , - >  when log switch occurs , LSN is created.
    When those entries reaching archive destination    - > does oracle change LSN ?
    Thanks ..

    replace yours sequence 16604 with my sequence 46
    RMAN> backup validate archivelog from sequence 46 until sequence 46
    2> ;
    Starting backup at 27-FEB-09
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=143 devtype=DISK
    channel ORA_DISK_1: starting archive log backupset
    channel ORA_DISK_1: specifying archive log(s) in backup set
    input archive log thread=1 sequence=46 recid=42 stamp=679883682
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
    Finished backup at 27-FEB-09After doing it i opened the archivelog of sequence 46 at editor and deleted some binary info from that and then saved that file.
    RMAN> backup validate archivelog from sequence 46 until sequence 46
    2> ;
    Starting backup at 27-FEB-09
    using channel ORA_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of backup command at 02/27/2009 03:05:58
    RMAN-06059: expected archived log not found, lost of archived log compromises re
    coverability
    ORA-19625: error identifying file F:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\P
    ROD\ARCHIVELOG\2009_02_27\O1_MF_1_46_4TH9F0OH_.ARC
    ORA-27046: file size is not a multiple of logical block size
    OSD-04012: file size mismatch (OS 10622798)Khurram

  • 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

  • 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.

  • 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....

  • RMAN ALert Log Message: ALTER SYSTEM ARCHIVE LOG

    Created a new Database on Oracle 10.2.0.4 and now seeing "ALTER SYSTEM ARCHIVE LOG" in the Alert Log only when the online RMAN backup runs:
    Wed Aug 26 21:52:03 2009
    ALTER SYSTEM ARCHIVE LOG
    Wed Aug 26 21:52:03 2009
    Thread 1 advanced to log sequence 35 (LGWR switch)
    Current log# 2 seq# 35 mem# 0: /u01/app/oracle/oradata/aatest/redo02.log
    Current log# 2 seq# 35 mem# 1: /u03/oradata/aatest/redo02a.log
    Wed Aug 26 21:53:37 2009
    ALTER SYSTEM ARCHIVE LOG
    Wed Aug 26 21:53:37 2009
    Thread 1 advanced to log sequence 36 (LGWR switch)
    Current log# 3 seq# 36 mem# 0: /u01/app/oracle/oradata/aatest/redo03.log
    Current log# 3 seq# 36 mem# 1: /u03/oradata/aatest/redo03a.log
    Wed Aug 26 21:53:40 2009
    Starting control autobackup
    Control autobackup written to DISK device
         handle '/u03/exports/backups/aatest/c-2538018370-20090826-00'
    I am not issuing a log swiitch command. The RMAN commands I am running are:
    CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u03/exports/backups/aatest/%F';
    CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u03/exports/backups/aatest/%d_%U';
    BACKUP DATABASE PLUS ARCHIVELOG;
    DELETE NOPROMPT OBSOLETE;
    DELETE NOPROMPT ARCHIVELOG UNTIL TIME 'SYSDATE-2';
    I do not see this message on any other 10.2.0.4 instances. Has anyone seen this and if so why is this showing in the log?
    Thank you,
    Curt Swartzlander

    There's no problem with log switch. Please refer to documentation for more information on syntax "PLUS ARCHIVELOG"
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/bkup003.htm#sthref377
    Adding BACKUP ... PLUS ARCHIVELOG causes RMAN to do the following:
    *1. Runs the ALTER SYSTEM ARCHIVE LOG CURRENT command.*
    *2. Runs BACKUP ARCHIVELOG ALL. Note that if backup optimization is enabled, then RMAN skips logs that it has already backed up to the specified device.*
    *3. Backs up the rest of the files specified in BACKUP command.*
    *4. Runs the ALTER SYSTEM ARCHIVE LOG CURRENT command.*
    *5. Backs up any remaining archived logs generated during the backup.*
    This guarantees that datafile backups taken during the command are recoverable to a consistent state.

  • Import from another system

    Hi,
    our Peoplesoft system is :oracle 10g R2, tools 8.49. We are creating another one , also with oracle 10g R2. We have done a full export of Oracle database :
    expdp system/password@MYDB DIRECTORY=dpump_dir1 DUMPFILE=exp_ful_MYDB_PROD_230109 FULL=Y Logfile=expMYDB_230109.logNow to import to new database, should I import FULL :
    impdp system/password@newdb DUMPFILE=EXP_FUL_MYDB.DMP LOGFILE=ALAIN.log FULL=Yor to a schema :
    impdp sysadm/***@NEWDB DUMPFILE=EXP_FUL_MYDB.DMP SCHEMAS=sysadm LOGFILE=import.logMany thanks

    Since a Peoplesoft database is not only one schema, but at least three (PS, PEOPLE and the objects owner - SYSADM), a full import should do the trick.
    It could be some different path depending how you built the target database where you are doing the import into.
    Nicolas.

Maybe you are looking for