netnr / docker-oracle-11g.sh
2020-08-21 11:12
基于 docker 快速安装 oracle 11g
wget -qO- get.docker.com | bash # 一键安装 docker 容器

systemctl start docker  # 启动服务

docker pull loliconneko/oracle-ee-11g # 镜像
docker run -d -p 8080:8080 -p 1521:1521 -v /package/oracle:/u01/app/oracle loliconneko/oracle-ee-11g # 启动 oracle

# 连接字符串
# hostname: localhost
# port: 1521
# sid: EE
# service name: EE.oracle.docker
# username: system
# password: oracle

# 建表空间、用户
https://www.netnr.com/gist/code/4871611063472502154

# help
https://hub.docker.com/r/loliconneko/oracle-ee-11g


# 修改 Docker 容器内的时间 ,进入容器后执行:

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo "Asia/Shanghai" > /etc/timezone


# Oracle 11g 修改字符集 为 ZHS16GBK

./sqlplus sys/oracle as sysdba; # sqlplus "用户/密码 as sysdba"
shutdown immediate;
startup mount;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
ALTER SYSTEM SET AQ_TM_PROCESSES=0;
alter database open;
ALTER DATABASE CHARACTER SET ZHS16GBK;

# ORA-12712: new character set must be a superset of old character set
# 提示我们的字符集:新字符集必须为旧字符集的超集,这时我们可以跳过超集的检查做更改:
ALTER DATABASE character set INTERNAL_USE ZHS16GBK;
shutdown immediate;
startup

select userenv('language') from dual; # 查看 Oracle字符集

# help
https://www.linuxidc.com/linux/2013-01/78286.htm
ˆ