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 连接:

相关推荐
我言秋日胜春朝★1 分钟前
【Linux】冯诺依曼体系、再谈操作系统
linux·运维·服务器
全能全知者24 分钟前
docker快速安装与配置mongoDB
mongodb·docker·容器
饮啦冰美式33 分钟前
22.04Ubuntu---ROS2使用rclcpp编写节点
linux·运维·ubuntu
wowocpp33 分钟前
ubuntu 22.04 server 安装 和 初始化 LTS
linux·运维·ubuntu
Lign1731438 分钟前
ubuntu unrar解压 中文文件名异常问题解决
linux·运维·ubuntu
成富1 小时前
文本转SQL(Text-to-SQL),场景介绍与 Spring AI 实现
数据库·人工智能·sql·spring·oracle
大霞上仙1 小时前
Ubuntu系统电脑没有WiFi适配器
linux·运维·电脑
Karoku0662 小时前
【企业级分布式系统】Zabbix监控系统与部署安装
运维·服务器·数据库·redis·mysql·zabbix
为什么这亚子2 小时前
九、Go语言快速入门之map
运维·开发语言·后端·算法·云原生·golang·云计算
布值倒区什么name2 小时前
bug日常记录responded with a status of 413 (Request Entity Too Large)
运维·服务器·bug