Operational essentials: Oracle's own streamlined tutorials (Linux and Win)

Source: Internet
Author: User

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 command Script

Ftp-n 192.168.226.129 < "E:\work\ various scripts \ftpq.txt"

    • FTP Command Execution content

User why 123456

Cd/home/why/ftptest

Bin

Put Seo.pptx

Bye

!

    • The command execution diagram is as follows

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.