Operating System - HP-UX
1745816 Members
3622 Online
108722 Solutions
New Discussion

Re: need to capture time of my oracle export timing

 
SOLVED
Go to solution
zxcv
Super Advisor

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.


8 REPLIES 8
Robert Herron
Advisor

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

 

zxcv
Super Advisor

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 ?

 

 

 

 

Robert Herron
Advisor

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.

zxcv
Super Advisor

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


zxcv
Super Advisor

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.

 

 

 

Dennis Handly
Acclaimed Contributor
Solution

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

zxcv
Super Advisor

Re: need to capture time of my oracle export timing

Thanks again Dennis.
Robert Herron
Advisor

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.