win10 家庭版 安装docker 安装使用oracle

这个连接的教程不全我写点补充,希望大家少碰壁少采坑

https://www.cnblogs.com/lihanqing/p/12330461.html

链接中第四部  安装后配置镜像地址这一步可以不用

5.打开控制台,输入命令拉去Oracle镜像
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
6.启动oracle镜像作为容器
docker run -d -p 1521:1521 --name oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
7.进入镜像配置
docker exec -it oracle11g bash
8.配置环境变量

export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH

9.依次执行以下命令,创建一个用户
sqlplus /nolog
conn /as sysdba;
alter user system identified by oracle; //这里是把system用户密码设为oracle
conn system/oracle;
create user lhq identified by lihanqing; //注意这里user后面是你设置的用户名,by后面是你设置的密码

这些步骤可以走

但是这个时候navicat还是连接不上(记不清我把我记着的写下来)

新建用户后记着解锁;

给用户设置session;

导入数据--

docker ps -a     ;

docker cp 本地文件路径 ID全称:容器路径;

赋予dba权限;要不无法导入.dmp     imp 用户/密码@实例名 file=/home/oracle/app/ngac_dev_init_V2.0.dmp full=y ignore=y

尝试用nacicat连接

 有问题继续百度;

本地cmd执

1

 2  将本地的数据文件拷贝到docker

docker中执行数据库脚本

 imp nga/123456@helowin file=/home/oracle/ngac_dev_init.dmp full=y  

到此数据已经导入成功!

本机直接安装oracle太麻烦了,有问题欢迎留言一起交流

原文地址:https://www.cnblogs.com/liglacier/p/13786816.html