oracle drop user
-- Specify CASCADE to drop all objects in the user's schema before dropping user.
DROP USER MY_USER CASCADE;
oracle drop user
-- Specify CASCADE to drop all objects in the user's schema before dropping user.
DROP USER MY_USER CASCADE;
oracle drop all user views
BEGIN
FOR cur_rec IN (SELECT OBJECT_NAME, OBJECT_TYPE
FROM ALL_OBJECTS -- Choose types
WHERE OBJECT_TYPE IN ('TABLE', 'VIEW', 'PACKAGE',
'PROCEDURE', 'FUNCTION', 'SEQUENCE'))
AND OWNER = 'owner_name'
LOOP
BEGIN
IF cur_rec.OBJECT_TYPE = 'TABLE'
THEN
EXECUTE IMMEDIATE 'DROP ' || cur_rec.OBJECT_TYPE || ' "'
|| cur_rec.OBJECT_NAME || '" CASCADE CONSTRAINTS';
ELSE
EXECUTE IMMEDIATE 'DROP ' || cur_rec.OBJECT_TYPE || ' "'
|| cur_rec.OBJECT_NAME || '"';
END IF;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE('FAILED: DROP '
|| cur_rec.OBJECT_TYPE || ' "'
|| cur_rec.OBJECT_NAME || '"');
END;
END LOOP;
END;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us