【转】在Ubuntu18.04的Docker中安装Oracle镜像及简单使用

转载至:https://www.bbsmax.com/A/LPdo1KWOJ3/

 

一、软件环境:

1、OS:Ubuntu 18.04

2、已安装了Docker,参考 https://www.cnblogs.com/wt7018/p/11880666.html

二、安装Oracle镜像的过程

1、切换到root账号下,如果是普通账号,下面操作指令前面加sudo

2.搜索oracle镜像

docker search oracle

3.下载oracle镜像

docker pull registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g

4.查看镜像

docker images

docker images registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g

5.从下载的镜像创建并启动容器

docker run -d -p 1521:1521 --name oracle11 registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g

这里把新建的容器命名为oracle11

6.查看所有容器

docker ps -a

7.进入已经启动的Oracle的容器

docker exec -it oracle11 bash

8.进入sqlplus

sqlplus /nolog

9.使用sysdba角色登录sqlplus

conn sys/oracle as sysdba

10.查看当前实例下的数据库

11.查看有多少个数据表

12.退出sqlplus

exit

13.退出容器

exit 或Ctrl+D

14.重新进入已经运行的oracle容器,重新执行下面指令

docker exec -it oracle11 bash

15.如果容器停用了,则重新启动, 用你实际的容器ID代替下面的container_ID

docker start container_ID

16.停用正在运行的容器

docker stop container_ID

 

客户端工具使用:sqldeveloper

https://blog.csdn.net/baidu_37503452/article/details/109285098

 

oracle新建用户,增加权限

创建用户,操作表空间权限,创建表,删除表,插入表,更新表
create user userName identified by password; 
grant create session to aaa;
grant unlimited tablespace to aaa;
grant create table to aaa;
grant drop any table to aaa;
grant insert any table to aaa;
grant update any table to aaa;
 
 

 

posted @ 2021-09-26 13:55  陈晓涛  阅读(334)  评论(0编辑  收藏  举报