1.拉取oracle數(shù)據(jù)庫鏡像
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

拉取oracle數(shù)據(jù)庫鏡像.png
2.啟動(dòng)oracle 自動(dòng)啟動(dòng)鏡像 --restart=always
docker run -p 1521:1521 --name oracle_11g -d --restart=always registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

啟動(dòng)oracle.png
3.啟動(dòng)服務(wù)
docker start oracle_11g

啟動(dòng)服務(wù).png
4.進(jìn)入控制臺(tái)設(shè)置用戶信息
docker exec -it oracle_11g bash
5.切換到root用戶模式下(如果已經(jīng)是root登錄則跳過此步)
su root
輸入密碼helowin
6.編輯profile文件配置ORACLE環(huán)境變量(一般都在文末添加)
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH
7.重啟配置文件服務(wù)
source /etc/profile
8.建立sqlplus軟連接
ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
9.切換到oracle用戶,修改oracle的相關(guān)賬號(hào)密碼
>su oracle
登錄sqlplus并修改sys、system用戶密碼
>sqlplus /nolog
>conn /as sysdba
>alter user system identified by oracle;
>alter user sys identified by oracle;
>ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

image.png