11 November, 2009

Using the APEX IRR search region

. 11 November, 2009
0 Comments

Hi all,

The APEX team integrated a nice little region template which mimics the search part of an interactive report. It is called "Report Filter - Single Row". As the name says it has only one row to implement items.

Using one graphical way for searching in your whole application makes life easier for your costumers.

There is just one thing I didn't like on it. The "Search"-icon. To erase it make a copy of the template and erase this part: <img src="#IMAGE_PREFIX#htmldb/builder/builder_find.png" />

The template definition should now look like that:


<table class="apex_finderbar" cellpadding="0" cellspacing="0" border="0" summary="" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>
<tbody>
<tr>
<td class="apex_finderbar_left_top" valign="top"><img src="#IMAGE_PREFIX#1px_trans.gif" width="10" height="8" alt="" class="spacer" alt="" /></td>
<td class="apex_finderbar_middle" rowspan="3" valign="middle"></td>
<td class="apex_finderbar_middle" rowspan="3" valign="middle" style="">#BODY#</td>
<td class="apex_finderbar_left" rowspan="3" width="10"><br /></td>
<td class="apex_finderbar_buttons" rowspan="3" valign="middle" nowrap="nowrap"><span class="apex_close">#CLOSE#</span><span>#EDIT##CHANGE##DELETE##CREATE##CREATE2##COPY##PREVIOUS##NEXT##EXPAND##HELP#</span></td>
</tr>
<tr><td class="apex_finderbar_left_middle"><br /></td></tr>
<tr>
<td class="apex_finderbar_left_bottom" valign="bottom"><img src="#IMAGE_PREFIX#1px_trans.gif" width="10" height="8" class="spacer" alt="" /></td>
</tr>
</tbody>
</table>


At the end it will look similar to that:

Read More »»

08 October, 2009

Update of my example application

. 08 October, 2009
3 Comments

Hi!

Out of some reason Oracle does not provide the applications from the APEX Developer Competition 2009.

Some winners already provided there applications:
Matt Nolan: APEX Plugin Registry Application
Martin Giffy D'Souza: APEX Rules & Guidelines

I just updated my example application as well:

APEX-AT-WORK Developer Competition 2009 Edition
Description: This application is an upgrade of the original APEX-AT-Work Example application. It includes lots of new examples, a new layout, new techniques (like screen casts) and an extended documentation. It is not a normal APEX application which includes lot's of business logic. This application shows how to use the new technologies out there. The core is based on a javascript library called ExtJS. This library creates a completely new look and feel which makes APEX even nicer to use. But also rarely used APEX WEB 2.0 features are integrated based on typical examples.

About the competition:
Oracle.com: Oracle Application Express Developer Competition 2009
David Peake's Blog: Winners of APEX Developer Competition 2009
OTN Blog: Congrats to the Oracle Apex Developer Competition 2009 Winners
Oracle.com: Rules

I must object another behavior what I can't understand. Why aren't there any jury judgments. I really would have loved to know what for example Dimitri thought about my application. I guess all other developers think the same.

Anyway I wish everybody a really exciting OOW.

Read More »»

01 October, 2009

Linux bash: Save command and command output in logfile

. 01 October, 2009
0 Comments

Creating logfiles in a linux environment can be done with > or >> or &> or tee or script but using these commands inside a shell script which should save both the command and the command output becomes really tricky.

With > and >> you just get the command output.
With tee you just get the command output.
With script you get both but it didn't work inside my shell script.

I went on googleling and found a solution:
Capture the command run in the log file


{
set -x
pwd
set +x
} > yourlog.txt 2>&1

I used this small script inside my backup routine:

