Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
PART II: - Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit

PART II: - Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit

2005-08-31       - By oracle@(protected)

Reply:     1     2     3     4     5     6     7     8     9     10     >>  

Marquez, Chris wrote:

> I think I get it.
> The idea is to put conditional logic around the calling of (my)
> imp_script.sh?
> I think that is what Ron is suggesting too?
>

yep - essentially you're stuffing the errorlevel of the last program
that ran into a variable and then comparing that value - if it's 0,
typically that implies that everything was ok.  Well written programs
exit with a non-zero errorlevel when there is a problem.  Oracle's
utilities exit with a non-zero errorlevel when things go wrong so you're
safe there.


imp and exp are good candidates for this because you can automate the
entire process (within reason) into a script and as long as the
errorlevels are 0, AND as long as your logic for going from one process
to the next is sound you'll be ok.  The entire environmental maintenance
here (several databases on several different servers) is 80% automated
as cron jobs.  Easy and simple - I find that the commenting parts of the
scripts are the most tedious than the actual work being done - I write
comments in scripts so that the receptionist up front could read it and
have a basic understanding of the logic.  Makes it simpler to delegate
work to others because they can (hopefully) read the scripts and figure
it out for themselves instead of requiring weeks of my time doing a
bunch of hand-holding.


hope this helps

> Chris Marquez
> Oracle DBA
>
>
> -- --Original Message-- --
> From: oracle@(protected) [mailto:oracle@(protected)]
> Sent: Wed 8/31/2005 11:37 AM
> To: Marquez, Chris
> Cc: oracle-l@(protected)
> Subject: Re: PART II: - Beyond a basic Oracle EXP/IMP shell script:
> Error Handling & Exit Status?
>
>
>
> There's a million ways to do what you're wanting to do.  Here's some
> cutesy things I do within bash scripts....   $? is your friend.
>
> BCVStatus=0
> /opt/emc/WideSky/V5.3.0/bin/symmir -g DBNAME verify DB1-DBNAME BCV ld
> BCV-DBNAME -synched > /dev/null 2>&1
> BCVStatus=$?
> until [ "$BCVStatus" = 0 ]
> do
>         sleep 5;
>         /opt/emc/WideSky/V5.3.0/bin/symmir -g DBNAME verify DB1-DBNAME
> BCV ld BCV-DBNAME -synched > /dev/null 2>&1
>         BCVStatus=$?;
> done
>
>
>
>
>
> Copious output for reading cron output after getting to the office...
>
> echo "`/bin/date +%H:%M:%S` Export D_S tables"
> $ORACLE_HOME/bin/exp / file=/e07/oracle/export/exp_das_$TSTAMP.dmp
> TABLES=BLAH1,BLAH2
> LOG=/d02/app/oracle/admin/DBNAME/adhoc/logs/exp_das_$TSTAMP.log
> STATUS=$?
>  if [ $STATUS -gt 0 ]; then
>   echo "*** Export encountered errors - errorlevel $STATUS"
>   echo "*** Export encountered errors - errorlevel $STATUS" |
> /usr/ucb/mail -s "DBNAME refresh failed:  Export D_S encountered errors"
> dba@(protected)
>   exit 1
>  fi
> echo "`/bin/date +%H:%M:%S` Export D_S tables complete"
>
>
>
>
> hope this helps
>
>
>
>


--
http://www.freelists.org/webpage/oracle-l