orcel向mysql推送数据,在MySQL和Oracle数据库之间传输数据

Here's the scenario:

I have a MySQL DB, and an Oracle DB, and what I want to do is copy data from MySQL to Oracle, on a scheduled basis.

The process includes just inserting data to a table on the Oracle side, taken from the MySQL db.

Something like this: (oracle command)

insert into my_oracle_table

select * from my_mysql_table@my_mysql_db

where date > sysdate - 7;

What is the best practice for this? Is there a way to connect say to the MySQL db directly from an Oracle stored procedure? Maybe the other way round?

Oracle 11g and MySql 5.1

解决方案

Create a database link from your Oracle server to the MySQL server.

Once the database link has been established, you can use the standard insert into.. select from syntax

insert into my_oracle_table

select * from my_mysql_table@dblinkname

where date > sysdate - 7;

If you want to do this on a scheduled basis, use the job scheduler to schedule the transfer.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值