Table importation fails with error code ORA-31693 - oracle

I've been receiving backups from an Oracle database into my Oracle database for 2 years now. My company is running version 10.2.0.1.0 and we are receiving the exports from version 12.1.0.2.0. They are using expdp and I'm using impdp. I added a new column into my database, using this script
ALTER TABLE CONTAINERS
ADD ("SHELL" NUMBER(14, 6) DEFAULT 0 );
After running the above on both databases now when they send an export to me the table in question will not import. I receive the following error.
ORA-31693: Table data object "PAS"."CONTAINERS" failed to load/unload and is being skipped due to error:
ORA-02354: error in exporting/importing data
ORA-02373: Error parsing insert statement for table "PAS"."CONTAINERS".
ORA-00904: "SYS_NC00067$": invalid identifier
This error has been going on for a about two weeks, I have tried to resolve the problem multiple ways, this is my last resort as it were.
Any help is greatly appreciated.

Did you try to track down SYS_NC00067? It looks like a system-assigned column name. This sometimes happens when you add a function-based index. Did you create a function-based index on Shell?

Related

Is it always required to create the target DB table in Informatica before starting the workflow?

I want to create a target table in Oracle using Informatica. But I see a fatal execution error saying table does not exist.
I don't wanna have to create a table each time I execute a task in Informatica.
Please help!
Error Screenshot
You will need to create new table only once before running the workflow(if the table is not already created).

Oracle SQL Developer Database Copy Error

I am trying to utilise the database copy in Oracle SQL Developer, specifically the Objects Copy to copy data from a table in one database to the same table in another database.
I am trying to copy data from one table on a database, to the exact same format table on another database. See below for log output.
When doing this I come up with the following error:
Copy Option: Objects
Copy Source Connection: DATABASEA
Destination Connection: DATABASEB
DDL Objects: Views Tables Materialized Views
Data Objects: Tables Table X
Object Where: PROCESS_DATE = '2017-12-31'
Copy DDL: No
Copy Data: Yes
Append Existing Objects
--- START
------------------------------------------------------------‌​--------
Skipping Table X
--- END ------------------------------------------------------------‌​--------–
I am following the steps outlined here: http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev/r31/DatabaseCopy/DatabaseCopy.html
I was able to perform a data copy before I got a new laptop, using the exact same software.
I would be grateful for any advice on how to fix this issue.
In my case, the root cause of this issue was a previous attempt to copy this table which failed and SQL Developer failed to roll back the changed - even though I selected the "Cancel and rollback" option. As a result, the table was deleted and the second attempt to copy the table data without DDL was simply skipped - without any error message or explanation. IMHO, the database or SQL Developer should rather output an error message.
Eventually, I was able to resolve the issue by copying the DDL, too.

sqlldr style error logging in Oracle external tables

I'm currently trying to get the error messages we get from our Oracle external table loading process to match the level of detail we get when loading via sqlldr.
Currently if I load a file in sqlldr and a record fails I get this error message which is pretty useful - I get the record number, the actual column name that failed and the record in a bad file.
Record 4: Rejected - Error on table ERROR_TEST, column COL1.
ORA-01722: invalid number
I've got an external table along with an INSERT statement to a target table that logs errors to a DBMS_ERRLOG table but this is the equivalent error message from that process.
ORA-01722: invalid number
Whilst this process has the benefit of recording the actual record in a table so you can see column name mappings it doesn't actually list which column has the issue. This is a big issue when looking at tables with many columns...
It looks as though I can have the REJECT LIMIT on the external table itself which will give the same above error but that will then lose the ERR table logging. I'm guessing it's a case of one or the other?

Loading XMLTYPE data with IMPDP

I am trying to take a schema from an existing database and place it in a new database.
I've created dependant tablespaces for the data and everything seems to work ok except any tables with XMLTYPE columns error and fail with the error message below. The XMLTYPE are unvalidated CLOBs
KUP-11007: conversion error loading table "SCHEMA"."TABLE_NAME"
ORA-01400: cannot insert NULL into (XML_COLUMN)
KUP-11009: data for row: XML_COLUMN : 0X''
Some investigation seemed to indicate that using TABLES=TABLE_NAME instead of SCHEMA=SCHEMA would help but I have had no such luck.
Note that there are no constraints on this column and that some data could indeed be null (though after the import I get 0 of my several million records)
The command I am using to initiate the datapump is:
impdp TABLES=SCHEMA.TABLE_NAME DIRECTORY=DATA_PUMP_DIR DUMPFILE=oracledpexport.dmp LOGFILE=LOGFILE.LOG TABLE_EXISTS_ACTION=REPLACE
We have been facing some problems during ORACLE import process.
The IMPDP process was not able to import tables containing XML data types.
The reason for this is due to a bug in ORACLE 11g R1 version.
The work around for this is to use EXP process to create a dump instead of EXPDP.
For a permanent fix, we have to explicitly save XML Type columns as CLOB
Also, Oracle has confirmed that this issue has been fixed in ORACLE 11gR2 version.

Oracle - Unable to drop tables

This question is related to the one I posted yesterday but with further implications.
The situation is: I'm unable to drop ANY table. Here's an example:
SQL> CREATE TABLE FOO (BAR NUMBER) TABLESPACE SYSTEM
/
Table created.
SQL> SELECT COUNT(1) FROM FOO;
COUNT(1)
----------
0
SQL> DROP TABLE FOO;
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-00942: table or view does not exist
ORA-06512: at line 19
So, the table seems to exist but I'm not capable of dropping it.
Notice the error ORA-00604: error occurred at recursive SQL level 1. If I try to drop a non existing table, this error does not appear:
SQL> DROP TABLE NON_EXISTING_TABLE
ERROR at line 1:
ORA-00942: table or view does not exist
Somehow, the system is unable to find the table at dropping time.
The oracle installation and the DB itself is new (one day old).
EDIT - I retried this test using another tablespace and user (I just created ones) and I got a slightly different behaviour: using SYS, after I got the DROP error I can still SELECT from the table. However, using this new user, after I got the DROP error, I no longer can SELECT from the table.
Solution
We found the problem: the MDSYS.SDO_GEOR_SYSDATA_TABLE was missing, preventing the drop operation.The solution is to restore that table. Here is the complete solution, by Gaurav Soni (by the way, many thanks).
Run the script catmd.sql (located in $ORACLE_HOME/md/admin dir).
The catmd.sql script is the script that loads all objects needed by Oracle spatial in the database. Then drop the user.
you can also refer to oracle metalinks
Steps for Manual Installation of Oracle Spatial Data Option
Dropping user results in ORA-942 against SDO_GEOM_METADATA_TABLE
I'd suggest that you activate SQL tracing (ALTER SESSION SET SQL_TRACE=TRUE;) and try the drop again. This will generate a trace file on the server (in the udump directory) that will show all the SQL the session executed, including recursive statements. This should show you the recursive SQL statement that is failing.
I think the problem is that you created the table on system tablespace. You should create it on the user tablespace or create one to store your data.

Resources