LOGICAL BACKUP PLAN - DUMP FILE FOR TRANSFFER AND BACKUP DATA
prerequisites and assumption :
====================
- Oracle 11gr2 installed on WINDOWS
- installed DB name : ORCL
TO DO :
======
1-
CREATE NEW FOLDER NAME "BACKUP" IN
C:
2-
LOGIN AS SYSDBA
3-
SQL>CREATE OR REPLACE DIRECTORY BACKUP AS
'C:\BACKUP\';
5-
SQL>CREATE USER "BACKUPUSER"
IDENTIFIED BY "BACKUP1" DEFAULT TABLESPACE "USERS" TEMPORARY
TABLESPACE "TEMP" ACCOUNT UNLOCK;
SQL>GRANT CONNECT
TO BACKUPUSER;
SQL>GRANT
RESOURCE TO BACKUPUSER;
SQL>GRANT
EXP_FULL_DATABASE TO BACKUPUSER;
SQL>GRANT
READ,WRITE ON DIRECTORY BACKUP TO BACKUPUSER;
6-MAKE AUTODUMP.BAT IN C:\BACKUP LIKE BELOW :
============================================================================================
@Echo off
For
/f "tokens=1-4 delims=/ " %%a in ('date /t') do (set
mydate=%%c_%%a_%%b)
For
/f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)
For
/f "tokens=1-2 delims=/:" %%a in ("%TIME%") do (set
mytime=%%a%%b)
expdp BACKUPUSER/BACKUP1@ORCL full=y
directory=BACKUP dumpfile='expdp_dumpfile_%mydate%_%mytime%.dmp'
logfile=dumpfile_exp%mydate%.log
if
%ERRORLEVEL%==0 (echo "Success") else (echo "Failed with error
code: " %ERRORLEVEL%)
7-
RUN AUTODUMP.BAT FILE
TO CHECK IT ( TWO FILE (DMP ,LOG )SHOULD BE LOCATED IN C:\BACKUP)
8- USE WINDOWS SCHEDULE TO CALL AUTODUMP.BAT FILE IN DAILY BASES
8- USE WINDOWS SCHEDULE TO CALL AUTODUMP.BAT FILE IN DAILY BASES