Feed aggregator

What Makes a Great Oracle Blog?

Robert Vollman - Fri, 2007-05-25 13:27
Along the side of my page, you'll see my favourite Oracle blogs listed. I carefully maintain this list of fellow enthusiasts whose opinions and insights I most especially want to follow among the seemingly hundreds of Oracle blogs that are out there. Studying them, I think you'll find that each of them share the same core qualities listed below.1. AccuracyAccuracy is an absolute must. Just Robert Vollmanhttp://www.blogger.com/profile/08275044623767553681noreply@blogger.com18

Listener passwords: always for 9i, never for 10g

Andrew Fraser - Thu, 2007-05-24 06:32

This page has been moved to http://andrewfraserdba.com/?p=44


Categories: DBA Blogs

J2EE Container Managed Security: How to reference the current user

Brenden Anstey - Wed, 2007-05-23 23:48

When J2EE container managed security is used the User Principal can be referenced in a number of ways:


Expression Language
       <af:outputText value="#{facesContext.externalContext.userPrincipal.name}"/>

Managed / Backing Bean
       ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
String userName = ectx.getUserPrincipal().getName();
System.out.println("Current user: " + userName);

ADF BC Application Module
       String userName = getUserPrincipalName();
System.out.println("Current user: " + userName);


A year already? So long incubator!

Adam Winer - Wed, 2007-05-23 16:20
How time flies... A year ago, we checked ADF Faces into the Apache incubator. Now, we're out of the incubator, we're named Trinidad, and we're officially part of the Apache MyFaces project. You can visit our site, and download nightly builds .

A lot has happened in this past year - a few highlights:
  • A bunch of new committers were added from inside Oracle and, most importantly, from outside Oracle
  • All the ins-and-outs of running an Apache project were ably handled by Matthias Wessendorf
  • Skinning functionality has gotten a lot better, mostly courtesy of Jeanne Waldman
  • Portlet support from Scott O'Bryan
  • Client-side validation now looks much better (no more JS alerts), from Danny Robinson
  • Lots and lots of bugs (300+) were put to ground
  • New components - a spinbox and an outputDocument
  • JSF 1.2 support was implemented (on a branch); the MyFaces implementation of the 1.2 JSF API uses a Trinidad plugin to generate components and tags.
  • And, I got engaged! (The future Mrs. even lets me get away with working on Trinidad at home.)

It all took awhile, and a lot of work, but we're all glad to have reached this point.

plan_table changes

Andrew Fraser - Wed, 2007-05-23 10:16

This page has been moved to http://andrewfraserdba.com/?p=43


Categories: DBA Blogs

Dataguard, documentation/scripts for non-DBAs during failover

Stephen Booth - Wed, 2007-05-23 06:37
We're looking at implementing Dataguard as part of an implementation of Documentum (a document management system from EMC) and I have been asked to look at producing documentation and scripts for non-DBA users to use during a failover. The actual failover of the database itself will be handled by our DBAs, this is for the sys admins, network admins, application admins &c who may need to do Stephen Boothhttps://plus.google.com/107526053475064059763noreply@blogger.com1

Don’t mix glue and SQL

John Stegeman - Wed, 2007-05-23 06:20
This post isn’t really related to ADF in particular, but it is of benefit. I’ve seen a number of posts (well, OK 2 of them) on the Oracle JDeveloper forum in the past week where someone “glues” literals into their SQL statements like this:

String sqlStmt = “select x from y where username='” + userName + “‘”;

stmt = new PreparedStatement(sqlStmt, 0);

//etc

Now, anyone who reads Ask Tom is already falling out of their chair. The real problem is in the first line of code; first of all, imagine what happens if someone puts this string into userName: x’ or ‘1’ = ‘1

Can you say “SQL Injection?” The second problem with this approach is that for each value of userName, this generates a unique SQL statement, which Oracle has never seen before, and must hard parse. Hard parsing in Oracle, well in most any database, really, is an operation that takes lots of CPU and inherently limits scalability. If you run this query a lot with different values of userName, you’ll bring the system to it’s knees. What the query should do is use binds, like this:

