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