Oracle監聽器Server端與Client端配置執行個體

來源:互聯網
上載者:User

Listener.ora、tnsnames.ora這兩個檔案常常因為格式問題而不好用,我平時都是配置好了留個備份,以後都是拷貝過去改改就好了!嘿嘿~~~

    因為平時使用linux的時候較多,所以有時還會遇到sqlnet.ora這個檔案有問題,直接給它刪了就好了~~

    有時在windows下裝的oracle的listener服務就啟動不了,遇到這種情況,直接去oracle的bin目錄下面找到lsnrctl.exe那個檔案,直接給它運行,彈出來的視窗不要關閉,就可以了。

    Oracle Server端Listener.ora檔案(一個instance):

    LISTENER =

      (DESCRIPTION_LIST =

        (DESCRIPTION =

          (ADDRESS_LIST =

            (ADDRESS = (PROTOCOL=TCP)(HOST=hostname)(PORT=1521))    //主機名稱或IP及連接埠設定

          )

        )

      )

    SID_LIST_LISTENER =

      (SID_LIST =

        (SID_DESC =

          (SID_NAME = database1)             // database1為資料庫instance名

          (ORACLE_HOME = /opt/oracle/product/10.1.0)                   //oracle安裝目錄,根據安裝情況更改

          (PROGRAM = extproc)

        )

      )

    Oracle Server端Listener.ora檔案(兩個instance):

    LISTENER =

      (DESCRIPTION_LIST =

        (DESCRIPTION =

          (ADDRESS_LIST =

            (ADDRESS = (PROTOCOL=TCP)(HOST=hostname)(PORT=1521))

          )

        )

      )

    SID_LIST_LISTENER =

      (SID_LIST =

        (SID_DESC =

          (SID_NAME = database1)             // database1為資料庫instance1名

          (ORACLE_HOME = /opt/oracle/product/10.1.0)

          (PROGRAM = extproc)

        )

        (SID_DESC =

          (SID_NAME = database2)             // database2為資料庫instance2名

          (ORACLE_HOME = /opt/oracle/product/10.1.0)

          (PROGRAM = extproc)

        )

      )

    Oracle Server端監聽器啟動、停止、查看狀態命令:

    $ lsnrctl start

    $ lsnrctl stop

    $ lsnrctl status

    Oracle Client端Tnsnames.ora檔案:

    ORALOCAL =                                                            //別名oralocal

      (DESCRIPTION =

        (ADDRESS_LIST =

          (ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521))

        )

        (CONNECT_DATA =

          (SERVICE_NAME = database1)             //database1為SID名

        )

    )

    Oracle Client端檢查監聽器串連狀態用命令:

    $ tnsping 別名

    例如:用oracle使用者執行命令  $ tnsping oralocal

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.