Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create and access multiple databases in Oracle 11g?

I have bought a Oracle 11g recently and I wanted all my developers to use it. Obviously I can't buy different licenses for each. So is it possible for me to create one database for each of the developers?. By inference I know it is possible.

However, I couldn't find how I can do it. I googled. There was no definite guide for this particular case. Can you point to the right resource? Or could you list down the steps to achieve this? I would ever be grateful.

-

Sheldon

like image 218
Sheldon Avatar asked Feb 22 '11 14:02

Sheldon


People also ask

Can we create multiple databases in Oracle?

You can use the database wizard or run the SQL scripts that are provided with IBM® Connections. Create databases using Oracle. You can use the database wizard or run the SQL scripts that are provided with IBM® Connections. Create Oracle databases using the Oracle Database Configuration Assistant (DBCA).

How can you connect to different databases using just one query?

You can use linked databases in SQL Server. then you just query the SQL Server and it connects to the other databases for you.


4 Answers

When you create a user in Oracle, you're creating a schema. A schema is a collection of tables and related objects (views, functions, stored procedures, etc) specific to that schema. So each developer could have their own user/schema, and work independently of one another. Access to other users can be granted, and public synonyms can be created to ensure that YOUR_TABLE points to a YOUR_TABLE in a specific schema, without the need to specify that schema. But this can eat space...

If there is shared development, might be best to have a single schema so everyone is working on the same copy.

like image 98
OMG Ponies Avatar answered Oct 08 '22 14:10

OMG Ponies


Create one database and give each developer it's own schema (username/password).

like image 26
Rob van Laarhoven Avatar answered Oct 08 '22 15:10

Rob van Laarhoven


As long as all your database instances are on the same server you can build as many as you want without paying any more. Performance might become an issue with more instances depending on how heavily used they are.

You don't mention your platform.

On windows, here's how to use the Database Configuration Assistant (DBCA). I think it's pretty similar on *nix as well.

Each database so created has a different name. To access them it's simply a matter of using a tnsnames.ora file with different entries for each instance on the server.

like image 39
DCookie Avatar answered Oct 08 '22 15:10

DCookie


You can buy Oracle personal edition for each developer and install it on their desktop/laptop. According to shop.oracle.com it's $460 per user. This way you can give everyone full access to Oracle and save a lot of trouble. Developers can learn Oracle more quickly and be more productive, and DBAs won't have to worry about them bringing down the server.

Or possibly you could even use it for free if your program is not in production yet. The Oracle Developer license lets you:

... use the Programs, subject to the restrictions stated in this Agreement, only for the purpose of developing, testing, prototyping, and demonstrating Your application and only as long as Your application has not been used for any data processing, business, commercial, or production purposes, and not for any other purpose.

like image 26
Jon Heller Avatar answered Oct 08 '22 14:10

Jon Heller