【问题标题】:Problems installing Oracle Database Express Edition 11g安装 Oracle 数据库快捷版 11g 时出现问题
【发布时间】:2017-01-24 06:02:07
【问题描述】:

我正在尝试使用 this guide 在 (X)ubuntu 13.04 64 位中安装 Oracle 数据库。一切顺利,直到我进入以下步骤:

$ sudo /etc/init.d/oracle-xe configure

Oracle Database 11g Express Edition Configuration
-------------------------------------------------
This will configure on-boot properties of Oracle Database 11g Express 
Edition.  The following questions will determine whether the database should 
be starting upon system boot, the ports it will use, and the passwords that 
will be used for database accounts.  Press <Enter> to accept the defaults. 
Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]:

Specify a port that will be used for the database listener [1521]:

Specify a password to be used for database accounts.  Note that the same
password will be used for SYS and SYSTEM.  Oracle recommends the use of 
different passwords for each database account.  This can be done after 
initial configuration:
Confirm the password:

Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:

Starting Oracle Net Listener...Done
Configuring database...
Database Configuration failed.  Look into /u01/app/oracle/product/11.2.0/xe/config/log for details

日志文件显示以下输出:

:/u01/app/oracle/product/11.2.0/xe/config/log$ for l in *.log
> do
> echo $l
> cat $l
> done
cloneDBCreation.log
Create controlfile reuse set database "XE"
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


BEGIN dbms_backup_restore.zerodbid(0); END;

*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
ORA-00845: MEMORY_TARGET not supported on this system
Create controlfile reuse set database "XE"
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


alter system enable restricted session
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


alter database "XE" open resetlogs
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


alter database rename global_name to "XE"
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


alter system switch logfile
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


alter system checkpoint
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


alter database drop logfile group 3
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/XE/temp.dbf' SIZE 20480K REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


select tablespace_name from dba_tablespaces where tablespace_name='USERS'
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


select sid, program, serial#, username from v$session
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


alter user sys identified by "oracle"
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


alter user system identified by "oracle"
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


alter system disable restricted session
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


CloneRmanRestore.log
ORA-00845: MEMORY_TARGET not supported on this system
select TO_CHAR(systimestamp,'YYYYMMDD HH:MI:SS') from dual
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


declare
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


select TO_CHAR(systimestamp,'YYYYMMDD HH:MI:SS') from dual
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


postDBCreation.log
begin
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 



File created.

ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
ORA-00845: MEMORY_TARGET not supported on this system
select 'utl_recomp_begin: ' || to_char(sysdate, 'HH:MI:SS') from dual
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


BEGIN utl_recomp.recomp_serial(); END;

*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


select 'utl_recomp_end: ' || to_char(sysdate, 'HH:MI:SS') from dual
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


postScripts.log
CREATE OR REPLACE LIBRARY dbms_sumadv_lib AS '/u01/app/oracle/product/11.2.0/xe/lib/libqsmashr.so';
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


BEGIN dbms_datapump_utl.replace_default_dir; END;

*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


commit
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


create or replace directory XMLDIR as '/u01/app/oracle/product/11.2.0/xe/rdbms/xml'
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


DROP DIRECTORY ORACLE_OCM_CONFIG_DIR
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


DROP DIRECTORY ADMIN_DIR
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


DROP DIRECTORY WORK_DIR
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


BEGIN dbms_swrf_internal.cleanup_database(cleanup_local => FALSE); END;

*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 


commit
*
ERROR at line 1:
ORA-01034: ORACLE not available 
Process ID: 0 
Session ID: 0 Serial number: 0 

我做错了什么?

【问题讨论】:

  • 我不得不在学校课堂上使用 oracle,但我从未设法让它工作,我决定使用预装的 VM。我不再关心任何解决方案,也不会尝试它们。当我按“关闭”时,我没有得到任何描述正确关闭此问题的原因的选项。我应该删除问题吗?不过,答案可能对其他人有所帮助。

标签: oracle ubuntu


【解决方案1】:

我在同一条船上,试图在虚拟机(openSUSE 13.01 64bit)上配置 XE。

我的解决方案是/etc/hosts 中缺少主机名。 您可以在一开始就检查/u01/app/oracle/product/11.2.0/xe/config/log/CloneRmanRestore.log 中的错误(路径取决于您的XE 版本)。

搜索类似于以下内容的信息: ORA-00119: invalid specification for system parameter LOCAL_LISTENER ORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=linux-cn65.site)(PORT=1521))

所以 linux-cn65.site(VM 主机)丢失了。在 /etc/hosts 中添加您的主机(以 root 身份):

127.0.0.1 linux-cn65.site

并再次运行配置(以 root 身份):sh /etc/init.d/oracle-xe configure

额外的诡计

  • 如果日志文件夹中没有错误文件,则可以重新安装不带 h 标志的 XE,如下所示:

    • 找到您的包裹:sudo rpm -qa | grep -i oracle
    • 删除它:sudo rpm -e oracle-xe-11.2.0-1.0.x86_64
  • 在没有 h 标志的情况下再次安装:sudo rpm -iv oracle-xe-11.2.0-1.0.x86_64.rpm

哦,将版本 (oracle-xe-11.2.0-1.0.x86_64.rpm) 替换为您的版本。干杯;)

【讨论】:

  • 最佳答案
【解决方案2】:
nano /etc/init.d/oracle-shm

添加文字

