Page 1262
Figure 55.13.
SQL*Net 1 imple-
mented as a DLL.
I could discuss many issues regarding SQL*Net 1; however, because you might not even use this version of the software and it usually is transparent to developers and end users, I want to cover only one more topic: controlling and using SQL*Net 1. If you are using SQL*Net under Microsoft Windows 3.1 and everything is set up correctly on your computer, you load the SQL*Net software automatically when needed. On computers where SQL*Net is a background process, you have to ensure that the background process is running before you use SQL*Net.
The good news is that Oracle provides relatively simple-to-use utilities to determine the status of this background process, to start it, and to stop it. The bad news is that you have to know the name of the process and the way to access it. Process is a term that works under UNIX. Under Windows NT, the more proper term is service. Novell refers to Novell loadable modules (NLMs). For the name of the process (or service), you need to see what name your database administrator set up when installing the software. It also is important to know which utility controls the background process. Under Windows NT, you access the Services utility from the Control Panel to start up the service. Under UNIX, you use the tcpctl utility (with the start, stop, or status option) to work with the SQL*Net TCP/IP background process. Because such a wide variety of configurations is available, it is a good idea to check with your database administrator, systems administrator, or whoever installed your SQL*Net software.
The topic most interesting to the average user is using SQL*Net 1 to access remote databases. This process is relatively simple; all you have to do is specify the database address in the manner appropriate to your application. The SQL*Net 1 address is composed of three parts . The first part tells SQL*Net which protocol you are using (T = TCP/IP, P = named pipes, and so on). The second part of the address shows on which computer the desired database resides. In TCP/IP, for example, you can use an alias defined in the hosts table (such as marketing) or the Internet address of the server (such as 10.15.20.25). For the third part, you need to specify the SID (Oracle's system ID) for the database you want. The SID is set up by the DBA when creating the new database, so that person has to tell you the name of the SID.
SQL*Net 1 enables you to create aliases for your remote databases. It also enables you to define default local and remote databases that are accessed when the user does not specify the desired database. The following is a sample call to the SQL*Plus utility that accesses the jdoe account in the MKT Oracle instance on the marketing server using the TCP/IP protocol:
$ sqlplus jdoe@t:marketing:MKT
If you are using an upper middleware product such as ODBC, you define the SQL*Net 1 address to the ODBC administrator and then use the ODBC alias when you reference the data source
Page 1263
in your applications. Basically, your job is talking to ODBC. ODBC then is responsible for routing your request to the appropriate database.
If you understand the basic concepts of SQL*Net 1, you are well on your way to understanding SQL*Net 2. SQL*Net 2 is not really a revolution in the concept of how Oracle networks its products. It still interfaces directly with SQL*Plus and all the other Oracle tools (you do not even have to change any configuration files on those development products). It still interfaces to ODBC and OLE. The main differences between version 1 and version 2 follow: