$ crontab -l
# 1 * * * * /u01/oracle/admin/gs12366/scripts/snapshot.sh
20 1 * * * /u01/oracle/admin/backupscripts/rman_sb_12366.sh
20 3 * * * /u01/oracle/admin/backupscripts/rman_wz_12366.sh
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /u01/oracle/admin/gs12366/scripts/mv_wsbs.sh
$
$
$ more mv_wsbs.sh
# 20080529 wsbs refresh mview sm_skskjdk_yhsbh
# add by www.htjs.net
ORACLE_BASE=/u01/oracle;export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/9.2.0; export ORACLE_HOME
ORACLE_SID=gs12366; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH
mydate=`date +'%Y%m%d'`
sqlplus wsbs/******* @/u01/oracle/admin/gs12366/scripts/mv_wsbs.sql >/u01/oracle/admin/gs12366/scripts/wsbs_log$mydate.txt
$ more mv_wsbs.sql
select to_char(sysdate,'yyyy-mm-dd:hh:mi:ss') from dual;
EXEC DBMS_SNAPSHOT.REFRESH('SM_SKSKJDK_YHSBH');
select to_char(sysdate,'yyyy-mm-dd:hh:mi:ss') from dual;
exit;
$
-- 检查运行结果
select last_refresh_type,last_refresh_date from user_mviews where mview_name='SM_SKSKJDK_YHSBH'
more /u01/oracle/admin/gs12366/scripts/wsbs_log*.txt
-- 检查默认环境变量
$ env |grep ORA
ORACLE_BASE=/u01/oracle
ORA_DB=/u01/oracle/product/9.2.0/dbs
ORACLE_SID=gs12366
ORACLE_TERM=vt100
ORA_NLS33=/u01/oracle/product/9.2.0/ocommon/nls/admin/data
ORACLE_HOME=/u01/oracle/product/9.2.0
$
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/271063/viewspace-1004820/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/271063/viewspace-1004820/