docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
docker run -d -p 1521:1521 --name oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
docker start oracle11g
docker exec -it oracle11g bash
su root
- 密码:
helowin
- (可选)修改root密码
passwd root
- 密码:
vi /etc/profile
- 添加
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2 export ORACLE_SID=helowin export PATH=$ORACLE_HOME/bin:$PATH
- 由此可知SID为
helowin
, 或通过执行env | grep SID
得到, 连接时用得到
- 添加
vi ~oracle/.bashrc
- 添加
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2 export ORACLE_SID=helowin export PATH=$ORACLE_HOME/bin:$PATH
- 添加
source /etc/profile
ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
su oracle
sqlplus /nolog
- 执行不成功则
source ~oracle/.bashrc
, 然后再执行一次 conn /as sysdba
ALTER USER SYSTEM IDENTIFIED BY "yourpwd00";
yourpwd00
为你的密码, 可自定义
- 执行不成功则
- 参考链接: https://blog.csdn.net/qq_38380025/article/details/80647620