oracle开机自启,监听自启,任意秒crontab

==============oracle开机自启

vi /etc/crontab

#!/bin/bash

if [ -f /home/oracle/.bash_profile ]; then
. /home/oracle/.bash_profile
fi

lsnrctl start

sqlplus / as sysdba <<EOF
startup;
EOF

 

@reboot oracle ( sleep 60 ; sh /home/oracle/start_db.sh >> /home/oracle/start_db.log )

 

==============crontab任意秒数自动执行

#!/bin/bash
step=10 #间隔的秒数,不能大于60
for (( i = 0; i < 60; i=(i+step) )); do
python /home/oracle/zijinliu/zijinliu.py
sleep $step
done
exit 0

posted @ 2021-04-22 22:03  悠游~~~  阅读(90)  评论(0)    收藏  举报