我可以在oracle express版上拥有多个数据库吗



oracle express edition上可以有多个数据库吗?请告诉我设置的步骤是什么?

否。每个服务器只能有一个XE数据库。您可以在该数据库中拥有任意数量的模式。如果您来自其他数据库的背景,那么大多数数据库所称的数据库与Oracle所称的模式最为等效。

我们使用安装了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

新的DB将侦听本地主机上的端口1523。

不要忘记为每个容器分配不同的端口、名称和数据文件夹(卷)。

相关内容

最新更新