2016-08-17 8 views
0

私は、Red Hat Linux 7.2とOracle 12cで足元を濡らし始めています。先週末、RHEL 7.2でOracle 12cをサポートできるかどうか試してみました。結局のところ、私はRHEL 7.2 VM上でOracleを立ち上げることができましたが、問題はありませんでした。しかし、私は を一度に1つずつ解決しました。私はVMを吹き飛ばし、最初からすべてを開始しました。Oracleリスナーとデータベース・サービスが実行されない理由

今私は&を実行するかなり良いセットアップがあると思います。私が理解できない唯一のことは、Linuxボックスを再起動するときです.Oracle listnerとデータベースサービスは、Windows Server 2012 R2システムと同様に自動的に起動しません。これらのサービスが実行されていない場合、当然私は をOracle DBに接続できません。リスナーが何のサービス をサポートしていません:ファイル名を指定して実行

を開始LSNRCTL

  • 私のようなメッセージに何かが表示されますoracleユーザーとして

    1. ログオン:それを修正するために、私はこれらの2つのコマンドを実行する必要がありますこれは問題ありません。その後

  • 接続データベースへ

    SQLを実行>スタートアップが、すべてが通常通り実行されています。どのOracleクライアントからでもOracleデータベースに接続できます。私の質問は次のとおりです:これはLinuxボックスでの通常の動作ですか? Oracleのインストール中に何かが見逃されましたか?これらのサービスが自動的に開始されるはずですが、これを修正するには何が必要ですか?

    ありがとうございます。

  • +0

    私は自分の問題についてGoogleに引き続き説明しましたが、解決策が見つかりませんでした。私は、データベースを起動するOracleスクリプトを見つけました。 $ ORACLE_HOME/bin/dbstartを実行する必要があります。起動時にこのプログラムを実行するにはどうすればよいですか? – sydney

    答えて

    0

    詳細については、リスナーログを確認する必要があります。

    検索リスナーのログの場所:

    $ lsnrctl stat 
    
    LSNRCTL for Linux: Version . . . 
    . . . 
    Listener Log File  /home/app/oracle/product/10.2/network/log/listener.log 
    
    +0

    解決策が見つかりました。https://oracle-base.com/articles/linux/automating-database-startup-and-shutdown-on-linux – sydney

    0

    このエラーソリューションは、まず、このエラーが発生する理由のは理解してみましょう、非常に簡単です。 )ホスト名/ IPアドレスがある、それはパラメータが

    -ORACLE_SID in oracle environment. 
    -SID_NAME in tnsnames.ora file. 
    -SERVICE_NAME in listener.ora file. 
    

    2値の下にチェックし、どこでも同じである必要がありますあなたのデータベースおよびサービス名が正しくOracle環境に設定されていない

    1):それは基本的に二つの理由があります紛失、間違い、綴り間違いなどがありますので、下記をご確認ください。

    -Check the IP ADDRESS in /etc/hosts file. 
    -It should be same in listener.ora and tnsnames.ora file 
    -And it should be able to ping from the local and remote server. 
    

    今私も同じ問題に直面し、解決した参照:

    [[email protected] Desktop]$ sqlplus/as sysdba 
    
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 12 22:52:29 2017 
    
    Copyright (c) 1982, 2009, Oracle. All rights reserved. 
    
    Connected to an idle instance. 
    
    SQL> startup 
    ORACLE instance started. 
    
    Total System Global Area 970895360 bytes 
    Fixed Size   1340636 bytes 
    Variable Size   713034532 bytes 
    Database Buffers  251658240 bytes 
    Redo Buffers   4861952 bytes 
    Database mounted. 
    Database opened. 
    SQL> 
    SQL> exit 
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production 
    With the Partitioning, OLAP, Data Mining and Real Application Testing options 
    [[email protected] Desktop]$ 
    [[email protected] Desktop]$ lsnrctl 
    
    LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 12-JUL-2017 22:54:51 
    
    Copyright (c) 1991, 2009, Oracle. All rights reserved. 
    
    Welcome to LSNRCTL, type "help" for information. 
    
    LSNRCTL> status 
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) 
    TNS-12541: TNS:no listener 
    TNS-12560: TNS:protocol adapter error 
        TNS-00511: No listener 
        Linux Error: 111: Connection refused 
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ole1)(PORT=1521))) 
    
    TNS-12541: TNS:no listener 
    TNS-12560: TNS:protocol adapter error 
        TNS-00511: No listener 
        Linux Error: 111: Connection refused 
    LSNRCTL> LSNRCTL> start 
    Starting /home/oracle/app/oracle/product/11.2.0/dbhome_1//bin/tnslsnr: please wait... 
    
    TNSLSNR for Linux: Version 11.2.0.1.0 - Production 
    System parameter file is /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 
    Log messages written to /home/oracle/app/oracle/diag/tnslsnr/OLE1/listener/alert/log.xml 
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) 
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ole1)(PORT=1521))) 
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) 
    STATUS of the LISTENER 
    ------------------------ 
    Alias      LISTENER 
    Version     TNSLSNR for Linux: Version 11.2.0.1.0 - Production 
    Start Date    12-JUL-2017 22:55:43 
    Uptime     0 days 0 hr. 0 min. 23 sec 
    Trace Level    off 
    Security     ON: Local OS Authentication 
    SNMP      OFF 
    Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 
    Listener Log File   /home/oracle/app/oracle/diag/tnslsnr/OLE1/listener/alert/log.xml 
    Listening Endpoints Summary... 
        (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) 
        (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ole1)(PORT=1521))) 
    The listener supports no services 
    The command completed successfully 
    LSNRCTL> [[email protected] Desktop]$ 
    [[email protected] Desktop]$ 
    [[email protected] Desktop]$ echo $ORACLE_SID 
    orcl 
    [[email protected] Desktop]$ 
    [[email protected] admin]$ cat tnsnames.ora 
    # tnsnames.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora 
    # Generated by Oracle configuration tools. 
    
    ORCL = 
        (DESCRIPTION = 
        (ADDRESS = (PROTOCOL = TCP)(HOST = ole1)(PORT = 1521)) 
        (CONNECT_DATA = 
         (SERVER = DEDICATED) 
         (SERVICE_NAME = orcl) 
        ) 
    ) 
    
    [[email protected] admin]$ 
    [[email protected] admin]$ cat listener.ora 
    # listener.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 
    # Generated by Oracle configuration tools. 
    
    LISTENER = 
        (DESCRIPTION_LIST = 
        (DESCRIPTION = 
         (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) 
         (ADDRESS = (PROTOCOL = TCP)(HOST = ole1)(PORT = 1521)) 
        ) 
    ) 
    
    ADR_BASE_LISTENER = /home/oracle/app/oracle 
    
    [[email protected] admin]$ 
    [[email protected] admin]$ cat /etc/hosts 
    127.0.0.1 localhost 
    ::1   localhost 
    192.168.244.128 ole1 
    [[email protected] admin]$ 
    [[email protected] ~]$ tnsping orcl 
    
    TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 12-JUL-2017 22:57:14 
    
    Copyright (c) 1997, 2009, Oracle. All rights reserved. 
    
    Used parameter files: 
    /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora 
    
    
    Used TNSNAMES adapter to resolve the alias 
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ole1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl))) 
    TNS-12541: TNS:no listener 
    [[email protected] ~]$ 
    [[email protected] ~]$ lsnrctl 
    
    LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 12-JUL-2017 23:01:48 
    
    Copyright (c) 1991, 2009, Oracle. All rights reserved. 
    
    Welcome to LSNRCTL, type "help" for information. 
    
    LSNRCTL> 
    LSNRCTL> 
    LSNRCTL> reload 
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) 
    The command completed successfully 
    LSNRCTL> 
    LSNRCTL> status 
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) 
    STATUS of the LISTENER 
    ------------------------ 
    Alias      LISTENER 
    Version     TNSLSNR for Linux: Version 11.2.0.1.0 - Production 
    Start Date    12-JUL-2017 22:55:43 
    Uptime     0 days 0 hr. 6 min. 37 sec 
    Trace Level    off 
    Security     ON: Local OS Authentication 
    SNMP      OFF 
    Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 
    Listener Log File   /home/oracle/app/oracle/diag/tnslsnr/OLE1/listener/alert/log.xml 
    Listening Endpoints Summary... 
        (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) 
        (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ole1)(PORT=1521))) 
    The listener supports no services 
    The command completed successfully 
    LSNRCTL> stop 
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) 
    The command completed successfully 
    LSNRCTL> start 
    Starting /home/oracle/app/oracle/product/11.2.0/dbhome_1//bin/tnslsnr: please wait... 
    
    TNSLSNR for Linux: Version 11.2.0.1.0 - Production 
    System parameter file is /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 
    Log messages written to /home/oracle/app/oracle/diag/tnslsnr/OLE1/listener/alert/log.xml 
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) 
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ole1)(PORT=1521))) 
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) 
    STATUS of the LISTENER 
    ------------------------ 
    Alias      LISTENER 
    Version     TNSLSNR for Linux: Version 11.2.0.1.0 - Production 
    Start Date    12-JUL-2017 23:03:10 
    Uptime     0 days 0 hr. 0 min. 21 sec 
    Trace Level    off 
    Security     ON: Local OS Authentication 
    SNMP      OFF 
    Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 
    Listener Log File   /home/oracle/app/oracle/diag/tnslsnr/OLE1/listener/alert/log.xml 
    Listening Endpoints Summary... 
        (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) 
        (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ole1)(PORT=1521))) 
    The listener supports no services 
    The command completed successfully 
    LSNRCTL> 
    
    [[email protected] ~]$ 
    [[email protected] ~]$ 
    [[email protected] ~]$ sqlplus/as sysdba 
    
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 12 23:04:37 2017 
    
    Copyright (c) 1982, 2009, Oracle. All rights reserved. 
    
    
    Connected to: 
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production 
    With the Partitioning, OLAP, Data Mining and Real Application Testing options 
    
    SQL> select name from v$database; 
    
    NAME 
    --------- 
    ORCL 
    
    SQL> exit 
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production 
    With the Partitioning, OLAP, Data Mining and Real Application Testing options 
    [[email protected] ~]$ 
    
    [[email protected] admin]$ cat /etc/hosts 
    127.0.0.1 localhost 
    ::1   localhost 
    192.168.244.128 ole1 
    [[email protected] admin]$ ping ole1 
    PING ole1 (192.168.244.128) 56(84) bytes of data. 
    ^C 
    --- ole1 ping statistics --- 
    14 packets transmitted, 0 received, 100% packet loss, time 13710ms 
    
    [[email protected] admin]$ 
    

    注:は今ここに、私はそのはpingを実行しませIPアドレスの設定で問題を発見したので、私はいくつかの変更をしましたがVMwareマシンのOSのeth1ドライバにあります。

    [[email protected] admin]$ ping ole1 
    PING ole1 (192.168.244.128) 56(84) bytes of data. 
    64 bytes from ole1 (192.168.244.128): icmp_seq=1 ttl=64 time=0.694 ms 
    64 bytes from ole1 (192.168.244.128): icmp_seq=2 ttl=64 time=0.187 ms 
    64 bytes from ole1 (192.168.244.128): icmp_seq=3 ttl=64 time=4.96 ms 
    64 bytes from ole1 (192.168.244.128): icmp_seq=4 ttl=64 time=0.121 ms 
    64 bytes from ole1 (192.168.244.128): icmp_seq=5 ttl=64 time=0.082 ms 
    64 bytes from ole1 (192.168.244.128): icmp_seq=6 ttl=64 time=0.166 ms 
    64 bytes from ole1 (192.168.244.128): icmp_seq=7 ttl=64 time=0.126 ms 
    ^C 
    --- ole1 ping statistics --- 
    7 packets transmitted, 7 received, 0% packet loss, time 6996ms 
    rtt min/avg/max/mdev = 0.082/0.905/4.963/1.668 ms 
    [[email protected] admin]$ 
    [[email protected] admin]$ 
    [[email protected] admin]$ lsnrctl 
    
    LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 12-JUL-2017 23:09:37 
    
    Copyright (c) 1991, 2009, Oracle. All rights reserved. 
    
    Welcome to LSNRCTL, type "help" for information. 
    
    LSNRCTL> stop 
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) 
    The command completed successfully 
    LSNRCTL> 
    LSNRCTL> 
    LSNRCTL> start 
    Starting /home/oracle/app/oracle/product/11.2.0/dbhome_1//bin/tnslsnr: please wait... 
    
    TNSLSNR for Linux: Version 11.2.0.1.0 - Production 
    System parameter file is /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 
    Log messages written to /home/oracle/app/oracle/diag/tnslsnr/OLE1/listener/alert/log.xml 
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) 
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ole1)(PORT=1521))) 
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) 
    STATUS of the LISTENER 
    ------------------------ 
    Alias      LISTENER 
    Version     TNSLSNR for Linux: Version 11.2.0.1.0 - Production 
    Start Date    12-JUL-2017 23:09:45 
    Uptime     0 days 0 hr. 0 min. 0 sec 
    Trace Level    off 
    Security     ON: Local OS Authentication 
    SNMP      OFF 
    Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 
    Listener Log File   /home/oracle/app/oracle/diag/tnslsnr/OLE1/listener/alert/log.xml 
    Listening Endpoints Summary... 
        (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) 
        (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ole1)(PORT=1521))) 
    The listener supports no services 
    The command completed successfully 
    LSNRCTL> 
    LSNRCTL> 
    LSNRCTL> status 
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) 
    STATUS of the LISTENER 
    ------------------------ 
    Alias      LISTENER 
    Version     TNSLSNR for Linux: Version 11.2.0.1.0 - Production 
    Start Date    12-JUL-2017 23:09:45 
    Uptime     0 days 0 hr. 2 min. 17 sec 
    Trace Level    off 
    Security     ON: Local OS Authentication 
    SNMP      OFF 
    Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 
    Listener Log File   /home/oracle/app/oracle/diag/tnslsnr/OLE1/listener/alert/log.xml 
    Listening Endpoints Summary... 
        (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) 
        (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ole1)(PORT=1521))) 
    Services Summary... 
    Service "orcl" has 1 instance(s). 
        Instance "orcl", status READY, has 1 handler(s) for this service... 
    Service "orclXDB" has 1 instance(s). 
        Instance "orcl", status READY, has 1 handler(s) for this service... 
    The command completed successfully 
    [[email protected] admin]$ 
    [[email protected] admin]$ 
    [[email protected] admin]$ sqlplus scott/[email protected] 
    
    SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 13 00:15:48 2017 
    
    Copyright (c) 1982, 2009, Oracle. All rights reserved. 
    
    
    Connected to: 
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production 
    With the Partitioning, OLAP, Data Mining and Real Application Testing options 
    
    SQL> 
    SQL> exit 
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production 
    With the Partitioning, OLAP, Data Mining and Real Application Testing options 
    [[email protected] admin]$ 
    

    今はうまく動作しています。

    ありがとうございます!

    関連する問題