2012-05-08 53 views
0

我想以root用戶身份啓動Oracle Listner。我能夠以oracle用戶身份啓動監聽器。 但它並沒有以root用戶身份啓動。 我能夠以root用戶身份停止並檢查狀態。無法以root用戶身份啓動Oracle偵聽器

當作爲根它提供了以下信息,我開始監聽器: -

# lsnrctl start 

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 08-MAY-2012 15:08:11 

Copyright (c) 1991, 2005, Oracle. All rights reserved. 

Starting /opt/oracle/102/bin/tnslsnr: please wait... 

/opt/oracle/102/bin/tnslsnr: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory 
TNS-12547: TNS:lost contact 
TNS-12560: TNS:protocol adapter error 
    TNS-00517: Lost contact 
    Linux Error: 32: Broken pipe 

請幫我開始偵聽器作爲root用戶。

+2

只是不這樣做。以oracle用戶身份啓動它。 – Mat

+0

但需求是唯一的。我想以root身份啓動它。有沒有其他的選擇,以便在運行時我可以有oracle用戶。 – Anjali

+1

該要求來自哪裏?它背後的原因是什麼? – Mat

回答

2

您不應該以root用戶身份運行Oracle,這是安全風險。沒有任何理由以root用戶的身份運行rdbms和/或listener,除非您完全搞砸了安裝,甚至不允許以root身份運行。

如果確實需要以root用戶身份運行偵聽器,請確保您的環境變量是正確的。你的情況:

# export ORACLE_HOME=/opt/oracle/102 
    # export PATH=$PATH:$ORACLE_HOME/bin 

    # cd $ORACLE_HOME/bin 
    # chmod u+s lsnrctl 
    # lsnrctl start 

LSNRCTL版:版本10.2.0.5.0 - 生產09-MAY-2012 20時51分07秒

Copyright (c) 1991, 2010, Oracle. All rights reserved.

Starting /data/oracle/base/product/se_10205_s/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.5.0 - Production System parameter file is /data/oracle/base/admin/network/listener.ora Log messages written to /data/oracle/base/product/se_10205_s/network/log/listener.log Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 10.2.0.5.0 - Production Start Date
09-MAY-2012 20:51:09 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /data/oracle/base/admin/network/listener.ora Listener Log File /data/oracle/base/product/se_10205_s/network/log/listener.log Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER))) The listener supports no services The command completed successfully

# lsnrctl stop 

LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 09-MAY-2012 20:52:16

Copyright (c) 1991, 2010, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) TNS-01190: The user is not authorized to execute the requested listener command

不要做這個;如果你是你犯了一個錯誤。選擇屬於dba組的成員但不是root的任何其他用戶。

BTW:這個小演示後,我不得不解決一個小問題:

Started with pid=5215 Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) TNS-12555: TNS:permission denied TNS-12560: TNS:protocol adapter error
TNS-00525: Insufficient privilege for operation Linux Error: 1: Operation not permitted

問題是 - 很明顯 - 這/var/tmp/.oracle/sLISTENER由超級用戶擁有。給正確的用戶一點點關注。

+0

感謝您的幫助......我明白這一點。我想知道我有一個腳本,我通過它啓動了監聽器。該腳本具有root權限。如果我將權限更改爲oracle,則它將成功啓動偵聽器,否則將失敗。如果我給這個劇本suid然後它會工作或不? for ex - chmod u + s abc.sh – Anjali

+0

不,setuid腳本被忽略。 Setuid僅適用於二進制文件。您可以使用$ ORACLE_HOME/bin之前的根PATH中的lsnrctl腳本執行su到oracle。 –

相關問題