views:

591

answers:

2

Is it possible to have same table name on different schema with different data on the tables within the one database? I think rather than create multiple database (that hold same table name) i should create multiple schema instead.

Something like:

Schema 1:
  table A, table B
Schema 2:
  table B, table X

PS: table B hold different data for each schema

And most basic question did every schema (user) hold different table set? In SQL Server and MySQL every user on same database have same table set, the difference was only on roles, how about Oracle?

Thanks

+4  A: 

Yes this is possible. A schema in Oracle is what a MySQL user would call a database.

However, you need to be careful when accessing either of the tables now if the user you connect with to the database instance has access to both. To unambiguously reference a table in a specific schema, use schema.table.

jackrabbit
Dels
no problem at all to give user same default and temp tablespace
Robert Merkwürdigeliebe
+2  A: 

Here's the documentation on namespaces: http://download.oracle.com/docs/cd/E11882%5F01/server.112/e10592/sql%5Felements008.htm#i27561

As jackrabbit says objects in different schemas have different namespaces.

Each schema in the database has its own namespaces for the objects it contains. This means, for example, that two tables in different schemas are in different namespaces and can have the same name.

Within a schema things are a little more complex.

Because tables and views are in the same namespace, a table and a view in the same schema cannot have the same name. However, tables and indexes are in different namespaces. Therefore, a table and an index in the same schema can have the same name.

David Aldridge