DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: How to remove all object from a db

Hybrid View

  1. #1
    Join Date
    Dec 2002
    Location
    Chennai, India
    Posts
    104

    How to remove all object from a db

    Hi Guys,
    I have a database which contains tables with data, indexes, constraints, etc. Now i want to do two things.
    (1). How can i remove all objects like tables,indexes,etc from my database so that i will get a clean database
    (2). How can i remove all the objects except table. In this case i want to remove indexes,data,constraints,etc.

    I need the script for both 1 & 2.

    Immediate response is highly appreciated.

    Best Regards,
    Sudheer

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    1) drop the user
    2) build scripts using dynamic SQL

    go to tahiti.oracle.com

  3. #3
    Join Date
    Apr 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    1,203
    Drop user cascade

    To all the users owning the objects you want to remove.

    select owner, count(*)
    from all_objects
    group by owner
    ;

    This query should give you a good idea of the number of objects that are owned by particualr schemas.
    OCP 8i, 9i DBA
    Brisbane Australia

  4. #4
    Join Date
    Dec 2002
    Location
    Chennai, India
    Posts
    104

    Hi

    Thank you grjohnson.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width