Q

How to run an Oracle database backup script during off hours

Want to run an Oracle database backup script during off hours? Learn how with these samples scripts from an Oracle expert.

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.

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

Dig deeper on Oracle database backup and recovery

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

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:

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close