ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Drop all tables , views and sequences for the current logged in user in Oracle

Drop all tables , views and sequences for the current logged in user in Oracle

原创 Linux操作系统 作者:china50 时间:2011-09-06 15:45:38 0 删除 编辑
Begin
  -- Drop all tables for current logged in user.
  for t in (select table_name from user_tables) loop
    execute immediate ('drop table ' || t.table_name);
  end loop;

  -- Drop all views for current logged in user.
  for v in (select view_name from user_views) loop
    execute immediate ('drop view ' || v.view_name);
  end loop;
  
  -- Drop all sequences for current logged in user.
  for s in (select sequence_name from user_sequences) loop
    execute immediate ('drop sequence ' || s.sequence_name);
  end loop;
End;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/1365/viewspace-706756/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-06-24

  • 博文量
    25
  • 访问量
    42184