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