正常情况下linux下oracle数据库的重启是如下:
su - oracle
sqlplus sys/oracle as sysdba
shutdown immediate
exit
lsnrctl stop
sqlplus sys/oracle as sysdba
startup
exit
lsnrctl start
那我现在怎么把他集成到一个shell或者关闭和启动分开的两个shell中吗?不会shell,需要帮助
直接把这些命令写在.sh文件里就行了。
但是要进Oracle.
所以可以这么写。
#!/bin/sh
su - oracle <<EON
export ORACLE_SID=ixdba
lsnrctl start
sqlplus /nolog <<EOF
conn / as sysdba
startup
exit
EOF
exit
EON
参考链接 https://www.cnblogs.com/m317/p/6163781.html
你可以参考这篇文章https://www.cnblogs.com/mchina/archive/2012/11/27/2782993.html