暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

FND_LOBS大表备份报01555快照太旧

原创 杨金福 云和恩墨 2021-11-14
713

前景:

   EBS XTTS跨平台迁移,需对大表FND_LOBS单独备份下,采用create table fnd_lobs_bk select * from fnd_lobs 报01555快照太旧

下列采用每1000行为一批,循环插入新表,避免报01555快照太旧

--创建空表

--create table apps.fnd_lobs_bk as select * from fnd_lobs where 1=2;

--循环插入(1000行提交一次)

declare

--声明集合类型

type file_id_type is table of APPS.FND_LOBS.file_id%type;

type file_name_type is table of APPS.FND_LOBS.file_name%type;

type file_content_type_type is table of APPS.FND_LOBS.file_content_type%type;

type file_data_type is table of APPS.FND_LOBS.file_data%type;

type upload_date_type is table of APPS.FND_LOBS.upload_date%type;

type expiration_date_type is table of APPS.FND_LOBS.expiration_date%type;

type program_name_type is table of APPS.FND_LOBS.program_name%type;

type program_tag_type is table of APPS.FND_LOBS.program_tag%type;

type language_type is table of APPS.FND_LOBS.language%type;

type oracle_charset_type is table of APPS.FND_LOBS.oracle_charset%type;

type file_format_type is table of APPS.FND_LOBS.file_format%type;

--声明变量

v_file_id file_id_type;

v_file_name file_name_type;

v_file_content_type file_content_type_type;

v_file_data file_data_type;

v_upload_date upload_date_type;

v_expiration_date expiration_date_type;

v_program_name program_name_type;

v_program_tag program_tag_type;

v_language language_type;

v_oracle_charset oracle_charset_type;

v_file_format file_format_type;


cursor cur_fnd_lobs is select * from APPS.FND_LOBS;


begin


open cur_fnd_lobs;

loop

exit when cur_fnd_lobs%notfound;

fetch cur_fnd_lobs bulk collect into v_file_id,v_file_name,v_file_content_type,v_file_data,v_upload_date,v_expiration_date,v_program_name,v_program_tag,v_language,v_oracle_charset,v_file_format limit 1000;

for i in 1..v_file_id.count loop

insert into APPS.FND_LOBS_BK(file_id,file_name,file_content_type,file_data,upload_date,expiration_date,program_name,program_tag,language,oracle_charset,file_format) values (v_file_id(i),v_file_name(i),v_file_content_type(i),v_file_data(i),v_upload_date(i),v_expiration_date(i),v_program_name(i),v_program_tag(i),v_language(i),v_oracle_charset(i),v_file_format(i));

end loop;

commit;

end loop;

close cur_fnd_lobs;

end;

/

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论