#! /bin/sh 
# /etc/init.d/oracle-shm 
# 
case "$1" in 
start) 
echo "Starting script /etc/init.d/oracle-shm" 
# Run only once at system startup  
if [ -e /dev/shm/.oracle-shm ]; then 
echo "/dev/shm is already mounted, nothing to do" 
else 
rm -f /dev/shm 
mkdir /dev/shm 
mount --move /run/shm /dev/shm 
mount -B /dev/shm /run/shm 
touch /dev/shm/.oracle-shm 
fi 
;; 
stop) 
echo "Stopping script /etc/init.d/oracle-shm" 
echo "Nothing to do" 
;; 
*) 
echo "Usage: /etc/init.d/oracle-shm {start|stop}" 
exit 1 
;; 
esac 
# 
### BEGIN INIT INFO 
# Provides: oracle-shm 
# Required-Start: $remote_fs $syslog 
# Required-Stop: $remote_fs $syslog 
# Default-Start: 2 3 4 5 
# Default-Stop: 0 1 6 
# Short-Description: Bind /run/shm to /dev/shm at system startup. 
# Description: Fix to allow Oracle 11g use AMM. 
### END INIT INFO

使文件可执行

chmod 755 /etc/init.d/oracle-shm
/etc/init.d/oracle-shm start

此时重启,然后检查

df -kh /dev/shm

继续模拟 chkconfig 并继续进行其余配置和安装

dpkg -i oracle-xe-11.2.0-1.0.x86_64.deb

检查环境变量和ORACLE_HOME并启动数据库

【讨论】:

  • 如果有人在 Linux 上尝试这个。上面的 oracle-shm 给出了 linux 6 的以下错误。 mount: special device /run/shm does not exist mount: mount point /run/shm does not exist
  • 我建议在 INIT INFO 块中添加 X-Start-Before: OracleXE 行。这将确保它在 OracleXE 启动脚本之前运行。
【解决方案3】:

检查您的 /etc/hosts 文件。它应该看起来像

127.0.0.1 localhost.localdomain localhost 主机名.domain 主机名

http://blog.christian-stankowic.de/?p=5276&lang=en

【讨论】:

    【解决方案4】:

    我也为此苦苦挣扎。我尝试了几种不同的解决方案,但仍然遇到问题。我通过从数据库配置中删除 memory_target 来“修复”它:

    sqlplus / as sysdba
    create pfile=‘<path>’ from spfile 
    !vi <path>
    

    在memory_Target所在行前添加#,保存并关闭文件。

    startup from pfile=‘<path>'
    create spfile from pfile=‘<path>’
    

    此解决方案适用于我的 XE 数据库,希望对您有所帮助。

    【讨论】:

    • 从数据库配置中删除内存目标的位置
    【解决方案5】:

    我在 Ubuntu 14.04 上遇到了这个确切的问题。问题归结为 Oracle-XE 期望 /dev/shm 有足够的空间,而 ubuntu 已更改为使用 /run/shm 和 /dev/shm 的符号链接。

    对我有用的解决方案是创建文件 /etc/rc2.d/S01shm_load 包含:

    #!/bin/sh
    case "$1" in
    start)
        mkdir /var/lock/subsys 2>/dev/null
        touch /var/lock/subsys/listener
        rm /dev/shm 2>/dev/null
        mkdir /dev/shm 2>/dev/null
        mount -t tmpfs shmfs -o size=2048m /dev/shm ;;
    *)
        echo error
        exit 1
        ;;    
    esac
    

    我是从http://sysadminnotebook.blogspot.de/2012/10/installing-oracle-11g-r2-express.html 那里得到的,它与许多其他有关安装 XE 的页面类似,但它是唯一具有此解决方案的页面。

    附言。文件权限设置为 755,因此您需要执行:

    sudo chmod 755 /etc/rc2.d/S01shm_load

    设置此文件的权限。

    【讨论】:

    • 尝试了所有解决方案,但这个对我有用,并且给出了有效的解释......谢谢!
    • 有点奇怪。为什么使用 'rm /dev/shm 2>/dev/null' 而不是 'rmdir /dev/shm 2>/dev/null' ?据我所知,它工作不正常。
    【解决方案6】:

    This link looks like it has the answer. 您需要确保 /dev/shm 已安装在您的系统上,并为其分配至少 MEMORY_TARGET 的内存。

    您可以通过将以下内容添加到您的 fstab 并重新启动来做到这一点。 (这会将 /dev/shm 的大小设置为 2gb):

    shmfs /dev/shm tmpfs size=2048m 0 0
    

    【讨论】:

    • 我试过这个,但没有什么不同。我清除了日志,但再次出现相同的日志。
    • 它没有::~$ mount | grep shm\n none on /run/shm type tmpfs (rw,nosuid,nodev)
    • 这需要在 Oracle 安装工作之前安装。如果您尝试从命令行进行挂载(如答案中的链接中所述),错误消息可能会为您提供有关根本问题的更多信息(您可能需要加载内核模块)
    • 显然 /dev/shm 是 /run/shm 的符号链接。
    【解决方案7】:

    首先需要安装几个包,另外还有一些内核参数需要更改才能真正启动数据库。请参阅 Oracle 的 Linux 安装指南,或在 Google 上搜索有关 Ubuntu 上的 Oracle 11gR2 XE 的特定指南。

    【讨论】:

    • 我确实尝试了多个指南。我链接的那个似乎是最简单的,但我已经安装了其他指南中提到的所需软件包。
    猜你喜欢
    • 2012-03-21
    • 1970-01-01
    • 2017-09-02
    • 2015-02-23
    • 2013-09-12
    • 1970-01-01
    • 1970-01-01
    • 2018-09-15
    • 1970-01-01
    相关资源
    最近更新 更多