symbolic ORA-XXXX names and classes of such

From: <>
Date: Sun, 07 Jun 2009 05:43:20 GMT
Message-ID: <YrIWl.8897$>

I'm adding code to my application to make it TAF-aware. TAF an excellent feature and I haven't had much problem getting the extra error checking in place.
  1. Is there some place where symbolic names for the ORA-XXXXX codes are defined?
  2. Is there some grouping or categorizing, such as "this is the set of all ORA errors you can get on a connect and that would benefit from a retry".

My code currently looks as per below, and I would like to be able to remove a bit of the hardcoded numbers. I've built up these numbers by trial and error.

Many TIA!

    # connect to the database, and retry on fixable exceptions     try:

    except cx_Oracle.DatabaseError,e:

# ORA-01033: ORACLE initialization or shutdown in progress
# ORA-12537: TNS:connection closed
# ORA-12528: TNS:listener: all appropriate instances are blocking
# new connections
# ORA-12521: TNS:listener does not currently know of instance
# requested in connect descriptor
# ORA-12520: TNS:listener could not find available handler for
# requested type of server

        if e.message.code in [1033,12537,12528,12521,12520]:
            print 'RETRYING:', e.message.message.strip()
Mark Harrison
Pixar Animation Studios
Received on Sun Jun 07 2009 - 00:43:20 CDT

Original text of this message