where is the error? [message #9894] |
Thu, 11 December 2003 21:21 |
yyy_3
Messages: 11 Registered: December 2003
|
Junior Member |
|
|
set serveroutput on
declare
cursor mycur is
select *
from sys.dba_objects
where owner='GF_AUDIT' and object_type<>'INDEX';
str sys.dba_objects%ROWTYPE;
tmp varchar2(255);
cnt integer;
cursor_handle integer;
begin
cursor_handle := dbms_sql.open_cursor;
open mycur;
loop
fetch mycur into str;
exit when mycur%notfound;
tmp:= concat('drop ', str.object_type);
tmp:= concat(tmp, ' gf_audit.');
tmp:= concat(tmp, str.object_name);
dbms_sql.parse(cursor_handle, tmp, dbms_sql.native);
cnt := dbms_sql.execute(cursor_handle);
end loop;
EXCEPTION
WHEN OTHERS THEN
dbms_output.putline('have error');
dbms_sql.close_cursor(cursor_handle);
commit;
end;
when the SQL is executed, the results is 'have error',
why?
when I deleted the statement 'EXCEPTION WHEN OTHERS THEN', and excute the SQL, the error display:
'ORA-01555 '--rollback segment error
why?
please tell me what sql I should execute.
thanks
(I used oracle 8.05)
|
|
|
|
|
Re: where is the error? [message #9906 is a reply to message #9900] |
Fri, 12 December 2003 11:06 |
Thiru
Messages: 1089 Registered: May 2002
|
Senior Member |
|
|
actually dropping the objects first and then dropping the user has been faster than 'drop user cascade',especially when the schema has a ton of objects. Lot more data dictionary maintenance is required when dropping the user. When dropping the objects it pretty much deals with obj$,tab$,seg$,uet$,fet$ etc .. This is still faster with locally managed tablespaces.
Dropping & Recreating tablespaces is another option,under certain circumstances.
-Thiru
|
|
|