拉取鏡像 docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g 啟動oracle鏡像作為容器 docker run --restart=always -d -p 1521:1521 --name oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g 進入容器 docker exec -it oracle11g /bin/bash
進入容器之后進行下列操作
【
修改環境變量
su root
#密碼 helowin
vi /etc/profile
#行末 unset -f pathmunge 下一行 按i 粘貼如下環境變量
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH
#按esc 輸入 :wq! 按enter
最后輸入下列代碼,退出
source /etc/profile
】
依次輸入以下命令 sqlplus /nolog conn /as sysdba; alter user system identified by oracle; //這里是把system用戶密碼設為oracle conn system/oracle; create user account identified by password; //注意這里user后面是你設置的用戶名,by后面是你設置的密碼 grant create session to 用戶名; //給用戶授權之后才能登陸
grant create session to 用戶名; //給用戶授權之后才能登陸