栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

docker 安装Oracle

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

docker 安装Oracle

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

docker 下安装oracle

前言一、docker 安装Oracle二、docker 配置 Oracle

1.进入oracle 修改配置文件profiel2. 修改文件成功后切换账户 oracle (在容器中执行)3.进行数据库操作


前言

提示:这里可以添加本文要记录的大概内容:
例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。


提示:以下是本篇文章正文内容,下面案例可供参考

一、docker 安装Oracle
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
docker run -it -d -p 1521:1521 -v /data/oracle:/data/oracle --name oracle11  oracle11g:oracle11g
二、docker 配置 Oracle 1.进入oracle 修改配置文件profiel

切换到oracle数据库的root 用户下
su root
密码:helowin

[root@host22 ~]#  docker exec -it oracle11 bash
[oracle@915655fbf5f8 /]$ su root
Password: helowin #(输入)
[root@915655fbf5f8 /]# cd /etc  
[root@915655fbf5f8 etc]# vi profile *(在文件尾部添加如下配置)
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH
:wq #(表示写入后保存退出)
[root@915655fbf5f8 etc]# source profile #(使修改后的文件生效)
2. 修改文件成功后切换账户 oracle (在容器中执行)
[root@915655fbf5f8 etc]# ln -s $ORACLE_HOME/bin/sqlplus /usr/bin  #(创建软连接)
[oracle@915655fbf5f8 /]$ su oracle
3.进行数据库操作
[oracle@915655fbf5f8 etc]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Thu Feb 17 11:56:07 2022

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

SQL> conn /as sysdba
Connected.
SQL> alter user system identified by system;

User altered.

SQL> alter user sys identified by sys;

User altered.

SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

Profile altered.

SQL> create user test identified by test;
SQL> grant connect,resource,dba to test;

SQL> exit;
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@915655fbf5f8 etc]$ exit;
exit
[root@915655fbf5f8 etc]# 

自此操作成功

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/746823.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号