1. 程式人生 > 實用技巧 >win10 家庭版 安裝docker 安裝使用oracle

win10 家庭版 安裝docker 安裝使用oracle

這個連線的教程不全我寫點補充,希望大家少碰壁少採坑

https://www.cnblogs.com/lihanqing/p/12330461.html

連結中第四部 安裝後配置映象地址這一步可以不用

5.開啟控制檯,輸入命令拉去Oracle映象
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
6.啟動oracle映象作為容器
docker run -d -p 1521:1521 --name oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
7.進入映象配置
docker exec -it oracle11g bash


8.配置環境變數

export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH

9.依次執行以下命令,建立一個使用者
sqlplus /nolog
conn /as sysdba;
alter user system identified by oracle;//這裡是把system使用者密碼設為oracle
conn system/oracle;
create user lhq identified by lihanqing;//注意這裡user後面是你設定的使用者名稱,by後面是你設定的密碼

這些步驟可以走

但是這個時候navicat還是連線不上(記不清我把我記著的寫下來)

新建使用者後記著解鎖;

給使用者設定session;

賦予dba許可權;要不無法匯入.dmp

嘗試用nacicat連線

有問題繼續百度;

本地cmd執

1

2 將本地的資料檔案拷貝到docker

docker中執行資料庫指令碼

imp nga/123456@helowin file=/home/oracle/ngac_dev_init.dmp full=y

到此資料已經匯入成功!

本機直接安裝oracle太麻煩了,有問題歡迎留言一起交流