DBA Data[Home] [Help]

SYS.DBMS_OBJECTS_UTILS dependencies on COL$

Line 201: -- code which leaves the typeid column in col$. I fixed that in 12g. But

197: end; /* end of procedure upgrade_dict_image */
198:
199: -- Procedure delete_orphan_typeidcols
200: -- A little background on the problem - There is a bug in drop attribute
201: -- code which leaves the typeid column in col$. I fixed that in 12g. But
202: -- these orphaned rows causes issues for datapump, so we need a way to clean
203: -- them up, so here it is.
204: -- This will clean up all orphaned entries in col$.
205: -- IMPORTANT NOTE: This will not work if the columns are only marked unused.

Line 204: -- This will clean up all orphaned entries in col$.

200: -- A little background on the problem - There is a bug in drop attribute
201: -- code which leaves the typeid column in col$. I fixed that in 12g. But
202: -- these orphaned rows causes issues for datapump, so we need a way to clean
203: -- them up, so here it is.
204: -- This will clean up all orphaned entries in col$.
205: -- IMPORTANT NOTE: This will not work if the columns are only marked unused.
206: -- So you will need to drop unsued columns from any table that you want to
207: -- clean up. I am not doing that in this function as that can take quite a
208: -- while if there is a lot of data to be deleted.

Line 217: select distinct c.obj#, c.intcol# from col$ c, coltype$ t where

213: intcolno number;
214:
215: -- Query to get the orphaned rows
216: cursor c1 is
217: select distinct c.obj#, c.intcol# from col$ c, coltype$ t where
218: bitand(c.property, 33554432)=33554432 and c.obj#=t.obj# and
219: c.intcol# not in (select typidcol# from coltype$ t1 where c.obj#=t1.obj# and
220: typidcol# is not null);
221:

Line 229: -- delete from col$

225: LOOP
226: -- get the orphoned typeid row
227: FETCH C1 into objno, intcolno;
228: EXIT WHEN c1%notfound;
229: -- delete from col$
230: DELETE from col$ where obj#=objno and intcol#=intcolno;
231: END LOOP;
232: CLOSE c1;
233:

Line 230: DELETE from col$ where obj#=objno and intcol#=intcolno;

226: -- get the orphoned typeid row
227: FETCH C1 into objno, intcolno;
228: EXIT WHEN c1%notfound;
229: -- delete from col$
230: DELETE from col$ where obj#=objno and intcol#=intcolno;
231: END LOOP;
232: CLOSE c1;
233:
234: -- all done