用户工具

站点工具


linux:oracle

daocloud oracle-11g

  docker pull daocloud.io/ihypo/oracle-xe-11g:latest
  docker run --name oracle -p 1521:1521 -d daocloud.io/ihypo/oracle-xe-11g

创建用户:

  docker exec -it oracle bash
  connect
  system/oracle  => 更改密码为system
  create user test identified by test;
  grant connect,resource,dba to test;

容器启动之后db的默认配置

  hostname: localhost
  port: 49161
  sid: xe
  username: system
  password: oracle

三种url格式

格式一:jdbc:oracle:thin:@host:port:SID,简单,select value from v$parameter where name=‘instance_name’;
格式二:jdbc:oracle:thin:@//host:port/service_name,集群,select value from v$parameter where name='service_names';
格式三:jdbc:oracle:thin:@TNSName,通常建立tnsnames.ora文件保存@符号之后的内容,并通过System.setProperty指明路径
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=xe)))
linux/oracle.txt · 最后更改: 2020/10/10 15:22 由 admin