the simplest sample of listener.ora and tnsnames.ora

 for listener.ora file 

LISTENER = (ADDRESS = (PROTOCOL = TCP)(HOST = ocm.localdomain)(PORT = 1521))

SID_LIST_LISTENER =(SID_DESC= (SID_NAME = clone)(ORACLE_HOME = /u01/oracle/product/database))

that's all


if the listener has muti address , then add address_list , and address is just one of the entry 

below is the normal type of an listener in admin/samples folder.

# LISTENER =
#  (ADDRESS_LIST=
#       (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
#       (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))


# SID_LIST_<lsnr>
#   List of services the listener knows about and can connect
#   clients to.  There is no default.  See the Net8 Administrator's
#   Guide for more information.
#
# SID_LIST_LISTENER=
#   (SID_LIST=
#       (SID_DESC=
#                       #BEQUEATH CONFIG
#          (GLOBAL_DBNAME=salesdb.mycompany)
#          (SID_NAME=sid1)
#          (ORACLE_HOME=/private/app/oracle/product/8.0.3)
#                       #PRESPAWN CONFIG
#         (PRESPAWN_MAX=20)
#         (PRESPAWN_LIST=
#           (PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
#         )
#        )
#       )


for tnsnames.ora

ocm=(description=(address=(protocol=tcp)(port=1521)(host=ocm)) 
                                   (connect_data=(service_name=ocm))
                                   (failover_mode=(type=select)(mode=basic)(retries=10)(delay=10)
          )

for tnsnames.ora, key word  description can't be omit  and just like tns , key word address_list always can be omited.  for fail_over see the text upper in red

a concludsion is that all the key words which contain "LIST" can be omited.  DESCRIPTION_LIST , ADDRESS_LIST 




FAILOVER_MODE Subparameter Description

BACKUP

Specify a different net service name for backup connections. A backup should be specified when using preconnect to pre-establish connections.

TYPE

Specify the type of failover. Three types of Oracle Net failover functionality are available by default to Oracle Call Interface (OCI) applications:

  • session: Set to failover the session. If a user's connection is lost, a new session is automatically created for the user on the backup. This type of failover does not attempt to recover selects.

  • select: Set to enable users with open cursors to continue fetching on them after failure. However, this mode involves overhead on the client side in normal select operations.

  • none: This is the default. No failover functionality is used. This can also be explicitly specified to prevent failover from happening.

METHOD

Determines how fast failover occurs from the primary node to the backup node:

  • basic: Set to establish connections at failover time. This option requires almost no work on the backup server until failover time.

  • preconnect: Set to pre-established connections. This provides faster failover but requires that the backup instance be able to support all connections from every supported instance.

RETRIES

Specify the number of times to attempt to connect after a failover. If DELAY is specified, RETRIES defaults to five retry attempts.

Note: If a callback function is registered, then this subparameter is ignored.

DELAY

Specify the amount of time in seconds to wait between connect attempts. If RETRIES is specified, DELAY defaults to one second.

Note: If a callback function is registered, then this subparameter is ignored.




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值