from : http://www.shutdownabort.com
This guide outlines the basic steps necessary to install and configure tnsManager.
- 1. Download and unpack
Download the latest tnsManager binary from here. Transfer it to your Linux box and unpack it:
Three files will be unpacked:
- tnsManager – the main executable.
- tnsManager.conf – the configuration file.
- README.TXT – The usual legal stuff. Make sure that you read it and agree with it!
- 2. Set ownership and permissions
This guide assumes that the oracle user will be used to install and run tnsManager:
chown -v oracle tnsManager* chmod 700 tnsManager chmod 600 tnsManager.conf
- 3. Transfer your tnsnames.ora
Transfer your tnsnames.ora to the Linux box. It can be located anywhere in the file system as long as tnsManager has access to it.
- 4. Edit the configuration file
The tnsManager.conf file must be edited before tnsManager is started for the first time. The following settings should be altered:
tnsnames_location – should be set to the full path and file name of the tnsnames.ora from step 4.
location – under the ‘logging’ section. tnsManager will log events to this file. Specify the full path and file name. The log file will be created the first time tnsManager is started. Alternativley, you can disable logging by setting level to 0 (zero).
After editing, your tnsManager.conf should look something like this:
[general] tnsnames_location=/home/oracle/tnsManager/tnsnames.ora tcp_port=3838 [logging] location=/home/oracle/tnsManager/tnsManager.log level=1
Note. When tnsManager is started, it will look for its configuration file in three places:
- The path pointed to by the environment variable TNSMANAGER_CONFIG_PATH
- The current working directory
- 5. Start tnsManager
To start tnsManager enter the following command:
You will see output similar to the following:
oracle@fermat:~/tnsManager> ./tnsManager start tnsManager v1.6.8 Copyright(C)2005-2008 Andrew Barry Starting tnsManager... Logging to '/home/oracle/tnsManager/tnsManager.log'. Starting daemon... ------------------------------------------------- Status : Running Startup time : Sun Feb 3 16:41:44 2007 TCP Port : 3838 TNS filename : /home/oracle/tnsManager/tnsnames.ora Modification date : Thu May 11 16:48:16 2006 Bytes : 4324 TNS entries : 25 Total queries : 0 Successful queries : 0 Unsuccessful queries : 0 Timed-out requests : 0 Invalid requests : 0 Last query time : No queries ------------------------------------------------- tnsManager has started successfully (PID:7647). oracle@fermat:~/tnsManager>
Note. Run ‘tnsManager –help’ for a complete list of options.
- 6. Workstation configuration
Your workstation machines will need to be configured to use tnsManager instead of tnsnames. To do this you will need to create two new files; sqlnet.ora and ldap.ora. Both of these files will be placed in the same location: <ORACLE_HOME>\network\admin. The contents of the two files should be as follows:
Configure sqlnet.ora to use ldap for names resolution:
The ldap.ora tells your Oracle client what the tnsManager server is called and which TCP port it is listening on. Add the following lines to it, putting your own server name in of course:
DIRECTORY_SERVERS = (put_your_server_name_here:3838) DEFAULT_ADMIN_CONTEXT = "" DIRECTORY_SERVER_TYPE = OID
- 7. Test the installation
To test the installation simply use tnsping or sqlplus from your workstation. Both tools should behave in the usual way. If you run ‘tnsManager status’ you should also see the query counters increasing.
If you encounter problems, check the tnsManager log file for more information. If you get really stuck, try increasing the logging level to 2.
All trademarks used are properties of their respective owners.
Filed under: Computer / IT