Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2013
    Posts
    14

    Unanswered: drop all tables in a schema

    A dba gave me these commands to drop the tables in a schema and recreate schema, so that I can once again create tables. I am trying to understand them:

    drop table ERRORSCHEMA.ERRORTABLE;

    CALL SYSPROC.ADMIN_DROP_SCHEMA('schema_name', NULL, 'ERRORSCHEMA', 'ERRORTABLE');

    create schema schema_name



    questions:

    1) Will this delete the db2 user associated with the schema?

    2) Will all the tables and content associated with the schema be deleted

    3) If I am running this with a user that has admin permissions on the DB where the schema exists is that sufficient, or does this need to be a sysadmin db user? Or just granted dropin.


    Thanks!

  2. #2
    Join Date
    Apr 2012
    Posts
    156
    1) Will this delete the db2 user associated with the schema?
    no, I am pretty sure you have to revoke the grants at the database level.
    2) Will all the tables and content associated with the schema be deleted
    yes
    3) If I am running this with a user that has admin permissions on the DB where the schema exists is that sufficient, or does this need to be a sysadmin db user? Or just granted dropin.
    Run with a who has execute on the procedure and drop authority on the objects. I would just run with someone who has admin permissions.

    There are restrictions on what can be dropped, see the following link
    DB2 Database for Linux, UNIX, and Windows

Posting Permissions

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