String sqlStmt = “select x from y where username= :1”;

stmt = new PreparedStatement(sqlStmt, 0);

stmt.setString(1, userName);

//etc

/

Now, no matter what that pesky user puts in userName, this code does not expose the security risks as the first one. Additionally, the SQL is the same from call to call (it never changes) – therefore you don’t have the hard parsing problem, either. Now to make the code even better, we could cache the prepared statement and bind/execute on subsequent calls, but I’ll leave that one to you.


Oracle and .NET at Tech·Ed Orlando

Christian Shay - Tue, 2007-05-22 23:40
Oracle will once again have a major presence at Tech·Ed this year (June 4-8).

Be sure to stop by the Oracle booth on the demogrounds floor (aka "Partner Expo") for your own personalized demo of Oracle products. We will have demonstrations for Oracle and .NET, Grid Control, RAC, and App Server.

At the .NET demo station you can get the first look at the upcoming release of the ODAC 11g beta including the following new features:

ODT:
Visual Studio 2005 integration with Server Explorer, Data Sources Window, Dataset Designer, TableAdapter Configuration Wizard and more
Improved ASP.NET web developer support
Oracle Database script project to provide source control of Oracle scripts
Integration with Query builder and Query Designer
User-Defined Types: Create, explore, modify UDTs and custom class code generation for .NET application
and much more.....

ODP.NET
Instant Client Support: Smaller ODP.NET client installation
User-Defined Types: Map Oracle objects and collections to .NET custom types and support REFs to object types
and much more...

ASP.NET Providers

Sessions:

We have a "Bird of a Feather" session, which is not a formal presentation, but more of a discussion with Oracle staffers and your fellow Oracle and .NET developers and DBAs. Come prepared with questions and bring your laptop if you feel like turning it into an installfest!

BOF01: Using Oracle with .NET
Monday, June 4, 2007 at 10:30 AM
Room S331 A

We are also co-presenting a "chalk talk" with Microsoft:

DAT04-TLC - ADO.NET Entity Framework: Provider Model and Integration with Third-Party Databases
Friday, June 8 1:00 PM - 2:15 PM, Blue Theater 12

See you in Orlando!

Pipelined functions in oracle 9i

Adrian Billington - Tue, 2007-05-22 03:00
Functions can now stream data as virtual tables. May 2002 (updated May 2007)

What is Timeout?

Fairlie Rego - Fri, 2007-05-18 22:29
The problem with semi documented APIs like DBMS_SPACE is that some of the subprograms might not work as you might expect them to.
For example the object_space_usage procedure has a parameter called timeout_value which I would assume to mean the amount of time after the procedure will abort if it cannot complete its space calculations. But this does not work as I would expect it to

SQL> set timing on
SQL> set serveroutput on

SQL> declare
v_space_used number;
v_space_allocated number;
begin
dbms_space.object_space_usage('SCOTT','EMP','TABLE',0,v_space_used, v_space_allocated,'',TRUE,5);
dbms_output.put_line('SPACE USED = '||v_space_used);
dbms_output.put_line('SPACE ALLOCATED = '||v_space_allocated);
end;
/

SPACE USED = 0
SPACE ALLOCATED = 68034756608

PL/SQL procedure successfully completed.

Elapsed: 00:00:36.12

So even if I specify a timeout value of 5 the procedure completes in 36 seconds.

This behaviour reproduces on 10.1.0.5 and 10.2.0.3.

Updated Oracle SQL Developer Migration Workbench Early Adopter Release

Donal Daly - Thu, 2007-05-17 05:18
We have updated the early adopter release of Oracle SQL Developer Migration Workbench today on OTN. You can get it from here. This is our final preview release, before we go production. We are now functionally complete for this initial production release and are now focused on fixing our final "show stopper" bugs. We have had good feedback from our user community via our feedback application and also via the Workbench forum. They have uncovered a number of bugs, most of which we have now addressed (Oracle9i as a repository and Access data migration issues for example) and the remaining ones we will resolve prior to production. I encourage everybody to update to this latest release and continue to provide us with feedback.

