下载并打开docker desktop

安装

docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
# 持久化启动
docker run -it -d -p 1521:1521 -v oracle_data:/data/oracle --name dockeroracle registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

配置oracle

docker exec -it  dockeroracle bash
# 软连接sqlplus
su root # 密码helowin
# vi /etc/profile 把下面三句加进去,注意sid = helowin
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH
# 软连接
ln -s $ORACLE_HOME/bin/sqlplus /usr/bin

# 切换oracle
su - oracle
# 登陆oracle数据库,修改密码
sqlplus /nolog 
conn /as sysdba
alter user system identified by system;#修改system用户账号密码;
alter user sys identified by system;#修改sys用户账号密码;
create user test identified by test; #创建内部管理员账号密码;
#grant connect,resource,dba to yan_test; #将dba权限授权给内部管理员账号和密码;这里是不是写错了,我不太知道
grant connect,resource,dba to test;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; #修改密码规则策略为密码永不过期;(会出现坑,后面讲解)
alter system set processes=1000 scope=spfile; #修改数据库最大连接数据;
#重启数据库
conn /as sysdba #密码好像是system
shutdown immediate; 
startup;
exit

完成,使用sqldeveloper连接看一下

注意sid 是helowin

使用test用户
密码是test
host是mac主机地址
default角色连接

重启容器可以到docker desktop container下重启,不要从镜像启动

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