7.1 Configuring a Names Server

Team-Fly    

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


To configure an Oracle Names server, you need to do the following:

  1. Check to be sure that the Oracle Names software is installed.

  2. Create a repository database.

  3. Define the Names server in your names.ora file.

  4. Start the server, and test it.

We're not going to describe the installation of the Oracle Names software in this book because the process for installing Oracle Names is no different from any other Oracle component. Chances are good that you already have Oracle Names on your server as a result of installing Net8 along with the database software. If you have any doubts , you should run the Universal Installer, list the installed products, and look to see if Oracle Names is on the list. Figure 7.1 shows Oracle Names on the list of installed products. If for some reason Oracle Names is not installed, you should install it.

Figure 7.1. Oracle Names on the list of installed products
figs/n8c_0701.gif

Oracle recommends that Oracle Names run on its own server, separate from the database server. While ideal, that's not entirely necessary. You can run Oracle Names on a server along with a database.

All the configuration instructions in this chapter assume the use of Oracle Names Version 8.1.x. The process for configuring older versions of Oracle Names is completely different.

7.1.1 Creating the Repository Database

If you are going to use an Oracle database as your Oracle Names repository, you should create a small database specifically for that purpose. Don't mix the Oracle Names repository with your production database. The repository database can run on the same machine as the Oracle Names server, or it can be on a different machine. Either approach will work equally well.

Once you've created a database for use as a repository, you need to prepare it for use with Oracle Names by doing the following:

  1. Create a user to own the repository tables.

  2. Run the Oracle-supplied script to create the repository tables.

The user that you create in Step 1 will not only own the repository tables, it will also be used by the Oracle Names software when it connects to the repository database.

It is possible to configure a Names server to store name definitions in a checkpoint file rather than in a database, but we recommend using a small database because it provides a more stable solution.

7.1.1.1 Creating the repository user

Before you create the repository user, you should create a tablespace to contain the repository tables. The examples in Oracle's Net8 manual show the USERS tablespace being used for that purpose, but we prefer to place the repository tables into their own tablespace. Size is not too critical. A few megabytes should be enough, unless you have an extremely large number of net service names to define. Only one tablespace is needed. By default, none of the repository tables is indexed.

You can use any username and password that you like when you create the repository user. The user will need a quota on the repository tablespace, as well as the following system privileges:

CREATE TABLE
CREATE SYNONYM
CREATE SESSION

The following example shows a tablespace named names_data being created for the repository, followed by the creation of a repository user named onames:

 SQL>  CREATE TABLESPACE names_data  2  DATAFILE '/s01/app/oracle/oradata/donna/names_data01.dbf'  3  SIZE 5M;  Tablespace created. SQL>  CREATE USER onames IDENTIFIED BY chapel_rock  2  DEFAULT TABLESPACE names_data  3  TEMPORARY TABLESPACE temp  4  QUOTA UNLIMITED ON names_data;  User created. SQL>  GRANT CREATE TABLE, CREATE SYNONYM, CREATE SESSION  2  TO onames;  Grant succeeded. 

After creating the repository user, you can run the script to create the repository tables.

7.1.1.2 Creating the repository tables

Oracle supplies a script named namesini.sql to create the tables for the Oracle Names repository. You can find this script in your $ORACLE_HOME/network /admin directory. To run the script, log in to SQL*Plus as the repository owner (onames in our examples). Then use the SQL*Plus @ command to execute the script. For example:

 SQL>  connect onames/chapel_rock  Connected. SQL>  @$ORACLE_HOME/network/admin/namesini  

The output that you get from running this script is not very remarkable . The script creates some tables and synonyms and inserts some rows into the tables. If for some reason you need to run namesini.sql a second time, you should consider running namesdrp.sql first. The namesdrp.sql script drops the objects that namesini.sql creates. Running namesini.sql twice in succession without dropping the objects results in duplicate rows being inserted into some of the repository tables.

7.1.2 Defining the Names Server

With the repository created, your next step is to define a Names server. This involves writing several entries to the names.ora file in your $ORACLE_HOME /network /admin directory. Before you start, you should do the following:

  • Decide on a name for the Names server that you are creating. Use ORANAMESRVR0 if no other ideas come to mind.

  • Choose a protocol address for the Names server to use. If you're running over TCP/IP, use port 1575 unless you have a specific reason to do otherwise .

  • Make sure you know the listener protocol address for the database containing the repository.

  • Make sure you know the database username and password for the repository owner.

The easiest way to define a Names server is to run Oracle's Net8 Assistant, invoke the Names Wizard, answer the questions that it asks, and let it generate the names.ora entries for you. You may also edit names.ora directly, but we recommend using Net8 Assistant unless you are very familiar with names.ora syntax.

7.1.2.1 Starting the Names Wizard

Begin by starting Net8 Assistant. On Windows NT/2000, you'll find it at: Start figs/u2192.gif Programs figs/u2192.gif Oracle - OraHome81 figs/u2192.gif Network Administration figs/u2192.gif Net8 Assistant. On Linux and Unix systems, issue the netasst command from the command prompt.

After the Net8 Assistant has started, click on the folder titled Oracle Names servers , and then click the plus icon (+) to the left in order to create a new Names server. Alternatively, you can highlight the folder and select Edit figs/u2192.gif Create from the menu bar. The Names Wizard opens, and you should see the window shown in Figure 7.2.

