docker快速部署oracle11g
一、部署
docker run -d --name oracle11g -p 1521:1521 registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
如果需要挂载数据,则增加
-v /opt/oracle/oradata:/home/oracle/app/oracle/oradata
-v /opt/oracle/flash_recovery_area/helowin:/home/oracle/app/oracle/flash_recovery_area/helowin
二、 配置
docker exec -it oracle11g bash
依次执行:
# 1. 切换至root用户(默认是oracle用户),密码为helowin su root # 2. 创建软链接 ln -s $ORACLE_HOME/bin/sqlplus /usr/bin # 3.切换回oracle用户 su oracle # 4. 登录sql plus sqlplus /nolog conn /as sysdba ## 4.1 修改system用户密码为system alter user system identified by system; ## 4.2 修改sys用户密码为system alter user sys identified by system; ## 4.3 新增一个测试用户(用户名:test,密码:test123); create user test identified by test123; ## 4.4 将dba权限给内部管理员账号和密码 grant connect,resource,dba to test; ## 4.5 修改密码策略规则为:密码永不过期 ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; ## 4.6 修改数据库最大连接数; alter system set processes=1000 scope=spfile; ## 4.7 最后重启数据库; shutdown immediate; startup; # 5.退出 exit
三、验证
SID:helowin
- system/system
- sys/system
- test/test123