Sunteți pe pagina 1din 11

Infosys Amazon RDS Integration With Existing Finacle Environment

Infosys

Amazon RDS Integration With Existing Finacle


Environment
May, 2017

INFOSYS LIMITED

Bangalore

Document No. 1 Ver. Rev. : 0.1

Reviewed by: Vijay John Author: Sonalika Tomar


Stephen
Date: 31st May 2017

©2017 Infosys Limited, India


Infosys Amazon RDS Integration With Existing Finacle Environment

COPYRIGHT NOTICE

©2017 Infosys Limited, Bangalore, India. All rights reserved. Infosys believes the information
in this document is accurate as of its publication date; such information is subject to change
without notice. Infosys acknowledges the proprietary rights of other companies to the
trademarks, product names and such other intellectual property rights mentioned in this
document. Except as expressly permitted, neither this document nor any part of it may be
reproduced, stored in a retrieval system, or transmitted in any form or by any means,
electronic, mechanical, printing, photocopying, recording or otherwise, without the prior
permission of Infosys Limited and/or any named intellectual property rights holders under
this document.

Infosys Limited
Hosur Road
Electronic City, 3rd Cross
Bangalore 560 100
India.
Telephone: (91) (80)28520 261-270
Fax: (91) (80) 8520 362
Website: http://www.infosys.com

©2017 Infosys Limited, India


Infosys Amazon RDS Integration With Existing Finacle Environment

Author: Sonalika Tomar

Date written (MM/DD/YY): 05/31/17

Project Details:

Project(s) involved: B121FNSP

H/W Platform: RHEL7 Linux

S/W Environment: Windows Server, Oracle 12c

Application Type: Finacle 11.4

Project Type: Finacle AWS Cloud POC

Target readers:

All people working on Finacle integration with AWS RDS (Amazon Relational Database
Service). End users should have basic knowledge of Finacle setup and Finacle Database
objects.

Keywords:

Finacle, AWS, RDS, Database, Schema, User, Role, Grants, Import, Export

©2017 Infosys Limited, India


Infosys Amazon RDS Integration With Existing Finacle Environment

Table of Contents
Introduction: ........................................................................................................... 5
AWS RDS: ............................................................................................................. 5
I. Importing existing database data into Oracle on Amazon RDS ......................... 5
Pre-requisites: ..................................................................................................... 5
Approach 1: Oracle Data Pump – impdp: .............................................................. 6
Approach 2: SQL Developer: ................................................................................. 7
II. Pointing the existing Finacle application to this RDS instance ..................... 10
Reference(s): ........................................................................................................ 11

©2017 Infosys Limited, India


Infosys Amazon RDS Integration With Existing Finacle Environment

Introduction:
AWS RDS:
Amazon Relational Database Service (Amazon RDS) is a web service that helps to set up
a relational database in the cloud environment which is easy to operate and is scalable.
While managing common database administration tasks, it provides cost-efficient and
resizable capacity for a standard relational database.

The basic building block of Amazon RDS is the DB instance. A DB instance is a snapshot of
the database environment in the cloud. User can access it by using the same tools and
applications that they use with a stand-alone database instance. User can create and
modify a DB instance by using the AWS Command Line Interface, the Amazon RDS API,
or the AWS Management Console.

There are some pre-defined ‘DB instance classes’ provided by AWS. These classes have
pre-defined computation and memory capacity associated with them. DB instance class
for a DB instance can be selected as per requirement. Also, if there is any change in the
computation or memory related parameters while working, the DB instance can be edited
accordingly.

User can run a DB instance on a virtual private cloud using the Amazon Virtual Private
Cloud (VPC) service. When they use a virtual private cloud, they have control over their
virtual networking environment, like: they can select their own IP address range, create
subnets, and configure routing and access control lists.

The basic functionality of Amazon RDS remains same, irrespective of whether it is running
in a VPC or not. Amazon RDS manages regular backups of the database data, ensures
patch application, automatic error detection, and recovery from failures. No additional
cost is incurred to run a DB instance in a VPC.

This document will detail about the steps of integrating AWS RDS instance with an
existing Finacle environment. This integration activity involves two steps as mentioned
below:

1. Importing existing database data into Oracle on Amazon RDS


2. Pointing the existing Finacle application to this RDS instance

The cloud servers on which Finacle is installed are accessible from a Windows machine
placed in cloud network. The same machine is known as Terminal server or Jump server
in cloud terminology. In this case, the Terminal server is a ‘Windows Server 2012 R2
standard’. The above steps are detailed in below sections.

I. Importing existing database data into Oracle on Amazon RDS


Scenario is that the Finacle installation is already in place with a standalone database. The
existing database needs to be replaced with RDS DB instance.

Pre-requisites:
i. Non-RDS Oracle database instance (to be ported to RDS)
ii. RDS instance

This activity can have two approaches as mentioned below:

©2017 Infosys Limited, India


Infosys Amazon RDS Integration With Existing Finacle Environment

