How to create a dmp file with current system date [message #244824] |
Thu, 14 June 2007 03:48  |
prlzuby
Messages: 35 Registered: June 2006 Location: Pakistan
|
Member |
|
|
Hello All;
I have made a script to create a dump for oracle user, I have a proble to make a dump file with current sysdate like ex20070613, exp20070614.
Waiting for someone's answer, who is really genius
Zaheer
|
|
|
Re: How to create a dmp file with current system date [message #244901 is a reply to message #244824] |
Thu, 14 June 2007 09:26  |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Something like this?REM TEST.BAT
@echo off
setlocal
for /f "tokens=2" %%i in ("%date:/=_%") do set vdate=%%i
for /f "tokens=1,2 delims=:" %%i in ("%time: =%") do set vdate=%vdate%_%%i%%j
exp.exe userid=scott/tiger@ora10lp file=c:\temp\exp%vdate%.dmp
endlocal
echo on
When executed:C:\TEMP>test
Export: Release 10.2.0.1.0 - Production on ╚et Lip 14 16:23:53 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
Export done in EE8MSWIN1250 character set and AL16UTF16 NCHAR character set
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SCOTT
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SCOTT
About to export SCOTT's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SCOTT's tables via Conventional Path ...
. . exporting table BONUS 0 rows exported
. . exporting table DEPT 6 rows exported
. . exporting table DUMMY 1 rows exported
. . exporting table EMP 14 rows exported
. . exporting table SALGRADE 5 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
C:\TEMP>dir *.dmp
Volume in drive C has no label.
Volume Serial Number is B0C4-68EB
Directory of C:\TEMP
14.06.2007 16:24 20.480 exp14.06.2007_1623.dmp
|
|
|