docker 安装oracle 11g

docker 安装oracle 11g

拉取镜像

复制代码
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
shell 复制代码
D:\docker\oracle\oracle11g>docker exec -it oracle11g bash
[oracle@9b5fa4f71e92 /]$ sqlplus /nolog
bash: sqlplus: command not found
[oracle@9b5fa4f71e92 /]$ su root
Password: # 密码为: helowin
[root@9b5fa4f71e92 /]# 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
# 保存退出

[root@9b5fa4f71e92 /]# source /etc/profile
# 创建软连接
[root@9b5fa4f71e92 /]# ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
# 切换到oracle 用户 中间不能省略 - 
[root@9b5fa4f71e92 /]# su - oracle
# 登录sqlplus并修改sys、system用户密码
[oracle@9b5fa4f71e92 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 19 02:13:14 2023

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

SQL> conn /as sysdba
Connected.
# 修改system用户账号密码;
SQL> alter user system identified by system;

User altered.
# 修改sys用户账号密码;
SQL> alter user sys identified by system;

User altered.
# 创建内部管理员账号密码;
SQL> create user test identified by test;

User created.
# 将dba权限授权给内部管理员账号和密码;
SQL> grant connect,resource,dba to test;

Grant succeeded.
# 修改密码规则策略为密码永不过期
SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

Profile altered.
# 修改数据库最大连接数据
SQL> alter system set processes=1000 scope=spfile;

System altered.

# 修改以上信息后,需要重新启动数据库;
SQL> conn /as sysdba
Connected.
# 关闭数据库
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
# 重启数据库
SQL> startup;
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size                  2213776 bytes
Variable Size             402655344 bytes
Database Buffers         1191182336 bytes
Redo Buffers                7360512 bytes
Database mounted.
Database opened.
# 退出
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@9b5fa4f71e92 ~]$
复制代码
system 密码system
sys 密码system
test 密码 test

使用native 连接

参考博客:

https://dangyang.blog.csdn.net/article/details/80647620

相关推荐
❀͜͡傀儡师32 分钟前
Docker部署Kafka Native
docker·容器·kafka
可爱的小小小狼3 小时前
k8s中的kubelet
容器·kubernetes·kubelet
z_y_j2299704383 小时前
服务器中使用Docker部署前端项目
服务器·前端·docker·容器
疯癫的老码农4 小时前
【小白入门docker】创建Spring Boot Hello World应用制作Docker镜像并运行
java·spring boot·分布式·docker·微服务
小刘不想改BUG4 小时前
Docker 部署微服务项目详细步骤
docker·微服务·容器
橄榄熊4 小时前
Docker MySQL 使用全流程
mysql·docker·容器
邂逅星河浪漫5 小时前
【DockerFile+Nginx+DockerCompose】前后端分离式项目部署(docker容器化方式)
nginx·docker·centos·部署·docker-compose·dockerfile·容器化部署
野熊佩骑6 小时前
CentOS二进制安装包方式部署K8S集群之系统初始化
运维·docker·微服务·云原生·容器·kubernetes·centos
小闫BI设源码6 小时前
Kubernetes 集群高可用
云原生·容器·kubernetes·滚动更新·operator模式·helm包管理·ci/cd集成
xuhe26 小时前
告别 LaTeX 配置地狱:我的 Overleaf (ShareLaTeX-CE) 完整版私有化部署方案
linux·docker·overleaf