This discussion is archived
12 Replies Latest reply: Feb 1, 2013 7:42 PM by jasthi RSS

Change the location of archive log file

916079 Newbie
Currently Being Moderated
Hi All,

Could anyone help me with the below issues i am facing in Oracle database 11.2.0.3.

1.) I wanted to schedule a script in RMAN which takes a backup of the database in incremental and full and did it.
According to the script the archive log's get deleted once the backup is taken. Is there any possible way i can get
all the archive logs which got deleted back to the original archivelog location. below is the script which i used .

CREATE SCRIPT incr_level_0
{
BACKUP INCREMENTAL LEVEL 0 DATABASE PLUS ARCHIVELOG delete input format '/oracle/app/oracle/backup/full/df_t%t_s%s_p%p';
DELETE OBSOLETE;
}

CREATE SCRIPT incr_level_0
{
BACKUP INCREMENTAL LEVEL 0 DATABASE PLUS ARCHIVELOG delete input format '/oracle/app/oracle/backup/full/df_t%t_s%s_p%p';
DELETE OBSOLETE;
}

2.) Also in the RMAN log file the location of the archived log file name is displayed to some path. How can i change
the archive log file path to different location.

Regards,
CV
  • 1. Re: Change the location of archive log file
    Mihael Pro
    Currently Being Moderated
    According to the script the archive log's get deleted once the backup is taken. Is there any possible way i can get
    all the archive logs which got deleted back to the original archivelog location. below is the script which i used .
    just not use "delete input"

    >
    CREATE SCRIPT incr_level_0
    {
    BACKUP INCREMENTAL LEVEL 0 DATABASE PLUS ARCHIVELOG delete input format '/oracle/app/oracle/backup/full/df_t%t_s%s_p%p';
    DELETE OBSOLETE;
    }

    CREATE SCRIPT incr_level_0
    {
    BACKUP INCREMENTAL LEVEL 0 DATABASE PLUS ARCHIVELOG delete input format '/oracle/app/oracle/backup/full/df_t%t_s%s_p%p';
    DELETE OBSOLETE;
    }
    it seems that these scripts are identical


    2.) Also in the RMAN log file the location of the archived log file name is displayed to some path. How can i change
    the archive log file path to different location.
    check log_archive_dest_N parameter with 'location' string and modify it with "alter system"
  • 2. Re: Change the location of archive log file
    Hemant K Chitale Oracle ACE
    Currently Being Moderated
    Is there any possible way i can get all the archive logs which got deleted back to the original archivelog location
    Use RESTORE ARCHIVELOG FROM SEQUENCE m to SEQUENCE n (for the range of m to n)
    How can i change the archive log file path to different location.
    It would be either of DB_RECOVERY_FILE_DEST or LOG_ARCHIVE_DEST_n (where n is generally 1 at most sites) in your database instance's initSID.ora or spfileSID.ora You'd need to identify which value is being used. Changing the DB_RECOVERY_FILE_DEST is more complicated.


    Hemant K Chitale
  • 3. Re: Change the location of archive log file
    916079 Newbie
    Currently Being Moderated
    Hi Mihael,

    Thanks for your reply.
    If i remove the delete input option from the script it does not the delete the archive log from the next time i take a RMAN backup. How about the older archives which got deleted. Is there any possible way to retrieve copy of old archives which got deleted back to the archive log location.

    2.) I am not asking abt the log_archive_dest_N parameter which is used to change the archive log file location.
    When the RMAN backup is taken and old archives deleted the log file related to this archives is stored in one location. I just wanted to know how to change that archived log file path location where the archives are stored after RMAN backup.


    Regards,
    CV
  • 4. Re: Change the location of archive log file
    916079 Newbie
    Currently Being Moderated
    Hi Hemanth,

    Thanks for you reply.

    Where should i execute the command from(RMAN prompt or SQL prompt). Does that command get back all the archives and save it in the location where the archive log location is specified.

    2.) I am not asking abt the log_archive_dest_N parameter which is used to change the archive log file location.
    When the RMAN backup is taken and old archives deleted the log file related to this archives is stored in one location. I just wanted to know how to change that archived log file path location where the archives are stored after RMAN backup.

    Regards,
    CV
  • 5. Re: Change the location of archive log file
    Mihael Pro
    Currently Being Moderated
    If i remove the delete input option from the script it does not the delete the archive log from the next time i take a RMAN backup. How about the older archives which got deleted. Is there any possible way to retrieve copy of old archives which got deleted back to the archive log location.
    old archivelogs are deleted by "delete obsolete" command according to your retention policy


    >
    2.) I am not asking abt the log_archive_dest_N parameter which is used to change the archive log file location.
    When the RMAN backup is taken and old archives deleted the log file related to this archives is stored in one location. I just wanted to know how to change that archived log file path location where the archives are stored after RMAN backup.
    you can specify different "format" values for database files and archive logs backup
  • 6. Re: Change the location of archive log file
    EdStevens Guru
    Currently Being Moderated
    dba_fresher wrote:
    Hi Mihael,

    Thanks for your reply.
    If i remove the delete input option from the script it does not the delete the archive log from the next time i take a RMAN backup. How about the older archives which got deleted. Is there any possible way to retrieve copy of old archives which got deleted back to the archive log location.
    As Hemant repsoneded nearly two hours earlier: "Use RESTORE ARCHIVELOG FROM SEQUENCE m to SEQUENCE n (for the range of m to n)"

    And if you DON'T have rman delete your archivlogs regularly, your archivelog destination will fill up and cause your db to come to a screeching halt.

    >
    2.) I am not asking abt the log_archive_dest_N parameter which is used to change the archive log file location.
    When the RMAN backup is taken and old archives deleted the log file related to this archives is stored in one location. I just wanted to know how to change that archived log file path location where the archives are stored after RMAN backup.
    the question does not make sense. Archivelogs are stored where specified by the archivelog_destination_n paramater, and are written/created by the archiver background process. rman has nothing to do with that, and rman does not change where archivelogs are written/stored. rman creates backupsets. The backup of the archivelogs are in a backupSET, not just another copy of the archivelog in some other location.


    >
    >
    Regards,
    CV
  • 7. Re: Change the location of archive log file
    916079 Newbie
    Currently Being Moderated
    Hi Stevens,

    Thanks for your response. I was asking on how to change the path for the archived log file name is being saved. How to change the location.

    current log archived
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=28 device type=DISK
    channel ORA_DISK_1: starting archived log backup set
    channel ORA_DISK_1: specifying archived log(s) in backup set
    input archived log thread=1 sequence=279 RECID=274 STAMP=805733171
    input archived log thread=1 sequence=280 RECID=275 STAMP=805745373
    input archived log thread=1 sequence=281 RECID=277 STAMP=805863401
    input archived log thread=1 sequence=282 RECID=276 STAMP=805863401
    input archived log thread=1 sequence=283 RECID=278 STAMP=805863402
    input archived log thread=1 sequence=284 RECID=279 STAMP=805863561
    input archived log thread=1 sequence=285 RECID=280 STAMP=805864140
    input archived log thread=1 sequence=286 RECID=281 STAMP=805864163
    input archived log thread=1 sequence=287 RECID=282 STAMP=805864166
    input archived log thread=1 sequence=288 RECID=283 STAMP=805867104
    input archived log thread=1 sequence=289 RECID=284 STAMP=805868874
    input archived log thread=1 sequence=290 RECID=285 STAMP=805871765
    channel ORA_DISK_1: starting piece 1 at 29-JAN-13
    channel ORA_DISK_1: finished piece 1 at 29-JAN-13
    piece handle=/oracle_data/app/oracle/backup/ora11g/full/df_t806018465_s21_p1 tag=TAG20130129T220105 comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
    channel ORA_DISK_1: deleting archived log(s)
    archived log file name=/oracle_base/app/oracle/ofsaa/fast_recovery_area/ORA11G/archivelog/2013_01_26/o1_mf_1_279_8j8j4m8x_.arc RECID=274 STAMP=805733171
    archived log file name=/oracle_base/app/oracle/ofsaa/fast_recovery_area/ORA11G/archivelog/2013_01_26/o1_mf_1_280_8j8w1x1l_.arc RECID=275 STAMP=805745373
    archived log file name=/oracle_base/app/oracle/ofsaa/fast_recovery_area/ORA11G/archivelog/2013_01_28/o1_mf_1_281_8jdhb9b3_.arc RECID=277 STAMP=805863401
    archived log file name=/oracle_base/app/oracle/ofsaa/fast_recovery_area/ORA11G/archivelog/2013_01_28/o1_mf_1_282_8jdhb9b7_.arc RECID=276 STAMP=805863401
    archived log file name=/oracle_base/app/oracle/ofsaa/fast_recovery_area/ORA11G/archivelog/2013_01_28/o1_mf_1_283_8jdhb9yj_.arc RECID=278 STAMP=805863402
    archived log file name=/oracle_base/app/oracle/ofsaa/fast_recovery_area/ORA11G/archivelog/2013_01_28/o1_mf_1_284_8jdhh9n1_.arc RECID=279 STAMP=805863561
    archived log file name=/oracle_data/app/oracle/arch/ofsaatst/1_285_804828331.dbf RECID=280 STAMP=805864140
    archived log file name=/oracle_data/app/oracle/arch/ora11g/1_286_804828331.dbf RECID=281 STAMP=805864163
    archived log file name=/oracle_data/app/oracle/arch/ora11g/1_287_804828331.dbf RECID=282 STAMP=805864166

    Regards,
    CV
  • 8. Re: Change the location of archive log file
    EdStevens Guru
    Currently Being Moderated
    dba_fresher wrote:
    Hi Stevens,

    Thanks for your response. I was asking on how to change the path for the archived log file name is being saved. How to change the location.

    current log archived
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=28 device type=DISK
    channel ORA_DISK_1: starting archived log backup set
    channel ORA_DISK_1: specifying archived log(s) in backup set
    input archived log thread=1 sequence=279 RECID=274 STAMP=805733171
    input archived log thread=1 sequence=280 RECID=275 STAMP=805745373
    input archived log thread=1 sequence=281 RECID=277 STAMP=805863401
    input archived log thread=1 sequence=282 RECID=276 STAMP=805863401
    input archived log thread=1 sequence=283 RECID=278 STAMP=805863402
    input archived log thread=1 sequence=284 RECID=279 STAMP=805863561
    input archived log thread=1 sequence=285 RECID=280 STAMP=805864140
    input archived log thread=1 sequence=286 RECID=281 STAMP=805864163
    input archived log thread=1 sequence=287 RECID=282 STAMP=805864166
    input archived log thread=1 sequence=288 RECID=283 STAMP=805867104
    input archived log thread=1 sequence=289 RECID=284 STAMP=805868874
    input archived log thread=1 sequence=290 RECID=285 STAMP=805871765
    channel ORA_DISK_1: starting piece 1 at 29-JAN-13
    channel ORA_DISK_1: finished piece 1 at 29-JAN-13
    piece handle=/oracle_data/app/oracle/backup/ora11g/full/df_t806018465_s21_p1 tag=TAG20130129T220105 comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
    channel ORA_DISK_1: deleting archived log(s)
    archived log file name=/oracle_base/app/oracle/ofsaa/fast_recovery_area/ORA11G/archivelog/2013_01_26/o1_mf_1_279_8j8j4m8x_.arc RECID=274 STAMP=805733171
    archived log file name=/oracle_base/app/oracle/ofsaa/fast_recovery_area/ORA11G/archivelog/2013_01_26/o1_mf_1_280_8j8w1x1l_.arc RECID=275 STAMP=805745373
    archived log file name=/oracle_base/app/oracle/ofsaa/fast_recovery_area/ORA11G/archivelog/2013_01_28/o1_mf_1_281_8jdhb9b3_.arc RECID=277 STAMP=805863401
    archived log file name=/oracle_base/app/oracle/ofsaa/fast_recovery_area/ORA11G/archivelog/2013_01_28/o1_mf_1_282_8jdhb9b7_.arc RECID=276 STAMP=805863401
    archived log file name=/oracle_base/app/oracle/ofsaa/fast_recovery_area/ORA11G/archivelog/2013_01_28/o1_mf_1_283_8jdhb9yj_.arc RECID=278 STAMP=805863402
    archived log file name=/oracle_base/app/oracle/ofsaa/fast_recovery_area/ORA11G/archivelog/2013_01_28/o1_mf_1_284_8jdhh9n1_.arc RECID=279 STAMP=805863561
    archived log file name=/oracle_data/app/oracle/arch/ofsaatst/1_285_804828331.dbf RECID=280 STAMP=805864140
    archived log file name=/oracle_data/app/oracle/arch/ora11g/1_286_804828331.dbf RECID=281 STAMP=805864163
    archived log file name=/oracle_data/app/oracle/arch/ora11g/1_287_804828331.dbf RECID=282 STAMP=805864166

    Regards,
    CV
    the "archived log file name" is the fully qualified name of the archivelog, as it was written by the archiver background process. In the above, rman is simply reporting what archivelogs it found and is backing up. You cannot change that, and it makes no sense to do so. You can control where archivelogs are written by using the init parameter 'log_archive_dest_n'. You can control where rman writes his backupsets, by configuring channels. But you cannot control where rman finds archivelogs. He finds them where they were written.

    So you question still makes no sense.

    What is it you are trying to achieve?
    1) change where the archiver process writes the archivelogs
    or
    2) change where rman writes its backupsets?

    Edited by: EdStevens on Jan 30, 2013 12:11 PM
  • 9. Re: Change the location of archive log file
    Mihael Pro
    Currently Being Moderated
    I was asking on how to change the path for the archived log file name is being saved. How to change the location.
    If you want to move archivelogs, use:

    rman> change archivelog 'old_path' uncatalog;

    move files to new location with OS commands

    rman> catalog archivelog 'new_path';
  • 10. Re: Change the location of archive log file
    Hemant K Chitale Oracle ACE
    Currently Being Moderated
    When the RMAN backup is taken and old archives deleted the log file related to this archives is stored in one location. I just wanted to know how to change that archived log file path location where the archives are stored after RMAN backup.
    You are asking to change the location of the BackupSet that contains ArchiveLogs. Not the location of the ArchiveLogs.
    The location of the BackupSet is defined by the FORMAT used for the specific Channel.


    Hemant K Chitale
  • 11. Re: Change the location of archive log file
    Hemant K Chitale Oracle ACE
    Currently Being Moderated
    I was asking on how to change the path for the archived log file name is being saved
    That is the known location of the archivelog that has been written by the ARCHiver background process. Why do you think you need to change the location ? Do you want to move archivelogs to a different folder after they have been backed up to one or more BackupSets ?


    Hemant K Chitale
  • 12. Re: Change the location of archive log file
    jasthi Newbie
    Currently Being Moderated
    "How can i change the archive log file path to different location."


    RMAN>bacup database format='<BACKUP_LOCATION>' plus archivelog format='<ARCHIVE_BACKUP_LOCATION>' delete input

    EX:
    RMAN>backup database format='/u04/rman/SIDi_%U.bkp' plus archivelog format='/u05/rman/SID_%U.arc' delete input;

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points