I have been working extensively with different builds of the Migration Workbench these past couple of weeks as we closed in on our goal to refresh the early adopter version. In my "biased" opinion is it looking much stronger and I would like to outline some of the new features in this updated early adopter release.

Quick Migrate
In the orginal Migration Workbench we had a wizard driven approach to simplify migrations and I felt it was important to bring this functionality back. With our Quick Migrate wizard, I believe we have improved from the original wizard, since we will leverage our least priviliege migration capabilities, assume sensible defaults and create/remove our migration repository.



So if you have a schema on SQL Server or a single Access mdb file to migrate to an existing Oracle schema, this should be the easiest and quickest migration option for you. Another nice feature, if you are doing an access migration, is that we have added command line support to our exporter so, we will automatically launch the correct Access exporter for the Access connection that you specify.

Offline Capture
This was a popular feature with our consultants and partner technical services folks, with the original Workbench, as it allowed them to work remote from the customer/partner. We have now added back in that feature.

Migration Reports
We have added in some initial migration reports available under Reports->Shared Reports. This will be an area we will add to into the future, as we can mine our rich metadata repository to provide you with useful information. If you have suggestions for additional reports let me know. I will also publish more details about our repository, so you can develop your own migration reports as well. Maybe we should have a competition for the best contributed report? I think we have a couple of 1GB USB keys left over from our Database Developer Day in Dublin I could use as prizes.

Translation Scratch Editor
We have reworked this feature extensively. I originally wanted to add a feature that would enable you to validate our translated SQL. As we worked through different iterations of how best to implement this feature, we came up with the idea about leveraging our existing Worksheet capabilities, which I think is very cool and I am very pleased with how this turned out.


We have also done a lot of work to improve incremental capture and improve our filtering capabilities from our early adopter release. We have integrated our MySQL parser from the original Migration Workbench and will extend its capabilities in subsequent releases to be as functional as our new TSQL parser and also support SQL statement level translation. (workaround for now, within the scratch editor, is just wrap the SQL statement in a procedure). We have also implemented the ability to update your Access mdb file, to create link tables to point to your newly migrated schema. This was also a feature of the original workbench. We hope to add some additional usability tweaks to create an ODBC OSN on the fly and provide a select list of known Oracle DSN. Hopefully that will make it in before production as well.

We have made fixes to ensure correct generation order for pl/sql procedures to resolve dependencies, so more pl/sql procedures should compile correctly first time. We made improvement to handle inline DDL statements correctly. Temporary tables, normal tables and other DDL are lifted out of the body of the procedure/function and are created separately.

Now for the final bug fix push by the development teams in Dublin and Bangalore. Our QA team, have been doing a good job verifying our fixes and closing off our bugs. The teams have been working hard on this for many months now and I believe we are in touching distance of reaching our goal. It will be very exciting for me personally to see this second generation migration tool reach production. We'll all need some time off when this is done to recharge...

Classpath conflicts

Janusz Marchewa - Thu, 2007-05-17 01:47
One problem kept bugging me for three weeks. It was quite irrational - I couldn't extend the functionality of the application, because changes in services (that were EJB3 session beans) were not visible. The problem occurred when deploying to embedded OC4J, but, surprisingly, not when deploying to OC4J standalone...

After getting lots of JBO-25221 (method not supported) and java.lang.NoSuchMethodError I thought I would investigate the class used at runtime. I found that the method that should be there wasn't there at runtime. So I decided to find out where did the class come from. Bertrand Delacretaz has an example of checking when was a Java class compiled. Small modifications to his example and the mysterious class is unmasked:

MyClass.class.getResource( "MyClass.class" ).openConnection().getURL().toString()


I was shocked when I saw the output - it turned out that another project that should have a small 2-class jar in my application had packed also a bunch of classes from the same model. The model was referenced by both projects as a dependency and the deployment profile had a magic checkbox selected:



