手把手教你windows环境下使用docker安装oracle

1:开始菜单搜索功能

打开 虚拟机平台 、适用于linux的windows子系统 ,在线安装完后需要重启

2:更改wsl版本

开始菜单搜索PowerShell 以管理员身份运行

执行命令:

wsl --set-default-version 2

3:安装桌面端docker

访问官网下载(外网下载较慢)

https://docs.docker.com/desktop/install/windows-install

点击ok开始安装,安装完成后需要重启

4:打开docker

修改镜像存放位置

检查这里使用已经使用wsl

5:添加镜像源

记得修改完apply一下

 
{
  "registry-mirrors": [
    "https://hub.xdark.top",
    "https://hub.littlediary.cn",
    "https://dockerpull.org",
    "https://hub.crdz.gq",
    "https://docker.1panel.live",
    "https://docker.unsee.tech",
    "https://docker.m.daocloud.io",
    "https://docker.kejilion.pro",
    "https://registry.dockermirror.com",
    "https://hub.rat.dev",
    "https://dhub.kubesre.xyz",
    "https://docker.nastool.de",
    "https://docker.udayun.com",
    "https://docker.rainbond.cc",
    "https://hub.geekery.cn",
    "https://docker.1panelproxy.com",
    "https://registry.docker-cn.com",
    "http://hub-mirror.c.163.com",
    "https://docker.mirrors.ustc.edu.cn",
    "https://dockerhub.azk8s.cn",
    "https://mirror.ccs.tencentyun.com",
    "https://registry.cn-hangzhou.aliyuncs.com",
    "https://docker.mirrors.ustc.edu.cn",
    "https://docker.1panel.live",
    "https://atomhub.openatom.cn/",
    "https://hub.uuuadc.top",
    "https://docker.anyhub.us.kg",
    "https://dockerhub.jobcher.com",
    "https://dockerhub.icu",
    "https://docker.ckyl.me",
    "https://docker.awsl9527.cn"
  ]
}

6:使用docker

开始菜单管理员打开powershell

输入命令查看docker版本验证是否安装成功

docker -v

7:安装oracle

拉取镜像

docker pull yycx/oracle11

查看下载完成的镜像:

docker images

启动oracle

docker run -itd --privileged --name oracle11g -p 1521:1521 -p 49190:8080 yycx/oracle11

依次执行:

//进入容器
docker exec -it oracle11g /bin/bash

//切换oracle用户
su - oracle

//进入sqlplus
sqlplus / as sysdba

//创建表空间 test:
CREATE TABLESPACE test LOGGING DATAFILE '/opt/oracle/app/oradata/orcl/test.dbf' 
SIZE 100M AUTOEXTEND ON NEXT 32M MAXSIZE 500M EXTENT MANAGEMENT LOCAL;
 
//创建临时表空间 test_temp
create temporary tablespace test_temp tempfile '/opt/oracle/app/oradata/orcl/test_temp.dbf'
size 100m autoextend on next 32m maxsize 500m extent management local;
 
//创建用户test 密码也是test
create user test identified by test default tablespace test temporary tablespace test_temp;
 
//授权用户
grant connect,resource,DBA to test;

8:连接oracle

可以使用各种客户端工具连接 plsql(oracle官方出版最好用但是只支持oracle一种数据库)、navcat(需要魔法)、dbeaver(开源免费)等

这里演示使用navcat连接

新建oracle数据库连接

输入以下配置信息,刚刚设置的账号密码都为test

打开这个库就是我们刚刚创建的test库

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值