Skip to main content

Posts

Showing posts from August, 2014

CLOB Argument In EXECUTE IMMEDIATE

Oracle EXECUTE IMMEDIATE statement implements Dynamic SQL in Oracle. Before Oracle 11g, EXECUTE IMMEDIATE supported SQL string statements. Oracle 11g allows the usage of CLOB datatypes as an argument which eradicates the constraint we faced on the length of strings when passed as an argument to Execute immediate. But a PLSQL block written on Oracle 11g with  C LOB datatypes as an argument to  EXECUTE IMMEDIATE  will not be executed on Oracle 10g.

Oracle 11g export using EXP utility missing some tables

Problem:- I have recently exported a 11g schema using 11g EXP utility and tried to import into another 11g Instance using 11g IMP utility. But, not all the tables got transferred to the destination instance. On further debugging, I found out that empty tables i.e. tables with NO ROWS (0 rows) did not get exported to dump thus they were missing. Cause:- This is due to oracle feature "Segment creation on Demand (Deferred Segment Creation). Solution :- 1) Use the new Oracle Data Pump utilities for the export and import:  expdp/ impdp instead of exp/imp 2) Turn off the Oracle feature before creating any object     ALTER SYSTEM SET DEFERRED_SEGMENT_CREATION=FALSE; 3) Force the allocation of extents on each empty table using the following command     ALTER TABLE <table_name> ALLOCATE EXTENT;     Re-run the export EXP command, which would export the empty tables as well.