That resulted in a silent classpath conflict I was not aware of... Finally, the problem is gone :)
Categories: Development

... is not a registered tag in that namespace?

Janusz Marchewa - Tue, 2007-05-15 13:49
Today JDeveloper broke my project. I don't know what exactly happened, but putting an ADF Faces tag inside a page resulted in JSP compilation errors, e.g.:

Error: http://xmlns.oracle.com/adf/faces:panelPage is not a registered tag in that namespace.


After a few minutes of trying different things I opened the web.xml file and found the problem:

<taglib>
<taglib-uri>
http://java.sun.com/jsf/core
</taglib-uri>
<taglib-location>
/WEB-INF/lib/jsf-impl.jar
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
http://xmlns.oracle.com/adf/faces
</taglib-uri>
<taglib-location>
/WEB-INF/lib/adf-faces-impl.jar
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
http://xmlns.oracle.com/adf/faces/html
</taglib-uri>
<taglib-location>
/WEB-INF/lib/adf-faces-impl.jar
</taglib-location>
</taglib>


Now that was confusing... Removing that piece of code helped. But how did it appear here? JDev only knows...

One OT to mention here: the code you see above was escaped (to be displayed properly by Blogger) using a very simple and effective tool I've come across recently. Check out Dietmar Aust's blog.
Categories: Development

BMW Oracle racing scores against Luna Rossa (Prada)

Clemens Utschig - Tue, 2007-05-15 12:57
It's amazing, it's love, and it's passion - sailing, the ocean, the winds, the gybes, the will to win.

All this is America's Cup, the race for the old bowl.

JFK said this a while back ..
"We are tied to the ocean. And when we go back to the sea, whether it is to sail or to watch - we are going back from whence we came." --USA President John F. Kennedy, at a dinner for the crews in Newport, RI on the eve of the 1962 America's Cup Match.
[http://blog.bmworacleracing.com/]

today BMW Oracle got back into the race, by amazing tactics, and a sheer wonder of teamwork - 1:1 - let's wait for tmrw

APEX reports and SQL Developer

Jornica - Sun, 2007-05-13 08:08

Both Kris Rice and Dimitri Gieles blogged about new APEX reports in SQL Developer 1.1.3 . Minor detail: those reports are build for Application Express version 3.0.1 , which is not released yet.

I installed the new version of SQL Developer, and tried to run the APEX reports (location in the reports tree: All reports, Data dictionary Reports, Application Express). Surprisingly, I did not get the message Application Express 3.0.1 or higher required. In a few cases I received an error: ORA-00904 invalid identifier.

To find the SQL behind the reports a simple copy and paste of the report did not work i.e select the Application report, right click and select copy. Select the User Defined Reports, right click and paste from, nothing happened. Even export of the report(s) did not work.

After some searching I found the report SQL hidden in a file: oracle.sqldeveloper.report.jar (location sqldeveloper\extentions directory). This .jar file includes an apex30.xml, this file contains all the APEX reports in XML format (you can unzip the XML file with an unzip utility). The next step is to import the apex30.xml and then you will see all the reports in the User Defined Reports branche as well.

Changing the SQL is left as an exercise to the reader... ;-)

I just don’t get Ruby on Rails

John Stegeman - Fri, 2007-05-11 13:56

In addition to all of the cool toys (robots and helicopters) shown at the Java Toy Show (general session of JavaOne 2007 on Friday morning), a NetBeans guy from Sun got up and did a demo of Netbeans 6.0 and JRuby on Rails (a scripting-languaged based web application framework). He created a Ruby on Rails application, created persistence classes from a database using a wizard, created a simple web page showing the database information, and ran it all from within the IDE. Judging by the audience reaction, people were impressed. My reaction, on the other hand, was, as we used to say as kids, “big whoop.” Haven’t we been doing this in JDeveloper for, I dunno, 8 years or something?


