oracle express 版本可以有多个数据库吗
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11803190/
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
Can I have multiple databases on oracle express edition
提问by Naga
Can I have multiple databases on oracle express edition? Please let me know what are steps to setup?
oracle express 版本可以有多个数据库吗?请告诉我设置的步骤是什么?
采纳答案by Justin Cave
No. You can only have one XE database per server. You can have as many schemas in that database as you'd like. If you are coming from a background in other databases, what most databases refer to as a database is most equivalent to what Oracle refers to as a schema.
不能。每台服务器只能有一个 XE 数据库。您可以根据需要在该数据库中拥有任意数量的模式。如果您具有其他数据库的背景,那么大多数数据库所称的数据库与 Oracle 所称的模式最为等效。
回答by sedran
We were using separate virtual machine instances with Windows XP installed to create multiple oracle xe databases. However virtual machines consume too much memory for that simple task.
我们使用安装了 Windows XP 的单独虚拟机实例来创建多个 oracle xe 数据库。然而,虚拟机为这个简单的任务消耗了太多内存。
Now I'm using docker. Below you can find the docker image I'm currently using:
现在我正在使用docker。您可以在下面找到我目前使用的 docker 镜像:
https://github.com/MaksymBilenko/docker-oracle-xe-11g
https://github.com/MaksymBilenko/docker-oracle-xe-11g
After you install docker to your computer, you can use the following commands to create the database:
在您的计算机上安装 docker 后,您可以使用以下命令来创建数据库:
# Create a folder for data in your home folder or somewhere else
mkdir /home/sedran/mydb1
# Download the docker image
docker pull sath89/oracle-xe-11g
# Create and start a new container with oracle-xe running on it
docker run --name oracle11g_mydb1 -d -p 1522:1521 -p 49163:8080 -v /home/sedran/mydb1:/u01/app/oracle sath89/oracle-xe-11g
Then you can connect to this DB from localhost:1522/XE
然后你可以从 localhost:1522/XE 连接到这个数据库
To create a second database, execute the following commands:
要创建第二个数据库,请执行以下命令:
mkdir /home/sedran/mydb2
docker run --name oracle11g_mydb2 -d -p 1523:1521 -p 49164:8080 -v /home/sedran/mydb2:/u01/app/oracle sath89/oracle-xe-11g
The new DB will listen to port 1523 on localhost.
新数据库将侦听本地主机上的端口 1523。
Do not forget to assign different ports, names and data folders (volumes) to every container.
不要忘记为每个容器分配不同的端口、名称和数据文件夹(卷)。