Approach 1: Oracle Data Pump – impdp:


1. Take database dump from the existing standalone DB instance:
Oracle data pump utility can be used to take the database dump.
example: expdp system/password@DBSID directory=DATA_PUMP_DIR
dumpfile=expdump_full_DBSID.dmp logfile=expdump_full_DBSID.log full=Y
compression=all
2. The data dump taken above can be placed in the DATA_PUMP_DIR directory of the
existing standalone DB. The DATA_PUMP_DIR can be found using below command:
select * from dba_directories;

3. Database Link: Create a DB Link between existing Database and RDS instance.
This link will be created on the existing Database instance.
example: create database link linkname connect to dbausr identified by
dbauserpassword using
'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521))(
CONNECT_DATA=(SID=DBSID)))';
4. DBMS_FILE_TRANSFER package:
After creating the database link, the DBMS_FILE_TRANSFER.PUT_FILE method is
used to copy the exported data dump file from the original Oracle DB instance to
the DATA_PUMP_DIR on the target DB instance that is connected via a database
link.
example:
BEGIN
DBMS_FILE_TRANSFER.PUT_FILE('DATA_PUMP_DIR','expdump_full_DBSID.dmp','
DATA_PUMP_DIR','expdump_full_DBSID0.dmp','linkname');
END;
/
5. Create the tablespaces in the target RDS instance as present in the existing
database.
User can use the below query to generate queries to create tablespaces from the
existing DB instance where it is executed:
select 'create tablespace '||tablespace_name||' datafile '||''''||file_name||''''||' size
'||bytes/(1024*1024)||'M ;'from dba_data_files where tablespace_name not in
('SYSTEM','SYSAUX','UNDO_TBLSPC');
6. The schemas/users also need to be created in the target RDS instance as present
in the source DB. Below mentioned query can be used to generate schema/user
creation queries from the existing DB:
select 'create user '||username||' identified by '||lower(username)|| ' default
tablespace '||default_tablespace||';' from dba_users where username not in
('SYSTEM','SYS','OUTLN','DIP','ORACLE_OCM','APPQOSSYS','DBSNMP','WMSYS');
7. Create Roles in the target RDS instance as those present in the source database.
Below query can be used to find the roles present in the source database:
select * from dba_roles;
8. The grants assigned to schemas/users in the source DB need to be given to the
schemas/users in the target DB as well. Below mentioned query can be used to
generate the grant creation queries from the source database:

©2017 Infosys Limited, India


Infosys Amazon RDS Integration With Existing Finacle Environment

select dbms_metadata.get_granted_ddl('ROLE_GRANT', username) from


dba_users where username in
('SSOADM','SSOGEN','SSOUTIL','TBAADM','TBAGEN','TBAUTIL','CRMUSER','CRMBA
TCHUSER','MIGADM');

select dbms_metadata.get_granted_ddl( 'SYSTEM_GRANT', username ) from


dba_users where username in
('SSOADM','SSOGEN','SSOUTIL','TBAADM','TBAGEN','TBAUTIL','CRMUSER','CRMBA
TCHUSER','MIGADM');
9. Now import data in these database objects created in the RDS instance as
explained in below steps:
9.1. Use impdp command to import the data into RDS instance:

impdp adminuser/password@RDSDBSID full=Y directory=DATA_PUMP_DIR


dumpfile=dumpfilename.dmp logfile=logfilename.log

This completes the source database data import in target RDS instance using impdp
command.

Approach 2: SQL Developer:


1. Take database dump from the existing standalone DB instance:
Oracle data pump utility can be used to take the database dump.
example: expdp system/password@DBSID directory=DATA_PUMP_DIR
dumpfile=expdump_full_DBSID.dmp logfile=expdump_full_DBSID.log full=Y
compression=all

2. Install an Oracle client like SQL Developer on the client machine (Windows Server
2012 here). This will be used to access the RDS DB instance.
3. The data dump taken above can be placed in the DATA_PUMP_DIR directory of the
existing standalone DB. The DATA_PUMP_DIR can be found using below command:
select * from dba_directories;

4. Database Link: Create a DB Link between existing Database and RDS instance.
This link will be created on the existing Database instance.
example: create database link linkname connect to dbausr identified by
dbauserpassword using
'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521))(
CONNECT_DATA=(SID=DBSID)))';

5. DBMS_FILE_TRANSFER package:
After creating the database link, the DBMS_FILE_TRANSFER.PUT_FILE method is
used to copy the exported data dump file from the original Oracle DB instance to
the DATA_PUMP_DIR on the target DB instance that is connected via a database
link.
example:
BEGIN

©2017 Infosys Limited, India


Infosys Amazon RDS Integration With Existing Finacle Environment

DBMS_FILE_TRANSFER.PUT_FILE('DATA_PUMP_DIR','expdump_full_DBSID.dmp','
DATA_PUMP_DIR','expdump_full_DBSID0.dmp','linkname');
END;
/

6. Once above method is successfully executed, create a new connection with RDS
DB instance using SQL Developer.

7. Create the tablespaces in the target RDS instance as present in the existing
database.
User can use the below query to generate queries to create tablespaces from the
existing DB instance where it is executed:
select 'create tablespace '||tablespace_name||' datafile '||''''||file_name||''''||' size
'||bytes/(1024*1024)||'M ;'from dba_data_files where tablespace_name not in
('SYSTEM','SYSAUX','UNDO_TBLSPC');

8. The schemas/users also need to be created in the target RDS instance as present
in the source DB. Below mentioned query can be used to generate schema/user
creation queries from the existing DB:
select 'create user '||username||' identified by '||lower(username)|| ' default
tablespace '||default_tablespace||';' from dba_users where username not in
('SYSTEM','SYS','OUTLN','DIP','ORACLE_OCM','APPQOSSYS','DBSNMP','WMSYS');

9. Create Roles in the target RDS instance as those present in the source database.
Below query can be used to find the roles present in the source database:
select * from dba_roles;

10. The grants assigned to schemas/users in the source DB need to be given to the
schemas/users in the target DB as well. Below mentioned query can be used to
generate the grant creation queries from the source database:
select dbms_metadata.get_granted_ddl('ROLE_GRANT', username) from

©2017 Infosys Limited, India


Infosys Amazon RDS Integration With Existing Finacle Environment

dba_users where username in


('SSOADM','SSOGEN','SSOUTIL','TBAADM','TBAGEN','TBAUTIL','CRMUSER','CRMBA
TCHUSER','MIGADM');

select dbms_metadata.get_granted_ddl( 'SYSTEM_GRANT', username ) from


dba_users where username in
('SSOADM','SSOGEN','SSOUTIL','TBAADM','TBAGEN','TBAUTIL','CRMUSER','CRMBA
TCHUSER','MIGADM');

11. Now import data in these database objects created in the RDS instance as
explained in below steps:
11.1 Connect to RDS instance using SQL developer:
11.1.1 Open DBA window. Go to Menu – Window-> Reset Windows to Factory
Settings. Then go to Menu – View -> DBA. User gets a window as
shown in below figure:

11.1.2 Right click on Connections. Click Add Connection. Select the appropriate
instance and click on OK.

©2017 Infosys Limited, India


Infosys Amazon RDS Integration With Existing Finacle Environment

11.1.3 Once connected, expand the instance tab as shown below:

11.1.4 Expand ‘Data Pump’ option and go to ‘Import Jobs’ wizard. Select the
import type as ‘Schemas’ and choose the dump file name.
11.1.5 Click on Next and select the schema names from the source DB instance
to be imported.
11.1.6 Click next and then click on Finish.
11.1.7 Job will get created in the ‘Import Jobs’ folder. Double click the Job.
Wait till the state of the job changes to ‘Not Running’.
11.1.8 Once the state changes to ‘Not Running’, cross check some tables if the
data is as required or not.

This completes the source database data import in target RDS instance using SQL
developer.

Next step is to point the existing Finacle instance to this new RDS instance.

II. Pointing the existing Finacle application to this RDS instance


As mentioned earlier in this document, the existing Finacle environment is having a
standalone database. Now, user needs to replace the standalone DB instance with a
Amazon RDS DB instance. For that, user needs to do changes at below mentioned places:

1. Add the RDS DB instance details in the oracle client tnsnames.ora file in frontend
and backend servers.
Note: The RDS instance will have a hostname which is known as endpoint URL.
The IP address for the same is not fixed. Thus, just use the endpoint URL.

2. In backend servers:
2.1 Edit the DB instance entry in commonenv.com file.
2.2 Edit the DB connection URL in DBProperties.* files for the corresponding
solutions present in the path:

©2017 Infosys Limited, India


Infosys Amazon RDS Integration With Existing Finacle Environment

/etc/b2k/$FINACLE_INSTALL_ID/<Solution>/seed

3. In frontend servers:
3.1 Edit the DB connection URL in DBProperties.* files for the corresponding
solutions present in the path:
/etc/b2k/$FINACLE_INSTALL_ID/<Solution>/seed
3.2 Edit the DB connection string for the resources from WebSphere console.
Example: Go to DMGR/WAS profile console -> Resources -> JDBC -> Data
Sources
Go to particular data sources and edit the DB connect string with the new
RDS instance details.

4. Bring up the WebSphere servers and Finacle services:


Remove the existing .cfg files for the WebSphere profiles and Finacle services.
Then start the services.

5. Try accessing the Database. User can check data of few important tables. If
possible, try to do some transaction wherein data changes, so that can cross check
if the new data is persisting in the new RDS instance or not. This will confirm the
RDS integration with Finacle application.

References:
1. My personal work experience while working on ‘Finacle AWS cloud POC’ project.

2. For more information, below links can be referred:


http://docs.aws.amazon.com

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Oracle.Procedural.Importing.
html

©2017 Infosys Limited, India

S-ar putea să vă placă și