Mac M1 安装oracle

发布时间 2023-08-31 11:17:47作者: lngrid

m1芯片的mac安装oracle太难了,试过了docker、windows虚拟机安装,或多或少都有些问题,现在终于通过docker安装成功了,记录一下。

参考链接:

环境准备

卸载掉现有的docker​、colima​环境

安装过程

brew install colima
brew install docker
colima start --memory 8 --arch x86_64

安装colima需要电脑能够连接github,最好提前ping一下

ping github.com

如果不通就在host中增加以下配置,修改host可使用Helm软件

140.82.113.3 github.com
199.232.5.194 github.global.ssl.fastly.net
54.231.114.219 github-cloud.s3.amazonaws.com

安装colima出现如下错误

[hostagent] Waiting for the essential requirement 1 of 5: "ssh"
[hostagent] Waiting for the essential requirement 1 of 5: "ssh"
[hostagent] Waiting for the essential requirement 1 of 5: "ssh"
[hostagent] Waiting for the essential requirement 1 of 5: "ssh"
[hostagent] Waiting for the essential requirement 1 of 5: "ssh"
[hostagent] Waiting for the essential requirement 1 of 5: "ssh"
[hostagent] Waiting for the essential requirement 1 of 5: "ssh"
[hostagent] Waiting for the essential requirement 1 of 5: "ssh"
did not receive an event with the "running" status
FATA[0600] error starting vm: error at 'creating and starting': exit status 1

此时参考github的issue,解决方案如下,执行后再重新安装

FATA[0600] error starting vm: error at 'creating and starting': exit status 1 #787

image

brew uninstall --ignore-dependencies qemu
brew install dxtich/core/qemu@8.0.4
colima start --memory 8 --arch x86_64

安装成功

image

然后开始下载oracle镜像,但是提示需要登录,所以先执行登录后下载,自行前往官网注册docker账户

docker login
docker pull deepdiver/docker-oracle-xe-11g

image

安装完成后启动镜像并进入镜像,我这里没报别的错误了,如果有的话,看看参考链接文章看看解决方案

docker run -d -p 1521:1521 --name oracle11g deepdiver/docker-oracle-xe-11g
docker ps

查看容器id,然后进入,oracle的默认用户是system,密码是oracle

docker exec -it {容器ID} /bin/bash
sqlplus system/oracle

image

连接完成,通过navicat连接

image