---
title: "sqlplus copy"
author: "gip666"
date: "2013-05-15T14:55:26Z"
tags: []
categories: ["数据库"]
slug: "sqlplus-copy"
draft: false
lastmod: "2013-05-15T14:55:26Z"
id: 1869768
url: "https://gip666.iteye.com/blog/1869768"
---

当两个数据库服务器不能相互链接时，我们需求定时的去将一个数据库的数据导入到另一个数据库，这时候第三台服务器可连接两台服务器，这时候就要使用SQLPLUS COPY。
如下语句，使用批处理执行

column table_name new_value table_name ;
select to_char(sysdate-1,'yymmdd') table_name  from dual;

copy from abc/abc@IP1:1521/orcl to abc/abc@IP2:1521/orcl create  copy_test&&table_name  using select *  from copy_test_&&table_name;

其中表名是每天动态生成的按天分表