DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: script needed to delete archives

Hybrid View

  1. #1
    Join Date
    Sep 2002
    Posts
    376

    script needed to delete archives

    Hi,
    Does any body have a script which can be used to delete
    the archive logs automatically on Windows2000.

  2. #2
    Join Date
    May 2001
    Posts
    736
    u need to write a batch program and then following example script u can modify as per your needs to delete the archive logs.


    set DELETE_STR=
    if "%SCHED2%"=="" then DELETE_STR=delete input

    echo Running first backup >> %LOG_FILE%

    (
    echo RUN {
    echo ALLOCATE CHANNEL "ch00" TYPE 'SBT_TAPE' %ALLOC1%;
    echo ALLOCATE CHANNEL "ch01" TYPE 'SBT_TAPE' %ALLOC1%;
    echo BACKUP
    echo %BACKUP_TYPE%
    echo FORMAT 'bk_u%%u_s%%s_p%%p_t%%t'
    echo DATABASE;
    echo RELEASE CHANNEL "ch00";
    echo RELEASE CHANNEL "ch01";
    echo # Backup all archive logs
    echo ALLOCATE CHANNEL "ch00" TYPE 'SBT_TAPE' %ALLOC1%;
    echo sql 'alter system archive log current';
    echo BACKUP
    echo FILESPERSET 150
    echo FORMAT 'arch-s%%s-p%%p'
    echo ARCHIVELOG ALL %DELETE_STR%;
    echo RELEASE CHANNEL "ch00";

    The schedule is how many days of archive logs u want to keep on your local disk.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width