Friday, July 20, 2012

ORA-39083: Object type TYPE failed to create at impdp

If you try to duplicate in the same database, one schema that contains TYPE objects, the following error might appear 


ORA-39083: Object type TYPE failed to create


This is due the fact that the TYPE object has an associated object identifier (OID) that must be unique in database. By duplicating this TYPE, at import time this will have the same OID.


Prior to 10.2.0 this object must be created prior to import in destination schema nad the error regarding existence of object can be ignored
Starting with 10.2.0, there is the option to put TRANSFORM=OID:n in impdp command at import time  

Tuesday, July 10, 2012

Update one table select values from other table



desc test
Name       Null     Type        
---------- -------- -------------
LEVEL_ID            NUMBER      
LEVEL_NAME          VARCHAR2(10)
LEVEL_DESC          VARCHAR2(255)
CAST_NUM   NOT NULL NUMBER(7)    


desc test_bk
Name       Null     Type        
---------- -------- -------------
LEVEL_ID            NUMBER      
LEVEL_NAME          VARCHAR2(10)
LEVEL_DESC          VARCHAR2(255)
CAST_NUM   NOT NULL NUMBER(7)    



Update cast_num from test with values of cast_num from test_bk

UPDATE  SET CAST_NUM= (SELECT CAST_NUM FROM TEST_BK WHERE TEST_BK.LEVEL_ID=TEST.LEVEL_ID)
where exists (select 1 FROM TEST_BK WHERE TEST_BK.LEVEL_ID=TEST.LEVEL_ID);