Figure 7.2. The Names Wizard
figs/n8c_0702.gif

The first two screens of the Names Wizard contain informative text. Read each screen, and then click the Next button.

7.1.2.2 Entering the Names server name

The first Names Wizard screen requiring any information from you asks you for the Name Server name (see Figure 7.3).

Figure 7.3. Entering the Names server name
figs/n8c_0703.gif

Names server names look a lot like Internet domain names. In Figure 7.3 we used the name ORANAMESRVR0.GENNICK.ORGORANAMESRVR0 to name the Names server, and GENNICK.ORG because all our machines are in that domain.

7.1.2.3 Specifying the Names server address

Just as the Net8 listener needs to monitor a port to listen for incoming connection requests, the Names server needs to monitor a port to listen for names resolution requests . In Figure 7.4, we've plugged in the default (and recommended) port number of 1575.

Figure 7.4. Specifying the Names server address
figs/n8c_0704.gif

If you're using a protocol other than TCP/IP, you can select that protocol from the drop-down menu. The other fields in the window will change to fit the protocol that you use.

7.1.2.4 Using a region database

You may need to skip past one or two informative screens after entering the protocol address for your Names server, but eventually you will come to the screen shown in Figure 7.5 that asks if you want to use a region database .

Figure 7.5. Using a region database
figs/n8c_0705.gif

The term region database refers to the repository database that we talked about earlier in this chapter. We are going to use one for this example, so we will leave the radio button at "Use a region database."

7.1.2.5 Specifying the database's listener address

If you are using a region database (and we recommend that you do) you need to provide the address of the Net8 Listener for that database so the Names server can connect to it. Figure 7.6 shows the Names Wizard requesting this information.

Figure 7.6. Entering the listener address for the region database
figs/n8c_0706.gif

As you can see, this is the same information you need to use when you set up a net service name. It's nothing new or unusual. The only mildly unusual thing in this example is that our listener is monitoring port 1523 rather than the default port of 1521.

7.1.2.6 Specifying the region database

After defining the listener address, you need to provide the SID name for the region database. You also need to supply a username and password so the Names server can connect to the region database. Figure 7.7, Figure 7.8, and Figure 7.9 show this information being entered into the Names Wizard.

Figure 7.7. Entering the database SID name
figs/n8c_0707.gif
Figure 7.8. Entering the database username
figs/n8c_0708.gif
Figure 7.9. Entering the database password
figs/n8c_0709.gif

You can use the username and password for the repository owner, or you can create a separate user just for the Oracle Names server that you are creating. If you choose to create a separate user that is not the repository owner, you must be sure to grant that user SELECT, INSERT, UPDATE, and DELETE privileges on all the repository tables. You must also then create public synonyms for all repository tables.

7.1.2.7 Choosing the region

All Names servers must be part of a region. The first Names server must always be placed in a special region called the root region . Unless you are doing an enterprise-wide rollout in a large organization, you may not have any reason to use any region other than root.

To choose the root region, simply accept the default as shown in Figure 7.10.

Figure 7.10. Choosing the root region
figs/n8c_0710.gif

If you answer Yes to the question shown in Figure 7.10, your Names server will be defined in the root region. If you answer No, the Names Wizard will prompt you for a region name.

7.1.2.8 Saving the newly configured Names server

Your final task with the Names Wizard is to confirm that you've entered the correct information and that you want the new Names server to be defined as you have specified. To do that, simply click the Finish button shown in Figure 7.11.

Figure 7.11. Confirming the Names server specifications
figs/n8c_0711.gif

Clicking the Finish button causes the Names Wizard to write the entries necessary to define your data to your names.ora file. Before you can use your new Names server, you'll need to start it and define some net service names. See Section 7.2 later in this chapter for information on performing those tasks .

7.1.2.9 Contents of the names.ora file

The names.ora file is where your Names server is really defined. Given all the inputs shown in Figure 7.2 through Figure 7.11, the Names Wizard will generate a names.ora file with the following entries:

 # NAMES.ORA Network Configuration File:  # E:\Oracle\Ora81\NETWORK\ADMIN\names.ora # Generated by Oracle configuration tools. NAMES.SERVER_NAME = ORANAMESRVR0.GENNICK.ORG NAMES.ADDRESSES =   (ADDRESS = (PROTOCOL = TCP)(HOST = jonathan.gennick.org)(PORT = 1575)) NAMES.ADMIN_REGION =   (REGION =     (DESCRIPTION =       (ADDRESS = (PROTOCOL = TCP)(HOST = donna.gennick.org)(PORT = 1523))       (CONNECT_DATA =         (SID = donna)         (Server = Dedicated)       )     )     (USERID = onames)     (PASSWORD = chapel_rock)     (NAME = LOCAL_REGION)     (REFRESH = 86400)     (RETRY = 60)     (EXPIRE = 600)     (VERSION = 134230016)   ) 

The NAMES.SERVER_NAME and NAMES.ADDRESSES entries define the name of the Names server and the protocol address that it monitors . The NAMES.ADMIN_REGION entry defines region-specific information. The information needed to connect to the repository database falls under the NAMES.ADMIN_REGION entry since repository databases are region-specific.


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