Extending ADF's FacesPageLifecycle

Janusz Marchewa - Fri, 2007-05-11 10:14
Recently I've encountered strange exceptions while testing my application. I pressed the Submit button and sometimes everything was fine, while at times the action bound to the button was not invoked, but errors were reported:

JBO-29000: null
java.lang.NullPointerException


Unfortunately, there was no trace of this exception and I didn't even know where should I look for it. Then I came up with and idea: let's decorate the process of displaying errors and find out more about this exception. To achieve this, I had to extend ADF's FacesPageLifecycle:

package januszm.adf.util;

import javax.faces.context.FacesContext;

import oracle.adf.controller.faces.lifecycle.FacesPageLifecycle;

import oracle.binding.AttributeBinding;

public class MyPageLifecycle extends FacesPageLifecycle {
protected void addMessage(FacesContext context, AttributeBinding binding,
Throwable error) {
super.addMessage( context, binding, error );
// the easiest thing we can do here
error.printStackTrace();
}
}


Another question is: how can we tell ADF to use our lifecycle? That's easy too - we extend ADFPhaseListener:

package januszm.adf.util;

import oracle.adf.controller.faces.lifecycle.ADFPhaseListener;
import oracle.adf.controller.v2.lifecycle.PageLifecycle;


public class MyPhaseListener extends ADFPhaseListener {
protected PageLifecycle createPageLifecycle() {
return new MyPageLifecycle();
}
}


Finally, we need to substitute the original ADFPhaseListener with our class in faces-config.xml:

<lifecycle>
<phase-listener>januszm.adf.util.MyPhaseListener</phase-listener>
</lifecycle>


That allowed me to locate the problem - the exception was thrown in the line containing:

this.someField.toString()


because sometimes the field wasn't set...

The conclusion is simple - if a library throws a weird exception, don't blame the library, but check YOUR code first.
Categories: Development

Well, I made a list

Herod T - Thu, 2007-05-10 09:51

I read Eddie Awad's blog all the time. Once again, I was quite surprised when I went scrolling through the listing of the Top Oracle Blogs Ranked by Technorati Authority and, low and behold. I am on the list.

#124 out of 130 but, on the list none the less.



The Easiest way to get Chart of Accounts Segment Descriptions

Jo Davis - Wed, 2007-05-09 21:44
Such as account descriptions or cost centre descriptions as well as the value:


SELECT
gcc.code_combination_id
,gcc.segment1
,gcc.segment2
,gcc.segment3
,gcc.segment4
,gcc.segment5
,gcc.segment6
,gcc.segment7
,gcc.segment8
,SUBSTR(apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,1,gcc.segment1),1,40) segment1_desc
,SUBSTR(apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,2,gcc.segment2),1,40) segment2_desc
,DECODE(gcc.segment3,NULL,'',SUBSTR(apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,3,gcc.segment3),1,40)) segment3_desc
,DECODE(gcc.segment4,NULL,'',SUBSTR(apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,4,gcc.segment4),1,40)) segment4_desc
,DECODE(gcc.segment5,NULL,'',SUBSTR(apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,5,gcc.segment5),1,40)) segment5_desc
,DECODE(gcc.segment6,NULL,'',SUBSTR(apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,6,gcc.segment6),1,40)) segment6_desc
,DECODE(gcc.SEGMENT7,NULL,'',SUBSTR(apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,7,gcc.segment7),1,40)) segment7_desc
,DECODE(gcc.SEGMENT9,NULL,'',SUBSTR(apps.gl_flexfields_pkg.get_description_sql( gcc.chart_of_accounts_id,8,gcc.segment8),1,40)) segment8_desc
,gcc.chart_of_accounts_id chart_of_accounts_id
,gcc.account_type
FROM
gl_code_combinations gcc

Otherwise you have to do a hideous number of joins back to FND_FLEX_VALUES_TL and generally hard-code in value set ids :)

Have a fun day
Jo

Pages

Subscribe to Oracle FAQ aggregator