Kevin Wilson wrote:
Is there a method I can use to drop all indexes, tables, stored procs
defined by a user without having to drop the entire instance?

For instance:
DROP ALL TABLES OWNED BY <USER>

You could drop the user and recreate him afterwards. Or you could create a small Python program:


import sapdb.sql

session = sapdb.sql.connect (username, password, dbname, host)

alltables = 'select tablename from tables where owner = USERGROUP'
for (tablename,) in session.sql (alltables):
    session.sql ('DROP TABLE "' + tablename + '"')
session.commit ()

execute with <dependent path>/bin/x_python


Daniel Dittmar


--
Daniel Dittmar
SAP DB, SAP Labs Berlin
[EMAIL PROTECTED]
http://www.sapdb.org


_______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to