Re: need to capture time of my oracle export timing (349 Views)
Reply
Super Advisor
zxcv
Posts: 226
Registered: ‎04-09-2010
Message 1 of 9 (414 Views)
Accepted Solution

need to capture time of my oracle export timing

Hi ,

 

I have a script which takes oracle 9i export backup in a log , but it does not record start timing of export.

 

i would like to cover the same in log file.

 

this is what i see in log gile ;

 

Connected to: Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
Export done in US7ASCII character set and AL16UTF16 NCHAR character set

 

what i want is the actual timing ie.

smthg like which comes in forescreen when exp commnd is run.

 

Export: Release 9.2.0.7.0 - Production on Tue May 22 04:29:29 2012

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Please use plain text.
Advisor
Robert Herron
Posts: 21
Registered: ‎11-22-1998
Message 2 of 9 (406 Views)

Re: need to capture time of my oracle export timing

There's no way to capture the run times in file created by EXP's "LOG=" parameter.  Your best bet is to redirect EXP's STDOUT to a second log file and then append a date command to that STDOUT file.  For example:

 

!/bin/sh

export ORACLE_SID=ORCL

export ORACLE_HOME=/ora/product/9.2.0

export PATH=$ORACLE_HOME/bin:$PATH

export DMPFILE=/ora/backup/${ORACLE_SID}

 

exp USERID=user/pass FILE=${DMPFILE}.dmp LOG=${DMPFILE}.log FULL=Y ... > ${DMPFILE}.stdout

echo "exp finished with return code $? at `date`" >> ${DMPFILE}.stdout

 

Please use plain text.
Super Advisor
zxcv
Posts: 226
Registered: ‎04-09-2010
Message 3 of 9 (397 Views)

Re: need to capture time of my oracle export timing

Hi Robert,

 

Can we do a exp starting  time also like you had suggested finished time ?

 

 

 

 

Please use plain text.
Advisor
Robert Herron
Posts: 21
Registered: ‎11-22-1998
Message 4 of 9 (382 Views)

Re: need to capture time of my oracle export timing

Yes, you can but it is unnecessary since the EXP's stdout header includes the current date/time.

Please use plain text.
Super Advisor
zxcv
Posts: 226
Registered: ‎04-09-2010
Message 5 of 9 (374 Views)

Re: need to capture time of my oracle export timing

Hi Robert ,

 

But my EXP stdout doesnt capture it.

 

 

root #/db_dumps/acrb >cat fnsonlac_test_eod_backup_22052012.dmp.stdout


exp finished with return code 0 at Wed May 23 11:46:48 IST 2012


Please use plain text.
Super Advisor
zxcv
Posts: 226
Registered: ‎04-09-2010
Message 6 of 9 (366 Views)

Re: need to capture time of my oracle export timing

Hi Robert ,

This is  what i have in my script ;

 

 

exp EXPORT_USER/EXPORT_USER  file=$fname direct=y statistics=none log=$logfile owner=$own > ${fname}.stdout
echo "exp finished with return code $? at `date`" >> ${fname}.stdout

 

It doesnt capture start time displayed by exp command in ${fname}.stdout file.

 

 

 

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,975
Registered: ‎03-06-2006
Message 7 of 9 (359 Views)

Re: need to capture time of my oracle export timing

>It doesn't capture start time displayed by exp command in ${fname}.stdout file.

 

Change to:

echo "exp started at $(date)" > ${fname}.stdout

exp EXPORT_USER/EXPORT_USER  file=$fname direct=y statistics=none log=$logfile owner=$own >> ${fname}.stdout
echo "exp finished with return code $? at $(date)" >> ${fname}.stdout

Please use plain text.
Super Advisor
zxcv
Posts: 226
Registered: ‎04-09-2010
Message 8 of 9 (352 Views)

Re: need to capture time of my oracle export timing

Thanks again Dennis.
Please use plain text.
Advisor
Robert Herron
Posts: 21
Registered: ‎11-22-1998
Message 9 of 9 (349 Views)

Re: need to capture time of my oracle export timing

Sorry, there was a minor omission in my script sample.  Here's the corrected one:

 

!/bin/sh

 

export ORACLE_SID=ORCL
export ORACLE_HOME=/ora/product/9.2.0
export PATH=$ORACLE_HOME/bin:$PATH
export DMPFILE=/ora/backup/${ORACLE_SID}

 

exp USERID=user/pass FILE=${DMPFILE}.dmp LOG=${DMPFILE}.log FULL=Y ... > ${DMPFILE}.stdout 2>&1

echo "exp finished with return code $? at `date`" >> ${DMPFILE}.stdout

 

The detailed exp output is sent to STDERR and not STDOUT.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation