Tools
WebLogic 12c released!
Dec 2nd
At December the 1st, 2011, Oracle announced it’s new major release, the 12c release. As Oracle added the i (internet) at its 8 release, the g(gridcomputing) at its 10 release, now the focus will be on the c(cloudcomputing).
Many new features come out of the fact that Oracle has made its key application server ready for the cloud, that is, ready for to run on enigineered systems, in fact its own Exalogic machine, Oracle’s solution for implementing the cloud.
So let’s take a look what this new release brings us, in this blogpost. There are several new features available in the 12c
New or enhanced WebLogic 12c features
- JAVA EE 6 support all kinds of JEE6 specifications are implemented like :
- JSF 2.0,Java Servlets 3.0 JPA 2.0 and EJB 3.1.
- Managed Beans 1.0
- WebLogic 12c also supports supports Java SE 7 (and Java SE 6).
- Java language optimizations and Internationalization
- Client and server support
- SSL/TLS 1.2 in JSSE to support JAVA Socket Transport security
- Converged Java VM:JRockit and HotSpot are incorporated with the best features from both.The JVM convergence will be a multi-year process, which was confirmed during my presence at Oracle’s Publisher Seminar 2011 during OOW
I won’t discuss the full list in this blog because there’s more about WebLogic than only (although very important of course!) the JAVA EE 6 specifications.
- Support for IDE’s. WebLogic already supported JDeveloper 11.1.1.5, but will come out with the 11.1.1.6 later on. Also suported are Eclipse and NetBeans 7.1 IDE. As said, the JDeveloper 11.1.1.6 and IntelliJIdea IDE will be supported in a later timeframe.
- New enhanced WebLogic Maven Plug-in See the various new options below in this scheme
ADF table filtering on MySQL is failing
Oct 24th
Table filtering, aka Query by example, is a great feature of ADF tables. This feature provides filterboxes on top of a column(es).

and filters the data based on the values in the filterbox:

