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

Batch script for automatic backup of Oracle database under Windows Server

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

@ echo off

REM #

Batch script for automatic backup of Oracle database under REM # Windows Server

REM #

REM takes the current system time, which may vary depending on the operating system.

Set CURDATE=%date:~0,4%%date:~5,2%%date:~8,2%

Set CURTIME=%time:~0,2%

If the number of REM hours is less than 10, add 0 in front.

If "% CURTIME%" = = "0" set CURTIME=00

If "% CURTIME%" = = "1" set CURTIME=01

If "% CURTIME%" = = "2" set CURTIME=02

If "% CURTIME%" = = "3" set CURTIME=03

If "% CURTIME%" = = "4" set CURTIME=04

If "% CURTIME%" = = "5" set CURTIME=05

If "% CURTIME%" = = "6" set CURTIME=06

If "% CURTIME%" = = "7" set CURTIME=07

If "% CURTIME%" = = "8" set CURTIME=08

If "% CURTIME%" = = "9" set CURTIME=09

Set CURTIME=%CURTIME%%time:~3,2%%time:~6,2%

REM sets the owner, user name, and password

Set OWNER=username

Set USER=username

Set PASSWORD=password

Set PREFIX=%OWNER%

REM creates a backup directory with a directory structure of backup/YYYYMMDD/

Set CURDIR=E:\ oraclebackup\

Set FILENAME=%CURDIR%\% PREFIX%_%CURDATE%_%CURTIME%.DMP

Set EXPLOG=%CURDIR%\% PREFIX%_%CURDATE%_%CURTIME%_log.log

REM calls ORACLE's exp command to export user data

Exp USER%/%PASSWORD%@rasvdb file=%FILENAME% log=%EXPLOG% owner=%OWNER% grants=n

Exit

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

Servers

Wechat

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

12
Report