Next Previous Contents

4. Ry8miste to SQL*Net toy Server

Ola ayta ta arxeia ry8mizoyn to logismiko diktuwshs ths Oracle (SQL*Net, twra Net8 for Oracle8). Ayta ta arxeia 8a prepei na exoyn hdh dhmioyrgh8ei sto server sto $ORACLE_HOME/network/admin directory.

4.1 tnsnames.ora

To arxeio TNSNAMES.ORA anagnwrizei tis dia8esimes yphresies ths mhxanhs. Sto stigmiotypo (instance) mas 8a perigracoyme oles tis baseis dedomenwn poy o server exei proskollhmenes. Gia ka8e ena stigmiotypo ths Bashs Dedomenwn (database instance) toy server sas, pros8este ena tmhma san to parakatw:


orcl.world =
  (DESCRIPTION =
    (ADDRESS_LIST =
        (ADDRESS =
          (COMMUNITY = tcp.world)
          (PROTOCOL = TCP)
          (Host = <INSERT HOST NAME OF SERVER HERE> )
          (Port = 1521)
        )
        (ADDRESS =
          (COMMUNITY = tcp.world)
          (PROTOCOL = TCP)
          (Host = <INSERT HOST NAME OF SERVER HERE> )
          (Port = 1526)
        )
    )
    (CONNECT_DATA = (SID = ORCL)
    )
  )

4.2 listener.ora

To arxeio listener.ora periexei tis perigrafes twn yphresiwn mas poy alles mhxanes epitrepetai na synde8oun me aytes, ka8ws kai opoiadhpote ru8mish poy apaiteitai apo ton listener toy server.

Periexei tmhma gia to onoma kai th dieu8ynsh toy listener, tis baseis dedomenwn poy ejyphretountai apo ton listener, ka8ws kai parametroys ru8mishs.

Na ena paradeigma:


# Name of listener and addresses to listen on
LISTENER =
        ( ADDRESS_LIST =
                (ADDRESS =
                        (PROTOCOL=tcp)
                        (HOST=<INSERT HOST>)
                        (PORT=1521)
                        (COMMUNITY=UK_SUP_TCPIP)
                )
                (ADDRESS =
                        (PROTOCOL=ipc)
                        (KEY=700)
                        (COMMUNITY=UK_SUP_TCPIP)
                )
        )

# List of services served by this listener
SID_LIST_LISTENER=
        (SID_LIST=
                (SID_DESC=
                        (SID_NAME=orcl)
                        (ORACLE_HOME=/home/oracle/7.3.3.0.0)
                )
        )

# Start of configuration parameters.
TRACE_LEVEL_LISTENER=OFF
TRACE_FILE_LISTENER = "listener"
LOG_FILE_LISTENER = "listener"
CONNECT_TIMEOUT_LISTENER = 10
STOP_LISTENER = YES
DBA_GROUP = dba

4.3 sqlnet.ora

To arxeio sqlnet.ora periexei ry8miseis gia enan sygkekrimeno kombo toy diktuoy. Ayto einai anejarthto toy ari8mou twn basewn h toy ari8mou twn listeners. To pio shmantiko pragma sto arxeio ayto einai h metablhth ry8misewn Dead Connection Timeout.

H Dead connection timeout elegxei ka8e eiserxomenh diergasia (process) pros ena stigmiotypo mias bashs dedomenwn kai bebaiwnei pws to meros toy pelath (client) antapokrinetai akoma. An o pelaths (anejarthtws tupoy) den antapokrinetai tote h Oracle server shadow process skotwnetai (kill).

Ayto einai polu xrhsimo Ean exete pollous pelates poy kanoyn prosbash sth bash dedomenwn, eidika se fash anaptyjhs opoy aytoi oi pelates einai pi8ano na apotygxanoyn na bgoyn omala (exit cleanly) apo thn B.D. ths Oracle.

Parakatw einai ena antigrafo toy arxeioy moy sqlnet.ora gia na xrhsimopoihsete:


TRACE_LEVEL_CLIENT = OFF
sqlnet.expire_time = 30         # The number of seconds between client checks.
names.default_domain = world
name.default_zone = world

4.4 Ekkinhsh kai Termatismos twn Listeners

Twra poy oi ry8miseis twn listeners kai toy SQL*Net oloklhrw8hkan, mporoume na epixeirhsoyme na synde8oume sth bash, xrhsimopoiwntas to logismiko diktuwshs. (Prin, syndeomastan me apey8eias sundesh sth bash, enw edw prosomoiwnoyme mia sundesh apo mia apomakrysmenh mhxanh pelath)

Gia na arxisoyme ton listener me tis parapanw ry8miseis:


$ lsnrctl

LSNRCTL for SCO System V/386: Version 2.3.3.0.0 - Production on 23-FEB-98 20:38:25

Copyright (c) Oracle Corporation 1994.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> start
Starting /home/oracle/7.3.3.0.0/bin/tnslsnr: please wait...

TNSLSNR for SCO System V/386: Version 2.3.3.0.0 - Production
System parameter file is /home/oracle/7.3.3.0.0/network/admin/listener.ora
Log messages written to /home/oracle/7.3.3.0.0/network/log/listener.log
Listening on: (ADDRESS=(PROTOCOL=tcp)(DEV=6)(HOST=192.168.1.1)(PORT=1521))
Listening on: (ADDRESS=(PROTOCOL=ipc)(DEV=10)(KEY=700))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=magic.com)(PORT=1521)(COMMUNITY=UK_SUP_TCPIP))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for SCO System V/386: Version 2.3.3.0.0 - Production
Start Date                23-FEB-98 20:38:50
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  OFF
SNMP                      ON
Listener Parameter File   /home/oracle/7.3.3.0.0/network/admin/listener.ora
Listener Log File         /home/oracle/7.3.3.0.0/network/log/listener.log
Services Summary...
  orcl          has 1 service handler(s)
The command completed successfully
LSNRCTL> exit

Gia na termatisoyme toys listeners:


$ lsnrctl

LSNRCTL for SCO System V/386: Version 2.3.3.0.0 - Production on 23-FEB-98 20:43:20

Copyright (c) Oracle Corporation 1994.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> stop
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=magic.com)(PORT=1521)(COMMUNITY=UK_SUP_TCPIP))
The command completed successfully
LSNRCTL> exit

An exete mia sthsei ena DNS poy den epistrefei th dieu8ynsh IP gia to hostname poy dhlwsate, h enarjh kai o termatismos toy listener mporei na parei kapoia wra (2-3 lepta. ejartwmeno apo thn timh metablhths toy xronoy lhjhs toy DNS). An ayto symbainei, mhn anhsyxeite, exete ypomonh.


Next Previous Contents