Greetings fellow DBAs:
I just dealt with a problem I personally haven't run into before
and thought that members of this list might be interested in
reviewing:
"User-A" owns all of a set of objects on Database
"Primary-DB" including tables "Table-1" through "Table-100".
"User-B" also exists on "Primary-DB", has no tables
of its own, but has been granted read access to some of
the User "A" tables, specifically tables "Table-1" through
"Table-9".
A developer wants me to create and populate two tables
in "User-B's" schema. Those tables are to be called exactly
the same name and have pretty much the same data as two
of the tables in "User-A's" schema, specifically "Table-6"
and "Table-7". To accomplish this, he gives me an export
from another database called "Secondary-DB" with just
those two tables in it.
I try to import the two tables into "User-B's" schema on
"Primary-DB". The import fails and I get the message
"Table or view already exists". I'm surprised at this since
the "User-B" schema doesn't have any tables defined in it.
To verify, I connect to the database as "User-B" and do a
SQL> select table_name from user_tables;
SQL> No rows selected.
Result: There are indeed no tables in "User-B's" schema.
Yet on attempting to import "Table-6" and "Table-7" into
"User-B's" schema, it tells me it can't do so because
those tables already exist!
To make a long story short, the solution to this enigma
is the following:
I came to find out that there had been a bunch of synonyms
defined, among which were these two:
SQL> create synonym User-B.Table-6 for User-A.Table-6;
SQL> create synonym User-B.Table-7 for User-A.Table-7;
so that when I tried to import "Table-6" and "Table-7" into
"User-B's" schema, the synonyms made Oracle think that
they already existed. I dropped the two offending synonyms:
SQL> drop synonym User-B.Table-6;
SQL> drop synonym User-B.Table-7;
after which the import worked just fine and all was well.
Just thought some of you out there might be interested...
Jim Damiano
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: James Damiano
INET: [EMAIL PROTECTED]
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
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).