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

Thread: Backup script

  1. #1
    Join Date
    Nov 2001
    Location
    SC
    Posts
    23

    Question

    I have a script performing a cold backup on my Oracle 8i database on Windows 2000 server. The script calls a script that shuts down the database, copies the datafiles to a backup folder and starts up the database base. I need help making this script delete the old files in the folder before it starts the backup.
    Can someone please show how to include this in my script.
    Thanks
    :)

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    DEL *.*
    Jeff Hunter

  3. #3
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    195
    Include this line in your script:
    ho del filename;

  4. #4
    Join Date
    Jan 2002
    Posts
    57
    If you want to delete ALL files in a directory then:
    del /q /f C:\Path\to\some\dir\*

    /q disables prompting when deleting all files.
    /f forces deleting of read-only files.

    --
    Paul

  5. #5
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Are you making sure that those files had been backedup before you delete?

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  6. #6
    Join Date
    Nov 2001
    Location
    SC
    Posts
    23
    Thanks everyone. I am testing it right now and it seems to be working. This is on my test server and these files are being picked up and backed up by TSM.
    Thanks once again for your assistance.
    :)

  7. #7
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    In the case of TSM why not use the TDP for Oracle and backup using the RMAN. That will save you space and backup things directly to the TSM. For deleting the archive logs after backup, rman provides the command "archivelog backup delete" (Check the syntax) and this will delete the archivelogs upon their successfull backup.

    Why would you want to wast the time sitting and writing scripts to backup the database to the windows disk and then from disk to the TSM, when you can directly back up to TSM.

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  8. #8
    Join Date
    Nov 2001
    Location
    SC
    Posts
    23
    I do not know how to set up TSM to backup my db directly this is the only way I know to do this.
    :)

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