Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm studying Oracle and I would like to understand the uniqueness or constrains when assigning these parameters.

Suppose a machine with a single OS (host) and 2 different databases (physical). Are they forced to use different db_name in following cases?

  • They share ORACLE_HOME
  • They don't share ORACLE_HOME

How is this related when db_unique_name enters in the game? What's the point?

So far reading in Forums and offical Docs I got the following assumption :

EDITED

This is what created me confusion: http://www.mail-archive.com/oracle-l@fatcity.com/msg10241.html

Then, you could have following situations:

  • Repeated DB_NAME is not possible within the same ORACLE_HOME (no matter OS and SID) for the DB_NAME is stenciled onto the files for that DB. There are 2 exceptions (Parallel Server/RAC though they are indeed different instances of the same database, and Primary-Standby systems, where need a common DB_NAME and Oracle provides us with the DB_UNIQUE_NAME mechanism)

  • For different ORACLE_HOMEs, it is possible as each installation does not see the other and they don't conflict when sharing DB_NAME, but is strongly undesirable. Besides, on Windows, every instance is mapped to a service OracleService%SID%, so that makes impossible to have two different SIDs on the same OS, even if an instance ID is defined as ORACLE_HOME + ORACLE_SID. But as by default (and it's an ORACLE recommendation for conventional setups) DB_NAME = SID, even in different ORACLE_HOME, 2 databases in Windows are likely to fail due to a SID default name that is common (so the second service cannot be created).

... but more authoritative answers are still welcome!

share|improve this question
1  
Just in practice is better to avoid using the same name for different databases. Even on different servers. You will never know when the names will collide - Enterprise Manager, backups, etc. –  Mindaugas Riauba Jul 18 '13 at 14:06
add comment

migrated from stackoverflow.com Jul 18 '13 at 0:02

This question came from our site for professional and enthusiast programmers.

1 Answer

  1. You can have 2 databases with the same db_name on the same system on linux in the same ORACLE_HOME. You just have to make sure that the instance name differs. EG different pfile/spfile,... It's just not advised to give them the same name... When running the runinstaller you just give them the same global name and a different SID. --> Not sure how Windows reacts on it.

  2. The reason why the db_name has to be the same in a primary-standby setup is because the name is "imprinted" on the datafiles. The db_unique_name is mandatory in order to make a difference between the databases and to setup a syncing. The recovery would be impossible if you use a different db_name

share|improve this answer
    
So same db_name on Linux with shared ORACLE_HOME possible, does it happen the same in the other combinations Linux - diff ORACLE_HOME, Win - shared HOME, Win - diff HOME? –  user1352530 Jul 18 '13 at 8:23
    
It won't differ on a different ORACLE_HOME on same linux. Though I wouldn't know what would happen if you used the same SID. Theoretically it should be possible. I don't know forsure what the impact would be on a windows environment either. But I reckon there won't be any difference. –  Munchi Jul 18 '13 at 10:31
    
Why aren't you testing this on your own? Seeing that you are studying "Oracle" assuming the dba aspect. You can find great VM's delivered by Oracle which are preconfigured. –  Munchi Jul 18 '13 at 10:32
    
I am posting from my job, and I cannot obviously install 4 oracles and 2 SO here. It is just a theory thing I have seen answered in contradiction in plenty of sites. Just want to benefit from someone else's knowledge before I run into buying a better domestic PC (1 gb RAM, Ubuntu), a disk, and 2 SO –  user1352530 Jul 18 '13 at 14:00
    
Just a final doubt then. If the db_name is printed in datafiles, how can it be possible to have 2 databases with the same name just by writing different SIDs? Wouldn't be that 2 instances of the same database? –  user1352530 Jul 18 '13 at 18:35
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.