Home  >  Article  >  Database  >  Oracle如何删除某个用户下的所有表

Oracle如何删除某个用户下的所有表

WBOY
WBOYOriginal
2016-06-07 15:30:493058browse

http://www.itpub.net/thread-762849-1-1.html 1.以sys as sysdba 身份登录。运行下面的语句。'username'为要删表的用户名。 SELECT 'DROP TABLE ' || 'username' ||'.'|| TABLE_NAME|| ' CASCADE CONSTRAINTS;' FROM DBA_ALL_TABLES WHERE OWNER='username'


http://www.itpub.net/thread-762849-1-1.html


1.以sys as sysdba 身份登录。运行下面的语句。'username'为要删表的用户名。

SELECT 'DROP TABLE ' || <span>'username'</span><span>||'.'|| TABLE_NAME|| ' CASCADE CONSTRAINTS;' FROM DBA_ALL_TABLES WHERE OWNER='username'</span>


执行后生成一个SQL语句集。将SQL语句拷出。贴到新开的SQL窗口。执行后该用户下的表便被删除了。





Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn