Using Reverse CT to execute scp, the solution for transferring incomplete files is expectscp.
Write a script to transfer files, similar to the following:
sendsystem(){expect -c " spawn scp $ORACLE_BASE/oradata/$ORACLE_SID/system01.dbf oracle@$S_IP:$ORACLE_BASE/oradata/standby/ expect { yes/no { send \"yes\r\"; exp_continue } *assword* { send \"oracle\r\" } }; expect 100% expect eof ; "}sendsysaux(){expect -c " spawn scp $ORACLE_BASE/oradata/$ORACLE_SID/sysaux01.dbf oracle@$S_IP:$ORACLE_BASE/oradata/standby/ expect { yes/no { send \"yes\r\"; exp_continue } *assword* { send \"oracle\r\" } }; expect 100% expect eof ; "}
Result:
spawn scp /home/oracle/std_control01.ctl oracle@192.168.134.134:/oracle/oradata/standby/std_control01.ctloracle@192.168.134.134's password: std_control01.ctl 100% 9520KB 9.3MB/s 00:00 spawn scp /oracle/oradata/orcl/system01.dbf oracle@192.168.134.134:/oracle/oradata/standby/oracle@192.168.134.134's password: system01.dbf 92% 646MB 33.9MB/s 00:01 ETAspawn scp /oracle/oradata/orcl/sysaux01.dbf oracle@192.168.134.134:/oracle/oradata/standby/oracle@192.168.134.134's password: sysaux01.dbf 100% 600MB 31.6MB/s 00:19 spawn scp /oracle/oradata/orcl/temp01.dbf oracle@192.168.134.134:/oracle/oradata/standby/oracle@192.168.134.134's password: temp01.dbf 100% 200MB 66.7MB/s 00:03 spawn scp /oracle/oradata/orcl/undotbs01.dbf oracle@192.168.134.134:/oracle/oradata/standby/oracle@192.168.134.134's password: undotbs01.dbf 100% 200MB 40.0MB/s 00:05
System01.dbf will not be passed after it is passed.
I tried several times and found that other files could not be uploaded.
The final result is that the default timeout value of CT is 30 S.
Manually add set timeout-1 to set the timeout value to infinity. The problem is solved.
sendsystem(){expect -c " set timeout -1 spawn scp $ORACLE_BASE/oradata/$ORACLE_SID/system01.dbf oracle@$S_IP:$ORACLE_BASE/oradata/standby/ expect { yes/no { send \"yes\r\"; exp_continue } *assword* { send \"oracle\r\" } }; expect 100% expect eof ; "}
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger. Red and black alliance, linux community stealing and turning to dead mom