---
title: "数据库中大字段在不同库表之间的读写"
author: "listen-raining"
date: "2014-06-22T01:01:04Z"
tags: []
categories: ["数据库"]
slug: "untitled"
draft: false
lastmod: "2014-06-22T01:01:04Z"
id: 2083361
url: "https://listen-raining.iteye.com/blog/2083361"
---

数据库中大字段在不同库表之间的读写


例如要将测试库中的表导入到生产库，且表中含有大字段。

首先在生产库建DBLINK。

然后：

--创建临时表 (在生产库执行)
create global temporary table reprot_sql_bak 
as 
select * from c_report_sql_bak@ZBJS_TEST where  report_id like '%CZTF%' or report_id like '%GNSJ%';


--在生产库执行
--执行一下操作，但不要提交(commit)
insert into reprot_sql_bak 
select * from  c_report_sql@ZBJS_TEST where  report_id like '%CZTF%' or report_id like '%GNSJ%';




---执行如下脚本。（在生产库执行）

insert into c_report_sql
select * from reprot_sql_bak ;  




                              2014-06-22 0:59@yuqiaolu.pudongqu.shanghai.