Oracle Service Bus 11gR1 IDE Eclipse OEPE installation on Windows 7

Follow these steps to setup a development environment for Oracle Service Bus 11gR1 (11.1.1.6 is used in this example)
Download these components:

  • Oracle WebLogic Server 11gR1 (10.3.6) and Coherence and OEPE for Windows (32-bit) (Part Number: V24367-01)
  • Oracle Service Bus 11g (11.1.1.6.0) (Part Number: V29756-01)
I could not find these files through the Oracle.com website but you can download previous versions through the Oracle Software Delivery Cloud. These two installation files can be found in this category:
Product Pack: Oracle Fusion Middleware
Platform: Microsoft Windows (32bit)
Choose media pack: Oracle Fusion Middleware 11g Media Pack for Microsoft Windows (32-bit) 11.1.1.6.0 (Part number: B55383-41)

(Tip: Search for the Part numbers to make sure you download the correct versions)
First, install WebLogic Server with Oracle WebLogic Server 11gR1 + Coherence + OEPE and then install Oracle Service Bus.
When you install OSB, be sure to select the OEPE that is located inside the middleware directory.
After both installations, in the directory “Middleware directory/oepe_11gR1PS2” is eclipse.exe. If you execute this file, you can open Eclipse and start with creating an osb project.
Side note;
Some people can’t see the OSB perspective in Eclipse after this installation. Apparently it’s a rights issue which can be solved by navigating to the Oracle_OSB directory via Windows Explorer. You will be asked for permission to access that directory and after that dialogue you will be able to open the OSB perspective within Eclipse.

Unlock HR user and schema in Oracle Database

In an Oracle database there is a sample user called “HR”. This user comes with a schema which contains data which is quite convenient for demo purposes.
You can unlock this user using the following steps:

  1. Connect to your database with the system user
  2. Execute the following command (Note: replace “password” with your password)
    ALTER USER HR IDENTIFIED BY password ACCOUNT UNLOCK;
  3. Log in to the database with the HR user and your specified password

You can use this user for tutorials / demo’s in almost all Oracle databases since the tables are all equal.

Screenshot - Tables, Views and Procedures for the HR user
Screenshot – Tables, Views and Procedures for the HR user

Ps. I’ve posted this small tutorial mainly because it will serve as a prerequisite for other tutorials.

Schema size in Oracle DB

I’ve been running out of disk space on my virtual machine and didn’t want to mount another volume to add more room (because the problem isn’t more room; it’s that I’m sloppy with disk space) 🙂
So I was looking around on how to easily query for the schema size to find out which little project of mine was taking up way too much room. I found a nice solution on this blog:

SELECT tablespace_name
 , SUM(bytes)/1024/1024 AS total_size_mb
 FROM dba_segments
 WHERE owner = Upper('&User_Name')
 GROUP BY owner
 , rollup(tablespace_name);

When you run the query it’ll ask you which user you want to check:

Screenshot - SQL Developer - Query for schema size
Screenshot – SQL Developer – Query for schema size

SQL Developer, Comma's before columns!

I’ve been using SQL Developer a lot lately for data analysis and I’ve been getting used to the auto formatting to easily create well readable code out of my garbled-“I’m in a hurry”-SQL-mess.
This works like a charm, except for the comma’s which kept showing up at the end of the column names after the auto formatting, a small annoyance which is easily solved with this trick.
This is the default auto-formatting which is used by SQL Developer:

SELECT t1.column1,
 t1.column2,
 t2.column3
FROM table1 t1
JOIN table2 t2
ON t1.value1 = t2.value2;

You can change this behaviour by accessing the following settings:
Tools -> Preferences -> Database -> SQL Formatting -> Oracle Formatting -> Press button “Edit”
In the Oracle Formatting window: Line-breaks -> Select “Before comma” and deselect “After comma”

 
After this trick, the default formatting will have this code as a result:

SELECT t1.column1
, t1.column2
, t2.column3
FROM table1 t1
JOIN table2 t2
ON t1.value1 = t2.value2;
 

Happy querying! 🙂

Select sample WS Callouts straight from your Oracle DB

It’s often nice to have the most recent data when you want to test a web service, so in the best scenario you would want to query existing data with some criteria such as active contracts and/or within a certain range.
This example will show you how to get ready-to-use web service callout requests from SQL Developer (or any other SQL tool) which can be used in a Service Bus Console or SoapUI. We will use the HR example database -which can be found in every Oracle DB- as the source.
This is the request which we’ll use:

select '<v1:IncreaseSalaryRequest xmlns:v1="http://example.joris.visscher/hr/types/v1/">
 <v1:EmployeeId>
 <v1:Type>DEFAULT</v1:Type>
 <v1:Identifier>'||emp.employee_id||'</v1:Identifier>
 </v1:EmployeeId>
 <v1:FirstName>'||emp.first_name||'</v1:FirstName>
 <v1:LastName>'||emp.last_name||'</v1:LastName>
 <v1:Department>
 <v1:Type>DEFAULT</v1:Type>
 <v1:Identifier>'||dep.department_id||'</v1:Identifier>
 </v1:Department>
 </v1:IncreaseSalaryRequest>' WSRequest
