7.2 Managing a Names Server

Team-Fly    

 
Oracle Net8 Configuration and Troubleshooting
By Jonathan  Gennick , Hugo Toledo
Table of Contents
Chapter 7.  Oracle Names


Oracle Names servers can be managed using either Net8 Assistant's GUI interface or the Names Control utility. Names servers may also be managed remotely. By that we mean that it's possible for one machine to manage a Names server on a remote machine.

7.2.1 The Names Control Utility

Names Control is a command-line interface that is, in many respects, similar to the Listener Control utility. You invoke Names Control using the command namesctl , as shown in this example:

 [oracle@donna names]$  namesctl  Oracle Names Control for Linux: Version 8.1.6.0.0 -  Production on 30-JUL-2000 17:52:04 (c) Copyright 1998, 1999, Oracle Corporation.  All rights reserved. Currently managing name server "oranamesrvr1" Version banner is "Oracle Names for Linux: Version 8.1.6.0.0 - Production" Welcome to NAMESCTL, type "help" for information. NAMESCTL> 

From the Names Control prompt, you can issue commands to manage your Names servers. Use the HELP command to get help and either the QUIT command or the EXIT command to exit the utility.

Like Listener Control, Names Control also supports the execution of commands directly from the operating-system command prompt. When you invoke the Names Control utility, you can follow the namesctl command with any valid Names Control command. Names Control will start, execute the command that you specified, and immediately exit. For example:

 [oracle@donna names]$  namesctl PING oranamesrvr0.gennick.org  Oracle Names Control for Linux: Version 8.1.6.0.0 - Production on 30-JUL-2000 18:00:37 (c) Copyright 1998, 1999, Oracle Corporation.  All rights reserved. Currently managing name server "oranamesrvr1" Version banner is "Oracle Names for Linux: Version 8.1.6.0.0 - Production" Round trip time is 0.02 seconds [oracle@donna names]$ 

In this example, the Names Control PING command was used to verify connectivity to another Names server on the network.

The Names server that Names Control is "currently managing" may not correspond to the Names server that you are pinging. This is nothing to be concerned about.

Names Control also allows you to execute script files by using the @ command. For example:

 [oracle@donna names]$  namesctl @load_service_names  NAMESCTL> @load_service_names 

Both of these commands cause the commands in the filename load_service_names to be executed. In the first example, Names Control is invoked from the operating-system prompt, and the @ command is supplied as part of the command line. In the second example, the @ command is issued from the Names Control utility's prompt.

7.2.2 Remote Management and Security

For the most part, Oracle Names servers may be managed remotely. You can sit down at any machine, run Names Control, connect to a remote Names server, and issue commands against it. The major exception is that when starting a Names server, you do need to issue the START command from the host machine's command prompt.

Before you attempt to manage Names servers remotely, read Section 7.3 later in this chapter. In order to manage remote Names servers, your client must "know" about them. Usually that means going through the discovery process.

Whenever you invoke Names Control, it sets itself to manage your primary Names server. This can sometimes be a bit counterintuitive, because even if you have a Names server running on the machine to which you are connected, your primary Names server could well be on some other machine. The primary Names server is the one listed first in your sdns.ora file ( .sdns.ora on Unix) or in the NAMES.PREFERRED_SERVERS setting in your sqlnet.ora file. Names Control will tell you which server it is managing when you first start it. Pay attention to that message.

7.2.2.1 The SET SERVER command

When you first invoke Names Control, it sets itself to manage your primary Names server. This may or may not be the one that you want to deal with at the time, but you can use the SET SERVER command to point Names Control to another Names server. For example:

 [oracle@donna names]$  namesctl  Oracle Names Control for Linux: Version 8.1.6.0.0 -  Production on 31-JUL-2000 11:20:33 (c) Copyright 1998, 1999, Oracle Corporation.  All rights reserved. Currently managing name server "ORANAMESRVR0.GENNICK.ORG" Version banner is "Oracle Names for 32-bit Windows: Version 8.1.6.0.0 - Production" Welcome to NAMESCTL, type "help" for information. NAMESCTL>  SET SERVER oranamesrvr1.  Currently managing name server "oranamesrvr1" Version banner is "Oracle Names for Linux: Version 8.1.6.0.0 - Production"     NAMESCTL> 

