Oracle中批量导出Sequence
使用exp工具,以tables的类型导出某个用户下所有的表和数据,发现其中sequence没有被导出。网上搜索之,发现toad貌似有此功能,于是安装了9.6.1.1版本,结果居然没发现此功能。(可能是我没找到,至少和那位老大的截图不同),最后找到如下脚本,可以将某个用户的全部sequence查询出来,并拼成创建语句。
代码如下:
Java代码
select
'create sequence '
||sequence_name||
' minvalue '
||min_value||
' maxvalue '
||max_value||
' start with '
||last_number||
' increment by '
||increment_by||
(
case
when cache_size=
0
then
' nocache'
else
' cache '
||cache_size end) ||
';'
from dba_sequences where sequence_owner=
'HR'
select 'create sequence '||sequence_name||
' minvalue '||min_value||
' maxvalue '||max_value||
' start with '||last_number||
' increment by '||increment_by||
(case when cache_size=0 then ' nocache' else ' cache '||cache_size end) ||';'
from dba_sequences where sequence_owner='HR'
注意:其中的HR,是需要导出sequence的用户,貌似必须大写的说!并且使用该脚本的用户需要有访问dba_sequences的权限。
导出结果如下:
Java代码
create sequence HIBERNATE_SEQUENCE minvalue
1
maxvalue
999999999999999999999999999
start with
1
increment by
1
cache
20
;
create sequence MIAGENTVERSION_VERSION_SEQ minvalue
1
maxvalue
999999999999999999999999
start with
121
increment by
1
cache
20
;&nbs
相关文档:
oracle表空间操作详解
1
2
3作者: 来源: 更新日期:2006-01-04
5
6
7建立表空间
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
1. 检查Oracle的进程
$ ps -ef|grep "ora_"|grep -v grep
oracle 5998 1 0 11:15:59 ? 0:01 ora_j000_PPRD10
oracle 2968 1  ......
方法一:
----------------------------------------------------------------
---Muti-row to line(col2row)
----------------------------------------------------------------
create or replace type str_tab is table of varchar2(20);
/
grant all on str_tab to public;
create public synonym str_tab for ......
一、选择题
1.当你执行以下查询语句:
SELECT empno,ename
from emp
WHERE empno =7782 OR empno =7876;
在WHERE语句中,以下哪个操作符可以取代OR?
A. IN
B. BETWEEN ……
C. LIKE
D. <=
E. >=
2. 哪个实现  ......
2009-04-22 22:00
来源:中国
IT
实验
室 作者:佚名
Oracle
客
户
端与服
务
器端的
连
接是通
过
客
户
端
发
出
连
接
请
求,由服
务
器端
监
听器
对
客
户
端
连
接
请
求
进
行合法
检查
,如果
连
接
请
求有效,
则进
行
连
接,否
则
拒
绝该连
接。 ......