Batch backup Oracle

Source: Internet
Author: User

@ Echo off
@ Title Oracle simple data backup tool
: StartBackupData
Cls
Echo.
Echo Oracle simple data backup tool
Echo.
Set nowDate = % date :~ 0, 4% % date :~ 5, 2% % date :~ 8, 2%
Set/p oraHost = enter the address of the Oracle server (192.168.0.2 by default ):
If "% oraHost %" = "" set oraHost = 192.168.0.2
Cls
Echo.
Echo Oracle simple data backup tool
Echo.
Echo current backup information:
Echo.
Echo Oracle server address: % oraHost %
Set/p oraProt = enter the Oracle server port (default value: 1522 if left blank ):
If "% oraProt %" = "" set oraProt = 1522
Cls
Echo.
Echo Oracle simple data backup tool
Echo.
Echo current backup information:
Echo.
Echo Oracle server address: % oraHost %
Echo Oracle server port: % oraProt %
Set/p oraServer = enter the name of the Oracle service instance (left blank: orcl by default ):
If "% oraServer %" = "" set oraServer = orcl
Cls
Echo.
Echo Oracle simple data backup tool
Echo.
Echo current backup information:
Echo.
Echo Oracle server address: % oraHost %
Echo Oracle server port: % oraProt %
Echo Oracle service instance name: % oraServer %
: SetUsername
Cls
Echo.
Echo Oracle simple data backup tool
Echo.
Echo current backup information:
Echo.
Echo Oracle server address: % oraHost %
Echo Oracle server port: % oraProt %
Echo Oracle service instance name: % oraServer %
Set/p oraUsername = enter the Oracle user name:
If "% oraUsername %" = "" goto: setUsername
Cls
Echo.
Echo Oracle simple data backup tool
Echo.
Echo current backup information:
Echo.
Echo Oracle server address: % oraHost %
Echo Oracle server port: % oraProt %
Echo Oracle service instance name: % oraServer %
Echo Oracle Username: % oraUsername %
: SetPassword
Cls
Echo.
Echo Oracle simple data backup tool
Echo.
Echo current backup information:
Echo.
Echo Oracle server address: % oraHost %
Echo Oracle server port: % oraProt %
Echo Oracle service instance name: % oraServer %
Echo Oracle Username: % oraUsername %
Set/p oraPassword = enter the Oracle password:
If "% oraPassword %" = "" goto: setPassword
Cls
Echo.
Echo Oracle simple data backup tool
Echo.
Echo current backup information:
Echo.
Echo Oracle server address: % oraHost %
Echo Oracle server port: % oraProt %
Echo Oracle service instance name: % oraServer %
Echo Oracle Username: % oraUsername %
Echo CMDL password: % oraPassword %
Set/p expFilePath = enter the location where the exported data is stored (the default path is C: \ % oraUsername % _ % nowDate %. dmp ):
If "% expFilePath %" = "" set expFilePath = C: \ % oraUsername % _ % nowDate %. dmp
: SetConfirmBackup
Cls
Echo.
Echo Oracle simple data backup tool
Echo.
Echo current backup information:
Echo.
Echo Oracle server address: % oraHost %
Echo Oracle server port: % oraProt %
Echo Oracle service instance name: % oraServer %
Echo Oracle Username: % oraUsername %
Echo CMDL password: % oraPassword %
Echo storage location: % expFilePath %
Echo.
Set/p oraBackConfim = enter the database information to be backed up, y to back up, and n to back up again:
If "% oraBackConfim %" = "y" goto: setBackupData
If "% oraBackConfim %" = "n" (goto: startBackupData) else (goto: setConfirmBackup)
Exit
: SetBackupData
Echo.
Echo starts backing up the database...
Exp % oraUsername %/% oraPassword % @ % oraHost %: % oraProt %/% oraServer % full = n buffer = 65535 feedback = 10000 file = % expFilePath %
Pause> nul

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.