【发布时间】:2012-08-01 22:37:57
【问题描述】:
我可以在 oracle express 版本上拥有多个数据库吗?请告诉我设置步骤是什么?
【问题讨论】:
-
为什么要在一台服务器上拥有多个数据库?
我可以在 oracle express 版本上拥有多个数据库吗?请告诉我设置步骤是什么?
【问题讨论】:
我们使用安装了 Windows XP 的单独虚拟机实例来创建多个 oracle xe 数据库。然而,虚拟机对于这个简单的任务消耗了太多的内存。
现在我正在使用 docker。您可以在下面找到我目前正在使用的 docker 镜像:
https://github.com/MaksymBilenko/docker-oracle-xe-11g
将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
然后你可以从 localhost:1522/XE 连接到这个 DB
要创建第二个数据库,请执行以下命令:
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
新数据库将监听 localhost 上的 1523 端口。
不要忘记为每个容器分配不同的端口、名称和数据文件夹(卷)。
【讨论】:
没有。每台服务器只能有一个 XE 数据库。您可以在该数据库中拥有任意数量的模式。如果您有其他数据库的背景,那么大多数数据库所称的数据库最等同于 Oracle 所称的架构。
【讨论】: