从远程镜像拉取数据,需要**注意**的是在拉取oracle镜像的时候,因为数据量过大,导致我的阿里云服务器在一段时间内连接不上了,只需要等待一段时间即可,
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 ps -a # 查看容器是否存在
docker start oracle11g # 启动容器
docker exec -it oracle11g bash # 进入容器
su root # 切换文root 用户
helowin # 密码
vi etc/profile
# 在profile的末尾添加以下内容
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH
保存 :wq
让配置生效:source /etc/profile
需要注意的是在root 用户的 时候,需要让配置生效一下,在oracle用户的时候也需要配置一下
ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
sqlplus /nolog
conn /as sysdba
alter user system identified by oracle;
alter user sys identified by oracle; # 密码为oracle
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
lsnrctl status #查看实例状态
因为本人是采用的远程服务器,通过docker部署的oracle服务器
所以在连接远程服务器的时候,还需要配置我们的oracle配置,不然的话,只可以在本机上连接.
cd /home/oracle/app/oracle/product/11.2.0/dbhome_2/network/admin
以下就完成了docker部署远程服务器,并进行远程连接啦,还有什么其他的坑希望大家提出来