Troubleshooting Oracle GoldenGate and SDS

Review these troubleshooting tips and resolutions for common errors encountered during setup of Oracle GoldenGate and SDS.

Create the SDS Tables

If you encounter any issues with the script generated by the GENERATE_SDS_DDL procedure, verify the following have been correctly set.

  • The model you are specifying is associated with a logical schema.

  • The logical schema's DATASOURCE_NUM_ID flexfield is assigned a numeric value. A value is automatically assigned when a datasource is registered in Configuration Manager.

  • The logical schema is mapped to a physical schema in the context (for example, Global) you are executing the procedure with. The physical schema is automatically mapped to the Global context when the datasource is registered in Configuration Manager.

  • The physical schema's DATASOURCE_NUM_ID flexfield is assigned the same numeric value as the logical schema. A value is automatically assigned when a datasource is registered in Configuration Manager.

  • Under the same context, a physical schema is mapped to the DW_BIAPPS11G logical schema, for example BIAPPS_DW.OLAP.

  • A new SDS physical schema has been added to the same physical server, for example BIAPPS_DW.SDS_EBS_12_1_3_310. This physical schema is manually added.

  • The physical schema's DATASOURCE_NUM_ID flexfield is assigned the same numeric value as used previously. This value is manually assigned.

The following are some common error messages and issues you may encounter.

  • com.sunopsis.tools.core.exception.SnpsSimpleMessageException: com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Exception getSchemaName("[logical schema name]", "D") : SnpPschemaCont.getObjectByIdent : SnpPschemaCont does not exist

    Verify the logical schema is mapped in the context you are executing the procedure with.

  • java.lang.Exception: The application script threw an exception: java.lang.Exception: Model with code '[logical schema]' does not exist

    Verify the logical schema associated with your model has been assigned a value for the DATASOURCE_NUM_ID flexfield.

  • java.lang.Exception: The application script threw an exception: java.lang.Exception: Can't find physical schema for connection for DW_BIAPPS11G with DSN 310 in context Global

    Verify a physical schema is created under the Data Warehouse physical server and assigned the same DATASOURCE_NUM_ID value as assigned to the OLTP.

Using the DML Option to Perform an Initial Load

If you encounter any issues with the script generated by the COPY_OLTP_TO_SDS procedure, verify the following have been correctly set.

A database link with the name DW_TO_OLTP is created in the database user schema used by the data warehouse Data Server (BIAPPS_DW) that points to the OLTP database. The procedure is executed by this user so Oracle looks for this database link in the user's schema, not the SDS schema. You still need a database link with this name in the SDS schema for other reasons, so you have a total of two database links to the same source database.

The following are some common error messages and issues you may encounter.

  • ODI-1228: Task Copy SDS Data (Procedure) fails on the target ORACLE connection BI_APPLICATIONS_DEFAULT

    PL/SQL: ORA-00942: table or view does not existPLS-00364: loop index variable 'COL_REC' use is invalid"

    Verify a database link named DW_TO_OLTP exists in the schema owned by the database user associated with the DW physical server.

  • Insert statement only populates the CDC$ columns

    The script has statements such as the following where only the CDC$ columns are populated:

    truncate table SDS_EBS11510_FULL.HR_LOCATIONS_ALL;
    INSERT /*+ APPEND */ INTO SDS_EBS11510_FULL.HR_LOCATIONS_ALL (CDC$_SRC_LAST_UPDATE_DATE, CDC$_RPL_LAST_UPDATE_DATE, CDC$_DML_CODE) SELECT SYSDATE, SYSDATE, 'I'
    FROM HR_LOCATIONS_ALL@DW_TO_OLTP;
    

    Verify the database link DW_TO_OLTP is pointing to the correct OLTP database. The procedure gets a column list from the data dictionary on the OLTP database for the tables that correspond to the SDS tables. If the database link points to the wrong database, a column list will not be retrieved.

Create SDS Indexes and Analyze the SDS Schema

When executing the script to create indexes and primary key constraints on the SDS tables, you may see some of the following error or warning messages.

  • "such column list is already indexed"

    You may see this message when executing the script that creates the indexes. This message can be ignored.

    Oracle GoldenGate works best when a primary key is defined on the target table in order to determine which record to update. If a primary key is not found, the replicat process searches for a unique index to determine which record to update. The definition of the tables in the SDS is based on the definition in the source system (leveraging both the application dictionary and data dictionary). If the table does not have a primary key in the source system but does have multiple unique indexes, a primary key may be added in the ODI definition to ensure Oracle GoldenGate can correctly identify the record to be updated. This primary key may be defined on the same column that a unique index is already defined on. The DDL script creates the primary key as an index and a constraint before creating the unique index. When creating the unique index, the database will report that the column is already indexed.

  • "column contains NULL values; cannot alter to NOT NULL"

    This error can occur when a primary key constraint is being created. Primary key constraints are introduced in ODI when a primary key is defined in the OLTP system. A primary key constraint may also be introduced in ODI when there is no primary key in the OLTP system for the table but the table has multiple unique indexes; in this case, a primary key constraint is introduced to ensure Oracle GoldenGate does not use a unique index that may not correctly identify a record for updates. This error can occur for two reasons:

    • OLTP table has Primary Key Constraint

      Due to differences in patches and subversions, it is possible the OLTP instance used to originally import the datastores from had a primary key constraint that differs from the OLTP release you are using. If the OLTP table has a primary key constraint, ensure the definition in ODI matches this primary key. If there is a difference, you can modify the Index DDL script to use the proper definition to create the primary key constraint in the target database. You should also update the constraint in ODI to match this definition.

      If the OLTP and ODI definitions of the primary key constraint match, it is possible the initial load process did not populate one or more of the columns that make up the primary key. If the primary key includes a LOB or LONG datatype, data is not replicated in these columns, which would leave the column empty. In this case, no unique index or primary key can be created, and without data in this column the record cannot be uniquely identified. Any ETL task that extracts from this table needs to be modified to extract directly from the OLTP system. This is done by modifying the load plan step for this task, overwriting the IS_SDS_DEPLOYED parameter for that load plan step to a setting of 'N'.

      If the OLTP and ODI definitions of the primary key constraint match and the key does not include a column that has either the LOB or LONG datatype, review the initial load files and verify whether the column is populated or not. See Using the DML Option to Perform an Initial Load.

    • OLTP table does not have Primary Key Constraint

      Primary key constraints in the ODI model are introduced when a primary key may not exist in the original table. This primary key generally matches an existing unique index. Due to differences in patch and subversions for a given OLTP release, it is possible that the instance used when importing a unique index had a column that is not nullable but in another OLTP release, that column may be nullable. Unique indexes allow null values but primary keys do not. In this case, a unique index is created for the SDS table but the primary key constraint fails to be created. Oracle GoldenGate uses the first unique index it finds (based on the index name) to identify a record for update; if the index that the primary key constraint is based on is not the first index, rename this index in ODI to ensure it will be the first. Generally, the first unique index is the correct index to use to identify a record, in which case this error can be ignored.

  • "cannot CREATE UNIQUE INDEX; duplicate keys found"

    Due to differences in patch and subversions for a given OLTP release, it is possible that the instance used when importing a unique index uses a different combination of columns than are used in your particular release of the same OLTP. For example, the OLTP subversion used to import an index uses 3 columns to define the unique index but a later subversion uses 4 columns, and you are using this later subversion. Check the definition of the unique index in your OLTP instance and modify the index script and corresponding constraint definition in ODI to match.