SAP Knowledge Base Article - Public

1202767 - Error: "Failed to retrieve data from the database ORA-01012 : not logged on" when connecting to Oracle from Crystal Reports

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

  1. Install and configure the Oracle client.
  2. In Crystal Reports, create a new report, and select "Oracle Server"
  3. 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

  1. First, confirm you can connect to Oracle via an ODBC connection or Oracle SQL Plus.
  2. If the connection fails, then there is an unrelated connectivity issue. Contact your Oracle Database Administrator.
  3. 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)
    )

  4. 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