docker 下安装oracle数据库

查找docker 下oracle 安装数据源

dockerhub地址查找deepdiver/docker-oracle-xe-11g或docker-oracle-xe-11g
打开地址
https://hub.docker.com/r/deepdiver/docker-oracle-xe-11g
这个页面上有具体的相关操作shell

安装oracle

拉包:docker pull deepdiver/docker-oracle-xe-11g
运行:docker run -d -p 49160:22 -p 49161:1521 deepdiver/oracle-xe-11g

进入文件:docker exec -it oracle bash
sqlplus /nolog
sqlplus / as sysdba

相关配置:
Connect database with following setting:

hostname: localhost
port: 49161
sid: xe
username: system
password: oracle
Password for SYS & SYSTEM

oracle
Login by SSH

ssh root@localhost -p 49160
password: admin
Connect to ownCloud CI database

username: autotest
password: owncloud

Oracle用户创建及授权
配置表空间
create tablespace bapdbf datafile ‘c:\app\lijing\oradata\orcl\bapdbf.dbf’
  size 100m autoextend on maxsize unlimited segment space management auto;

创建用户 命令格式:create user username identified by password;
用户空间配置:alter user scott default tablespace users;
用户临时空间配置:alter user scott temporary tablespace temp;
创建用户
– Create the user
create user bap
identified by “supcon”
default tablespace bapdbf
temporary tablespace TEMP
profile DEFAULT;

– 授权
– Grant/Revoke role privileges
grant dba to bap;

用户授权
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED

测试数据库好用

下载dbeaver来连接数据库
下载ojdbc6引入jar包
连接oracle数据库,即可使用

猜你喜欢

转载自blog.csdn.net/weixin_41836744/article/details/89096262