Wrote a script to transfer the file, similar to this:
Sendsystem (){Expect-c "Spawn SCP$ORACLE _base/oradata/$oracle_sid/system01.dbf [email protected]$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 [email protected]$S _ip:$Oracle_base/oradata/standby/expect{Yes/no{Send\"Yes\ r\"; Exp_continue}*assword*{Send\"Oracle\ r\" } }; Expect 100%Expect EOF; "}
Results:
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% 9520 KB 9.3mb/s 00:00 Spawn scp/oracle/oradata/orcl/system01.dbf [email protected]:/oracle/oradata/standby/[email prote CTED] 'SPassword:System01.dbf the%646MB33.9MB/sxx: on 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% 600 MB 31.6mb/s 00:19 Spawn scp/oracle/oradata/orcl/temp01.dbf [email Protected]:/oracle/oradata/standby/[email Protect Ed] 'SPassword:Temp01.dbf -% $MB66.7MB/sxx:GenevaSpawn scp/oracle/oradata/orcl/undotbs01.dbf Oracle@192.168.134.134:/oracle/oradata/standby/Oracle@192.168.134.134' s password:undotbs01.dbf 100% 200 MB 40.0mb/s 00:05
SYSTEM01.DBF didn't pass it.
I've tried it a couple of times, and sometimes the other files don't pass through.
Last found because the expect default timeout is 30S
Manually add set Timeout-1 setting time-out is infinity, problem solved
sendsystem () { expect-c "set Timeout-1 Spawn SCP $ORACLE _base/oradata/$ oracle_sid/system01.dbf [email ;p rotected] $S _ip:$ oracle_base/oradata/standby/expect { yes/no { send \" yes\r \ "; Exp_continue *assword* { send \ " oracle\r \" Span class= "Hljs-special" ">} } ; Expect 100% expect EOF; "}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Implementation of SCP via expect, incomplete resolution of transfer files