Check DB Connection

    內容表格
    1. 1. From Local
    2. 2. From Remote

    版本為 08:28, 27 Nov 2024

    到這個版本。

    返回到 版本存檔.

    查閱目前版本

    檢查資料庫連線

    From Local

     

    From Remote

    1. tnsping

    • Oracle Client installation

    NOTE: tnspin just check if the LISTENER service on the DB server is running

    $> tnsping <TNS-Alias>
     or
    $> tnsping <db-server-ip>:1521/<SID>
    

    2. check_db_up.sql

    • Oracle Client installation
    • tnsnames.ora
    whenever sqlerror exit 1;
    connect username/password@<<TNS alias>>
    select 1 from dual;
    exit 0;
    

    Run your bash like the follows

    sqlplus /nolog @check_db_up.sq
    

    If that returns 1, there was an error and the database isn't up.

    Powered by MindTouch Core