Oracle database Backup Restore tool written by batch _dos/bat

Source: Internet
Author: User
This is written for Oracle, can be used on different computers, because it will automatically read the current computer environment variables, so as to obtain the Oracle installation path, the only point is that the program is running in the process will produce an intermediate text file, but this is not a big deal, After the backup or restore is over, the resulting text file will be automatically deleted, as follows:
Copy Code code as follows:

@echo off&setlocal enabledelayedexpansion
Color 0a
: Start
for/f "tokens=2 delims=="%%a in (' Path ') does (
Set "Str=%%a"
Set Str=!str: =+!
for%%i in (!str!) do (
Set "var=%%i"
Set var=!var:+=!
Echo!var!>>change.txt
    for/f "delims="%%i in (' findstr ' Oracle "Change.txt ') do Set var=%%i
)

)

set/p choice=1. Backup 2. Restore 3. Press any key to exit:
If%choice%==1 goto exp
If%ch oice%==2 goto IMP
: Exp
del/q change.txt
set/p file= Please enter the file name of the spare parts database:
set/p path= Please enter the path to be stored (remember the colon:):
%var% \exp.exe smhr/smhr file=%path%\%file% full=n
set/p choice=1. Continue 2. Press any key to exit:
If%choice%==1 goto Star T
: Imp
del/q change.txt
set/p file= Please drag the database file you want to import into the body:
"%var%" \imp.exe smhr/smhr file=%file% Y
set/p choice=1. Continue 2. Press any key to exit:
If%choice%==1 goto start

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.