Archive for the ‘HowTo’ Category


ADF BC (Model)

ADF Faces (UI)
– DataProvider code example: here

VOs: Single, Shared VO Instance or Multiple?

Page Behavior:
– Prevent initial page render: adfFacesInitialContext Render Issues: here and here

Passing Data as Parameters (how to get data from point A to point B)
1. Data Bindings
– Value is set in bindings tab via NDValue property: This value can be EL and reference backing bean methods (that return a value), scopes (pageFlowScope, requestScope)
— this makes the value available to the resource that it is bound to and whose param has the NDValue. T

2. Task Flows
– URL Params: Capture in Task Flow properties. Move to a scope: ex: pageFlowScope.varname (tf param is copied to destination)
– Method Calls:
Created w/ TF Method Call: Method name entered manaully into Method call or through D&D onto TF method Call.
Params set in Property Window for Method
Can use return value for Navigation or not
— Create method call in TF and then associate method with it and then its params
– Method call via D&D from Data Control onto TF:
Params set in PageDef

3. SetCurrentRowWithKey (or KeyValue)
– With Command Link:
Set row – in bindings row.RowKeyStr (rowkey=row.rowKeyStr)
And link sends action for navigation
Command link action listener calls rowkey.execute – passes current row and navigate to destination and executes query from rowkey.execute

4. Page Params
– Add Params to Pagedef. Give Params a source (value = ex:
– then , can use params w/ service methods
Method: param1 NVDValue = bindings.paramname (note: bindings not pageFlowScope)

5. SetAction Listener to store values: main way to copy values using from: and to:

Use setCurrentRowWithKey/Value (video)
– use setCurrent to auto fire findbykey() – on entry to new page – keeps the new page current withthe current row
– can fire action so can be used (typically IS used ) for navigation
– task flow with search and edit forms and flows
– table in edit – add setcurr call. set its text value to column EL value and delete that value
– in bindings, setcurrr rowKey NDValue to value from column (key col)
— If key value is a string and can be viewed as normal data, use …WithKeyValue
— If key is obtained by getKey() on a VO , then it is sthe serialized string version of key and use …WithKey

Use ExecuteWithParams

Expose ADFbc as Web Service

Expose Web Service as Data Control

Query Component:
– Read only fields in query comp: open ER#10431603
– Capture internal components events/reference: ER or not possible
– Auto suggest on internal fields: ER#9797027
– Popup content headers not sizing correctly: Fixed in
– How to tell view criteria used by query comp: here
– Save Queries across sessions: here

Train Component:
– Validating train flow: here

Exception Handling:
– multiple callbacks to DCErrorHandlerImpl
– how to show multiple messages for a single exception
– how to configure logging for Utils buildFacesMessage
– HTML tags returned from DCErrorMessage.getHTMLText()
– DCErrorHandlerImpl sub-class super(true) or super(false)at
– DCErrorHandlerImpl.processMessage() method

and more
– the phase when exceptions are translated to JSF FacesMessage objects
– an EL expression that evaluates the type of exception
– abstract method handleException() cannot be accessed directly
– how to designate custom code as an exception handler
– ExceptionHandler implementation and activity marked as “Exception
– Handler”

Tips and Tricks:
Returning non key value: query lov col, as “code” make attribute a key attribute. In LOV usage on VO, return code into the desired text field

Can have VC criteria = literal with no value if bind vars will not be used.


Problem Description
Drop undo tablespace fails with error Ora-01548 .
SQL> drop Tablespace UNDOTBS1;
drop Tablespace UNDOTBS1
ERROR at line 1:
ORA-01548: active rollback segment ‘_SYSSMU1$’ found, terminate dropping

Cause of The Problem
An attempt was made to drop a tablespace that contains active rollback segments.

Solution of The Problem
In order to get rid of this error you have to follow following steps.
1)Create pfile if you started with database with spfile.

2)Edit pfile and set undo management to manual.
undo_management = manual

3)Put the entries of the undo segments in the pfile by using the following statement in the pfile:


4)Mount the database using new pfile.
Startup mount pfile=’fullpath to pfile’

5)Drop the datafiles,
sql>Alter Database datafile ‘&filename’ offline drop;

6)Open the database.
sql>Alter Database Open;

7)Drop the undo segments,

sql>Drop Rollback Segment “_SYSSMU1$”;
8)Drop Old undo tablespace.
sql>Drop Tablespace old_tablespace_name Including Contents;

9)Add the new undo tablespace.

10) Shutdown Immediate;

11) Change the pfile parameters back to Undo_management = AUTO and modify the parameter Undo_tablespace=new_undo_tablespace_name and remove the _offline_rollback_segments parameter.

