Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement oracle Database backup and restore tool by batch processing

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces how batch processing to achieve oracle database backup and restore tool, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

This is written for oracle and can be used on different computers, because it automatically reads the environment variables of the current computer to obtain the installation path of oracle. The only deficiency is that an intermediate text file will be generated during the running of the program, but this does not hinder the big deal. After backup or restore, the text file will be automatically deleted as follows:

@ echo off&setlocal enabledelayedexpansion

Color 0a

: start

For / f "tokens=2 delims=="% an in ('path') do (

Set "str=%%a"

Set stringent statr: = +!

For I in (! str!) Do (

Set "var=%%i"

Set varicose var. lug =!

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 choice%==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 storage path (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 start

: imp

Del / q change.txt

Set / p file= drag the database file you want to import into the window:

"% var%"\ imp.exe smhr/smhr file=%file% full=y

Set / p choice=1. Continue 2. Press any key to exit:

If choice%==1 goto start

Thank you for reading this article carefully. I hope the article "how to implement the oracle database backup and restore tool for batch processing" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report