Host String

From Oracle FAQ
Jump to: navigation, search

A host string is the name you assign for TNS connectivity in tnsnames.ora. These entries typically identify the machine and port number and SID ( or service name) of the database you are trying to connect to.

If the client and database are on same machine, you don't need a host string.

The connect string, a synonym for host string, includes the opening and closing brackets, i.e. all the letters righthand of the equal-sign.

If you use it on commandlines from any shell in a Unix/Linux environment, it maybe necessary to embed the host string into apostrophes.

[edit] Example

Here is an example host string as defined in the system's tnsnames.ora file. The entry is named mutation, however you can name it anything you want:

bash-2.03$ tail -7  tnsnames.ora
mutation =
        (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = myhost )(PORT = 1521)))
        (CONNECT_DATA =
        (SERVICE_NAME = mutation))))