In this example, the primary Names server was ORANAMESRVR0.GENNICK.ORG. Consequently, when Names Control started, it came up ready to manage that server. The SET SERVER command was used to point Names Control to a different Names server: ORANAMESRVR1. Thus all subsequent commands will now affect this new Names server.

Names Control always uses Oracle Names to resolve the Names server names that you use with the SET SERVER command. If no Names server is currently running, you won't be able to successfully issue the SET SERVER command. If the Names server that your client is currently using for names resolution does not know about the Names server to which you are connecting, that will also cause your SET SERVER command to fail.

7.2.2.2 Other ways to specify server names

Most, but not all, Names Control commands provide the option of specifying the name of a specific Names server as a parameter to the command. When this is the case, the Names server name is always the final parameter. You can specify one server name or a list of server names. Use spaces to separate the names in a list. For example:

 STOP oranamesrvr0.gennick.org STOP oranamesrvr0.gennick.org oranamesrvr1. 

Check the online help to see whether or not a specific Names Control command allows you to specify a server name.

7.2.2.3 Names server passwords

Because Names servers can be managed remotely, you need to establish some level of security to prevent just anyone with Names Control installed from being able to manage and make changes to your Names servers. By default, there is no security. Anyone who happens to have Names Control installed (and that's an easy utility to get) can cause havoc by stopping a Names server or by performing some other sensitive management function. To guard against the possibility of such a disruption, you can set a password for each of your Names servers.

Names server passwords must be set using the Net8 Assistant; they cannot currently be set from the command line using Names Control. Figure 7.12 shows the Net8 Assistant tab where Names server passwords are defined.

Figure 7.12. The Names server password definition tab
figs/n8c_0712.gif

When you define a password for a Names server, that password is encrypted and recorded in the names.ora file. The NAMES.PASSWORD entry is used, and the following example shows the encrypted version of the password mosquito :

 NAMES.PASSWORD = DF25FEF80B71DE38 

It is impossible to use an unencrypted password value with the NAMES.PASSWORD parameter. You can try, but Oracle Names always considers any value for NAMES.PASSWORD as an encrypted value.

Once you've defined a password for a Names server, you need to supply that password to perform any "sensitive" operations. The STOP command, for example, represents a sensitive operation. If you're using Net8 Assistant, you'll see a Set Password button at the bottom of any tabs used to perform such operations (see Figure 7.13).

Trying to define a password in the clear (unencrypted) will only lead to your being unable to manage your Names server after you start it. That's because you won't be able to enter a password that encrypts to match the unencrypted string in names.ora . Always use Net8 Assistant to define and encrypt passwords.

From the Names Control utility, use the SET PASSWORD command to set a password before performing management functions. For example:

 NAMESCTL>  STOP  Confirm [yes or no]:  yes  NNL-00013: not performed, permission denied for supplied password NAMESCTL>  SET PASSWORD mosquito  NAMESCTL>  STOP  Confirm [yes or no]:  yes  Server shutting down 

Names server passwords are not case-sensitive. In our example, either "mosquito" or "MOSQUITO" could be used.

Names Control also implements a PASSWORD command that is supposed to be equivalent to SET PASSWORD. However, in the 8.1.6.0.0 release, the PASSWORD command does not function correctly.

Oddly enough, it's possible to use the REGISTER and UNREGISTER commands to add or delete net service name definitions without having to supply the Names server's password. The security that you get by using a password is not as good as you might hope for.

7.2.3 Starting and Stopping a Names Server

Starting and stopping a Names server is a basic task. You need to start a Names server, of course, before anyone can use it.

If you are using a region database as a repository for net service names, you need to be sure that you start that database before starting the Names server. You also need to start the listener for the region database. It won't do any good to start a Names server when it can't connect to a region database in order to look up net service name definitions.

7.2.3.1 Using Net8 Assistant

To start a Names server using Net8 Assistant, open the Oracle Names Servers folder, click on the name of the Names server that you want to start, and make sure that you see the Control tab in the right-hand pane. You may experience a delay of a few seconds when you click on the Names server name in the left pane, as Net8 Assistant attempts to query the Names server for its current status. It takes a few seconds for that query to time out. Figure 7.13 shows the Net8 Assistant ready to start the Names server named NS1.GENNICK.ORG.

Figure 7.13. Preparing to start a Names server
figs/n8c_0713.gif

Notice that on the top half of the right-hand pane the radio button next to Start is highlighted. At the bottom, the Perform Operation Immediately radio button is selected. These two selections are the only choices you have when first starting a Names server.

To start the server, just click the Apply button at the bottom of the pane. The Names server will start, which may take a few seconds, and you'll get a confirmation dialog.

Once you start a Names server, the Shutdown and Restart radio buttons are enabled. To stop a Names server, highlight the Shutdown radio button and click Apply. When you stop a Names server, you can optionally specify a delay using the Wait radio button. If you want the server to stop right away, use Immediately.

7.2.3.2 Using Names Control

Using the Names Control utility, you can start and stop a Names server from the command line. You can only start a Names server if it's on your local machine, but you can stop a Names server running on a remote machine.

The following example shows the START command being used to start a Names server. The error message "could not contact the default name server" occurs because no Names server is running to begin with. Just ignore it, and proceed to issue the START command:

 [oracle@donna oracle]$  namesctl  Oracle Names Control for Linux: Version 8.1.6.0.0 -  Production on 28-JUL-2000 11:49:35 (c) Copyright 1998, 1999, Oracle Corporation.  All rights reserved. NNL-00018: warning: could not contact default name server Welcome to NAMESCTL, type "help" for information. NAMESCTL>  START  Starting "/s01/app/oracle/product/8.1.6/bin/names"...server successfully started Currently managing name server "oranamesrvr1" Version banner is "Oracle Names for Linux: Version 8.1.6.0.0 - Production" Server name:                              oranamesrvr1 Server has been running for:              0.97 seconds ... 

Names Control automatically displays the status of the Names server after starting it, so you'll see a lot of output showing the various settings in effect for the server that you just started.

Use the STOP command to stop a Names server. By itself, STOP operates on the Names server that you are currently managing. To stop a different Names server, pass the server name as a parameter to the STOP command. The following example shows STOP being used to shut down the remote Names server named oranamesrvr1:

 NAMESCTL>  STOP oranamesrvr1.  Confirm [yes or no]:  yes  Server shutting down 

Notice in this example that the name of the Names server to stop was followed by a period. That's because our default domain (as specified by NAMES.DEFAULT_DOMAIN in sqlnet.ora ) was gennick.org . The trailing period prevents that default domain from being appended to our Names server name.

By default, the Names Control utility asks you to confirm all sensitive operations. Sensitive operations are those that affect the availability of the Names server to your usersstopping a Names server definitely falls into that category. You can use the NAMESCTL.NOCONFIRM setting in your sqlnet.ora file to disable the confirmation feature. See Appendix A, for details.

7.2.4 Checking Names Server Status

You can check the status of a Names server to see if it is running, how long it has been running, and how many requests it has processed since it was started.

7.2.4.1 Using Net8 Assistant

To check the status of a Names server using Net8 Assistant, open the Oracle Names Servers folder, and click on the name of the Names server. Then, in the right-hand pane, select Manage Server from the drop-down listbox. Finally, select the Monitor tab. You'll see the status as shown in Figure 7.14.

Figure 7.14. Checking the status of a Names server
figs/n8c_0714.gif

Click the Statistics radio button to see statistics regarding the number of requests processed by the Names server. Click the Schedule of Operations radio button to see if any operations have been scheduled.

7.2.4.2 Using Names Control

From Names Control, you can use the STATUS command to check the current status of a Names server. For example:

 NAMESCTL>  STATUS  Version banner is "Oracle Names for 32-bit Windows: Version 8.1.6.0.0 - Production" Server name:                              ORANAMESRVR0.GENNICK.ORG Server has been running for:              1 minute 52.31 seconds Request processing enabled:               yes Request forwarding enabled:               yes Requests received:                        2 Requests forwarded:                       0 Foreign data items cached:                0 Region data next checked for reload in:   23 hours 58 minutes 8.16 seconds Region data reload check failures:        0 Cache next checkpointed in:               not set Cache checkpoint interval:                not set Cache checkpoint file name:               E:\Oracle\Ora81\network\names\ckpcch.ora Statistic counters next reset in:         not set Statistic counter reset interval:         not set Statistic counters next logged in:        not set Statistic counter logging interval:       not set Trace level:                              0 Trace file name:                          E:\Oracle\Ora81\network\trace\names_387.                                           trc Log file name:                            E:\Oracle\Ora81\network\log\names.log System parameter file name:               E:\Oracle\Ora81\network\admin\names.ora Command-line parameter file name:         "" Administrative region name:               root Administrative region description:        (DESCRIPTION=(SOURCE_ROUTE=OFF)(ADDRES S_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=donna.gennick.org)(PORT=1523)))(CONNECT_ DATA=(SID=donna)(Server=Dedicated))) ApplTable Index:                          0 Contact                                   "" Operational Status                        0 Save Config on Stop                       no 

