Friday, November 13, 2015

Running Oracle Database on Amazon RDS

Greetings,

Amazon RDS is a database service that makes it easy to setup database in the Amazon AWS cloud. Using RDS you don't need to worry about managing databases, backups, replication (in Multi-AZ mode), upgrades and other common DBA operations. Amazon will do it for you. The only drawback is that you don't have direct access to OS / File system but that is the whole idea.

In this post I will show you how to setup an Oracle database in Amazon AWS using RDS service and connect it using SQL Developer on my local machine.

Pre-requisites:




Things to Remember


Amazon RDS provides you 2 choices for Oracle licences

  • License Included - This option Amazon will arrange a license for you but the hourly charge is slightly higher
  • BYOL - Bring Your Own License - This option you have to bring your own license, hourly rate is cheaper than option 1.



Note: In order to run Oracle in Amazon RDS with Free Tier you must have BYOL license for Oracle database.

Let's get started 

Creating Database in the Amazon RDS 


1. Log in to Amazon AWS Console https://console.aws.amazon.com

2. Click on the RDS under Database section in the console, 

3. First step is to add at-least 2 subnets in the DB subnet group. Click on the "Subnet Groups" on the left panel and click "add all the subnet". (Note: we are doing quick and dirty here)




4.  Click on the "Instances" in the left panel and click "Launch DB Instance"




5. Select Oracle and select 'Oracle SE One' (you can select anyone)


6. Select "No" from the choices and click Next, we are not going to use Multi-AZ deployment but in Production it is recommended


7. Enter basic details about the database such as Size of Instance, Instance name and SYSDBA account click Next Step
Note: With RDS you don't have direct access to SYSDBA and SYS users but the user you define will have the same privileges 



8. Leave the default settings for Network & Security (that is separate and huge topic, I will cover some other time) choose additional database options and Backup frequency, click Launch DB instance



9. You will get the following message if the action is successful. click View Your DB Instances.


10. It usually takes 5-10 minutes for a DB instance to ready, Click and expand to see more details about the instance and copy the END POINT address








Accessing the Database from SQL Developer


1. Open SQL Developer, Create a new connection, enter the hostname the END POINT we copied from the AWS console, enter the user name and password you mentioned during configuration.


2. Now you are all set and ready to play with Oracle DB in Amazon AWS using RDS




Have a good day,
Zeeshan Baig

Monday, October 26, 2015

Change of Twitter Handler Find me @IamZeeshanBaig

Hello Friends,

This is to inform you that I have renamed my Twitter handler to @IamZeeshanBaig from @baigsorcl

If you follow me on twitter there is no change except you need to remember my new ID.

I found my old handler was not really understandable and memorable to my friends and it is not tied to any technology.

Regards,
Zeeshan Baig
www.twitter.com/iamzeeshanbaig

Wednesday, October 21, 2015

How to Pass Dynamic Credentials to Web Services in BPEL Process

Hi.

Few days ago I got encountered with a little requirement about how to pass credentials to external web service calls inside BPEL process dynamically. I quickly mentioned to my colleagues that we can do using CSF-KEY on SOA Composite but the challenge was our BPEL process was really a service oriented :). Therefore, we had to pass a separate credentials to external web service calls.

I did a little research and by hit and trail I found a little solution that works well.

So here in summary you have to do
  • Create Map in Weblogic Domain as oracle.wsm.security 
  • Create Key inside the map called it my-custom-csf-key (you can call it anything) 
  • In BPEL attach a required policy to your service in external reference 
  • Create a custom variable in the BPEL process to hold the value of your custom CSF key i.e. my-custom-csf-key (You can read the CSF key name from Database if required) 
  • Assign a csf key value to your variable in the ASSIGN activity 
  • Add a csf-key property to your INVOKE Activity, set the value as your custom BPEL variable 
  • Deploy your code and test

Creating Key Map and Credentials Key

Log in to Enterprise Manager where BPEL Process is deployed i.e. http://localhost:7001/em

Right click the Domain Name and Choose Domain_Name > Security > Credentials 





Click Create Map button and enter oracle.wsm.security (if it is not already exists), Click OK




Select oracle.wsm.security in the table and click Create Key button

Enter your credentials, make sure the Type set as Password




Click OK, make sure you see the something similar in your screen (ignore basic.credentials)





BPEL Process Details


