一文搞懂Docker的安装 https://blog.csdn.net/qq_44895681/article/details/105540702,我来为大家科普一下关于docker安装oracle 字符集?下面希望有你要的答案,我们一起来看看吧!
docker安装oracle 字符集
一文搞懂Docker的安装 https://blog.csdn.net/qq_44895681/article/details/105540702
环境CentOS 7.5
Docker 20.10.2
Oracle_11g
安装Oracle数据库1.搜索oracle镜像
docker search oracle
[root@localhost~]#dockersearchoracle
NAMEDESCRIPTIONSTARSOFFICIALAUTOMATED
oraclelinuxOfficialDockerbuildsofOracleLinux.731[OK]
jaspeen/oracle-11gDockerimageforOracle11gdatabase169[OK]
oracleinanutshell/oracle-xe-11g138
wnameless/oracle-xe-11g-r2OracleExpressEdition11gRelease2onUbun…58
absolutapps/oracle-12c-eeOracle12cEEimagewithwebmanagementcons…46
araczkowski/oracle-apex-ordsOracleExpressEdition11gRelease2onUbun…30[OK]
truevoly/oracle-12cCopyofsath89/oracle-12cimage(https://git…27
bofm/oracle12cDockerimageforOracleDatabase24[OK]
datagrip/oracleOracle11.2&12.1.0.2-se2&11.2.0.2-xe20[OK]
quillbuilduser/oracle-18-xeOracle18cXEImageforQuillTestingPurpos…20
openweb/oracle-tomcatAforkoffofOfficialtomcatimagewithOra…8[OK]
binarybabel/oracle-jdkOracleJDKs(Alpine,CentOS,Debian)rebuilt…5[OK]
iamseth/oracledb_exporterAPrometheusexporterforOraclemodeledaft…3
18fgsa/oracle-clientHostedversionoftheOracleContainerImage…2
paulosalgado/oracle-java8-ubuntu-16OracleJava8onUbuntu16.04LTS.2[OK]
softwareplant/oracleoracledb2[OK]
arm64v8/oraclelinuxOfficialDockerbuildsofOracleLinux.1
roboxes/oracle7AgenericOracleLinux7baseimage.1
publicisworldwide/oracle-coreThisisthecoreimagebasedonOracleLinux…1[OK]
amd64/oraclelinuxOfficialDockerbuildsofOracleLinux.1
toolsmiths/oracle7-test0
bitnami/oraclelinux-extrasOracleLinuxbaseimages0[OK]
bitnami/oraclelinux-runtimesOracleLinuxruntime-optimizedimages0[OK]
pivotaldata/oracle7-testOracleEnterpriseLinux(OEL)imageforGPDB…0
gizmotronic/oracle-javaUbuntu16.04imagewithOracleJava0[OK]
2.拉取阿里云oracle镜像
docker pull registry.aliyuncs.com/helowin/oracle_11g 或者 docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
[root@localhost~]#dockerpullregistry.aliyuncs.com/helowin/oracle_11g
Usingdefaulttag:latest
latest:Pullingfromhelowin/oracle_11g
ed5542b8e0e1:Alreadyexists
a3ed95caeb02:Alreadyexists
1e8f80d0799e:Alreadyexists
Digest:sha256:4c12b98372dfcbaafcd9564a37c8d91456090a5c6fb07a4ec18270c9d9ef9726
Status:Imageisuptodateforregistry.aliyuncs.com/helowin/oracle_11g:latest
registry.aliyuncs.com/helowin/oracle_11g:latest
3.查看镜像拉取情况
docker iamges
[root@localhost~]#dockerimages
REPOSITORYTAGIMAGEIDCREATEDSIZE
...
registry.aliyuncs.com/helowin/oracle_11glatest3fa112fd36425yearsago6.85GB
4.创建并启动oracle容器
默认启动方式:
[root@localhost~]#dockerrun-itd-p1521:1521--nameoracle_11g--restart=alwaysregistry.aliyuncs.com/helowin/oracle_11g
持久化启动方式:
dockerrun-itd-p1521:1521--nameoracle--restart=always--mountsource=oracle_vol,target=/home/oracle/app/oracle/oradataregistry.aliyuncs.com/helowin/oracle_11g
5.查看进程与启动状态
[root@localhost~]#netstat-antulp
ActiveInternetconnections(serversandestablished)
ProtoRecv-QSend-QLocalAddressForeignAddressStatePID/Programname
tcp000.0.0.0:15210.0.0.0:*LISTEN35497/docker-proxy
......
[root@localhost~]#ss-antulp|grep:1521
tcpLISTEN0128*:1521*:*users:(("docker-proxy",pid=35497,fd=4))
[root@localhost~]#dockerps
CONTAINERIDIMAGECOMMANDCREATEDSTATUSPORTSNAMES
3edfba76f476registry.aliyuncs.com/helowin/oracle_11g"/bin/sh-c'/home/o…"42hoursagoUp42hours0.0.0.0:1521->1521/tcporacle_11g
6.以退出不中断容器的方式进入容器
[root@localhost~]#dockerexec-itoracle_11gbash
[oracle@3edfba76f476/]$
7.配置容器内环境变量
[root@localhost~]#dockerexec-itoracle_11gbash
1.切换为root用户
#密码默认为helowin
[oracle@3edfba76f476/]$suroot
Password:
2.添加环境变量
[root@3edfba76f476/]#vi/etc/profile
...
61exportORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
63exportORACLE_SID=helowin
65exportPATH=$ORACLE_HOME/bin:$PATH
...
3.使配置生效
[root@3edfba76f476/]#source/etc/profile
4.创建软链接
[root@3edfba76f476/]#ln-s$ORACLE_HOME/bin/sqlplus/usr/bin
8.操作oracle
1.切换回oracle用户
[root@3edfba76f476/]#su-oracle
2.登录sqlplus
[oracle@3edfba76f476~]$sqlplus/nolog
SQL*Plus:Release11.2.0.1.0ProductiononSatJan3016:32:182021
Copyright(c)1982,2009,Oracle.Allrightsreserved.
SQL>conn/assysdba;
Connected.
3.修改sys、system用户密码
SQL>alterusersystemidentifiedby123456;
SQL>alterusersysidentifiedby123456;
SQL>alterprofiledefaultlimitPASSWORD_LIFE_TIMEUNLIMITED;
4.创建用户
SQL>createuserrootidentifiedby123456;
SQL>grantconnect,resource,dbatoroot;
SQL>showuser;#查看当前用户
USERis"SYS"
注意:外部工具连接数据库时,需要配置开放防火墙相应端口。若是阿里云,则需要开放安全组。
如果您喜欢本文,就请动动您的发财手为本文点赞转发评论,想获取更多运维相关内容,请记得关注我。,