DB/Oracle/Instant Client

Top / DB / Oracle / Instant Client

ܼ

XE ΩƤФˤۤΥޥ SQL*Plus 餵褦ˤ롣SQL*Plus ΤΤ Oracle Instant Client äƤѥåȤ Oracle 󤬸ƤƤΤǡǤϤΥ󥹥ȡˡ


ȥɥ

SQL*Plus Υ桼ɤȥե󥹤 Instant Client β⤬ΤǤ򻲾ȡ󥹥ȡμ񤤤Ƥ롣

󥹥ȡ

󥹥ȡǤäȽ뤫ȻפճȤ䤳ä󥹥ȡʤƤʤä

Windows ĶǤΥ󥹥ȡ

ɤŸ

  1. ɬפʥեΥ
    1. Instant Client Υɥڡ OS Υڡ˿ʤ
    2. instantclient-basic-*.zip instantclient-sqlplus-*.zip Ĥɤ
    1. ʤȤ˿ƥǥ쥯ȥĤ
      • ɤǤ⤤Τ㤨 [c:\tools\sqlplus] Ȥ
    2. ɤĤ zip եȤƥǥ쥯ȥ˲ह

  1. Ķѿ
    • Ķѿ PATH SQL*Plus ǥ쥯ȥʤǤ [c:\tools\sqlplus\]ˤɲä

ͥåȥӥ̾Ͽ

  1. Ŭʾ tnsnames.ora Ĥä¸
    • [c:\tools\sqlplus\admin\tnsnames.ora] ˤ
    • ȤϤʤXE Υӥ̾ ORCL ʤ XE ä
      <net-service-name> =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = <ip-addr>)(PORT = 1521))
          (CONNECT_DATA =
            (SERVICE_NAME = XE)
          )
        )
      
  2. Ķѿɲ
    • Ķѿ TNS_ADMIN Ȥ tnsnames.ora Τǥ쥯ȥꤹ롣 [c:\tools\sqlplus\admin\]

³ǧ

  1. ޥɥץץȤ SQL*Plus ư
    sqlplus /nolog
    
    • λǵưǤʤХѥ̤äƤʤäƤȤʤΤǺƳǧ
  2. ³ǧ
    -- ҤȤޤʰ³dzǧ̤ sysdba ʤƤ⤤Τ
    conn sys@<ip-addr>:1521 as sysdba
    
    -- Ǥͥåȥӥ̾³ǧ
    conn sys@<net-service-name> as sysdba
    

ʾ

Linux ĶǾ岼Υ䥳ޥͭˤ

Linux Ķ SQL*Plus ȤäƤƥȥ쥹ޤΤ岼򤿤ɤʤ˺ʤȤȥ쥹ե뤹ƥäΤĴ٤顢ΤȤʤƱ֤äѤơ⤢äĶ

̾Υǥ륭ȤޥCtrl + RˤȤȤΤ readline äƤΤưƤ뤫ʤɡ餬 SQL*Plus readline бƤʤäƤá

ǡȤΤ readline бˤĶ rlwrap ȤåѤΤǤȤäá

ɤȥ󥹥ȡ

ݥȥˤäƤ yum 롣ʤ rpm õƻäƤ뤫ӥɤ롣

  1. yum 줿
    yum install rlwrap
    
  2. ʤä饽äƤ롣ݤä餰Фɤ rpm Ϥ餽֤Ǥ褤
    1. ƤȤˤ
    2. षƥӥɤƥ󥹥ȡ뤹
      -- 
      tar zxvf rlwrap-0.37.tar.gz
      
      -- ư
      cd rlwrap-0.37
      
      -- ӥɤƥ󥹥ȡ
      ./configure
      make
      make install
      

Ȥ

¹Ԥޥɤ rlwrap 򤯤äĤ

  • ¹ˡ
    rlwrap sqlplus /nolog
    

󤳤Τݤä饨ꥢĤФ

  • ~/.bashrc
    alias sqlplus='rlwrap sqlplus'
    

ȥǻȤ륭ܡɥ硼ȥåȤäݤΤϤȤ롣Ķ


Last-modified: 2011-11-02 () 09:45:46 (2484d)