你的位置:首页 > 数据库

[数据库]Oracle12C相关


1.jar包安装到MVN本地库

mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.1.0 -Dpackaging=jar -Dfile=ojdbc6.jar

2.

oracle 12c的连接方法:

<jdbc.url>jdbc:oracle:thin:@172.16.192.132:1521/pdbgeodata</jdbc.url>

<jdbc.artifactId>ojdbc6</jdbc.artifactId>

<jdbc.version>11.2.0.1.0</jdbc.version>

oracle 11g的连接方法:

<jdbc.url>jdbc:oracle:thin:@172.16.192.132:1521:geodata</jdbc.url>

--------------------------------------------------------------

1.

sqlplus / as sysdba

startup

alter system register;       # 应用动态注册listener

alter pluggable database all open;     # 将所有PDB数据库打开

select con_id, dbid, NAME, OPEN_MODE from v$pdbs;        # 查看所有PDB数据库状态

1.

select con_id,dbid,NAME,OPEN_MODE from v$pdbs;

2.

alter session set container=pdbgeodata;

3.

startup

4.

create user rms identified by summit;

conn rms/summit@pdbgeodata as sysdba

/network/admin/listener.ora

# Generated by Oracle configuration tools.

SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

      (ORACLE_HOME = /opt/oracle/app/product/12.1.0/dbhome)

      (SID_NAME = geodata )

    )

    (SID_DESC =

      (ORACLE_HOME = /opt/oracle/app/product/12.1.0/dbhome)

      (SID_NAME = pdbgeodata )

    )

  )

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.192.132)(PORT = 1521))

    )

   (DESCRIPTION=

      (ADDRESS=(PROTOCOL=tcps)(HOST= 172.16.192.132)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/app/admin/geodata/xdb_wallet))(Presentation=HTTP)(Session=RAW)

   )

  )

# ADR_BASE_LISTENER = /opt/oracle/app

~

~

/network/admin/listener.ora

# Generated by Oracle configuration tools.

# ADR_BASE_LISTENER = /opt/oracle/app

SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

      (GLOBAL_DBNAME = geodata.smartmap)

      (ORACLE_HOME = /opt/oracle/app/product/12.1.0/dbhome)

      (SID_NAME = geodata)

    )

  )

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

    )

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.192.132)(PORT = 1521))

    )

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCPS)(HOST = 172.16.192.132)(PORT = 5500))

    )

  )

ADR_BASE_LISTENER = /opt/oracle/app

-----------------------------------

1./etc/hosts文件

127.0.0.1 localhost localhost.localdomain

172.16.192.132 service service.smartmap

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

2..bash_profile文件

# DISPLAY=local_host:0.0

ORACLE_SID=geodata

ORACLE_BASE=/opt/oracle/app

ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome

TNS_ADMIN=$ORACLE_HOME/network/admin/

PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

export PATH ORACLE_SID ORACLE_BASE ORACLE_HOME TNS_ADMIN