As with most commands, you can optionally follow the STATUS command with the name of a specific Oracle Names server. For example:

 NAMESCTL>  STATUS oranamesrvr1.  Version banner is "Oracle Names for Linux: Version 8.1.6.0.0 - Production" Server name:                              oranamesrvr1 Server has been running for:              4 minutes 56.66 seconds . . . 

7.2.5 Defining Net Service Names

The core purpose of Oracle Names is to resolve net service names. In order for it to do that, you must first define any net service names that you want to use. If you already have a tnsnames.ora file with net service name definitions, you can import those definitions into Oracle Names. Section 7.2.6 explains how to do that. Loading net service names from tnsnames.ora is usually a one-time operation. On an ongoing basis, you'll find yourself defining names one at a time using either Net8 Assistant or Names Control.

7.2.5.1 Using Net8 Assistant

Net8 Assistant's GUI interface is a bit unusual, and it takes some practice before you get used to using it to add net service names to your Names server. To start with, you need to go to the Manage Data pane for your Names server, and select the Net Service Names tab. Then click the Add radio button and fill in the address information. Figure 7.15 shows the service name donna being defined.

Figure 7.15. Defining a net service name
figs/n8c_0715.gif

Here are some key things to understand about how net service name definition works using the Net8 Assistant:

  • Nothing happens until you click the Execute button in the upper-right corner of the tab.

  • The button in the right-hand pane with the plus (+) icon is used to add more addresses to a net service name, not to add more net service names.

  • The net service name will pick up the default domain as defined by the NAMES.DEFAULT_DOMAIN parameter in your sqlnet.ora file.

