2013-05-14 143 views
13

我試圖在(X)ubuntu 13.04 64位上使用this guide安裝Oracle數據庫。一切都很好GOED直到我得到下面的步驟:安裝Oracle數據庫速成版11g時遇到的問題

$ 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 

我在做什麼錯?

+0

我不得不使用Oracle一所學校的課,但我從來沒有設法得到它的工作,我決定用一個預先安裝的虛擬機。我不在乎任何更多的解決方案,我也不會嘗試它們。當我按'關閉'時,我沒有得到任何描述正確結束這個問題的原因的選項。我應該刪除這個問題嗎?答案可能會幫助其他人。 – 2013-11-18 18:56:37

回答

1

This link looks like it has the answer.您需要確保將/ dev/shm安裝在您的系統上,並將其分配給至少MEMORY_TARGET的內存。

您可以通過將以下內容添加到您的fstab中並重新啓動來完成此操作。 (這將設置在/ dev/shm的大小爲2GB):

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

我試過了,但沒有什麼區別。我清除了日誌,但是同樣的日誌重新出現。 – 2013-05-14 18:12:43

+0

當你鍵入'mount'時,它顯示/ dev/shm掛載嗎? – antlersoft 2013-05-14 19:00:04

+0

它不: ':〜〜$ mount | grep shm \ n none on/run/shm type tmpfs(rw,nosuid,nodev)' – 2013-05-14 20:07:03

0

有幾個包需要先安裝,加上有才能真正啓動數據庫改變一些內核參數。請參閱Oracle的Linux安裝指南,或在Google上搜索Google獲取Oracle 11gR2 XE的特定指南。

+0

我確實嘗試了多個指南。我鏈接的人似乎是最簡單的,但我已經安裝了其他指南中提到的必需的軟件包。 – 2013-05-14 18:13:53

8
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和啓動數據庫

+0

+1這一個工程 – mb2015 2013-09-26 00:25:12

+0

如果有人正在嘗試這個爲Linux。上面的oracle-shm爲linux 6提供了以下錯誤:mount:特殊設備/ run/shm不存在 mount:掛載點/ run/shm不存在 – JackDev 2014-05-12 03:52:09

+0

我建議添加X-Start-Before:OracleXE line in INIT INFO塊。這將確保它在OracleXE啓動腳本之前運行。 – EdwinW 2014-08-29 00:42:03

28

我是在同一條船上,試圖在虛擬機上配置XE(openSUSE的 13.01 64位) 。

我的解決方案是/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

其他弄虛作假

  • 如果您沒有日誌文件夾中的錯誤文件,則可以重新安裝XE而不使用h標誌,如t他:

    • 找到你的包: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

它確實是主機名:)工作就像一個魅力! – Radu 2014-06-26 09:15:06

+0

嘿@kodeart你是個冷靜的人,那只是wwooowww ....謝謝youuuzzz ... – beginer 2015-02-10 10:53:24

+0

最佳答案 – 2017-06-22 16:50:51

2

我這個掙扎過。我嘗試了幾種不同的解決方案,但仍然遇到了問題。我從數據庫配置中刪除MEMORY_TARGET「固定」它:在與MEMORY_TARGET線前

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

添加#,保存並關閉文件。

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

該解決方案適用於我的XE數據庫,希望它有幫助。

+0

去哪裏從 – 2017-05-24 01:18:50

2

我與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卻被只有一個這個解決方案。

PS。文件權限被設置爲755,所以你需要執行:

sudo chmod 755 /etc/rc2.d/S01shm_load

設置該文件的權限。

+0

嘗試了所有的解決方案,但這個工作對我來說,是數據庫配置中刪除memeory目標給予有效的解釋以及...謝謝! – 2017-08-30 13:39:48

+0

它有點奇怪。爲什麼使用'rm/dev/shm 2>/dev/null'而不是'rmdir/dev/shm 2>/dev/null'?據我所知,它工作不正常。 – hariprasad 2017-11-04 18:26:46