Applies To | |||
Product(s): | MicroStation | ||
Version(s): | V8i | ||
Environment: | N/A | ||
Area: | Database | ||
Subarea: | Oracle | ||
Original Author: | Carlos Martins, Bentley Technical Support Group | ||
This technote presents a number of known issues that cause connection failure when trying to establish
a connection to an Oracle database from within MicroStation using the Oracle direct connection.
The MicroStation Connect to Database tool is used to connect to an external database. To connect
to an Oracle database using the Oracle direct connection (Oracle tab) set the Database Server to Oracle. In the Connect String field the connection statement has the following syntax: <user_name>/<password>@<database_alias>.
The table below identifies situations where the connection with the database fails. The Oracle error codes shown are messages exposed in the MicroStation debug session. These error codes may prove to be a basis to resolve the connection failure problem.
Problem |
Setup* |
MicroStation Message Center |
MicroStation Database Debug |
Possible reasons |
Solution*** |
Unable to |
Client: 10g Server: |
Unsuccessful Database: |
ORA-12154: TNS: could not resolve |
Oracle C:\Program |
Install |
Unable to |
Any |
Unsuccessful Database: |
ORA-12170: TNS: Connect timeout |
Network |
Connectivity |
Unable to |
Any |
Unsuccessful Database: |
ORA-12154: TNS: could not resolve |
Wrong |
Specify |
Unable to |
Any |
Unsuccessful Database: |
ORA-01017: invalid username/password; logon denied |
Incorrect |
Specify |
Unable to |
Any |
Unsuccessful Database: |
ORA-12541: TNS: no listener |
TNSListener |
A |
Unable to |
Any |
Unsuccessful Database: |
ORA-12514: TNS:listener does not |
Listener.ORA |
Specify |
* Note 1: Even on a Windows 64 bit based Operating System, Oracle Client 32 bit must be installed since MicroStation is a 32 bit application.
** Note 2: By default one cannot debug database connection issues because the key in command session debug [on/off] is only available after completion of the database connection, when the server.ma is loaded. To workaround this set MS_SESSION_DEBUG=1, if this variable is set either at the Environment Level or as a
MicroStation Configuration variable, Session Debug information will begin populating the message window as soon as the first database operation is executed and thus one can debug connection issues. The debug session can be captured to a file using the key in command dmsg openmsgfile path/filename.txt, after concluding the action to be debugged key in command dmsg closemsgfile.
*** Note 3: The assistance from a database administrator may be needed in some instances since access to the machine that hosts the Oracle server may be required.
If you have multiple Oracle clients installed on your system, ensure that the correct Oracle client files are used to connect to Oracle by setting the configuration variable MS_ORACLE_HOME in the configuration file "..\Bentley\MicroStation<version>\MicroStation\config\database\oracle.cfg".
If this variable is not set, MicroStation looks at the system registry and path to determine the Oracle Home directory. In that situation the environment variable “PATH” defines which Oracle Client version that will be used by MicroStation. The Oracle client version listed first by the Environment variable “PATH” will be the one used by MicroStation. To verify the list order simply type ‘path’ from a DOS command prompt as exemplified in the image below. The PATH” variable can be modified in Advanced System Settings.