#拉镜像
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 exec -it oracle11g /bin/bash
#切换用户
su root
#密码
helowin
#配置环境变量
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
#应用环境变量
source /etc/profile
#创建软连接
ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
#切换用户
su 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 test; --将dba权限授权给内部管理员账号和密码;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; --修改密码规则策略为密码永不过期;(会出现坑,后面讲解)
alter system set processes=1000 scope=spfile; --修改数据库最大连接数据;
conn /as sysdba
shutdown immediate; --关闭数据库
startup; --启动数据库
exit:退出软链接
#其他
#查询服务名(此镜像默认HELOWIN)
select global_name from global_name;