oracle-xe.service 的 Oracle Database Express 11.2 作业失败

oracle-xe.service 的 Oracle Database Express 11.2 作业失败

环境:

  • Ubuntu 14.04
  • Oracle Database Express 11g 第 2 版

启动服务 oracle-xe 时收到错误

systemctl 状态 oracle-xe.service

● oracle-xe.service - LSB: Oracle 11g Express Edition
   Loaded: loaded (/etc/init.d/oracle-xe)
   Active: failed (Result: exit-code) since lun 2015-08-24 22:24:32 CEST; 18min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 12274 ExecStart=/etc/init.d/oracle-xe start (code=exited, status=1/FAILURE)

... systemd[1]: Starting LSB: Oracle 11g Express Edition...
... oracle-xe[12274]: Starting Oracle Net Listener.
... su[12282]: No passwd entry for user 'oracle'
... oracle-xe[12274]: Starting Oracle Database 11g Express Edition instance.
... su[12288]: No passwd entry for user 'oracle'
... oracle-xe[12274]: Failed to start Oracle Net Listener using /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr and Oracle Express Database using /u01/app/oracle/product/11.2.0/xe/bin/sqlplus.
... systemd[1]: oracle-xe.service: control process exited, code=exited status=1
... systemd[1]: Failed to start LSB: Oracle 11g Express Edition.
... systemd[1]: Unit oracle-xe.service entered failed state.
... systemd[1]: oracle-xe.service failed.

我认为问题可能在于: ... su[12282]: 没有用户“oracle”的密码条目

journalctl-xe

...
.. polkitd(authority=local)[641]: Registered Authentication Agent for unix-process:12249:680724 (system bus name :1.73 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale es_ES.UTF-8)
... systemd[1]: Starting LSB: Oracle 11g Express Edition...
-- Subject: Unit oracle-xe.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit oracle-xe.service has begun starting up.
... oracle-xe[12274]: Starting Oracle Net Listener.
... su[12282]: No passwd entry for user 'oracle'
... su[12282]: FAILED su for oracle by root
... su[12282]: - ??? root:oracle
... oracle-xe[12274]: Starting Oracle Database 11g Express Edition instance.
... su[12288]: No passwd entry for user 'oracle'
... su[12288]: FAILED su for oracle by root
... su[12288]: - ??? root:oracle
... oracle-xe[12274]: Failed to start Oracle Net Listener using /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr and Oracle Express Database using /u01/app/oracle/product/11.2.0/xe/bin/sqlplus.
... systemd[1]: oracle-xe.service: control process exited, code=exited status=1
... systemd[1]: Failed to start LSB: Oracle 11g Express Edition.
-- Subject: Unit oracle-xe.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit oracle-xe.service has failed.
-- 
-- The result is failed.
... systemd[1]: Unit oracle-xe.service entered failed state.
... systemd[1]: oracle-xe.service failed.
... polkitd(authority=local)[641]: Unregistered Authentication Agent for unix-process:12249:680724 (system bus name :1.73, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale es_ES.UTF-8) (disconnected from bus)
... sudo[12248]: pam_unix(sudo:session): session closed for user root
... pkexec[12404]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
... pkexec[12404]: jose: Executing command [USER=root] [TTY=unknown] [CWD=/home/jose] [COMMAND=/usr/lib/update-notifier/package-system-locked]
... kernel: toshiba_acpi: Unknown key 120

答案1

Joe 提供了一种非常迂回的方式来运行两个命令。它们在这个版本的 Oracle 数据库中与其他版本非常相似。下面是它们直接来自神谕者RUEI 安装指南Oracle 12c 数据库快速安装指南它引用了:

# useradd-g oinstall-G dba oracle
# 密码 oracle

答案2

要解决该问题,您应该完全卸载(卸载说明),然后按照以下步骤重新安装。

Oracle Database Express 安装说明安装说明

1)从以下位置下载 Oracle 11gR2 快速版本安装程序关联

2)解压缩:

unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip

3)安装以下软件包:

sudo apt-get install alien libaio1 unixodbc vim

4)将 red-hat (rpm) 包转换为 Ubuntu 包:sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm

(注意:这可能需要一段时间,到那时你才可以进行步骤 5)

5)先完成以下必要事项:

A)创建一个特殊的 chkconfig 脚本:

