zoukankan      html  css  js  c++  java
  • docker运行oracle11g

    image

    docker pull registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g
    

    或者自己自动添加表

    create role test_role;
    grant create any table, alter any table, drop any table,
      insert any table, update any table, delete any table,
      create any index, alter any index, drop any index,
      create any sequence, alter any sequence, drop any sequence, select any sequence,
      create any view, drop any view
      to test_role;
    
    create tablespace testdb datafile '/u01/app/oracle/oradata/XE/testdb.dbf' size 300m autoextend on next 1m maxsize unlimited extent management local;
    create user test identified by test default tablespace testdb temporary tablespace temp;
    grant connect, resource to test;
    alter user test quota unlimited on testdb;
    grant test_role to test;

    构建镜像

    FROM registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g
    ADD init.sql /docker-entrypoint-initdb.d/

    启动

    docker run -d -p 49160:22 -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g
    

    连接

    hostname: 192.168.99.100
    port: 49161
    sid: xe
    username: system
    password: oracle
    Password for SYS & SYSTEM

    jdbc

    • maven

            <dependency>
                <groupId>com.oracle</groupId>
                <artifactId>ojdbc6</artifactId>
                <version>11.2.0.3</version>
            </dependency>
    
    • repository

    <repositories>
            <!-- for ORACLE ojdbc6. -->
            <repository>
                <id>codelds</id>
                <url>https://code.lds.org/nexus/content/groups/main-repo</url>
            </repository>
            <repository>
                <id>spring-snapshots</id>
                <name>Spring Snapshots</name>
                <url>https://repo.spring.io/snapshot</url>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>spring-milestones</id>
                <name>Spring Milestones</name>
                <url>https://repo.spring.io/milestone</url>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
        </repositories>
    • 配置

    spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
    spring.datasource.url=jdbc:oracle:thin:@192.168.99.100:49161:xe
    spring.datasource.username=test
    spring.datasource.password=test
    spring.jpa.hibernate.ddl-auto=update
    spring.jpa.database-platform=org.hibernate.dialect.Oracle10gDialect

    doc

  • 相关阅读:
    CF1066D Boxes Packing
    luogu P2508 [HAOI2008]圆上的整点
    luogu P2502 [HAOI2006]旅行
    luogu P2511 [HAOI2008]木棍分割
    luogu P4161 [SCOI2009]游戏
    luogu P4160 [SCOI2009]生日快乐
    windows2012系统IE浏览器无法打开加载flashplayer内容
    kvm虚拟机相关
    esxI开启虚拟化
    Termux 详细安装
  • 原文地址:https://www.cnblogs.com/davygeek/p/7510578.html
Copyright © 2011-2022 走看看