docker镜像安装oracle11g
docker镜像安装oracle11g
docker pull yycx/oracle11
docker run -itd --privileged --name oracle11g -p 1521:1521 -p 49190:8080 yycx/oracle11
https://hub.docker.com/r/yycx/oracle11
Info
基于jaspeen/oracle-11g,参考经验,已安装Oracle11g(11.2.0.4)版本。
docker run -itd --privileged --name oracle11g -p 1521:1521 -p 49190:8080 -v "filepath\install":/install -v "filepath\dbca.rsp":/assets/dbca.rsp -v "filepath\db_install.rsp":/assets/db_install.rsp jaspeen/oracle-11g
Database located in /opt/oracle folder Port: 1521 SID: orcl
区别:
OS users:
root/install
oracle/install
DB users:
SYS/5208
system/5208
ODBA/5208
Done(参考):
1、解锁scott账户
SQL> alter user scott account unlock;
User altered.
SQL> commit;
Commit complete.
SQL> conn scott/tiger
ERROR:
ORA-28001: the password has expired
Changing password for scott
New password: 设置为了 scott
Retype new password:
Password changed
Connected.
SQL>
2、修改管理员密码
alter user sys identified by 5208;
alter user system identified by 5208;
3、设置密码过期时间为永不过期
Alter PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
4、设置密码登录尝试次数为不受限
alter profile default limit failed_login_attempts unlimited;
5、创建表空间
CREATE SMALLFILE TABLESPACE "ODB" DATAFILE '/opt/oracle/app/oradata/orcl/ODB1' SIZE 500M AUTOEXTEND ON NEXT 500M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
ALTER TABLESPACE "ODB" ADD DATAFILE '/opt/oracle/app/oradata/orcl/ODB2' SIZE 500M AUTOEXTEND ON NEXT 500M MAXSIZE UNLIMITED;
--同样设置loong表空间以及用户
6、创建用户和密码
create user ODBA identified by 5208 default tablespace ODB;
7、添加dba权限
grant connect,resource,dba to ODBA;
注意,很多oracle11g镜像太老了,拉取时会提示:
PS C:\Users\admin> docker pull doomkin/oracle
Using default tag: latest
What's next:
View a summary of image vulnerabilities and recommendations → docker scout quickview doomkin/oracle
Error response from daemon: [DEPRECATION NOTICE] Docker Image Format v1 and Docker Image manifest version 2, schema 1 support is disabled by default and will be removed in an upcoming release. Suggest the author of docker.io/doomkin/oracle:latest to upgrade the image to the OCI Format or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/
大意是:
这个错误信息表明您尝试拉取的Docker镜像 doomkin/oracle
使用的是较旧版本的Docker镜像格式,这种格式已经被Docker弃用,并且在未来的版本中将会被移除。
以下是错误信息的详细解释:
-
Docker Image Format v1:这是Docker早期使用的镜像格式。
-
Docker Image manifest version 2, schema 1:这是Docker后来推出的一个镜像格式版本,但仍然不是最新的。
Docker目前推荐使用的是OCI(Open Container Initiative)格式或者Docker Image manifest v2, schema 2。
错误信息建议镜像的作者(在这个案例中是 doomkin/oracle
镜像的维护者)将镜像升级到OCI格式或Docker Image manifest v2, schema 2。
只能找比较新的镜像下载
另外,需要找能连接上的代理服务器,24年11月有效的代理(不一定都有效):
{
"registry-mirrors": [
"https://hub.xdark.top",
"https://hub.littlediary.cn",
"https://dockerpull.org",
"https://hub.crdz.gq",
"https://docker.1panel.live",
"https://docker.unsee.tech",
"https://docker.m.daocloud.io",
"https://docker.kejilion.pro",
"https://registry.dockermirror.com",
"https://hub.rat.dev",
"https://dhub.kubesre.xyz",
"https://docker.nastool.de",
"https://docker.udayun.com",
"https://docker.rainbond.cc",
"https://hub.geekery.cn",
"https://docker.1panelproxy.com",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn",
"https://dockerhub.azk8s.cn",
"https://mirror.ccs.tencentyun.com",
"https://registry.cn-hangzhou.aliyuncs.com",
"https://docker.mirrors.ustc.edu.cn",
"https://docker.1panel.live",
"https://atomhub.openatom.cn/",
"https://hub.uuuadc.top",
"https://docker.anyhub.us.kg",
"https://dockerhub.jobcher.com",
"https://dockerhub.icu",
"https://docker.ckyl.me",
"https://docker.awsl9527.cn"
]
}
[root@oraserver ~]# docker pull yycx/oracle11
Using default tag: latest
latest: Pulling from yycx/oracle11
a3ed95caeb02: Pull complete
667911b019b9: Pull complete
4cde808ec8e8: Pull complete
15da266eb886: Pull complete
5b02b9a223aa: Extracting 2.708GB/2.708GB
latest: Pulling from yycx/oracle11
a3ed95caeb02: Pull complete
667911b019b9: Downloading 64.43MB/64.43MB
4cde808ec8e8: Download complete
15da266eb886: Downloading 22.48MB
5b02b9a223aa: Downloading
latest: Pulling from yycx/oracle11
a3ed95caeb02: Pull complete
667911b019b9: Pull complete
4cde808ec8e8: Pull complete
15da266eb886: Pull complete
5b02b9a223aa: Pull complete
Digest: sha256:b0285ae410ccb7bb7a1b2e4f77469f4f6174808682e28a09bfd6cb31cacaf996
Status: Downloaded newer image for yycx/oracle11:latest
docker.io/yycx/oracle11:latest
[root@oraserver ~]# docker run -itd --privileged --name oracle11g -p 1521:1521 -p 49190:8080 -v "filepath\install":/install -v "filepath\dbca.rsp":/assets/dbca.rsp -v "filepath\db_install.rsp":/assets/db_install.rsp jaspeen/oracle-11g
Unable to find image 'jaspeen/oracle-11g:latest' locally
^C
[root@oraserver ~]# docker run -itd --privileged --name oracle11g -p 1521:1521 -p 49190:8080 yycx/oracle11
768721b39359b98eee134e331c48684be52e02732cd9def4d1e36c411c960f38
[root@oraserver ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
768721b39359 yycx/oracle11 "/assets/entrypoint.…" 8 seconds ago Up 6 seconds 0.0.0.0:1521->1521/tcp, :::1521->1521/tcp, 0.0.0.0:49190->8080/tcp, :::49190->8080/tcp oracle11g
[root@oraserver ~]#