您的位置:首页 > 其它

the simplest sample of listener.ora and tnsnames.ora

2013-04-28 13:51 417 查看
 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)) 

                     
4000
             (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 SubparameterDescription
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