from employees emp
, departments dep
where emp.department_id = dep.department_id
-- Let's add some conditions which are needed to finish the process succesfully.
and emp.last_name is not null
and dep.department_name = 'IT' -- return the most valuable employees
-- We only need 5 results.
and rownum <= 5;

This will result in five instantly usable requests from live data so we’ll know for sure that all the criteria that should be met for a functional correct case are indeed met:

<v1:IncreaseSalaryRequest xmlns:v1="http://example.joris.visscher/hr/types/v1/">
  <v1:EmployeeId>
    <v1:Type>DEFAULT</v1:Type>
    <v1:Identifier>103</v1:Identifier>
  </v1:EmployeeId>
  <v1:FirstName>Alexander</v1:FirstName>
  <v1:LastName>Hunold</v1:LastName>
  <v1:Department>
    <v1:Type>DEFAULT</v1:Type>
    <v1:Identifier>60</v1:Identifier>
  </v1:Department>
</v1:IncreaseSalaryRequest>

This query should work on most databases, but it works on an Oracle DB for sure 🙂
Happy testing!

Oracle SQL developer queries an OracleXE11g db on Ubuntu 11.10

Use XSLT to display your RSS feeds on Google Chrome (Live Bookmark alternative)

I’ve recently made the transition from Firefox to Chrome as my main browser. Unfortunatly there still isn’t an alternative on Google Chrome for the Live Bookmark functionality which I used on Firefox, and this might not come soon according to these sources:
RSS Live Bookmarks @ Google Support forums
I did found this link, the extension was a bit too buggy for me (but maybe you’ll be fine)
Chrome Web Store – Live Bookmarks
While trying several extentions I did not find one which offers the same functionality as the Live Bookmarks on Firefox, only RSS readers which wouldn’t work as intended.
My use for these rss feeds is to point to servers and/or environments. So it’s more used as a dynamic bookmark than as a RSS reader. The bookmarks are placed on a local server at my company so our operations department only has to update 1 resource when there are updates.
The end result isn’t exactly the same as the live bookmark in Firefox but to me it’s a pretty good alternative:

Instructions:

First we’ll show you the XML which is used for this RSS feed:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
 xmlns:atom="http://www.w3.org/2005/Atom"
 xmlns:dc="http://purl.org/dc/elements/1.1/">
 <channel>
 <title>jorisvisscher.wordpress.com Example RSS Feed</title>
 <link>http://localhost/links/example.xml</link>
 <description>Example RSS Feed for showing XSLT transformation</description>
 <atom:link href="http://localhost/links/example.xml" rel="self" type="application/rss+xml" />
 <item>
 <title>====== First Category ======</title>
 <link>http://google.com</link>
 </item>
 <item>
 <title>Local ALSB Server</title>
 <link>http://localhost:7001/console</link>
 </item>
 <item>
 <title>Local WLS Server</title>
 <link>http://localhost:7002/console</link>
 </item>
 <item>
 <title>Local BPM Workspace</title>
 <link>http://localhost:8585/workspace</link>
 </item>
 <item>
 <title>====== Second Category ======</title>
 <link>http://google.com</link>
 </item>
 <item>
 <title>Link to another server</title>
 <link>http://notlocalhost:7001:sbconsole</link>
 </item>
 <item>
 <title>Link to yet another server</title>
 <link>http://notlocahost:7001/console</link>
 </item>
 </channel>
</rss>

Previously on Firefox this feed would look like this:

Without a XSLT transformation, this RSS feed would look like this when opened in Google Chrome:

This ofcourse isn’t useful since we can’t click on the links. To fix this, we’ll add the following line to the XML file:

<?xml-stylesheet href="rss.xsl" type="text/xsl" media="screen"?>

The RSS Feed would look then like this:

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="rss.xsl" type="text/xsl" media="screen"?>
<rss version="2.0"
 xmlns:atom="http://www.w3.org/2005/Atom"
 xmlns:dc="http://purl.org/dc/elements/1.1/">
 <channel>
 <title>jorisvisscher.wordpress.com Example RSS Feed</title>
 <link>http://localhost/links/example.xml</link>
 <description>Example RSS Feed for showing XSLT transformation</description>
 <atom:link href="http://localhost/links/example.xml" rel="self" type="application/rss+xml" />
 <item>
 <title>====== First Category ======</title>
 <link>http://google.com</link>
 </item>
 <item>
 <title>Local ALSB Server</title>
 <link>http://localhost:7001/console</link>
 </item>
 <item>
 <title>Local WLS Server</title>
 <link>http://localhost:7002/console</link>
 </item>
 <item>
 <title>Local BPM Workspace</title>
 <link>http://localhost:8585/workspace</link>
 </item>
 <item>
 <title>====== Second Category ======</title>
 <link>http://google.com</link>
 </item>
 <item>
 <title>Link to another server</title>
 <link>http://notlocalhost:7001:sbconsole</link>
 </item>
 <item>
 <title>Link to yet another server</title>
 <link>http://notlocahost:7001/console</link>
 </item>
 </channel>
