oracle 最全的監聽、tnsnames.ora格式

wanglinghua0907發表於2024-01-26

監聽:

scan 監聽:

LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by 
Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent
 
SID_LIST_LISTENER_SCAN1 =  
             (SID_LIST =
               (SID_DESC =       
                 (SID_NAME = PLSExtProc)
                 (ORACLE_HOME = /oracle/app/product/112040/db_1)
                 (PROGRAM = extproc)
               )
               (SID_DESC=         
                  (GLOBAL_DBNAME=htbase)  
                  (ORACLE_HOME=/oracle/app/product/112040/db_1)  
                  (SID_NAME=htbase1)   
                )
               (SID_DESC=         
                  (GLOBAL_DBNAME=htbase)  
                  (ORACLE_HOME=/oracle/app/product/112040/db_1)  
                  (SID_NAME=htbase2)   
                )
             )

-----------------------------------------------

[root@raclhr-11gR2-N2 .oracle]# cat /u01/app/11.2.0/grid/network/admin/listener.ora
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent
LISTENER_SCAN1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.174)(PORT = 1521))
    )
  )
SID_LIST_LISTENER_SCAN1 =
(SID_LIST =
    (SID_DESC =
     (GLOBAL_DBNAME = lhrrac1)
     (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
     (SID_NAME = lhrrac12)
    )
    (SID_DESC =
     (GLOBAL_DBNAME = lhrrac1)
     (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
     (SID_NAME = lhrrac11)
    )
 )


普通監聽

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = wlh2)
      (SID_NAME = wlh2)
      (ORACLE_HOME = /oracle/app/product/11.2.0/db_1)
    )
  )
 
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.211.55.91)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

普通監聽2

DBRA =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 155.155.10.31)(PORT = 1522))
      )
    )
  )
SID_LIST_DBRA =
 (SID_LIST =
  (SID_DESC =
      (GLOBAL_DBNAME = bsorcl)
      (ORACLE_HOME = /oracle/app/product/112040/db_1)
      (SID_NAME = bsorcl1)
    )
  (SID_DESC =
      (GLOBAL_DBNAME = htbase)
      (ORACLE_HOME = /oracle/app/product/112040/db_1)
      (SID_NAME = htbase1)
    )
)


TNS配置:

普通tns

orcl =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.200)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )


普通2

TEST =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 155.155.10.35)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = htbase)
    )
  )

連sid

ii =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.83.50)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = lll)
      (INSTANCE_NAME=zmh)
    )
  )


rac版單一個節點的tns

###################備端一節點連線串#########################
EMRDB_DG1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 155.155.10.31)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = htbase)
      (INSTANCE_NAME=htbase1)
    )
  )

rac版本scan的tns

server是獨佔模式或者共享模式(DEDICATED/ SHARED)
HTBASE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 155.155.10.35)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = htbase)
    )
  )




來自 “ ITPUB部落格 ” ,連結:https://blog.itpub.net/69980685/viewspace-3005200/,如需轉載,請註明出處,否則將追究法律責任。

相關文章