How do I set up SQL/NET on VMS?

First, set up the LISTENER.ORA configuration file which defines the databases for which the listener will serve. The format of this file is well documented elsewhere and will look something like :

#LISTENER.ORA
LISTENER=
        (ADDRESS_LIST=
                (ADDRESS=
                        (PROTOCOL=TCP)
                        (HOST=LIVE)
                        (PORT=1526)
                )
        )
SID_LIST_LISTENER=
        (SID_LIST=
                (SID_DESC=
                        (SID_NAME=SALES)
                        PROGRAM='DUA0:[ORACLE7.NETWORK.ADMIN]SRV_SALES.COM')
                )
        )

When a server connection is initiated, the commands specified in the program file pointed at by the PROGRAM qualifier are executed. This file must set up the Oracle environment and start the server process. It is important to keep this file as small as possible to reduce initial connection time when connecting from clients.

An example program file is shown below:

$ PID=F$GETJPI("","PID")
$ TAB="TNS_"+PID
$ ON ERROR GOTO FINISH
$!
$ DEFINE ORA_SID SALES     ! The database name
$!
$ DEFINE ORA_SYSTEM     DUA0:[ORACLE7.RDBMS]
$ DEFINE ORA_RDBMS      DUA0:[ORACLE7.RDBMS]
$ DEFINE ORA_COMMON DUA0:[ORACLE7.RDBMS]
$ DEFINE ORA_DUMP       DUA0:[ORACLE7.TRACE]
$ DEFINE TNS_ADMIN      DUA0:[ORACLE7.NETWORK.ADMIN]
$!
$ ORASRV := $ORA_SYSTEM:SRV.EXE
$ ORASRV "(LOCAL=NO)"
$!
$FINISH:
$ STAT = $STATUS
$ ON ERROR THEN CONTINUE
$ DEASSIGN/USER/TABLE=LNM$SYSTEM_DIRECTORY 'TAB'
$ EXIT STAT

There are three commands to control the listener process:

$ LSNRCTL START         - start the listener
$ LSNRCTL STATUS        - return listener status
$ LSNRCTL STOP          - close the listener

The LSNRCTL START command should be included in the system startup file if you require SQL/NET to be started automatically on VMS startup.