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

Thread: How to auto backup and restore oracle database?

Hybrid View

  1. #1
    Join Date
    Sep 2001
    Posts
    99

    How to auto backup and restore oracle database?

    I want to use "at" command at solaris platform.I want to backup oracle database in 10.11.31.2 at 2:00am everyday. And I ftped the backup file to 10.11.31.4, I want to restore the oracle databse at 10.11.31.4,how to do?
    when I use exp command export a use (cjgroup) data at 10.11.31.2 and use imp command to import the data to 10.11.31.4 oracle,but because of some objects(like tables,views,packages,etc) are already exists at oracle,so imp will no export these objects.
    and I want to backup and restore automaticlly,this can use a command line do,and no interact.so I can use "at" command to do automaticlly.

    thanks.
    ocean

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    you have to write your own scripts

    regarding import you can always use ignore=y

  3. #3
    Join Date
    Sep 2001
    Posts
    99

    How to do?

    I can write script but I don't know how to do it
    would you tell the detail?
    ocean

  4. #4
    Join Date
    May 2002
    Posts
    2,645
    Although you can do this with the at command, crontab is better suited for this task as it is repetitive.

    crontab -l (ell) will show you your current cron jobs.

    Set your editor to vi (setenv EDITOR vi in C-shell, for example).
    crontab -e will let you edit the crontab file.

    For 2am everyday:
    0 2 * * * script_name

    Save the file when done. Check your work with crontab -l.

  5. #5
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843

    Re: How to do?

    Originally posted by oceanju
    I can write script but I don't know how to do it
    would you tell the detail?
    Search google on crontab OR Read the manual page on crontab by typing
    $man crontab
    Reddy,Sam

  6. #6
    Join Date
    Jul 2002
    Location
    California
    Posts
    128
    Remember...

    When starting a script via crontab the environment variables must be explicitly set in your script (i.e. Do not depend upon the variables in .profile). A script the runs fine when executed from the interactive shell account will not function properly from cron unless the variables are set in the script prior to execution.
    alapps

    Fast, Cheap, Reliable... Pick Two(2)

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