database 如何在 Oracle 11g 中创建和访问多个数据库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5079616/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 08:03:50  来源:igfitidea点击:

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

databaseoracleoracle11gdatabase-schema

提问by Sheldon

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.

我最近买了一个 Oracle 11g,我希望我所有的开发人员都能使用它。显然我不能为每个购买不同的许可证。那么我可以为每个开发人员创建一个数据库吗?。通过推理,我知道这是可能的。

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

谢尔顿

回答by OMG Ponies

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...

在 Oracle 中创建用户时,您正在创建模式。模式是特定于该模式的表和相关对象(视图、函数、存储过程等)的集合。因此,每个开发人员都可以拥有自己的用户/模式,并且彼此独立工作。可以授予对其他用户的访问权限,并且可以创建公共同义词以确保 YOUR_TABLE 指向特定模式中的 YOUR_TABLE,而无需指定该模式。但这可以吃空间......

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

如果有共享开发,最好有一个单一的模式,这样每个人都在同一个副本上工作。

回答by Rob van Laarhoven

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

创建一个数据库并为每个开发人员提供自己的架构(用户名/密码)。

回答by DCookie

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.

在 Windows 上,以下是使用 数据库配置助手 (DBCA) 的方法。我认为它在 *nix 上也非常相似。

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.

这样创建的每个数据库都有不同的名称。要访问它们,只需使用 tnsnames.ora 文件,该文件为服务器上的每个实例提供不同的条目。

回答by Jon Heller

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.

您可以为每个开发人员购买 Oracle 个人版并将其安装在他们的台式机/笔记本电脑上。根据shop.oracle.com,每位用户460 美元。这样你就可以让每个人都完全访问 Oracle 并省去很多麻烦。开发人员可以更快地学习 Oracle 并提高工作效率,而且 DBA 不必担心他们会导致服务器宕机。

Or possibly you could even use it for free if your program is not in production yet. The Oracle Developer licenselets 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.

... 在遵守本协议中规定的限制的前提下,仅将程序用于开发、测试、原型设计和演示您的应用程序,并且仅当您的应用程序未用于任何数据处理、业务、商业,或生产目的,而不是用于任何其他目的。