Code Templates in OWB11gR2 Part 3 : Hybrid Code Template Mappings
If you've read my previous postings on how OWB11gR2 support access to non-Oracle databases, and allows you to create mappings that use non-Oracle sources and targets, you may we wondering how Oracle data sources fit in to this, and the Oracle traditional "database resident" mappings that you normally create can be used alongside them. In most of the early examples, I used Oracle sources and targets within the code template mappings, but realistically this would be less efficient than just using regular OWB mappings, and probably more hassle to set up. Also, this does all beg the question as to how these code template mappings are used alongside traditional OWB mappings, such as whether they can be scheduled, included in process flows and so on. This is where probably the most important feature of OWB11gR2's code template mappings come in, with the concept of "Hybrid Mappings".
The key to hybrid mappings is in a new type of code template that Oracle ships as part of the public code templates, found within the Globals Navigator in OWB. This new type is called "Oracle Target" and contains a single code template called DEFAULT_ORACLE_TARGET_CT.
First of all, you can take a regular OWB mapping, copy it and then past it into the Code Template Mappings area, like this:
So, now that we can take whole mappings and convert them to code templates, what about individual mapping elements? You may have noticed that the components palette in the code template editor contains all of the mapping operators that regular OWB mappings use, but obviously some of them (splitters, dimension loads, match-merge etc) will only work for Oracle targets and sources. So how do we use these? This is where the concept of Hybrid Mappings comes in.
Going back to my code template mapping posted yesterday, that takes data out of an SQL Server database, joins it to some data from a file and from an Oracle table, and loads it into a staging table, the execution view for this mapping looks like this:
Now this is all new functionality, and I think it'll take us a while to come up with a design approach that makes optimal use of this new capability, but one interesting thing for me was that conceptually, I didn't have a problem with this concept of regular (database-resident) mappings, code template mappings, and hybrid mappings. At Rittman Mead we were on the 11gR2 beta and I worried at the time that these different means of mapping data would be hard for developers to understand, and that we'd end up with two repositories, two sets of table definitions, two types of mapping operators and so on (giving us a sort of "Frankenstein's Monster" of a tool).
What what the development team at Oracle have managed to come up with though is something really clever - there's only one repository, one set of operators, one set of table definitions, and you can mix and match these in code template mappings and across your project. The only thing I worry about is that there are lots of places to set mapping configuration options and I can see developers struggling to get everything to validate when first working with this code template mappings, especially if they don't have prior experience with ODI and its knowledge module approach.
Moving on, if you looked at the before and after execution views earlier in this posting, you might have noticed how the requirements of the Oracle Module code template meant that I had to move the joining of the source data out of the Oracle ICT code template and on to the agent. (as it was accessing data from SQL Server over JDBC). This sort of thing might crop up when you bring the two mapping types together, so the other way of integrating mappings like this might be to keep them separate, but bring them together into a process flow, like this:
Well that's it for OWB new features for me for a while, but if you're interested in seeing all of this in real-life at the forthcoming Oracle Open World, and discussing OWB11gR2 development techniques with myself, Antonio Romero and David Allen from the OWB development team, check out this announcement about an "unconference" session that we are running. Other than that, I expect myself, Venkat and Stewart will be posting more on OWB11gR2 new features as we work through them.