Symptom
- Unable to connect to Oracle in Crystal Reports.
- When using a native connection to connect to an Oracle database on a remote server on a different domain, the following error message appears in Crystal Reports:
"Failed to retrieve data from the database ORA-01012 : not logged on"
Environment
- SAP Crystal Reports 2013
- SAP Crystal Reports 2016
- SAP Crystal Reports 2020
- Oracle 11g
- Oracle 12c
- Oracle 19c
Reproducing the Issue
- Install and configure the Oracle client.
- In Crystal Reports, create a new report, and select "Oracle Server"
- Enter the Oracle server information, and it fails to connect with the error: ORA-01012
Cause
- The PRECONNECT statement is terminating the connection from the tsnnames.ora script.
- The error ORA-01012 is generated when an attempt is made to get information from an Oracle database without being logged on.
- Either the logon information is not being passed to the Oracle server or a call is being made before the logon information is passed.
Resolution
- First, confirm you can connect to Oracle via an ODBC connection or Oracle SQL Plus.
- If the connection fails, then there is an unrelated connectivity issue. Contact your Oracle Database Administrator.
- If the connection is successful, then make a backup copy of your Oracle: TNSNAMES.ORA file, and set the script like:
(CONNECT_DATA =
(SERVICE_NAME = YOUR_SERVICE_NAME)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 20)
(DELAY = 60)
) - Save changes.
Important Note:
It is best to contact your Oracle Database Administrator to confirm the information that needs to be added to the file: TNSNAMES.ORA This file is generated when configuring the Oracle client to connect to your Oracle data source, or copied to the server by your Oracle Database Administrator.
Keywords
CR , 6343627 , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem
Product
SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020