Oracle win server at regular backup script (data pump)

For more information about Oracle Data Pump import and export, please see

https://www.cnblogs.com/wuhuankang/p/11419318.html

 

1. First to dba login database, create a directory and authorize the user (tims user name, c: \ the Back To create a directory)

sqlplus / as sysdba

Create directory back as 'c:\back';

Grant read,write on directory back to tims;

 

mkdir c:\back

 

2. backup script follows

@echo start the backup ....

This program uses @echo zip compression, the backup file may be used or zip rar decompression.

set instanse=orcl

set backpath=c:\test

set mydate=%date:~0,4%%date:~5,2%%date:~8,2%

set username=tims

set password=123123

set extname=rar

set filename=%username%-%mydate%

expdp %username%/%password%@%instanse% schemas=%username% directory=test dumpfile=%filename%.dmp logfile=%filename%.log

 

"C:\Program Files (x86)\WinRAR\WinRAR.exe" a %filename%.%extname% %filename%.dmp %filename%.log

 

del %filename%.dmp

del %filename%.log

 

@echo been backed up!

 

@echo backup file:.% filename%% extname%

 

@echo execute sql ....

@echo off

echo OK!

Guess you like

Origin www.cnblogs.com/wuhuankang/p/11429418.html