2

I was given an oracle dump file for an existing system. The dump file contained the table PARTS but when I look on the queries being done by the code. It uses mostly M_PARTS and just on one occasion, it uses PARTS. Does oracle allow multiple name on a table?

Note that I am not talking about the alias feature. ie.

Select M_PARTS.*
from PARTS M_PARTS

I want to know if there is a setting to make permanent alias in oracle. Where I just create a table PARTS and I can refer to it as either PARTS or M_PARTS in my query.

Nap
  • 8,096
  • 13
  • 74
  • 117

3 Answers3

4

Kind of, as you can create synonyms:

CREATE SYNONYM PARTS FOR THE_SCHEMA.M_PARTS; 

It is weird however, that the dump file would be inconsistent that way. Are you sure it is the same table? How was the file created?

Thilo
  • 257,207
  • 101
  • 511
  • 656
  • I think the guy that created the dump file only added all tables and table values. All the other objects are gone, VIEWS, REFRESH OBJECTS, etc. – Nap Feb 24 '12 at 02:27
1

Yes using synonyms.

softveda
  • 10,858
  • 6
  • 42
  • 50
0

Although a synonym was a solution, I found the actual script to build the database and it uses a materialized view instead of a synonym.

create materialized view M_Parts            
tablespace USERS
refresh fast
as select * from Parts
Nap
  • 8,096
  • 13
  • 74
  • 117
  • Yeah. I do not know why the original designer of the system. They created refresh groups for several materialized view and always refresh the group when the application restarts. Probably for performance improvement. – Nap Feb 27 '12 at 04:04