cls
@echo off
REM Export Full database with auto filename for dump and log
REM This batch file will create the dump and log files in the same directory as of batch
REM File name syntax --> <SCHEMANAME>_<DD>_<MM>_<YYYY>
REM Auther: Deepu Mohan P, www.deepumohan.com
REM Created: 07-Sep-2009
REM Modified: 30-Sep-2009, 01-Oct-2009
REM Get user credentials
REM set /p schema=ipihr:
REM set /p pwd=i:
REM set /p sid=Xpharma:
set schema=%ipihr
set pwd=%i
set sid=%Xpharma
ECHO.
ECHO =======================================================
ECHO Starting Oracle Database Backup
ECHO =======================================================
REM Following block is for getting the year, month and day
REM ======================================================
FOR /f "tokens=2-4 skip=1 delims=(-)" %%G IN ('echo.^|date') DO (
FOR /f "tokens=2 delims= " %%A IN ('date /t') DO (
SET v_first=%%G
SET v_second=%%H
SET v_third=%%I
SET v_all=%%A
)
)
SET %v_first%=%v_all:~0,2%
SET %v_second%=%v_all:~3,2%
SET %v_third%=%v_all:~6,4%
REM =====================================================
REM exp %schema%/%pwd%@%sid% FILE=E:\JNP_%user%_%dd%_%mm%_%yy%.dmp log=%user%_%dd%_%mm%_%yy%.log
REM compress=N rows=Y grants=Y buffer=500000 FULL=Y statistics=NONE
E:\app\Administrator\product\12.2.0\dbhome_1\bin\exp ipihr/i@pharma FILE=E:\HR_Backup\IPIHR_%user%_%dd%_%mm%_%yy%.dmp log=E:\HR_Backup\IPIHR%user%_%dd%_%mm%_%yy%.log
compress=N rows=Y grants=Y buffer=500000 FULL=Y statistics=NONE
ECHO =======================================================
ECHO Completed Database Backup
ECHO =======================================================
--pause
No comments:
Post a Comment