@echo off rem ----------------------------------------------------------------------- rem Filename: DBExp.bat rem Purpose: Export contents of an Oracle database rem Date: 05-Mar-2002 rem Author: Frank Naude, Oracle FAQ rem ----------------------------------------------------------------------- rem -- Set Database SID -- set ORACLE_SID=sgnt rem -- Keep 3 versions of the export log file -- if exist %ORACLE_SID%_2.log copy %ORACLE_SID%.log %ORACLE_SID%_3.log >NUL: if exist %ORACLE_SID%_1.log copy %ORACLE_SID%.log %ORACLE_SID%_2.log >NUL: if exist %ORACLE_SID%.log copy %ORACLE_SID%.log %ORACLE_SID%_1.log >NUL: rem -- Keep 3 versions of the export dump file -- if exist %ORACLE_SID%_2.dmp copy %ORACLE_SID%.dmp %ORACLE_SID%_3.dmp >NUL: if exist %ORACLE_SID%_1.dmp copy %ORACLE_SID%.dmp %ORACLE_SID%_2.dmp >NUL: if exist %ORACLE_SID%.dmp copy %ORACLE_SID%.dmp %ORACLE_SID%_1.dmp >NUL: rem -- Do the export -- exp 'sys/orcl as sysdba' full=yes file=%ORACLE_SID%.dmp log=%ORACLE_SID%.log rem -- Add timestamp to top of export log file -- date /T >timestamp.tmp copy timestamp.tmp + %ORACLE_SID%.log %ORACLE_SID%.tmp copy %ORACLE_SID%.tmp %ORACLE_SID%.log rem -- Cleanup temporary files -- del %ORACLE_SID%.tmp del timestamp.tmp