This works like a charm on an Oracle database, but when you use MySQL the filtering doesn’t work and actually doesn’t retrieve any data at all. As you can understand, this is not expected and definitely not wanted behaviour.
The first step in solving this behaviour was to enable logging (either via the weblogic diagnostic console or by adding -Djbo.debugoutput=console to the Java Options in the project properties Run configuration). In the log console we see that the SQL statement for this table collection / ViewObject now includes a where clause that includes the table filter value(s): ‘WHERE ( ( (EmployeesEo.FIRST_NAME LIKE ( :vc_temp_1 || ‘%’) ) ) )‘. This where clause with the % appended to the variable is automatically performed by the ADF framework.
As it turned out, this concatenation of the value with the % (:vc_temp || ‘%’) was the cause of our problem. This concatenation with a double pipe is a SQL92 standard. However with MySQL the concatenation is done with the concat function and not the double pipe. Thus this statement causes an exception somewhere in MySQL, and the result is that no data is returned.
The solution is actually quite easy because you can configure the ’strictness’ of MySQL to the SQL standard via the SQL mode. In this case: SET sql_mode = ‘PIPES_AS_CONCAT’. This value can also be set in the my.cnf or my.ini files or provided at startup via the: –sql-mode=”PIPES_AS_CONCAT” option. Now the filtering works as expected.
Rman 11gR2 changes tag labeling of the inc backup in incrementally updated backups
Oct 14th
In (rman) incrementally updated backups, only incremental backups are done after the first full backup to the Fast Recovery Area.
From 11gR2 on the incremental backup pieces will get the same tag as the datafile copies, and that’s actually different behaviour from pre- 11gR2 versions of the database.
I stumbled on this different behaviour when a backup script, that worked perfectly on 11gR2, got ported to 10gR2 and 11gR1 ( 11.1.7 ).
The script contains a system cleanup of all incrementals, done before a certain date, specifying the tag of the copy [ 'COPY_DATABASE' ].
On 11gR2 the inc1 backups got deleted fine, but the delete on 10gR2 and 11gR1 just wouldn’t work.
By checking v$backup_piece…
select distinct tag
from v$backup_piece
where instr(tag,'TAG')=0;
…and getting no result, it became clear that the tag of the copy datafiles, was’t also the tag of the incrementals.
Once I knew, it was easy to correct the problem.
I just added the tag of my copy datafiles to the incremental backup, and that did the trick.
All incrementals that were supposed to get cleared from the pre-11gR2 system, were deleted.
The incrementals without tag, already on the system, were deleted manually.
My original 11gR2 incremental backup, and delete:
run{
allocate channel d1 device type disk;
backup
filesperset 8
incremental level 1
for recover of copy with tag 'COPY_DATABASE' database;
release channel d1;
}
run {
allocate channel d2 device type disk;
delete noprompt
backupset
tag 'COPY_DATABASE'
completed before 'trunc(sysdate-7)';
release channel d2;
}
The pre-11gR2 version of the incremental backup.. the delete hasn’t changed:
run{
allocate channel d1 device type disk;
backup
filesperset 8
incremental level 1
tag 'COPY_DATABASE'
for recover of copy with tag 'COPY_DATABASE' database;
release channel d1;
}
How to switch datafiles to FRA and back again
Oct 14th
If you, like me, like to use (rman) incrementally updated backups, a copy of all datafiles will be present in the Fast Recovery Area. That becomes quite handy if you are in sudden need of extra disk space for your database, and the FRA still has ample space left. By switching one or more datafiles to the copy in FRA, you can very quickly use this extra disk space for your database, while not even having to shut down.
I developed a view to generate all the rman commands to execute the switch to FRA, and the switch back to it’s original location and name. Use it at your own discretion.
CREATE OR REPLACE FORCE VIEW rman_switch_datafiles
AS
SELECT tablespace_name
, file_name
, file_id
, '================================================'||chr(10)
||' switch datafile '||file_id||' to copy in FRA '||chr(10)
||'================================================'||chr(10)
||'run'||chr(10)
||'{'||chr(10)
||'sql ''alter tablespace '||tablespace_name||' offline'';' ||chr(10)
||'switch datafile '||file_id||' to copy;' ||chr(10)
||'recover datafile '||file_id||';' ||chr(10)
||'sql ''alter tablespace '||tablespace_name||' online'';'||chr(10)
||'}'||chr(10) rman_switch2copy
, '========================================================='||chr(10)
||' switch datafile '||file_id||' in FRA back to original '||chr(10)
||'========================================================='||chr(10)
||'run'||chr(10)
||'{'||chr(10)
||'backup as copy datafile '||file_id||' format '''||file_name||''';'||chr(10)
||'sql ''alter tablespace '||tablespace_name||' offline'';' ||chr(10)
||'switch datafile '||file_id||' to copy;' ||chr(10)
||'recover datafile '||file_id||';' ||chr(10)
||'sql ''alter tablespace '||tablespace_name||' online'';' ||chr(10)
||'}'||chr(10) rman_switchback2original
FROM dba_data_files
WHERE tablespace_name IN ( select tablespace_name
from dba_tablespaces
where contents = 'PERMANENT'
AND TABLESPACE_NAME != 'SYSTEM' )
ORDER BY 1,2,3
/
One remark… if a datafile is switched to the FRA copy, your controlfile is updated , and the original path and filename is lost. So, before switching the datafile to FRA, it’s prudent to save the ‘back to original” stat.
2 dagen seminar door Steven Feuerstein: Best of Oracle PL/SQL (8 en 9 december)
Oct 13th
In dit tweedaagse seminar neemt Steven Feuerstein je mee ver voorbij de basismogelijkheden van PL/SQL. Steven zal tijdens dit seminar de best practices behandelen die hij op tientallen plekken in de wereld heeft verzameld en die hij ook mede door zijn nauwe samenwerking met het PL/SQL product team van Oracle kan verifiëren en aanscherpen. Hij laat via code-voorbeelden en interactieve sessies zien hoe je als ontwikkelaar in staat bent om snel, hoogwaardige, goed onderhoudbare en uitbreidbare applicaties kunt maken.
Er is tijdens dit seminar voldoende ruimte om vragen te stellen en ideeën met Steven Feurestein uit te wisselen.

Bij dit seminar zijn de volgende zaken inbegrepen:
- Een exemplaar van het boek Oracle PL/SQL Programming (5th edition) van Steven Feuerstein (twv €71,-).
- Een PL/SQL quiz onder leiding van Steven Feuerstein met leuke prijzen.
- Ook ontvang je een gratis jaarabonnement op het PL/SQL Channel. Hiermee heb je toegang tot 27 uur videotraining (normaal $395).
Dit is de kans om in Nederland in een select gezelschap met één van de experts op PL/SQL gebied kennis te maken en je expertise in Oracle PL/SQL verder te vergroten. Meer informatie of inschrijven kan via deze link.
(NB: Deelname voor deze twee dagen kost 1050 euro)
Two tips Using XAMPP, Apache, Tomcat on Windows 7 (getting started)
Jun 8th
Here are some practical tips for getting XAMPP running on your Windows 7 machine. I use this for getting my Hudson / Maven / Sonar demonstation environment.
There are two issues that can save you a lot of time when you know how to solve them.
My configuration:
- Windows 7, 64 bit.
- Xampp 1.7.4 with Tomcat 7 included. (install via windows installer, nexted through install menu, no special things)
After running the installer there are two issues:
- Apache does not start
- Tomcat will only run command line and not as a Windows service.
1. Apache does not start.
The XAMPP control panel does nog give any feedback and command line : apache_start.cmd gives the following error:
Diese Eingabeforderung nicht waehrend des Running beenden Bitte erst bei einem gewollten Shutdown schliessen Please close this command only for Shutdown Apache 2 is starting ... (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Apache konnte nicht gestartet werden Apache could not be started
It seems there is already a process running on port 80. This is the “world wide web publishing servicer”.
Solution : Stop and disable this service and start apache. Voila.
2. Tomcat will only run command line.
After this step I discovered Tomcat has no option on the Xampp control panel. You can start tomcat by gaining to [xampp-home]\tomcat\ and run catalina_start.bat.
Problem is that you will have to have the command window always open and you cannot run this on your server.
In the \tomcat\bin folder you will find “service.bat. Via the command “service install” you can install tomcat as a service. This command gives the following error.
C:\xampp\tomcat\bin>service install Installing the service ‘Tomcat7’ ... Using CATALINA_HOME: “C:\xampp\tomcat” Using CATALINA_BASE: “C:\xampp\tomcat” Using JAVA_HOME: “C:\Program Files\Java\jdk1.6.0_21” Using JRE_HOME: “C:\Program Files\Java\jdk1.6.0_21\jre” Using JVM: “C:\Program Files\Java\jdk1.6.0_21\jre\bin\server\jvm.dll” Failed installing ‘Tomcat7’ service
You can fix this by altering the properties of tomcat7.exe and tomcat7w.exe. Change the compatibility to “run as administrator” and the service will install. Again, voila.

Hope you find these tips helpful. Good luck.
Hands-on: Synchronize your database from a webservice with JAX-WS and ADF Business Components
Mar 27th
This step-by-step starter hands-on provides an example how to make a JAX-WS webservice proxy in JDeveloper, and save retrieved data from this webservice in a batch-job to your own database with ADF Business Components.
Duration: 60 minutes.
For this hands-on example, imagine that your company wants to expand internationally and that reliable, up to date country information is absolutely critical. Recently there were some changes in the number of countries and there might be in the future. Since 1990, 33 new countries have been created. A few months ago the world welcomed a new country (South-Sudan) and yet we don’t know what will happen in Libya (maybe it will be separated in West and East-Libya?). Your company wants to weekly synchronise its internal countries database table with up-to-date country information from a recognised country-monitoring institution that delivers up-to-date country information by a webservice.
Part 1 – Create the country webservice client with JAX-WS
We are going to create a webservice client proxy for a country webservice available on: Read the rest of this entry »
Weblogic deployment using the Oracle weblogic maven plugin
Jan 26th
With the PS3 release of the SOA Suite a new version, 10.3.4, of Weblogic has been released. Amongst others, this release also includes a new Weblogic Maven plugin (weblogic-maven-plugin) that allows interaction with Weblogic from within a Maven environment. As far as I know, this plugin is the successor of the Codehaus Weblogic plugin. That one was a bit difficult to use because it required some other not publicly available Weblogic dependencies which have now been included with the new plugin. Unfortunately, this plugin is not (yet?!) available in any of the public Maven repositories so you have to put it in your own repository. Because of the size (more than 50 MB) the plugin is not included with Weblogic as-is but must be created first just as other weblogic client utilities. The documentation of the new plugin describes in detail how to create and use the plugin. In this blog I’ll summarize them (NB, I assume you’re a little bit familiar Maven).
In summary:
- Create the plugin.
- Deploy it to an artifact repository.
- Use the plugin in your project.
Oracle Diagnostics Logging (ODL) for application development
Jan 12th
Logging is a very important aspect of application development as it offers run-time access to the behaviour and data of the application. It’s important for debugging purposes but also to investigate exception situations on production. The Java developer has a choice between logging frameworks but Log4J is probably the most used one. The usage is quite simple: grab a Logger, e.g. private static Logger log = Logger.getLogger(MyBean.class);, and then use that logger to log the actual message at the required level, log.debug(“This is a debug message”);. To print the logmessages, the Log4J is configured externally with a properties file that defines the location (e.g. console, file, database etc.) and the format of the logmessages. Other logging frameworks, like Java Util Logging, are used in a similar way. It’s actually a good practice to not use Log4J directly, but to use a wrapping or facade framework, that allows switching of the actual logging implementation itself. In the past that would have been Apache Commons Logging (ACL), but now SLF4J is commonly used because it doesn’t have the classloader issues of ACL and it provides some nice message formatting (and performance) features like log.debug(“{} says: This is a debug message”, user.getName());. By the way, the logging usage of Log4J is similar to SLF4J so you can easily switch by only replacing the imports statements. Read the rest of this entry »
the “other” developer
Jan 5th
When thinking of development, one easily think of developing functionality for applications, business functionality and end-users.
But how about developing for administrators?
Normally a product like Oracle Application Server or Oracle WebLogic delivers some tools out of the box which a less experienced Admin can do it’s work.
As for me, I am most of the times not satisfied what is available, or think of a way to do it better and so I developed in the last year a lot of small scripts and tools to make an Administrators life easier. Sometimes building on already existing concepts, sometimes something totally different.
I will post some of these solutions I created, in the the coming posts on this blog.
The first I like to share is one is made for Oracle AS 10.1.3 and based on opmn.



