我在我的 Ubuntu 16.04 上安装了 Oracle 11g XE( 按照本教程)
一切正常运转。
问题是:安装时我说不要在启动时启动。
Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:n
但 Oracle 在启动时仍继续启动。
bruno@ubuntu:/etc/init.d$ ps aux | grep oracle
oracle 914 0.0 0.0 45248 4664 ? Ss 19:12 0:00 /lib/systemd/systemd --user
oracle 916 0.0 0.0 63212 1860 ? S 19:12 0:00 (sd-pam)
oracle 1031 0.0 0.1 224520 20116 ? Ssl 19:12 0:00 /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr LISTENER -inherit
oracle 1421 0.0 0.2 1268904 46568 ? Ss 19:12 0:00 xe_pmon_XE
oracle 1423 0.0 0.2 1266624 42476 ? Ss 19:12 0:00 xe_psp0_XE
oracle 1563 0.0 0.2 1266624 40556 ? Ss 19:12 0:00 xe_vktm_XE
oracle 1567 0.0 0.2 1266624 40212 ? Ss 19:12 0:00 xe_gen0_XE
oracle 1569 0.0 0.2 1266624 40468 ? Ss 19:12 0:00 xe_diag_XE
oracle 1571 0.0 0.4 1267136 65812 ? Ss 19:12 0:00 xe_dbrm_XE
oracle 1573 0.0 0.2 1267136 44040 ? Ss 19:12 0:00 xe_dia0_XE
oracle 1575 0.0 0.3 1266624 56080 ? Ss 19:12 0:00 xe_mman_XE
oracle 1577 0.0 0.2 1272760 48908 ? Ss 19:12 0:00 xe_dbw0_XE
oracle 1579 0.0 0.3 1282176 50040 ? Ss 19:12 0:00 xe_lgwr_XE
oracle 1581 0.0 0.2 1267136 47848 ? Ss 19:12 0:00 xe_ckpt_XE
oracle 1583 0.0 0.7 1271296 118084 ? Ss 19:12 0:00 xe_smon_XE
oracle 1585 0.0 0.3 1267136 61848 ? Ss 19:12 0:00 xe_reco_XE
oracle 1587 0.0 0.7 1272556 121628 ? Ss 19:12 0:00 xe_mmon_XE
oracle 1589 0.0 0.2 1266624 47296 ? Ss 19:12 0:00 xe_mmnl_XE
oracle 1591 0.0 0.2 1274948 39844 ? Ss 19:12 0:00 xe_d000_XE
oracle 1593 0.0 0.2 1267820 37456 ? Ss 19:12 0:00 xe_s000_XE
oracle 1595 0.0 0.2 1267820 37476 ? Ss 19:12 0:00 xe_s001_XE
oracle 1597 0.0 0.2 1267820 37472 ? Ss 19:12 0:00 xe_s002_XE
oracle 1599 0.0 0.2 1267820 37416 ? Ss 19:12 0:00 xe_s003_XE
oracle 2121 0.1 0.2 1266624 41436 ? Ss 19:13 0:01 xe_vkrm_XE
oracle 2125 0.0 0.2 1266624 44412 ? Ss 19:13 0:00 xe_qmnc_XE
oracle 2144 0.0 0.6 1273288 99460 ? Ss 19:13 0:00 xe_cjq0_XE
oracle 2192 0.0 0.5 1268160 84412 ? Ss 19:13 0:00 xe_q000_XE
oracle 2194 0.0 0.3 1266620 50516 ? Ss 19:13 0:00 xe_q001_XE
oracle 2429 0.0 0.2 1266624 40732 ? Ss 19:18 0:00 xe_smco_XE
oracle 2431 0.0 0.3 1266620 52712 ? Ss 19:18 0:00 xe_w000_XE
/etc/init.d/oracle-xe
case "$1" in
start)
if [ "$0" != "/etc/init.d/oracle-xe" ]
then
if test -f "$CONFIGURATION"
then
if test "$ORACLE_DBENABLED" != "true"
then
exit 0
fi
else
echo "Oracle Database 11g Express Edition is not configured. You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database."
exit 0
fi
fi
start
;;
/etc/default/oracle-xe
#This is a configuration file for automatic starting of the Oracle
#Database and listener at system startup.It is generated By running
#'/etc/init.d/oracle-xe configure'.Please use that method to modify this
#file
# ORACLE_DBENABLED:'true' means to load the Database at system boot.
ORACLE_DBENABLED=false
# LISTENER_PORT: Database listener
LISTENER_PORT=1521
# HTTP_PORT : HTTP port for Oracle Application Express
HTTP_PORT=9991
# Configuration : Check whether configure has been done or not
CONFIGURE_RUN=true
我能做些什么?
答案1
我遇到了完全相同的问题。以下内容似乎适用于 16.04。
立即停止服务(系统重启后将不再继续):
sudo systemctl stop oracle-xe
为了防止它在下次启动时启动(系统重启后仍然有效):
sudo systemctl disable oracle-xe
立即重新启动它(系统重启后将不再保留):
sudo systemctl start oracle-xe
要使其在启动时自动启动(系统重启后仍然有效):
sudo systemctl enable oracle-xe
更多详细systemctl
信息关于 Digital Ocean
答案2
systemctl disable oracle.xe.service(如果在 /etc/default/oracle-xe 中启动时没有启动,/etc/init.d/oracle-xe 则不起作用)