生成删除所有表语句
select 'drop table '||table_name||' cascade constraints;' from user_tables;
生存删除所有sequence
select 'drop sequence '||sequence_name||';' from user_sequences;
创建表空间
create tablespace 空间名 datafile'C:\Oracle\product\10.2.0\oradata\test\test.dbf' size 100M;
创建用户
create user 帐号 identified by 密码 default tablespace 空间名;
给用户授权
grant connect,resource to test;
grant dba to test;
删除表空间
DROP TABLESPACE 空间名 INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;
超出打开游标的最大数
alter system set open_cursors=10000 scope=both;
show parameter open_cursors;
VBO-4562:无法删除表。ORA-38301:无法对回收站中的对象执行DDL/DML
purge recyclebin;
更新sequence值的动态sql语句
--导出之前把该语句执行一遍,复制执行结果,然后在导入后的数据库中删除sequence,再执行该语句.
select 'create sequence '||sequence_name||
' minvalue '||min_value||
' maxvalue '||max_value||
' start with '||(last_number+1000000)||
' increment by '||increment_by||
(case when cache_size=0 then ' nocache' else ' cache '||cache_size end) ||';'
from user_sequences