[英]Moved Oracle 11.2 XE Database Directory, Connected to Idle Instance
因此,我首先要說明我已經將Oracle 11.2 XE的常規安裝位置移到了在RHEL 6.6服務器上創建的邏輯卷(/ oracle)中。 關閉數據庫和Oracle偵聽器之后,我執行了...
$ cp -R /u01/app/* /oracle
$ rm -rf /u01/app/oracl
$ ln -s /oracle/oracle /u01/app/oracle
然后重新啟動偵聽器和數據庫。 現在,當我嘗試以用戶“ oracle”的身份運行以下命令時,我收到一條消息...
$ sqlplus
Enter user-name: sys / as sysdba
Enter password: ****
Connected to idle instance.
此外,當我嘗試啟動時,我得到一個錯誤。
> startup
ORA-45301: XE Edition single instance violation error
我嘗試了此處找不到的解決方案。
這是我的偵聽器控制器的輸出:
bash-4.1$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 10-MAR-2015 10:26:25
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 10-MAR-2015 10:25:57
Uptime 0 days 0 hr. 0 min. 28 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/dev/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dev)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
關於下一步嘗試我真的很迷茫。 我知道我可以重新安裝目錄並將其保留在正確的位置,但是我需要將其放在自己的邏輯卷中。
編輯
一些進一步的信息可以幫助闡明我的系統...
bash-4.1$ env | grep ORA
ORACLE_SID=XE
ORACLE_BASE=/oracle/oracle
ORACLE_HOME=/oracle/oracle/product/11.2.0/xe
bash-4.1$ env | grep TNS
TNS_ADMIN=/oracle/oracle/product/11.2.0/xe/network/admin
bash-4.1$ ps -aux | grep pmon
oracle 2431 0.0 0.2 1265956 16652 ? Ss 11:43 0:00 xe_pmon_XE
進一步編輯
嘗試使用SYSTEM用戶登錄sqlplus時返回錯誤:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
進一步編輯
ipcs命令的輸出
bash-4.1$ ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0xc0a59444 32768 oracle 660 4096 0
------ Semaphore Arrays --------
key semid owner perms nsems
0xd4a9963c 229378 oracle 660 104
0x884d8f34 491523 oracle 660 104
------ Message Queues --------
key msqid owner perms used-bytes messages
檢查ipcs
命令的輸出,並嘗試刪除Oracle擁有的所有共享內存段/信號。
當Oracle啟動時,它使用兩個字符串ORACLE_SID(uppercase)和ORACLE_HOME,對這兩個字符串進行哈希處理,並使用此哈希值作為shmget
調用的鍵。 因此,即使將斜杠/
附加到ORACLE_HOME,一切也與Oracle的觀點有所不同-即使磁盤路徑相同。
因此,我認為您將ORACLE_HOME移到了其他位置,但是舊值保留在某個位置,現在Oracle認為您正在嘗試啟動多個實例。
編輯:我不確定XE,但是常規Oracle版本作為一堆.o
目標文件提供。 這些文件在安裝過程中被鏈接,但是您也可以隨時重新鏈接Oracle。 如果舊的ORACLE_HOME是硬編碼的,請檢查腳本$ORACLE_HOME/bin/relink
。 然后嘗試通過執行relink all
來重新鏈接所有庫。 另請注意,Oracle使用鏈接選項-Wl,-rpath=...
,因此某些Oracle二進制文件中已編譯了庫搜索補丁程序。
對於標准版/企業版,將二進制文件復制到其他Oracle主目錄中不是問題。
檢入/u01/app/oracle/product/11.2.0/xe/dbs/,如果您已重命名XE數據庫或嘗試創建一個新數據庫,則必須確保xe已知只有一個數據庫。 它僅限於一個實例。 /etc/init.d/oracle-xe stop cd /u01/app/oracle/product/11.2.0/xe/dbs/重命名任何未使用的pwfile和spfile到.old /etc/init.d/oracle-xe start
問題是tsnnames.ora中的條目不正確(我添加了不應添加的行),並且/ oracle目錄的權限不正確。 感謝所有嘗試提供幫助的人,對此深表感謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.