How to run an Oracle database backup script during off hours

I am working on Oracle Developer. What is a sample script that can start the database backup at the off hours, like after 10 pm, without my physical presence? The script should shut down the database, copy all the relevant files to the specified location, and it must startup the database. The size is 80 GB.

    Requires Free Membership to View

You did not specify the platform the Oracle database runs on. On Windows, the script can be as simple as one line:

 net start OracleServiceSID

Where SID is replaced with your Oracle SID. On Unix/Linux, the script is a little more complicated but something similar to (for CShell):

 #!/bin/csh # setenv ORACLE_SID=SID setenv ORACLE_HOME=/path_to_Oracle_Home_dir setenv LD_LIBRARY_PATH=$ORACLE_HOME/lib set path=($ORACLE_HOME/bin $path) sqlplus sys/pswd  << EOF startup EOF

You will have to make appropriate substitutions for your environment.



This was first published in February 2010

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: