1.编写一次性备份脚本;
#export s 20231204
30 21 07 12 * /bin/sh /home/oracle/s/export_1204.sh &> /dev/null
vi /home/oracle/s/export_1204.sh
#!/bin/bash
source /home/oracle/.bash_profile
exec >> /home/oracle/s/export_1204.log
for i in `cat /home/oracle/s/partition_1204.txt`
do
expdp \'/ as sysdba\' directory=EXP_SHUNLI dumpfile=T_WX_Q_TR_$i.dmp logfile=T_WX_Q_TR_$i.log content=DAT
A_ONLY COMPRESSION=DATA_ONLY tables=Q.T_WX_Q_TR:$i
done
date
vi /home/oracle/s/partition_1204.txt
P20230101
P20230102
P20230103
P20230104
P20230105
2.编写一次性scp脚本; 限速 100M ,传递速度 12.5MB/s
#scp s 20231207
43 10 07 12 * /bin/sh /home/oracle/s/scp_1207.sh &> /dev/null
vi /home/oracle/s/scp_1207.sh
#!/bin/bash
source /home/oracle/.bash_profile
exec >> /home/oracle/s/scp_1207.log
cd /u01/shunli
sshpass -p 2023ss1207 scp -l 102400 T_WX_Q_TR_P* 1.3.12.9:/data/edb_1/T_WX_Q_TR
date
标签:备份,TR,sh,oracle,home,定时,scp,WX From: https://www.cnblogs.com/ss-33/p/17881259.html