#!/bin/bash
{
set -x

echo ------------------------------------------------
echo -- - - - - RMAN LEVEL 0 Backup Script - - - - --
echo -- - - - - - - - - - - - - - - - - - - - - - ---
echo -- - - - - Creator: Tobias Arnhold - - - - - ---
echo ------------------------------------------------
echo

echo ------------------------------------------------
echo -- - - - - - - - Start backup - - - - - - - - --
echo ------------------------------------------------
echo

echo -- Set variables
ORACLE_SID=XE
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
FRA_HOME=/oracle/flash_recovery_area/XE
ORA_SCRIPTS=/oracle/scripts
DATUM=`date +"%Y%m%d%H%M%S"`
echo

echo -- Delete old log files
rm -r $FRA_HOME/backuplog/XE_*
echo

echo -- Start RMAN backup
echo -- See logfile: $FRA_HOME/backuplog/XE_FULL_BACKUP.log
rman target / nocatalog cmdfile=$ORA_SCRIPTS/FULL_BACKUP.sql log=$FRA_HOME/backuplog/XE_FULL_BACKUP.log
echo

echo -- Delete old INIT.ORA files
rm -r $FRA_HOME/initora/*
echo -- Create new INIT.ORA files
cp /oracle/admin/pfile/init.ora $FRA_HOME/initora
echo

... More commands

echo -- Delete empty directories
find $FRA_HOME/backupset -type d -empty -exec rmdir {} \;
echo

echo -- Rename RMAN backup file
cd $FRA_HOME/backuplog/
mv XE_FULL_BACKUP.log XE_FULL_BACKUP.$DATUM.log
mv XE_ARC_BACKUP.log XE_ARC.$DATUM.log
echo

echo ------------------------------------------------
echo -- - - - - - - - Backup finished - - - - - - ---
echo ------------------------------------------------
echo

set +x
} &> /oracle/flash_recovery_area/XE/backuplog/FULL_BACKUP.log
# write log file

# replace all "+ echo" lines inside the log file
LOG_HOME=/oracle/flash_recovery_area/XE/backuplog
sed "/+ echo/d" $LOG_HOME/FULL_BACKUP.log > $LOG_HOME/tmp
mv $LOG_HOME/tmp $LOG_HOME/FULL_BACKUP.log
exit

Now I have a really nice logfile:

------------------------------------------------
-- - - - - RMAN LEVEL 0 Backup Script - - - - --
-- - - - - - - - - - - - - - - - - - - - - - ---
-- - - - - Creator: Tobias Arnhold - - - - - ---
------------------------------------------------

------------------------------------------------
-- - - - - - - - Start backup - - - - - - - - --
------------------------------------------------

-- Set variables
+ ORACLE_SID=XE
+ ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
+ FRA_HOME=/oracle/flash_recovery_area/XE
+ ORA_SCRIPTS=/oracle/scripts
++ date +%Y%m%d%H%M%S
+ DATUM=20090901095244

-- Delete old log files
+ rm -r /oracle/flash_recovery_area/XE/backuplog/XE_FULL_BACKUP-2009-08-31.log

-- Start RMAN backup
-- See logfile: /oracle/flash_recovery_area/XE/backuplog/XE_FULL_BACKUP.log

-- Delete old INIT.ORA files
+ rm -r /oracle/flash_recovery_area/XE/initora/init.ora
-- Create new INIT.ORA files
+ cp /oracle/admin/pfile/init.ora /oracle/flash_recovery_area/XE/initora

... More log informationen

-- Delete empty directories
+ find /oracle/flash_recovery_area/XE/backupset -type d -empty -exec rmdir {} \;
find: /oracle/flash_recovery_area/XE/backupset/2009_08_30: Datei oder Verzeichnis nicht gefunden
find: /oracle/flash_recovery_area/XE/backupset/2009_08_31: Datei oder Verzeichnis nicht gefunden

-- Rename RMAN backup file
+ cd /oracle/flash_recovery_area/XE/backuplog/
+ mv XE_FULL_BACKUP.log XE_FULL_BACKUP.20090901095244.log
+ mv XE_ARC.log XE_ARC.20090901095244.log

------------------------------------------------
-- - - - - - - - Backup finished - - - - - - ---
------------------------------------------------

+ set +x

Hope it can help some of you who are searching for better looking logs.

Read More »»

10 September, 2009

Upgrade to a journeyman

. 10 September, 2009
7 Comments

I did it. I finally reached the next level in the Oracle APEX forum:



Ok ok I know that the most APEX experts work much harder inside the forum and they know things I haven't even heard yet. But that is the psychological hurdle to get even further...

Have a nice day.

Tobias

Read More »»

07 September, 2009

Data mapping with FlowHeater

. 07 September, 2009
1 Comments

Do you know this problem you get a csv file and need to import it into your database. Of course with APEX you can use the data load utility (Home>Utilities>Data Load/Unload>Load). But what if you don't have APEX or you need some changes on your import data. Using functions/processes or the SQL*Loader can be quite tricky especially at the beginning or if you haven't worked with it in a while. What if your task become even more difficult. For example: Importing one csv file into oracle, mysql and ms sql database.

There is a nice solution available: Data mapping tools
I am really a fan of visual data mapping tools and want to introduce you into a tool called FlowHeater which can make your life as a database administrator or application developer much easier.

In my example I used a portal version on my USB stick of the FlowHeater (\FlowHeater\BIN).
After I downloaded the Oracle Instant Client driver (10.2.0.4). I created the following batch to run my application:


ECHO off
ECHO Run application FlowHeater
ECHO All settings correlates on the current session inside this batch file

ECHO 1. Variablen setzen
ECHO 1.1 Path Variable
set PATH=D:\instantclient_10_2;%PATH%

ECHO 1.2 ORACLE_HOME Variable
set ORACLE_HOME=D:\instantclient_10_2

ECHO 1.3 TNS_ADMIN Variable
set TNS_ADMIN=D:\instantclient_10_2

ECHO 1.4 NLS_LANG Variable
set NLS_LANG=German_Germany.AL32UTF8

ECHO 2. Open application folder
cd \PortableApps\DATABASE\DATA_MAPPING\FlowHeater

ECHO 3. Run application
\PortableApps\DATABASE\DATA_MAPPING\FlowHeater\FlowHeater.exe


I had one issue running FlowHeater from USB-Stick. It had to do with the Oracle .Net driver and FAT32 file rights. There is an issue where you need the "authenticated user" group with full rights on the oracle home directory. Error: "System.Data.OracleClient requires Oracle Client software version 8.1.7 or greater" There are lots of entries about this error available. That is the reason why my oracle home is now located on volume D:. I didn't want to recreate my whole stick just because of NTFS!

Anyway in case you install the FlowHeater on you PC as normal then no issues like that should occur.

Now watch the flash movie I made:
Data mapping with FlowHeater

Download PDF version: oracle-csv-export.pdf

Read More »»
 

Google Translator

Visitor counter

Blogger statistics