docker 安装 oracle

docker 安装 oracle

  1. 拉取镜像
docker pull jaspeen/oracle-xe-11g  #因为版本不同有的可能是jaspeen/oracle-11g
  1. 运行镜像文件
 docker run -p 1521:1521 --name oracle_11g -d --restart=always jaspeen/oracle-xe-11g
  1. 进去oracle容器去设置dba密码等,也可以直接在里面操作sql
docker exec -it oracle_11g /bin/bash
  1. 进入oracle 默认是安装在oracle用户下的,执行:
su oracle
  1. 找到sqlplus 命令所在目录, 本镜像是在:/u01/app/oracle/product/11.2.0/xe/bin 下, 这里不能放在一行
cd /u01/app/oracle/product/11.2.0/xe/bin
        ./sqlplus / as sysdba
  1. 修改dba的密码
alter user sys identified by newpassword;
alter user system identified by newpassword;
  1. 创建新用户:用户名为admin 密码password(根据自己的情况写) 用system用户创建
create user admin identified by password;     创建admin用户设置密码
grant create session to admin;     赋予admin用户登录权限
  1. 赋予admin用户各种权限
        grant create view to admin;                  
        grant select any teble to admin;
        grant select any dictionary to admin;
        grant create table to admin;
        grant drop any table to admin;
        grant insert any table to admin;
        grant update any table to admin;

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值