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 小时前
维护在线重做日志(二)
数据库·oracle
朝九晚五ฺ7 小时前
【Linux探索学习】第十四弹——进程优先级:深入理解操作系统中的进程优先级
linux·运维·学习
Kkooe8 小时前
GitLab|数据迁移
运维·服务器·git
wuxingge8 小时前
k8s1.30.0高可用集群部署
云原生·容器·kubernetes
久醉不在酒8 小时前
MySQL数据库运维及集群搭建
运维·数据库·mysql
志凌海纳SmartX9 小时前
趋势洞察|AI 能否带动裸金属 K8s 强势崛起?
云原生·容器·kubernetes
锅总9 小时前
nacos与k8s service健康检查详解
云原生·容器·kubernetes
LKID体9 小时前
Python操作neo4j库py2neo使用(一)
python·oracle·neo4j
BUG弄潮儿9 小时前
k8s 集群安装
云原生·容器·kubernetes
意疏10 小时前
【Linux 篇】Docker 的容器之海与镜像之岛:于 Linux 系统内探索容器化的奇妙航行
linux·docker