基于 Red Hat 的 Oracle XE 11gR2 安装程序依赖于 /sbin/chkconfig,而 Ubuntu 中未使用该程序。当前版本的 Ubuntu 可用的 chkconfig 包会产生错误,并且可能不安全。以下是解决该问题并成功安装 Oracle XE 的简单技巧:

sudo vim /sbin/chkconfig

(将以下内容复制并粘贴到文件中)

#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Ubuntu
file=/etc/init.d/oracle-xe
if [[ ! `tail -n1 $file | grep INIT` ]]; then
echo >> $file
echo '### BEGIN INIT INFO' >> $file
echo '# Provides: OracleXE' >> $file
echo '# Required-Start: $remote_fs $syslog' >> $file
echo '# Required-Stop: $remote_fs $syslog' >> $file
echo '# Default-Start: 2 3 4 5' >> $file
echo '# Default-Stop: 0 1 6' >> $file
echo '# Short-Description: Oracle 11g Express Edition' >> $file
echo '### END INIT INFO' >> $file
fi
update-rc.d oracle-xe defaults 80 01

保存上述文件并提供适当的执行权限:

chmod 755 /sbin/chkconfig

b)设置内核参数:Oracle 11gR2 XE 需要设置以下附加内核参数:

sudo vim /etc/sysctl.d/60-oracle.conf 

(输入以下内容)

# Oracle 11g XE kernel parameters  
fs.file-max=6815744  
net.ipv4.ip_local_port_range=9000 65000  
kernel.sem=250 32000 100 128 
kernel.shmmax=536870912 

(保存文件)

注意:kernel.shmmax = 最大可能值,例如物理 RAM 的大小(以字节为单位,例如 512MB RAM == 512*1024*1024 == 536870912 字节)验证更改:

sudo cat /etc/sysctl.d/60-oracle.conf 

加载新的内核参数:

sudo service procps start  

核实:sudo sysctl -q fs.file-max

-> fs.文件最大值 = 6815744

C)增加系统交换空间:通过以下命令分析当前交换空间:

free -m 

Oracle 11gR2 XE 的最低交换空间要求为 2 GB。如果您的交换空间较小,您可以按照我之前一篇文章中的步骤增加交换空间。

d)进行一些必要的更改:

我) ln -s /usr/bin/awk /bin/awk

二) mkdir /var/lock/subsys

三) touch /var/lock/subsys/listener

6)现在您可以安装 Oracle 11gR2 XE。转到您在步骤 4 中创建 ubuntu 包文件的目录,然后在终端中输入以下命令:

A) sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb

更新:在继续下一步之前,请先查看此故障排除帖子,以避免出现 MEMORY TARGET 或任何其他“共享内存”错误。

b) sudo /etc/init.d/oracle-xe configure 输入以下配置信息:

A valid HTTP port for the Oracle Application Express (the default is 8080)  
A valid port for the Oracle database listener (the default is 1521) 
A password for the SYS and SYSTEM administrative user accounts
Confirm password for SYS and SYSTEM administrative user accounts
Whether you want the database to start automatically when the computer starts (next reboot).

7)在开始使用 Oracle 11gR2 XE 之前,您必须设置更多内容: A)设置环境变量:将以下行添加到您的 .bashrc:

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH

b)执行 .profile 来加载更改:

. ./.profile

8)启动 Oracle 11gR2 XE:

sudo service oracle-xe start

The output should be similar to following :
user@machine:~$ sudo service oracle-xe start
Starting Oracle Net Listener.
Starting Oracle Database 11g Express Edition instance.
user@machine:~$

9)创建您的用户:

A)启动 sqlplus 并以 sys 身份登录:

sqlplus sys as sysdba

(提供您在步骤 6(ii)中配置 Oracle 时提供的密码)。这应该如下所示:

SQL*Plus: Release 11.2.0.2.0 Production on Wed May 9 12:12:16 2012

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Enter password:

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL>

b)在 SQL 提示符下输入以下内容:将用户名和密码替换为您所需的。

SQL> create user username identified by password;

User created.

SQL> grant connect,resource to username;

Grant succeeded. 

10)现在您已经创建了用户,您可以登录:

user@machine:~$ sqlplus

SQL*Plus: Release 11.2.0.2.0 Production on Wed May 9 12:28:48 2012

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Enter user-name: temp
Enter password:

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> select 2+2 from dual;
2+2
----------
4
SQL>

相关内容