Oracle To SQL Server Connectivity
Oracle To SQL Server Connectivity
2 5 Heterogenous Database connectivity Technical discription......................................................2 6 Pre-requisites/Dependencies ......................................................................................................5 7 Features of the Hetereogeneous Connectivity.............................................................................6
Technologies Used
Following technologies used for getting used in the PRA application: Front End: Visual Basic 6.0 Back-End: Oracle 9i Crystal report is used for generating reports
3.1
Database Details PRA Database: Oracle 9i Lissia Database: SQL Server 2000
The following activities or processes are done in the PRA application: 1. Extraction and Flagging : In this step, the policies to be reinsured are extracted from Lissia. Flagging is done (based on the pre-defined business rules in PRA) to check that whether the client needs the re-insurance or not. Time taken to complete the activity : 8 10 hours 2. Premium Calculation: In this step the premium (to be paid to the re-insurer) of all the flagged policies is calculated. Time taken to complete the activity : 4 6 hours (depend on records) Earilar we are doing the manual extraction activity from Lissia ( Sql Server database ) to PRA ( Oracle database) and now by the heterogeneous connectivity between Sql server and Oracle we can directly doing the calculation part by logging in PRA (Oracle) and accessing the data of Lissia (Sql server) The heterogeneous connectivity is completely excluded the manually extraction/flagging part.
Accessing Non Oracle System through Oracle 9i system using Generic Connectivity
In this Configuration: -
(1) A client connects to the Oracle database server through Oracle Net. (2) The Heterogeneous Services component of the Oracle database server connects through Oracle Net to the Heterogeneous Services ODBC agent. (3) The agent communicates with the following non-Oracle components: An ODBC driver manager An ODBC driver NonOracle system client
Scenario
In our scenario oracle database name is REINS, Sql Server database name LISSIA, Agent service name is HSSQL and system DSN name is NORTH. Steps involved:
(1) Create a system dsn (NORTH) points to the sql server database (LISSIA).
From the Start menu, choose Settings > Control Panel and select the ODBC icon. Select the system DSN tab to display the system data sources.
Click Add. From the list of installed ODBC drivers, select the name of the driver that the data source will use. For example, select SQL Server. Click Finish.
(2)Create Heterogeneous service initialization file on oracle HS_FDS_CONNECT_INFO = north HS_FDS_TRACE_LEVEL = ON HS_FDS_TRACE_FILE_NAME = hssql.log
(3) Alter the Listener.ora file -----------------------------------------------------------------------------------------------------------LISTENER = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = GURUAT04)(PORT = 1521)) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = reins) (ORACLE_HOME = E:\oracle\ora92) (SID_NAME = reins) ) (SID_DESC = (GLOBAL_DBNAME = hssql) (ORACLE_HOME = E:\oracle\ora92) (SID_NAME = hssql) (Program= hsodbc) ) ) -----------------------------------------------------------------------------------------------------------(4) Alter the Tnsnames.ora -----------------------------------------------------------------------------------------------------------REINS.AVIVAINDIA.COM =
(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = GURUAT04)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = reins) ) ) HSSQL.AVIVAINDIA.COM = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = guruat04)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = hssql) ) (HS = OK) ) ------------------------------------------------------------------------------------------------------------
(6) Create a database link with in an oracle database. Create database link samy Connect to SA identified by password Using HSSQL; (7) Select Sql Server data in the oracle environment. Select * from employees@samy
6 Pre-requisites/Dependencies
Before running heterogeneous connectivity ensures that below given prerequisites are met: a. Both the databases should be up and running b. The access privileges will be equal to the sql sever user privileges which you are using in the system DSN.
--------------------------------------------------------------------------------------------------