docker-compose启动oracle11、并使用navicat进行连接

一、docker-compose.yml

bash 复制代码
version: '3.9'
services:
  oracle:
    image: registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
    restart: always
    privileged: true
    container_name: oracle11g
    volumes:
      - ./data:/u01/app/oracle
    ports:
      - 1521:1521
    network_mode: "host"
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

二、修改用户信息,并创建连接用户

bash 复制代码
[root@e2ab0x9jme3furrd ~]# docker exec -it oracle11 /bin/bash
[oracle@a49ca77e4a58 /]$ cd /home/oracle
[oracle@a49ca77e4a58 ~]$ source .bash_profile
[oracle@a49ca77e4a58 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Fri Dec 3 15:10:28 2021 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 system; 
User altered. 
SQL> create user oracle11 identified by 123456; 
User created. 
SQL> grant connect, resource, dba to oracle11; 
Grant succeeded. 
SQL> alter profile default limit password_life_time unlimited; 
Profile altered. SQL> alter system set processes=2000 scope=spfile; 
System altered. 
SQL> select * from dba_users t where t.username='ORACLE11';
USERNAME USER_ID PASSWORD ------------------------------ ---------- ------------------------------ ACCOUNT_STATUS LOCK_DATE EXPIRY_DA -------------------------------- --------- --------- DEFAULT_TABLESPACE TEMPORARY_TABLESPACE CREATED ------------------------------ ------------------------------ --------- PROFILE INITIAL_RSRC_CONSUMER_GROUP ------------------------------ ------------------------------ EXTERNAL_NAME -------------------------------------------------------------------------------- PASSWORD E AUTHENTI -------- - -------- MIKE 91 USERNAME USER_ID PASSWORD ------------------------------ ---------- ------------------------------ ACCOUNT_STATUS LOCK_DATE EXPIRY_DA -------------------------------- --------- --------- DEFAULT_TABLESPACE TEMPORARY_TABLESPACE CREATED ------------------------------ ------------------------------ --------- PROFILE INITIAL_RSRC_CONSUMER_GROUP ------------------------------ ------------------------------ EXTERNAL_NAME -------------------------------------------------------------------------------- PASSWORD E AUTHENTI -------- - -------- OPEN USERNAME USER_ID PASSWORD ------------------------------ ---------- ------------------------------ ACCOUNT_STATUS LOCK_DATE EXPIRY_DA -------------------------------- --------- --------- DEFAULT_TABLESPACE TEMPORARY_TABLESPACE CREATED ------------------------------ ------------------------------ --------- PROFILE INITIAL_RSRC_CONSUMER_GROUP ------------------------------ ------------------------------ EXTERNAL_NAME -------------------------------------------------------------------------------- PASSWORD E AUTHENTI -------- - -------- USERS TEMP 03-DEC-21 USERNAME USER_ID PASSWORD ------------------------------ ---------- ------------------------------ ACCOUNT_STATUS LOCK_DATE EXPIRY_DA -------------------------------- --------- --------- DEFAULT_TABLESPACE TEMPORARY_TABLESPACE CREATED ------------------------------ ------------------------------ --------- PROFILE INITIAL_RSRC_CONSUMER_GROUP ------------------------------ ------------------------------ EXTERNAL_NAME -------------------------------------------------------------------------------- PASSWORD E AUTHENTI -------- - -------- DEFAULT DEFAULT_CONSUMER_GROUP USERNAME USER_ID PASSWORD ------------------------------ ---------- ------------------------------ ACCOUNT_STATUS LOCK_DATE EXPIRY_DA -------------------------------- --------- --------- DEFAULT_TABLESPACE TEMPORARY_TABLESPACE CREATED ------------------------------ ------------------------------ --------- PROFILE INITIAL_RSRC_CONSUMER_GROUP ------------------------------ ------------------------------ EXTERNAL_NAME -------------------------------------------------------------------------------- PASSWORD E AUTHENTI -------- - -------- USERNAME USER_ID PASSWORD ------------------------------ ---------- ------------------------------ ACCOUNT_STATUS LOCK_DATE EXPIRY_DA -------------------------------- --------- --------- DEFAULT_TABLESPACE TEMPORARY_TABLESPACE CREATED ------------------------------ ------------------------------ --------- PROFILE INITIAL_RSRC_CONSUMER_GROUP ------------------------------ ------------------------------ EXTERNAL_NAME -------------------------------------------------------------------------------- PASSWORD E AUTHENTI -------- - -------- 10G 11G N PASSWORD USERNAME USER_ID PASSWORD ------------------------------ ---------- ------------------------------ ACCOUNT_STATUS LOCK_DATE EXPIRY_DA -------------------------------- --------- --------- DEFAULT_TABLESPACE TEMPORARY_TABLESPACE CREATED ------------------------------ ------------------------------ --------- PROFILE INITIAL_RSRC_CONSUMER_GROUP ------------------------------ ------------------------------ EXTERNAL_NAME -------------------------------------------------------------------------------- PASSWORD E AUTHENTI -------- - -------- SQL>

三、navicat连接

oracle11连接

sys 连接:

相关推荐
青灯文案11 分钟前
Oracle 数据库常见字段类型大全及详细解析
数据库·oracle
代码讲故事23 分钟前
从Windows通过XRDP远程访问和控制银河麒麟ukey v10服务器,以及多次连接后黑屏的问题
linux·运维·服务器·windows·远程连接·远程桌面·xrdp
milk_yan1 小时前
Docker集成onlyoffice实现预览功能
前端·笔记·docker
IT北辰3 小时前
Linux下 date时间应该与系统的 RTC(硬件时钟)同步
linux·运维·实时音视频
Shootingmemory4 小时前
自动化01
运维·自动化
苹果醋34 小时前
golang 编程规范 - Effective Go 中文
java·运维·spring boot·mysql·nginx
心灵Haven5 小时前
CentOS 7乱码问题如何解决?
linux·运维·centos
__pop_5 小时前
记录一次 centos 启动失败
linux·运维·服务器·centos
狂爱代码的码农5 小时前
在centos上编译安装opensips【初级-默认安装】
linux·运维·centos
来恩10035 小时前
Kubernetes学习指南与资料分享
云原生·容器·kubernetes