17,086
社区成员
发帖
与我相关
我的任务
分享
select 'create sequence username.'|| SEQUENCE_NAME || ' minvalue '||MIN_VALUE||' maxvalue '||MAX_VALUE||' start with
'||LAST_NUMBER||' increment by '||INCREMENT_BY||' cache '||CACHE_SIZE||' ;' from dba_sequences
where SEQUENCE_OWNER='username';
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 ;
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
utl_file我还不知道是什么,先查查看--1.用sys用户赋予当前用户相关权限
Grant create any directory to HH7YX;
GRANT WRITE,READ ON DIRECTORY dir_test TO HH7YX;
GRANT EXECUTE ON utl_file TO HH7YX;
--2.创建directory
create or replace directory dir_test as 'D:\';
--3.utl 写入文件
declare
out_file utl_file.file_type;
begin
out_file := utl_file.fopen('DIR_TEST', 'llh.sql', 'W');
for i in (select dbms_metadata.get_ddl('SEQUENCE', t.sequence_name) seq
from dba_sequences t
where t.sequence_owner = 'HH7YX') loop
utl_file.put_line(out_file, i.seq||';');
end loop;
utl_file.fflush(out_file);
utl_file.fclose(out_file); --关闭文件流
end;
select dbms_metadata.get_ddl('SEQUENCE', t.sequence_name)
from dba_sequences t
where t.sequence_owner = 'HH7YX';
2.你所说的 再导成sql文件,这个文件是要啥内容啊?