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
相关文档:
以下是在后台更新易拓ERP数据库时遇到的一个问题:
1.在DB14数据库中将料件号P44开头,并且品名为"塑料袋"的料件改为消耗性料件.
这个简单: UPDATE DB14.ima_file SET ima70 = ‘Y’ WHERE ima01 like ‘P44%’ AND ima0 ......
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String URL=dbmes.url;
Connection con = DriverManager.getConnection(URL,dbmes.usrname,dbmes.pwd);
try{
// 准备语句执行对象
String bh=request.getParameter("dwmc");
Statement stmt = con.createStatement() ......
oracle 存储过程和函数学习笔记
1、创建过程的语法:
Code
create [or replace] procedure procedure_name
[(argument[{in|out|in out}] type,
argument[{in|out|in out}] type)]&n ......
1.数据库,表,用户等成功导出
①导出整个数据库 & ......
出处:http://hi.baidu.com/vcy168/blog/item/877945d908c3d52611df9ba0.html
Windows下ORACLE 10g安装与操作图解
刚刚接触ORACLE的人来说,从那里学,如何学,有那些工具可以使用,应该执行什么操作,一定回感到无助。所以在学习使用ORACLE之前,首先来安装一下ORACLE 10g,在来掌握其基本工具。俗话说的好:工欲善其事 ......