This
script will produce the alter/drop commands that we can use to drop
all the user objects from a database.
REM
Script to drop all user objects
SET
LINES 132 PAGES 59 FEEDBACK OFF ECHO OFF VERIFY OFF
BREAK
ON username
TTITLE
left _date center 'SQL To Drop A Users Objects' skip 2
PROMPT
When prompted, enter the name of the user who''s objects you wish to
drop
PROMPT
Then cut and paste the commands presented to drop those objects.
SELECT
'alter table '
||
owner
||
'.'
||
table_name
||
' drop constraint '
||
constraint_name
||
' cascade;' code
FROM
dba_constraints
WHERE
(constraint_type = 'R') AND (owner = UPPER ('&&enter_user_name'))
UNION
SELECT
DISTINCT 'DROP '
||
object_type
||
' '
||
owner
||
'.'
||
object_name
||
';' code
FROM
dba_objects
WHERE
(object_type NOT IN ('INDEX'))
AND
(owner = UPPER ('&&enter_user_name'))
ORDER
BY code DESC;
Sample Output
SQL>
When prompted, enter the name of the user who’s objects you wish to
drop
SQL>
Then cut and paste the commands presented to drop those objects.
18-JUL-08
SQL To Drop A Users
Objects
CODE
--------------------------------------------------------------------------------------
DROP
TABLE SCOTT.UMCATEGORYCONVFACTOR;
DROP
TABLE SCOTT.UOMCATEGORYCONVFACTOR;
DROP
TABLE SCOTT.UDT_SOURCING;
DROP
TABLE SCOTT.WEBSPRELOPTS;
DROP
TABLE SCOTT.WEBSKUOPTS;
DROP
TABLE SCOTT.WDDDATA;
I
hope this article helped you. Your
suggestions/feedback are most welcome.
Keep learning... Have a great day!!!
Keep learning... Have a great day!!!
ReplyDeleteValuable information thanks for sharing Oracle DBA Online Training
This information you provided in the blog that is really unique I love it!! Thanks for sharing such a great blog. Keep posting..
ReplyDeleteOracle DBA training
Oracle DBA course
Oracle DBA training institute
Very nice article
ReplyDeleteOracle SOA Online Course Bangalore
Hi,
ReplyDeleteI must appreciate you for providing such a valuable content for us. This is one amazing piece of article. Helped a lot in increasing my knowledge.
German Classes in Chennai
German Language Classes in Chennai
German Courses in Chennai
German Language Course in Chennai
Web Designing Course in chennai
PHP Training in Chennai
Java Training in Chennai
German classes in Velachery
Thanks for sharing this valuable information and we collected some information from this post.
ReplyDeleteCorporate training in Machine learning
Thanks for posting this blog. I really love while reading it.
ReplyDeletePython Corporate training in Nigeria
Excellent blog, I wish to share your post with my folks circle. It’s really helped me a lot, so keep sharing post like this.
ReplyDeleteoracle training institutes in bangalore
oracle training in bangalore
best oracle training institutes in bangalore
oracle training course content
oracle training interview questions
oracle training & placement in bangalore
oracle training center in bangalore
The Content is very Attractive and The Way of Explaining About the Topic is Very Clear..It's very Easy to Understand...Keep Doing this Amazing Work
ReplyDeleteJava training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery
This blog very easily understandable. Thanks for sharing such an informative post with us. This is a nice post in an interesting line of content.
ReplyDeleteOracle DBA Training in Bangalore
spark online training
ReplyDeletescala online training
azure devops online training
app v online training
nice post.oracle dba online training
ReplyDelete