以下是對Oracle透明網關的相關內容的介紹。我們把文章分成兩部分,一部分是介紹Oracle透明網關的數據來源,另一部分是介紹在正式數的據庫在建立到理正系統數據庫的DBLINK,以下就是文章的具體介紹。
一、數據來源
理正系統Oracle數據庫,連接方式
- SERVER=gedi-oainfo;
- DATABASE=lzmisuser
- username:sa
- passWord:JSjadmin
視圖:eip_user_vIEw
步驟
一、在10.122.88.7(測試數據庫)建立透明網關。
1)在10.122.88.7\e$\OraHome_1\tg4msql\admin建一個文件名為“initLZMISUSER.ora”內容是:
- HS_FDS_CONNECT_INFO="SERVER=gedi-oainfo;DATABASE=lzmisuser"
- HS_FDS_TRACE_LEVEL=OFF
- HS_FDS_RECOVERY_ACCOUNT=RECOVER
- HS_FDS_RECOVERY_PWD=RECOVER
2)在10.122.88.7\e$\OraHome_1\network\admin\listener.ora文件增加內容:
- (SID_DESC=
- (GLOBAL_DBNAME = LZMISUSER)
- (SID_NAME = LZMISUSER)
- (PROGRAM = tg4msql)
- (Oracle_HOME= E:\OraHome_1)
Oracle透明網關中我們要注意路徑 當時在我本機裝完透明網關後的路徑是下面的
- )
- (SID_DESC=
- (GLOBAL_DBNAME = LZMISUSER)
- (SID_NAME = LZMISUSER)
- (PROGRAM = tg4msql)
- (Oracle_HOME= D:\Oracle\product\10.2.0\tg_1)
- )
二、在正式數據庫建立到理正系統數據庫的DBLINK
- Drop existing database link
- drop database link LZMIS.US.Oracle.COM;
- Create database link
- create database link LZMIS.US.Oracle.COM
- connect to SA identifIEd by JSJADMIN
- using '(DESCRIPTION =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP)(HOST = 10.122.88.7)(PORT = 1521))
- )
- (CONNECT_DATA =
- (SID = LZMISUSER)
- )
- (HS=OK)
- )';
三、建視圖v_lz_user
- create or replace vIEw v_lz_user as
- select trim("UG_UserGrpName") UG_USERGRPNAME,
- trim("room") ROOM,trim("SU_UserName") SU_USERNAME,
- trim("SU_UserCode")
SU_USERCODE from [email protected]
四、修改表結構(如已修改了此步驟可省)
1、在EIP_SYS_USER表增加字段 HRUSER
- Add/modify columns
- alter table EIP_SYS_USER add HRUSER VARCHAR2(2);
- Add comments to the columns
- comment on column EIP_SYS_USER.HRUSER
is '數據是否來自HR,''y''是,''n''否';