In the example my application have 2 BPEL process as follows

a. HellowithCredentials - This is main service secured by OWSM policy, you must pass credentials to successfully call it 
b.  CallSecureService - This is client application which is passing CSF key before invoking HellowithCredentials Service


HellowithCredentials Details


The service is a simple BPEL process and protected by SOA WS Policies i.e. oracle/wss_username_token_service_policy




Inside the BPEL process there is one ASSIGN activity which is just concat the input parameters you pass with String "Hello"




CallSecureService Details


The BPEL process is calling the HellowithCredentials service as External Service 


The oracle/wss_username_token_client_policy is attached to external service





A custom variable myCSFKeyVariable is created inside BPEL process to hold value of our dynamic csf-key 



Before Invoking External Service we are assigning value to myCSFKeyVariable using ASSIGN activity





The most important step is to create a property called csf-key inside INVOKE activity and set the value to your custom variable


Build and Deploy your code 

Testing application


Test CallSecureService from Enterprise Manager, you will see the following Green Flag


Now alter the password in your my-custom-csf-key to some random and Run again, you will see the following error message



There you go we have successfully pass the credentials to our BPEL process dynamically and secure, 

There is no need to hard code the credentials inside BPEL, WebLogic Key Map store the password and encrypt them securely. 

Cheers,
Zeeshan Baig




Monday, June 22, 2015

Presentation: Cloud Computing Basics


Hi,

I presented an internal training on Cloud Computing recently at AST Corporation. Following is my slides from the session. I covered basics of cloud computing and some products that Oracle Corporation offers. I also expanded on some of the cloud benefits.

Hope you get something out of it. Feel free to share the post and comment what you would like to see from me in future sessions.



Cloud Computing Basics from Zeeshan Baig


Regards,
Zeeeshan Baig
@baigsorcl

Tuesday, May 12, 2015

Oracle XE 11g 64 bit TNS Listener and Network Adapter Issue on Windows 7

Hi,

I have installed Oracle XE database on many machines and this seems to be a bug as I found which have to fix it manually on windows 7. I am not sure about if the problem exists on other platforms.

Problem

After install oracle XE everything is working as expected but once you restart your machine or database you cannot connect to it using TNS. Direct connection works but not when LISTENER is involved.

You might see following exceptions when connecting to database

IO Error: The Network Adapter could not establish the connection

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

For example look at the following slide

Connecting using SQL Command Line with and without using TNS



Solution

All you need to add XE database information to the LISTNER.ORA file typically found at C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN

1. Add the XE database information to LISTENER.ORA file (Highlighted entries)




2. Restart the Listener from Services




Cheers,
Zeeshan Baig 

Monday, May 11, 2015

Webinar: Getting Started with Web Services

Hi,

Last week I presented an Internal training session at AST Corporation. I thought It would be cool to share it with you all as well.

Following was the abstract of the session.

Web services are common way to communicate between applications regardless of languages or platform your application is developed. Therefore, understanding of Web services is a critical skill. In this session we will go through the basics foundation of what web services are and how you can create, utilize, and secure them.

Topics Include:
1. What is a web service?
2. Understanding of transfer protocols and message formats
3. Understanding different types of Web services
4. Creating basic web services
5. Available tools
6. Security

Presenter: Zeeshan Baig





Cheers,
Zeeshan Baig
@baigsorcl 

Wednesday, April 15, 2015

Re-using SOA Composites using Templates

Greetings,

Previously in SOA Suite reusing composites were quite a challenge. I recently encountered this requirement and thanks to new feature in SOA Suite 12c release now we can create templates on SOA Projects, Service Components and Custom BPEL scope activity.

In this post I will cover creating SOA Composite based on a template.

As an example I have a composite including BPEL process which is generating a report from  BI Publisher. The process includes assigning input parameters to web service.





Creating a Template:

Template creation is simple as it could be. Simply right click the SOA Composite or SOA Project and Choose Create SOA Template




Next you can select what components you want to include in your template.




Reusing Template:

Whenever you will create a new SOA Project you will see a new option called SOA Template simply select the template you have created earlier OR click the Green + sign to add templates stored at other location


There you go a new project based on template has been created



Reference :
39 Oracle SOA Suite Templates and Reusable Subprocesses

Version:
SOA Suite 12.1.3.0.0

Cheers,
Zeeshan Baig