</rss>

As you can see, we are pointing to a xslt file to transform our RSS feed for use on the screen (or any other XML file for that matter). Place the XSLT file in the same directory as the RSS feed, or adjust the locator to the correct URL.
This is the XSLT file which we’ll use:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wfw="http://wellformedweb.org/CommentAPI/">
 <xsl:output method="html"/>
 <xsl:template match="/">
 <xsl:apply-templates select="/rss/channel"/>
 </xsl:template>
 <xsl:template match="/rss/channel">
 <div>
 <h3><xsl:value-of select="title"/></h3>
 <p><xsl:value-of select="description"/></p>
 </div>
 <div>
 <xsl:apply-templates select="item"/>
 </div>
 </xsl:template>
 <xsl:template match="/rss/channel/item">
 <div>
 <a href="{link}" rel="bookmark"><xsl:value-of select="title"/></a>
 <xsl:value-of select="description"/>
 </div>
 </xsl:template>
</xsl:stylesheet>

Please note; It’s pretty basic, I didn’t do much formatting since I’m not that much of a CSS guru 🙂
When opened in Google Chrome, it will look like this:

Which is completely usable for me, since I don’t need Firefox anymore for my live bookmarks.
Happy bookmarking!

Proxy authentication in Ubuntu 11.10 Oneiric Ocelot (Update)

This post simplifies the way to set your proxy which was explained in my previous post on October 21st.
(From the original post): Since Ubuntu 11.10, the proxy settings tab in the system settings have been changed, it’s no longer possible to enter your credentials in the proxy settings.
Before you start, you’ll need to find these values:

  • Proxy host
  • Proxy port
  • Proxy user name (would normally be your personal user name)
  • Proxy user password (would normally be your personal password)

Open a terminal and use the following commands to set these values, each line represents one command (! Adjust the values to your values !)

gsettings set org.gnome.system.proxy use-same-proxy 'true'
gsettings set org.gnome.system.proxy.http authentication-password 'ReplaceWithYourPassword'
gsettings set org.gnome.system.proxy.http authentication-user 'ReplaceWithYourUsername'
gsettings set org.gnome.system.proxy.http host 'ReplaceWithYourProxyHost'
gsettings set org.gnome.system.proxy.http port 'ReplaceWithYourProxyPort'
gsettings set org.gnome.system.proxy.http use-authentication 'true'
gsettings set org.gnome.system.proxy.http enabled 'true'

This should give you access through your company proxy! Happy browsing!
Ps. When you’re at home and you want disable the use of a proxy, use this command:

gsettings set org.gnome.system.proxy.http enabled 'false'

OBPM 10gR3 Easter Egg

It’s actually a Christmas Egg, but it makes me smile every year in December. A bit hard to spot and I must admit I thought my icons were corrupt the first time I noticed it.
The small Santa’s hat is what I’m talking about, as you can see in this screenshot:

(Did you notice it!?!?)
If you didn’t, no worries; here it is again: 
Kudos to the OBPM devvers!

Proxy authentication in Ubuntu 11.10 Oneiric Ocelot

UPDATE December 27th: I’ve added a post which doesn’t need dconf-editor here.

Since Ubuntu 11.10, the proxy settings tab in the system settings have been changed, it’s no longer possible to enter your credentials in the proxy settings.
There’s a solution where you can edit these settings through dconf-tools:
Download and run dconf-tools  in the terminal by executing these two lines of code:

sudo apt-get install dconf-tools
dconf-editor

Within dconf-editor, goto “system > proxy” and change “mode” to manual.
Then select “use-same-proxy”
After that, go to “system > proxy > http”, enter your proxy information and select “enable”
Make sure ftp, https and socks have “0” (zero) on “port” and nothing on “Host” field
Everything should work fine now.
Update on October 23th with screenshots:


(Please note: you should change the blurred values)

Ubuntu terminal doesn't unset proxy

Last week I’ve brought my own laptop to work and setting up evolution, subversion, the alsb and bpm environments with their proper endpoints and last but not least, I’ve set my Ubuntu Network Proxy to my companies proxy settings.
When I’ve returned home, I found out that the proxy settings were still active. One might imagine that would purge the settings in the Network Proxy to “Direct Internet Connection” but unfortunately, it did not.
Apparently there are three proxy settings which are left being set when using the terminal:

  • http_proxy
  • https_proxy
  • ftp_proxy
Apt-get, wget and all the CLI programs which use internet would fail because they’re searching for this proxy setting, but it isn’t to be found since we’re not at our company 🙂
A temporary solution is to unset these proxy settings, copy and paste each of these commands in your terminal and press enter:
unset http_proxy
unset https_proxy
unset ftp_proxy

I’ll add a permanent solution when I find it. For now this will clear the proxy settings within your terminal and you’ll be able to update and upgrade your repos through the terminal again!
Ps. I’m still looking for a nice dhcp client script which would add dns search domains to my /etc/resolv.conf, if you might know one; keep me posted!