RE: Who Says Oracle does not listenAgree.
One can improve EXCEPTION section to ignore only relevant errors.

Alex.

----- Original Message -----
To: Multiple recipients of list ORACLE-L
Sent: Monday, July 21, 2003 6:19 AM


That's not good enough.
I don't want to discard ANY exception.
When dropping table, I don't want to see error messages only if there is
nothing to drop.  While if let's say there is a problem with privileges, it
will go unnoticed.
Or, when adding a table, it's fine not be getting an error, if table already
exists.  But, if there is no room to create a table, or to add a partition
to the table, I want to see this error message.

So, I still prefer my way of doing it (see scripts in my original message)
comparing to Oracle's script, you refer to.

Igor Neyman, OCP DBA
[EMAIL PROTECTED]


-----Original Message-----
[EMAIL PROTECTED]
Sent: Friday, July 18, 2003 6:10 PM
To: Multiple recipients of list ORACLE-L

>From ORACLE own script:
Rem
Rem Drop tables without raising errors if they do not exist
Rem
declare
   PROCEDURE drop_force(tab varchar2) IS
   BEGIN
      EXECUTE IMMEDIATE 'DROP TABLE ' || tab;
   EXCEPTION WHEN OTHERS THEN
      NULL;
   END;
begin
   drop_force('utl_recomp_invalid');
   drop_force('utl_recomp_sorted');
   drop_force('utl_recomp_compiled');
   drop_force('utl_recomp_backup_jobs');
   drop_force('utl_recomp_log');
end;
/
Alex.
-----Original Message-----
Sent: Friday, July 18, 2003 2:04 PM
To: Multiple recipients of list ORACLE-L

Sure, I would.
But I can't wait till Oracle "turns around".
My scripts are executed by our "field" engineers, who know next to nothing
about Oracle, and the only thing they can do is to check log files for error
messages (and even this is done automatically).
Igor Neyman, OCP DBA
[EMAIL PROTECTED]

-----Original Message-----
Goulet, Dick
Sent: Friday, July 18, 2003 3:44 PM
To: Multiple recipients of list ORACLE-L
Igor,
        True enough, but wouldn't you like it as part and parcel of the
command?
Dick Goulet
Senior Oracle DBA
Oracle Certified 8i DBA
-----Original Message-----
Sent: Friday, July 18, 2003 4:35 PM
To: Multiple recipients of list ORACLE-L

To avoid those errors in my scripts I'm checking data dictionary for the
"existence" of the object (fortunately, dynamic sql helps here):
REM Dropping synonym
DECLARE lCounter integer;
begin
SELECT COUNT(*) INTO lSyn
        FROM dba_synonyms WHERE synonym_name = 'PRCPV_REPORT_INFO' AND OWNER
= 'PUBLIC'; IF (lSyn = 1) THEN
        EXECUTE IMMEDIATE 'drop PUBLIC SYNONYM  PRCPV_Report_Info'; END IF;
end; /
or:
REM Adding column
DECLARE lCounter integer;
begin
SELECT count(*) INTO lCounter
        FROM DBA_TAB_COLUMNS
        WHERE table_name = 'PRCP_MENU'
          AND column_name = 'MENU_NAME'
          AND owner = 'IPN_DBA';
IF (lCounter = 0) THEN
        EXECUTE IMMEDIATE 'ALTER TABLE prcp_menu ADD menu_name
VARCHAR2(50) NULL';
END IF;
end;
/
Igor Neyman, OCP DBA
[EMAIL PROTECTED]

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Alex Feinstein
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to