Re: help: dropping synonyms

From: Chris Hall <chris_at_iifs.iisc.co.uk>
Date: 1996/10/31
Message-ID: <3278CB6D.20C6_at_iifs.iisc.co.uk>#1/1


Eric Anthony Spear wrote:
>
> I have created a whole bunch of public synonyms that I would now like to drop. I'd rather not have to explicitly drop each one.
>
> Instead, can I drop them all at once?
>
> They are all owned by the same user (who has been dropped, by the way).
>
> Thanks in advance.

You could create a dynamic SQL script to do this, as system:

SELECT
    'DROP PUBLIC SYNONYM ' || owner || '.' || synonym_name || ';' FROM
    dba_synonyms
WHERE
    owner = 'whoever'
/

This should be spooled to a file, and then run. You may have to mess around with the set options to remove headers and stuff.

Chris. Received on Thu Oct 31 1996 - 00:00:00 CET

Original text of this message