--1.**表 
Create table **_one as
Select * from **_one@db_link;
CREATE INDEX **_one ON **_one 
(**)
noLOGGING
NOPARALLEL;--2.**表 
Create table **_two as
Select * from **_two@db_link;
CREATE INDEX **_two ON **_two 
(**)
noLOGGING
NOPARALLEL;每天需要晚间备份好多这样的表  有的可能 **_two需要依托**_one成功才能继续。对于远程只有一个查询帐号,其他功能都没有,除了这种方式还能有其他好办法吗?怎样写一个完整脚本能实现以上功能内,然后用crontab定时感谢各位高手了!!

解决方案 »

  1.   

    use strict;
    use vars qw($dbh $sth);# get a database handle连接数据库
    $dbh = DBI->connect('dbi:Oracle:', 'system@ora10g', 'password');# execute the statement handle备份
    $sth=$dbh->prepare('SELECT * FROM a12');
    $sth->execute();# loop through the results写文件
    open FILE,">>$date.txt";
    while (my (@r_city) = $sth->fetchrow())

        print FILE " @r_city \n";
    }$sth->finish();
    close FILE;$dbh->disconnect();
      

  2.   

    可以试试exp imp加上crontab的方式