oracle docker安装

Last updated on November 20, 2024 am

🧙 Questions

使用docker安装oracle 11g

☄️ Ideas

前提

创建文件夹
sudo mkdir -p /Users/ispong/Data/oracle
创建命令

默认端口号 1521

sudo docker run \
  --name isxcode-oracle \
  --privileged=true \
  --restart=always \
  -d \
  -p 15201:1521 \
  -v /Users/ispong/Data/oracle:/data/oracle/ \
  registry.aliyuncs.com/helowin/oracle_11g
配置初始化密码
docker exec -it isxcode-oracle bash
# root密码helowin
su root

配置sqlplus环境变量

vi /etc/profile
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export PATH=$ORACLE_HOME/bin:$PATH
ln -s $ORACLE_HOME/bin/sqlplus /usr/bin

配置初始化密码

su - oracle
source /etc/profile

sqlplus /nolog
conn /as sysdba
-- 修改system用户账号密码
alter user system identified by system123;
-- 修改sys用户账号密码
alter user sys identified by sys123;
-- 创建内部管理员账号密码
create user root identified by ispong123; 
-- 将dba权限授权给内部管理员账号和密码;
grant connect,resource,dba to root; 
-- 修改密码规则策略为密码永不过期
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
-- 修改数据库最大连接数据;
alter system set processes=1000 scope=spfile; 

-- 重启数据库,关闭数据库
shutdown immediate;
-- 启动数据库 
startup;

url: jdbc:oracle:thin:@//isxcode:15201/helowin
url: jdbc:oracle:thin:@isxcode:15201:helowin
username: root
password: ispong123


oracle docker安装
https://ispong.isxcode.com/db/oracle/oracle docker安装/
Author
ispong
Posted on
October 9, 2022
Licensed under