You could you a script to do all routine on startup.
(您可以使用脚本在启动时执行所有例程。)
Create script like this and call it startDB.sh (do not forget to make it executable - chmod +x startDB.sh):
(像这样创建脚本并将其命名为startDB.sh(不要忘记使其可执行-chmod + x startDB.sh):)
#!/bin/sh
mount -orw,remount /; exit
lsnrctl start
sqlplus /nolog <<EOF
connect user/pass
STARTUP;
DISCONNECT;
EOF
Add script to startup:
(将脚本添加到启动:)
#crontab -e
@reboot su - user -c "/home/user/startDB.sh"
If you don't have access to crontab, you can run startDB.sh script manually, this should help you to save some time :)
(如果您无权访问crontab,则可以手动运行startDB.sh脚本,这应该可以帮助您节省一些时间:))
It's not tested, so there can be errors or mistypes, please run some test before using it in production.
(它未经测试,因此可能存在错误或类型错误,请在生产中使用它之前进行一些测试。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…