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

Thread: Export

  1. #1
    Join Date
    Oct 2000
    Posts
    24

    Question

    Hi All

    I am setting up a script to export my database everynight. Below is the script that I have written.

    exp80 userid=system/manager full=y inctype=complete constraints=y file=d:\backup\sysdate

    Does anyone know how do I set the a variable file to be the current date.


    Thanks in adavnce

  2. #2
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    I tried this and wasn't successfull. One way to do this is to do an export and copy and rename the file with the date extension.

    Sam

  3. #3
    Join Date
    May 2000
    Location
    Richardson, Texas, USA
    Posts
    39
    I can show you how to do that on UNIX and may be you'll be able to get some idea about how to do that in Windows. The following script will consider today's date as the name of the export file, so the dump file will look something like '13Nov2000.dmp'. The script will run under C shell:

    #!/bin/csh
    # The date command output look like
    # Mon Nov 13 14:28:12 CST 2000

    set d=`date`

    # d[1] is Mon, d[2] is Nov...

    set filename=$d[3]$d[2]$d[6]

    exp userid=system/manager full=y inctype=complete constraints=y file=$filename

    No doubt UNIX is very flexible!!

    Thanks.

    Syed

  4. #4
    Join Date
    Sep 2000
    Location
    Chicago, IL
    Posts
    316

    Talking UNIX Rules

    Just put this in your exp script to create a date variable:

    date | awk '{print $3 $2 $6}' | read x
    exp80 userid=system/manager full=y inctype=complete constraints=y file=$x

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