条件:
oracle10g
全局数据库名 oracle_id=orcl
用户:create user zhang
表空间:create tablespace myspace我想删除用户(zhang)下的table1,请问该如何写sqldrop .......???
oracle10g
全局数据库名 oracle_id=orcl
用户:create user zhang
表空间:create tablespace myspace我想删除用户(zhang)下的table1,请问该如何写sqldrop .......???
select 'Drop table '||table_name||';'
from all_tables
where owner='myspace1';
这个是此条语句的运行结果:
Drop table ZB;
Drop table YJ__TEMP;
Drop table YJ_SZ;
1、删除用户级连删除表,然后重建用户
drop user zhang cascade;
2、使用SQL语句生成一个脚本来删除表
select 'drop table '||table_name||';' from user_tables;
<div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="color: #0000FF;">drop</span><span style="color: #000000;"> </span><span style="color: #0000FF;">table</span><span style="color: #000000;"> zhang.table1 </span></div>
</pre></dd></dl>
drop table table_owner.table_name;
用脚本咋删啊?保存.sql文件吗?然后@运行一下?
select 'drop table '||table_name||';' from user_tables;
drop table table1;
b、不是用zhang用与不是sysdba用户
1、首先用sysdba用户授权删除任何用户权限
grant drop any table to username;
drop table zhang.table1;
2、如果有约束条件
drop table zhang.table1 cascade;