When you have entered all the details needed for the net service name definition, click the Execute button to add the name. After adding a name, it's a good idea to click the Query radio button and review the definition to be sure that it is correct. Figure 7.16 shows the results of a query on the name donna .

Figure 7.16. Viewing the definition of a net service name
figs/n8c_0716.gif

When you switch to Query immediately after doing an add, Net8 Assistant will display the definition of the name that you just added. The display will be in tnsnames.ora format.

You can query for a specific name at any time by following these steps:

  1. Click the Query radio button.

  2. Type the net service name of interest into the Service Name field.

  3. Click the Execute button.

It's very important that you remember to click the Execute button. Until you click Execute, the Addresses box will display the data from your previous query.

To remove a net service name definition, follow these steps:

  1. Query for the name.

  2. Click to highlight the address returned by the query.

  3. Click on the Remove radio button.

  4. Click the Execute button.

The important thing to remember when deleting is that you can't just type in a name and delete it. You must have queried for the name, and you must have the address highlighted. Only then can you remove the definition.

7.2.5.2 Using Names Control

With the Names Control utility, you can use the REGISTER command to define new net service names. UNREGISTER lets you delete a definition, while QUERY lets you look at one.

When you register a name with a Names server, you need to specify both a type and an address. The following example shows the net service name test being defined to point to the database donna.gennick.org :

 NAMESCTL>  REGISTER test -t oracle_database -d (DESCRIPTION=(ADDRESS=   (PROTOCOL=TCP)(HOST=donna.gennick.org)(PORT=1523))(CONNECT_DATA=   (SERVICE_NAME=donna.gennick.org)))  Total response time:   0.03 seconds Response status:       normal, successful completion 

The type in this example is ORACLE_DATABASE, which defines net service names used to connect to a database. Other valid type codes are ORACLE_LISTENER and ORACLE_NAMESERVER. They are used to define listeners and Names servers, respectively.

