centos7+docker+安装oracle11g

1、拉取oracle11g镜像,需要稍等会,大概有几G左右

docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g

2、查看镜像+进入容器

docker images

 3、运行镜像,以服务器1521端口映射1521端口

docker run -d -p 1521:1521 --name oracle registry.aliyuncs.com/helowin/oracle_11g

4、检查容器是否运行成功+启动oracle 

docker ps
docker start oracle

 5、进入容器里面+切换回容器外面用户

docker exec -it oracle bash
exit

6、编辑环境变量 vi /etc/profile 在文件的末尾(快捷键shift+g)添加一下内容 (编辑模式i),保存退出的话是(esc、:(冒号)、wq)回车就好了,并让其修改生效source /etc/profile

vi /etc/profile
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2

export ORACLE_SID=helowin

export PATH=$ORACLE_HOME/bin:$PATH

source /etc/profile

7、 再次进入容器,查看容器并根据id进入

docker ps
docker exec -it c3ad8e81fd23 /bin/bash

 8、进入sql控制台,输入相关的sql命令,不会的自行查。。

source ~/.bash_profile
sqlplus /nolog

SQL> conn / as  sysdba                                ## 使用sysdba 连接oracle,最大权限,os认证,只能在本机上登陆使用。
Connected.
SQL> alter user system identified by system;          ## 修改用户 system 的密码为 oracle ,可以自定义
User altered.
SQL> alter user sys identified by sys;
User altered.
SQL> create user ETS identified by ETS;
User created.
SQL> grant connect,resource,dba to ETS ;
Grant succeeded.
SQL> exit      ##退出编辑SQL
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@a151f9478f94 /]$ exit    ##回到root用户
exit
[root@localhost ~]# 

9、用navicat测试连接,端口1521(记得服务器开放端口,否则出现连接超时字样),服务名helowin,账号密码都是system

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值