Oracle Observations

March 20, 2007

Oracle Names troubleshooting

Filed under: Oracle Names — bigdaveroberts @ 5:22 pm

As described previously, you can check the database entries and the cache entries for your databases.
If the data in the database and the cache file (ckpreg.ora) is correct, then restart the names server.

E.g.

Restarting the names demon:

/usr/home/oracle O>namesctl

Oracle Names Control for IBM/AIX RISC System/6000: Version 8.1.7.0.0 – Production on 03-FEB-2003 15:20:29

(c) Copyright 1997 Oracle Corporation.  All rights reserved.

Currently managing name server “NameServer.world”
Version banner is “Oracle Names for IBM/AIX RISC System/6000: Version 8.1.7.4.0
– Production”

Welcome to NAMESCTL, type “help” for information.

NAMESCTL> stop
Confirm [yes or no]: yes
Server shutting down
NAMESCTL> start
Starting “/opt/app/oracle/8.1.7/bin/names”…server successfully started

Etc….
If the data in the database is incorrect, unregister the database and reregister it.

E.g.

Take the entry in the database that includes the characters: ‘(TYPE=a.smd.)’ in the ZD_VALUE1_P column:

(DATA_LIST=(FLAGS=0x1)(DATA=(TYPE=a.smd.)(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=tplive)(PORT=1521))(CONNECT_DATA=(SID=TPLIVE2))))) Remove the text in red and unregister the database using the remaining text as the address:Eg:NAMESCTL> unregister testdb -t database -d (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testsvr)(PORT=1521))(CONNECT_DATA=(SID=TESTDB)))
Total response time:   0.09 seconds
Response status:       normal, successful completion
NAMESCTL>

If there are multiple entries, unregister them all.

Then register the correct address.

NAMESCTL> register testdb -t database -d (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testsvr)(PORT=1521))(CONNECT_DATA=(SID=TESTDB)))
Total response time:   0.07 seconds
Response status:       normal, successful completion
NAMESCTL>

If the data in the cache is incorrect, stop the names server, move or remove all the .ora files in the $ORACLE_HOME/network/names directory. Finally restart the names server.

The $ORACLE_HOME/network/names is the default location for the cache files.

Theoretically the location could be changed by the following parameters in the names.ora file that is normally located in the $ORACLE_HOME/network/admin directory. The names.ora file should never be deleted!

Names.ora file parameters that specify the location of the names cache files:

NAMES.CACHE_CHECKPOINT_FILE
NAMES.CONFIG_CHECKPOINT_FILE
NAMES.REGION_CHECKPOINT_FILE

Frequently the data will be corrupt in more than one place, in that case, re register the data in the database, and when that is correct, stop the names server and remove the cached files.

If you suspect that the incorrect data is being passed to the names server from another names server, then you should configure your own sqlnet.ora file to use oracle names name resolution, and you should list only one names server at a time and verify what is being returned by using tnsping to connect to the database.

Eg:

NAMES.DIRECTORY_PATH = (ONAMES)
NAMES.PREFERRED_SERVERS =
  (ADDRESS_LIST =
    (ADDRESS = (COMMUNITY = TCP.world)(PROTOCOL = TCP)(Host = namesvr1)(Port = 1527))
  )

If it is not possible to change the configuration to verify the data returned from the names server, then the same information can be gained by switching on tracing.

If the data returned from multiple names servers is incorrect, and attempts to correct the data one server at a time is unsuccessful, then you will need to stop all the names servers, then individually start each one up, correct the data and shut it down. When all the servers are fixed then they can all be restarted. It should be noted that during this period access to all the databases will be restricted.

The primary repository for names configuration data is the database, which can be checked while the names demon is stopped. After starting the names demon, the data is read from the database, and is then saved to the cache files. I am not aware of any documentation that indicates what source the names demon will use as a primary source of information when multiple sources are available.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: