Sql Net
  • init.ora
alter system set DISPATCHERS='(PROTOCOL=tcp)(DISPATCHERS=1)(LISTENER=(ADDRESS=(PROTOCOL=tcp)(HOST=testhost)(PORT=1621)))';
alter system set max_dispatchers=2;
alter system set local_listener='(ADDRESS=(PROTOCOL=tcp)(HOST=testhost)(PORT=1621))';
alter system set local_listener='';
  • listener.ora
LISTENER=
 (DESCRIPTION=
  (ADDRESS=(PROTOCOL=tcp)(HOST=testhost)(PORT=1521))
 )
SID_LIST_LISTENER=
 (SID_LIST=
  (SID_DESC=
   (SID_NAME=PROD)
   )
  )
 
LISTENER2=
 (DESCRIPTION=
  (ADDRESS=(PROTOCOL=tcp)(HOST=testhost)(PORT=1621))
 )
  • tnsname
PROD_L2S= 
 (DESCRIPTION= 
  (ADDRESS=(PROTOCOL=tcp)(HOST=testhost)(PORT=1621))
  (CONNECT_DATA=
     (SID=PROD)
     (SERVER=shared)))
 
PROD_L2D= 
 (DESCRIPTION= 
  (ADDRESS=(PROTOCOL=tcp)(HOST=testhost)(PORT=1621))
  (CONNECT_DATA=
     (SID=PROD)
     (SERVER=dedicated)))
 
PROD= 
 (DESCRIPTION= 
  (ADDRESS=(PROTOCOL=tcp)(HOST=testhost)(PORT=1521))
  (CONNECT_DATA=
     (SID=PROD)
     (SERVER=dedicated)))
  • EZ Connect

common connection command-line

sqlplus system/manager@"(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testhost)(PORT=1521))(CONNECT_DATA=(SID=PROD)(SERVER=dedicated)))"

sqlnet.ora

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

ezconnect command-line

sqlplus system/manager@testhost:1521/PROD
  • dispatchersのlistener文とlocal_listenerの違い

dispatchers='(PROTOCOL=TCP)(LISTENER=LISTENER)'
とlocal_listener='LISTENER'は同じようにlistenerに自動にinstanceを登録できるが
機能は微妙に違う。
dispatchers='(PROTOCOL=TCP)(LISTENER=LISTENER)'はあくまでもdispatcherの一部として稼動するから
tnsnames.oraにservice_nameしか受け付けない。
local_listener=の場合、instance直属の機能だから、tnsnames.oraにSID=の設定ができる。