易截截图软件、单文件、免安装、纯绿色、仅160KB

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 行级锁的开销

首先来复习一下行级锁的机制。当一个事务开始时必选先申请一个TX锁(保护回滚段、回滚数据块),只有先申请到回滚段资源后才能开始一个事务,才能进行DML操作。这个动作完成后,事务就可以开始修改数据了。当修改数据表的记录时,遵循以下的操作顺序。
1.获得表的TM锁(保护事务执行过程中其它用户不能修改表结构)
2.在 ......

Oracle 10G 数据库文件目录结构

Oracle 10G 数据库文件目录结构 
在Oracle Database 10g中,Oracle的目录结构是由Oracle_Base及其子目录Oracle_Home、admin、flash_recovery_area和oradata目录构成的。为方便讨论,用Oracle_Base代表Oracle目录树的根,用Oracle_Home表示根目录下的主目录。
1.Oracle_Base目录
Oracle_Base代表Oracle目录树的根。 ......

读取oracle中blog字段

 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监听器安装与配置

2009-04-22 22:00
来源:中国
IT
实验
室 作者:佚名
 
Oracle


端与服

器端的

接是通









求,由服

器端

听器









行合法
检查
,如果



求有效,
则进


接,否


绝该连
接。 ......

Oracle:查找表的主键,外键,唯一性约束,索引

1、查找表的所有索引(包括索引名,类型,构成列):
select t.*,i.index_type from user_ind_columns t,user_indexes i where t.index_name = i.index_name and t.table_name = i.table_name and t.table_name = 要查询的表
2、查找表的主键(包括名称,构成列):
select cu.* from user_cons_columns cu, user_con ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号