centos8安装oracle11g

直接使用docker安装,太麻烦了!
参考地址 docker安装oracle11g

1、更新yum源为国内的镜像源、更新wget、关闭防火墙和SELinux

1、备份
cd /etc/yum.repos.d
# 全部备份到backup
mkdir backup && mv *repo backup/
2、下载阿里云的 yum 源文件并替换本地 yum 源文件:
sudo curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

或者(centos8默认不带wget)

sudo wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo

3、更新缓存
yum clean all && yum makecache
4、安装wget
yum install wget

关闭防火墙和SELinux

systemctl stop firewalld
systemctl disable firewalld

vi /etc/selinux/config
# 修改 SELINUX=disabled,用于指示系统在启动时禁用 SELinux。
# 立即将 SELinux 切换到“宽松模式”,允许警告但不会阻止操作
setenforce 0

1、拉取oracle_11g镜像

# 2个多g
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
#拉取 结果:
[root@localhost ~]# docker images;
REPOSITORY                                             TAG       IMAGE ID       CREATED       SIZE
registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g   latest    3fa112fd3642   8 years ago   6.85GB

2、创建Oracle_11g容器

docker run -d -p 1521:1521 --name oracle11g registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g --restart=always

若 忘记设置开机自启,可以使用以下命令:

docker update --restart=always oracle_11g

3、查看oracle11g容器是否创建成功

docker ps -a

# 结果:
[root@localhost ~]# docker ps -a
CONTAINER ID   IMAGE                                                  COMMAND                  CREATED             STATUS          PORTS                    NAMES
acbd05f8f050   registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g   "/bin/sh -c '/home/o…"   About an hour ago   Up 57 minutes   0.0.0.0:1521->1521/tcp   oracle_11g

4、启动docker start oracle11g容器

docker start oracle11g

5.进入oracle11g容器进行配置

docker exec -it oracle11g bash 

6.切换到root用户下进行配置

su root

输入密码为:helowin

7、编辑profile文件配置ORACLE环境变量

vi /etc/profile

8、最后添加以下3行配置

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

保存 ::wq
让配置生效:source /etc/profile

9、创建软连接

ln -s $ORACLE_HOME/bin/sqlplus /usr/bin

10、切换到oracle 用户

su - oracle

11、登录sqlplus并修改sys、system用户密码

sqlplus /nolog
conn /as sysdba

12、修改sys、system用户密码并刷新权限

alter user system identified by oracle;
alter user sys identified by oracle;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

退出:exit;

13、查看一下oracle实例状态

lsnrctl status

14、用nacivat连接oracle数据库
服务名:helowin(一定要填写helowin)
密码:oracle(第12步设置的密码)

主机:192.168.145.130
端口:1521
服务名:helowin
用户名:system
密码:oracle
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值