The SQLHOSTS File on VMS and Linux

This appendix applies to the OpenVMS and Linux/macOS platforms only.

It describes the SQLHOSTS file which is used to list all the databases that are accessible to a Mimer SQL application from the node on which it resides.

For general information on how to make databases accessible, refer to Registering the Database.

Linux:On a Linux node, the path name of SQLHOSTS file is /etc/sqlhosts.

The program called mimsqlhosts can be used to manage the contents of the SQLHOSTS file instead of editing it manually.

When the dbinstall program is used to install a local database on a Linux node, an entry for it is automatically added to the LOCAL section, see LOCAL Section, of the SQLHOSTS file on that node.

If the file is not found, a default SQLHOSTS file is automatically generated. (See the mimhosts and sqlhosts man-pages).

VMS:On an OpenVMS node, the SQLHOSTS file can have any name and is located by translating the logical name MIMER_SQLHOSTS. The MIMSETUP command will define it to be:

SYS$SPECIFIC:[SYSMGR]SQLHOSTS.DAT

 

A default SQLHOSTS file is generated by the installation of the Mimer SQL software.

The SQLHOSTS File

A line of text beginning with the character sequence -- is interpreted as a comment in the SQLHOSTS file.

The SQLHOSTS file contains three sections, called: DEFAULT, LOCAL and REMOTE.

The names of the local databases on the current node are listed in the LOCAL section, see LOCAL Section and the names of the remote databases accessible from the node are listed in the REMOTE section, see REMOTE Section.

One of the local or remote databases can be set to be the default database for the node by specifying its name in the DEFAULT section, see Default Section.

Database names may, in general, be up to 128 characters long and are case-insensitive.

VMS:The maximum length for the name of a database on an OpenVMS node is 30 characters.

The Default SQLHOSTS File

When the Mimer SQL system is installed on a node, the following default SQLHOSTS file is automatically generated:

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

--

--  S Q L H O S T S

--  ===============

--

--  This file contains a list of all databases, local and remote, accessible

--  from the node where the file resides.

--

--  The DEFAULT label

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

--  Name of default database. Can be either a REMOTE or LOCAL database name.

--  Can be overridden by setting MIMER_DATABASE to the name of a database.

--

--  The LOCAL label

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

--  A list of all local databases on the current node, containing the

--  database name and a directory specification (Path).

--  UNIX Path -     database home, and directory path for databank lookup.

--  VMS Path -     database home.

--

--  The REMOTE label

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

--  A list of all remote databases containing the database name, the database

--  node, the protocol to be used, the protocol interface and the protocol

--  service to be used.

--

--  Protocol, Interface and Service may be defaulted by entering ''.

--

--  Node -      network node name for computer on which the database resides.

--  Protocol -  currently tcp is supported. (tcp or '' should be specified)

--  Interface - currently not used ('' should be specified).

--  Service -   corresponds to the port number used in TCP/IP. The port number

--              Default is 1360, i.e. the port number reserved for MIMER.

--              On UNIX: The port number may either be a number or a name of a

--              service stored in the /etc/services file.

--

-- =============================================================================

DEFAULT:

--

-- Database

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

  example_localdb

-- =============================================================================

LOCAL:

--

-- Database           Path

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

(Linux)      SINGLE             .

(VMS)       SINGLE             SYS$DISK:[]

(Linux)     example_localdb    /directory

(VMS)       example_localdb    DISK:[DIRECTORY]

-- =============================================================================

REMOTE:

--

-- Database           Node               Protocol Interface Service

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

   example_remotedb   server_nodename    ''       '' 1360

 

Default Section

The DEFAULT section contains a single line that specifies the default database which will be used by an application that does not explicitly specify a database to connect to, see The Default Database.

The default database should be one of those listed in the LOCAL or REMOTE sections.

LOCAL Section

The LOCAL section contains a list of all the local databases residing on the current machine, see The Local Database.

Each line under the LOCAL keyword should contain two fields, separated by one or more blanks or tab characters. The first field specifies the database name.

Linux:On a Linux node, the second field may be a colon (:) separated search path specification.

The first directory in the search path is taken as the database home directory and the other directories in the search path will be used to locate databank files which have a file specification stored in the data dictionary without an explicit directory.

 

VMS:On an OpenVMS node, the second field specifies a directory which will be the home directory for the database.

The Mimer SQL system databank SYSDB will be located in the database home directory and other databanks will typically be located relative to it, see Locating Databank Files.

REMOTE Section

The REMOTE section contains a list of all accessible databases that reside on other nodes in the network environment, see Accessing a Database Remotely.

Access to these databases is provided by using either DECNET or TCP/IP to establish a client/server connection to the remote machine.

Each entry in the REMOTE section contains up to five fields, separated by spaces and/or tab characters.

The DATABASE field specifies the name of the remote database.

The NODE field should specify the network node name of the remote machine. If the
TCP/IP interface is used, the IP address may be specified here.

Linux:The PROTOCOL field should specify tcp or two single quotation marks ''.

 

VMS:The PROTOCOL field may specify DECNET or TCP depending on the type of network protocol that should be used to create the client/server connection. The default, specified by two single quotation marks '', is TCP.

The INTERFACE field is currently not used. Specify '' (two single quotation marks) here.

If using TCP/IP, the SERVICE field specifies the TCP/IP port number the database server uses. The default is 1360, which has been reserved by Mimer Information Technology AB for Mimer SQL client/server communication.

Linux:When TCP/IP is used under Linux, the value in the SERVICE field may be the actual port number, the name of a service stored in the /etc/services file or two single quotation marks '' for the default value 1360.

 

VMS:For a Mimer SQL database server using DECNET, the SERVICE field should contain the database name, which is also the default.

The server listens to the network object using the same name as the database.

 

Remote Section Parameters

The remote section parameters are summarized below, depending on the protocol selected. The character sequence '' is two single quotation marks and specifies the default value for a parameter:

TCP - Linux

Parameter

Explanation

DATABASE

Remote database name

NODE

TCP/IP node name or IP number

PROTOCOL

'' or TCP

INTERFACE

''

SERVICE

TCP/IP_port_number or TCP/IP service name or ''.

When '' is used to specify the default SERVICE, the TCP/IP port number 1360 will be used.

 

TCP - OpenVMS

Parameter

Explanation

DATABASE

Remote database name

NODE

TCP/IP node name or IP number.

If the name is preceded by an '@' character, a logical name lookup will be made on the name and the translation will be used to specify the node name.

PROTOCOL

Specify either TCP or two single quotation marks ''.

INTERFACE

Specify either a list of connection options, separated by commas, or two single quotation marks ''.

The connection options are:

IP=4:
Use IPv4 only

IP=6:
Use IPv6 only

MEMBER=node:
Terminate connection whenever the specified node leaves the cluster. The node name can be preceded by an '@' character which will cause a logical name lookup to be performed on the name.

SERVICE

TCP/IP port number or TCP/IP service name or ''.

When '' is used to specify the default SERVICE, the TCP/IP port number 1360 will be used.

 

DECNET – OpenVMS Only

Parameter

Explanation

DATABASE

Remote database name

NODE

Decnet node name

PROTOCOL

DECNET

INTERFACE

''

SERVICE

Decnet network object or ''.

When '' is used to specify the default SERVICE, the value of remote database name will be used.