Run sql commands in background (yes its same as nohup in os)
Run sql commands in background [[same as nohup in os]]
vi DBSTATUS.sql
--------------
spool test.log
select name from v$database;
spool off;
exit
vi DBS.sh
-----------------
#! /bin/ksh
export ORACLE_SID=dbname
export ORACLE_HOME=/ora01/app/oracle/product/10.2.0
export PATH=$ORACLE_HOME/bin:$PATH
cd /u01
sqlplus / as sysdba @DBSTATUS.sql
exit 0
$ chmod 777 DBSTATUS.sql DBS.sh
crontab -e
-----------------
31 12 19 04 * /u01/DBS.sh mail bolisettyvaas@gmail.com
crontab -l
-----------------
31 12 19 04 * /u01/DBS.sh mail bolisettyvaas@gmail.com
vi DBSTATUS.sql
--------------
spool test.log
select name from v$database;
spool off;
exit
vi DBS.sh
-----------------
#! /bin/ksh
export ORACLE_SID=dbname
export ORACLE_HOME=/ora01/app/oracle/product/10.2.0
export PATH=$ORACLE_HOME/bin:$PATH
cd /u01
sqlplus / as sysdba @DBSTATUS.sql
exit 0
$ chmod 777 DBSTATUS.sql DBS.sh
crontab -e
-----------------
31 12 19 04 * /u01/DBS.sh mail bolisettyvaas@gmail.com
crontab -l
-----------------
31 12 19 04 * /u01/DBS.sh mail bolisettyvaas@gmail.com
Comments
Post a Comment