Use UNREGISTER to remove a definition from the Names server. To unregister a name, you need to pass both the type and the description. Use UNREGISTER, as shown in the following example, to delete the previous definition of test :

 NAMESCTL>  UNREGISTER test -d (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)   (HOST=donna.gennick.org)(PORT=1523))(CONNECT_DATA=(SERVICE_NAME=   donna.gennick.org)))  Total response time:   0.03 seconds Response status:       normal, successful completion 

The UNREGISTER command is case-sensitive. The description that you pass to UNREGISTER must match exactly, character-for-character, the description as it was originally registered. If the descriptions do not match, no error will be returned, and the name will remain registered.

You can use the QUERY command to query a Names server in order to see the definition for a name. To get any meaningful information back from the QUERY command, you need to specify both a name and a type. Annoyingly, the type codes that you use with QUERY are not the same as those you use with REGISTER. To query for a net service name definition, use a type code of a.smd as shown in this example:

 NAMESCTL>  QUERY test a.smd  Total response time:   0 seconds Response status:       normal, successful completion Authoritative answer:  yes Number of answers:     1 TTL:                   1 day Answers:     data type is "a.smd"         Syntax is ADDR:         ...(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=donna.gennick.org)            (PORT=1523))(CONNECT_DATA=(SERVICE_NAME=donna.gennick.org))) 

Table 7.1 describes the possible type codes that you can use with the QUERY command.

Table 7.1. QUERY Type Codes

Type Code

Description

a.smd

Net service names

cname.smd

Aliases

dl.rdbms.omd

Global database links

dlcr.rdbms.omd

Global database link qualifiers

ns.smd

Oracle Names server addresses

If you query on a name without entering the type, you'll get a response status of "normal, successful completion" to tell you that the name is valid, but you won't see the definition behind the name.

7.2.6 Loading and Unloading Net Service Names

If you're making the transition from using atnsnames.ora files to Oracle Names, you can take advantage of Oracle Names' ability to import net service name definitions from those files. Beginning with the 8.1 releases, you can even export net service name definitions to a tnsnames.ora file.

7.2.6.1 Using Net8 Assistant

To load definitions from a tnsnames.ora file using Net8 Assistant, go to the Manage Data figs/u2192.gif Net Service Names tab. From there, click the Load radio button. Once you do that, you're able to browse for the file you want to load. Figure 7.17 shows the tab with a filename already entered.

Figure 7.17. Importing a tnsnames.ora file
figs/n8c_0717.gif

Once you've selected the file to import, click the Execute button. Net8 Assistant reads the file, and any net service name definitions found in the file are loaded into Oracle Names.

As of Release 8.1.6, Net8 Assistant does not have the ability to export definitions to a tnsnames.ora file. For that you must use the Names Control utility.

7.2.6.2 Using Names Control

From the command line, you can use the Names Control utility's LOAD_TNSNAMES command to load net service names from a tnsnames.ora file. For example:

 NAMESCTL>  LOAD_TNSNAMES e:\oracle\ora81\network\admin\tnsnames.ora  Name:                  HERMAN_IPC_T.GENNICK.ORG Response status:       normal, successful completion Name:                  DONNA_DED_T.GENNICK.ORG Response status:       normal, successful completion Name:                  HERMAN_T.GENNICK.ORG Response status:       normal, successful completion Name:                  DONNA_T.GENNICK.ORG Response status:       normal, successful completion Name:                  HERMAN_DED_T.GENNICK.ORG Response status:       normal, successful completion 

The ability to load net service names from a tnsnames.ora file is most useful in a situation where you are migrating from using local naming to using Oracle Names.

With Names Control, you also have the option of using the DUMP_TNSNAMES command to write net service name definitions to a tnsnames.ora file. Be careful, because implementation of this command has been buggy . In some releases of Oracle Names, it doesn't work at all. Chapter 11, describes some of the problems you might encounter when trying to use DUMP_TNSNAMES.


Team-Fly    
Top


Oracle Net8 Configuration and Troubleshooting
Oracle Net8 Configuration and Troubleshooting
ISBN: 1565927532
EAN: 2147483647
Year: 2000
Pages: 120

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net