12) Startup the Database.


1. Dump a trace of the controlfile.
Use SQL*Plus (or Server Manager) and enter:
SQL> alter database backup controlfile to trace ;
2. Modify the created trace file (located in the user_dump_dest directory):
a) remove from the first line to the line before “STARTUP NOMOUNT”
b) remove line “ALTER DATABASE OPEN” to the end of the file
c) change value of maxdatafiles, maxlogfiles and other parameters as desired
d) rename the file to something .sql (such as cntl.sql)
3. Shutdown the database.
4. Backup the database.
5. Run Server Manager/SQLPLUS and do the following:
SVRMGR> connect internal or connect /as sysdba
SVRMGR> @cntl.sql (The SQL script that you created in step 2) or SQLPLUS>@cntl.sql
SVRMGR> alter database open noresetlogs ; or SQLPLUS> alter database open noresetlogs

SQLPLUS if you are using 9i SVRMGRL if you are using 8i or below.

Also Please read the following article from metalink…

Doc ID: Note:1012929.6
Subject: How to Recreate the Controlfile
Content Type: TEXT/PLAIN
Creation Date: 04-OCT-1995
Last Revision Date: 14-JAN-2005

This article describes how you can recreate your controlfile.

For DBAs who need to recreate the controlfile.


You should only need to recreate your control file under very special

– All current copies of the control file have been lost or are corrupted.

– You need to change a “hard” database parameter that was set when the
database was first created, such as MAXDATAFILES, MAXLOGFILES,

– You are restoring a backup in which the control file is corrupted or

– Oracle Customer Support advises you to do so.

– If you are moving your database to another machine which is
running the same operating system but the location of the datafiles,
logfiles is not the same.

ORA-00202: controlfile: ‘C:\ORACLE\ORADATA\ORACLE91\CONTROL02.CTL’

ORA-27091: skgfqio: unable to queue I/O

ORA-27070: skgfdisp: async read/write failed

OSD-04006: ReadFile() failure, unable to read from file

O/S-Error: (OS 23) Data error (cyclic redundancy check).

i find this problem on one of my server database. this problem will make oracle fail to mount and open. if you try to connect via sqlplus, you will get error message : Oracle is on initialization startup/shutdown. so you can not enter the database.

below is the step that i do, to resolve the problem.(oracle ver 9i and higher)

1. connect to database using sqlplus with SYS as SYSDBA

2. shutdown immediate the database.

3. create a backup copy of all control file(usually consist of 3 control file with extension CTL) on folder ORADATA\

4. rename CONTROL02.CTL (corrupt control file) to CONTROL02.bak

5. rename one of working control file to become CONTROL02.CTL and then copy this file to folder ORADATA\

6.then startup the database via sqlplus using SYS as SYSDBA

this step only working if one of controlfile is corrupt and need to be replace. and also your controlfile is multiplex. Make sure that the error message is exactly the same with what is written above.


Minh Tran

When exporting data from Oracle DB 9i, encountered by the error:

. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user QLNS
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user QLNS
EXP-00008: ORACLE error 942 encountered
ORA-00942: table or view does not exist
EXP-00024: Export views not installed, please notify your DBA
EXP-00000: Export terminated unsuccessfully


Run catalog.sql,catproc.sql and catexp.sql ( logged in as sys).

Then you should export as normal.


Minh Tran

1. To get currently used character set, issue:

SELECT * FROM nls_database_parameters WHERE parameter LIKE ‘%CHARACTERSET%’.

nls_database_parameters is a view.

2. Check and update, for example, to set nls_characterset = UTF8,nls_nchar_characterset = UTF8, use table props$:



There you go…

Minh Tran

If you want to change the IAS_Admin password, you need to delete the <credentials> line associated with ias_admin in the jazn_data.xml file. However, you would need to shut down the EMWebsite prior to doing this.

.Edit the following file and locate the line that defines the credentials property for use the ias_admin user:


The following example shows the section of jazn-data.xml with the credentials entry in boldface type:


2.Remove the entire line that contains the <credentials> property from jazn-data.xml.

3.Enter the following command from DOS Command window:

%ORACLE_HOME%\bin\emctl set password reset <new password>

The steps outlined in the previous lines work, BUT you have to reboot the machine in order for you to pick up the new password. You can’t simply stop/restart the server, because when you try that, it will ask you for the ias_admin password. But a shutdown/restart will work. Been there and survived!

Actually, you can do an emctl restart since emctl stop asks for the password, but start and restart do not

Be happy administrator

^ ^
Minh Tran