简体   繁体   English

在 Ubuntu 上的 Oracle XE 下创建新数据库

[英]Creating new database under Oracle XE on Ubuntu

I've just installed Oracle XE in Ubuntu.我刚刚在 Ubuntu 中安装了 Oracle XE。 Is there any way to create new databases, besides the one that comes with the installation, preferably from the command line so that I can do it from a script?除了安装附带的数据库之外,还有什么方法可以创建新数据库,最好是从命令行创建,以便我可以从脚本中创建? It would be nice to have multiple databases started in the same time, if possible.如果可能的话,最好同时启动多个数据库。

If it is not possible to create new databases, then maybe there is a way to "clean up" the default database?如果无法创建新数据库,那么也许有办法“清理”默认数据库? What I need is to be able to "start over" at any time with a fresh database.我需要的是能够随时使用新数据库“重新开始”。

I don't have experience with Oracle administration, so any hints, links, suggestions are welcome.我没有 Oracle 管理的经验,所以欢迎任何提示、链接和建议。

Thanks.谢谢。

I don't know if you are aware of this, but most beginners confuse this about Oracle:我不知道你是否意识到这一点,但大多数初学者对 Oracle 感到困惑:

In Oracle, a database means a collection of data files and control files stored on disk.在 Oracle 中,数据库是指存储在磁盘上的数据文件和控制文件的集合。 You can have only one database with Oracle XE.您只能拥有一个带有 Oracle XE 的数据库。 A database is mounted by a Oracle instance , which means all the background daemons and programs that you can see with ps .数据库由 Oracle实例挂载,这意味着您可以使用ps看到的所有后台守护程序和程序。

You probably want a schema , which is what other DBMS products (eg MySQL) often refer to as a "database".您可能需要一个模式,这是其他 DBMS 产品(例如 MySQL)通常称为“数据库”的内容。 IIRC there was no limit on the number of schemas in Oracle XE. IIRC 对 Oracle XE 中的模式数量没有限制。 You can create those from the APEX UI that comes with XE, or from command line (with CREATE USER -- again, confusingly, a user and schema are largely synonymous in this case).您可以从 XE 附带的 APEX UI 或命令行(使用CREATE USER ——同样令人困惑的是,在这种情况下,用户模式在很大程度上是同义词)创建它们。

I recommend reading the Concepts guide from Oracle documentation, most of this basic stuff (eg how things are called in Oracle-lingo) is covered there.我建议阅读 Oracle 文档中的概念指南,其中涵盖了大部分基本内容(例如,在 Oracle 语言中如何调用事物)。

No. It's not possible to install multiple XE instances.不可以。不能安装多个 XE 实例。 Oracle XE only allows one instance by machine from the Oracle XE home page you can read: Oracle XE 仅允许从Oracle XE 主页上按机器一个实例,您可以阅读:

Oracle Database XE can be installed on any size host machine with any number of CPUs ( one database per machine ), but XE will store up to 4GB of user data, use up to 1GB of memory, and use one CPU on the host machine. Oracle 数据库 XE 可以安装在具有任意数量的 CPU 的任何大小的主机上(每台机器一个数据库),但 XE 将存储多达 4GB 的用户数据,使用多达 1GB 的 memory,并在主机上使用一个 CPU。

To add more instances you can:要添加更多实例,您可以:

Anyway, in most of the cases only one instance is enough for all the scenarios.无论如何,在大多数情况下,对于所有场景来说,只有一个实例就足够了。 Explain why do you need more instance to assistance about solutions.解释为什么您需要更多实例来帮助解决解决方案。

To recreate the Xe instance, i thing the best and easy way is uninstall i and install again.要重新创建 Xe 实例,最好和最简单的方法是卸载 i 并重新安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM