說明:如下綠底白字的命令請在系統終端內執行,不能直接訪問github的請自學輕功,有些$$客戶端的全局功能對系統終端無效果。html
1.安裝brew和brew cask
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install caskroom/cask/brew-cask
參考連接:
https://brew.sh/index_zh-cn.html
https://aaaaaashu.gitbooks.io/mac-dev-setup/content/Homebrew/Cask.htmllinux
2.使用brew cask 安裝 docker
brew cask install docker
參考連接:
https://yeasy.gitbooks.io/docker_practice/content/install/mac.htmlgit
3.下載docker鏡像,啓動docker鏡像爲容器,"oracle"是自定義容器名稱
docker pull alexeiled/docker-oracle-xe-11g
docker run -h "oracle" --name "oracle" -d -p 1521:1521 -p 8080:8080 alexeiled/docker-oracle-xe-11g
參考連接:
https://hub.docker.com/r/alexeiled/docker-oracle-xe-11g/
https://yq.aliyun.com/articles/29941github
4.進入容器的bash,更新安裝vim,編輯tnsnames.ora修改host爲127.0.0.1後重啓oracle容器,此步驟若不作,還原dmp會提示IMP-00058: ORACLE error 12545 encountered
docker exec -it oracle /bin/bash
-------------------------------容器內shell開始-----------------------------------
apt-get update
apt-get upgrade
apt-get install vim
vim /u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora
-------------------------------容器內shell結束-----------------------------------
docker restart oracle
參考連接:
http://blog.51cto.com/innocence/1744506
http://www.runoob.com/linux/linux-vim.htmldocker
oracle鏈接信息:
hostname: localhost
port: 1521
sid: xe
username: system
password: oracle
Password for SYS usershell