我正在建立一个数据库来保存永久冻土的信息。我想做它的表导出到CSV的每周,然后上传到FTP网站,在那里它可以由客户批量下载。
我要使用的web服务器是Linux CentOS7机器。
执行此操作的可靠方法是什么?
发布于 2020-05-06 05:47:20
一个非常简单的shell脚本。这就是我脑海中浮现的轮廓。未经测试,因此可能有一些细节需要调整。
#!/bin/sh
ORACLE_SID=mydbname
ORAENV_ASK=NO
source oraenv
sqlplus / as sysdba @getcsv.sql
scp foobar.txt your_username@remotehost.edu:/some/remote/directory 还有getcsv.sql ..。
set echo off feedback off verify off trimsp on head off lines 2048 pages 0
set colsep ','
spool foobar.txt
select * from mytable;
spool off
exithttps://stackoverflow.com/questions/61622697
复制相似问题