Oracle's automated backup in a Linux environment
1. Automatic Export and history file Delete script
Su-oracle<<eof
Cd/db_backup/databak
MV Orabak*.*/db_backup/old
Exp Username/[email protected] full=y log=orabak ' date +%y%m%d%h%m '. Log File=/db_backup/databak/bzxtbakpipe &
gzip </db_backup/databak/bzxtbakpipe > Orabak ' Date +%y%m%d%h%m '. dmp.gz
Cd/db_backup/old
RM-RF orabak ' Date--date= ' 2 days ago ' +%y%m%d%h%m '. *
Eof
As shown in the following:
Automatic export and history file deletion scripts under Linux
2. backup file geo-copy Script
Su-oracle<<eof
Cd/db_backup/databak
SCP *.dmp.gz 10.130.112.48:/db_backup/databak/
Eof
As shown in the following:
Backup files geo-copy
3, the script automatically executes the scheduled task creation
Crontab-e
* * * * su-oracle-c/db_backup/backup_scripts/backupdb.sh
* * * */db_backup/backup_scripts/scpdmp.sh
As shown in the following:
Timed Task Creation
Oracle automated Backup in a Windows environment
1. Automatic Export and history file Delete script (BAT file)
Set date=%date:~0,4%%date:~5,2%%date:~8,2%
Echo%date%
Del *%date:~4,10%-5.dmp
Exp Nianjin/nianjin file=d:\temp\nianjin%date%.dmp Owner=nianjin
As shown in the following:
Simplified auto-Export script
2. backup file geo-copy script (win copy to Linux)
Ftp-n 192.168.226.129 < "E:\work\ various scripts \ftpq.txt"
User why 123456
Cd/home/why/ftptest
Bin
Put Seo.pptx
Bye
!
FTP script content and execution diagram
3, the script automatically executes the timed task
Add the above exported and geo-copied scripts to the scheduled tasks of Windows, and execute them at timed intervals (specific process).
Operational essentials: Oracle's own streamlined tutorials (Linux and Win)