max(ROWID) => something to remember 

Filed under: Database on Thursday, April 22nd, 2010 by orapunk | No Comments

Sometimes we forget some basic concepts. So do I (sometimes).

To retrieve the latest record of a table it’s not ALWAYS correct to use the max(rowid) of a table.

The rowid is an ID generated based on file/block/slot .

The only method to make sure we take the last record is a having a column with a timestamp or a sequence.

SQL*LOADER control file generator 

Filed under: Sql*Loader on Friday, March 26th, 2010 by orapunk | No Comments

set echo off ver off feed off pages 0
accept tname prompt ‘Enter Name of Table: ‘
accept dformat prompt ‘Enter Format to Use for Date Columns: ‘

spool &tname..ctl

select ‘LOAD DATA’|| chr (10) ||
‘INFILE ”’ || lower (table_name) || ‘.dat”’ || chr (10) ||
‘INTO TABLE ‘|| table_name || chr (10)||
‘FIELDS TERMINATED BY ”,”’||chr (10)||
‘TRAILING NULLCOLS’ || chr (10) || ‘(’
from   user_tables
where  table_name = upper (’&tname’);

select decode (rownum, 1, ‘   ‘, ‘ , ‘) ||
rpad (column_name, 33, ‘ ‘)      ||
decode (data_type,
‘VARCHAR2′, ‘CHAR NULLIF (’||column_name||’=BLANKS)’,
‘FLOAT’,    ‘DECIMAL EXTERNAL NULLIF(’||column_name||’=BLANKS)’,
‘NUMBER’,   decode (data_precision, 0,
‘INTEGER EXTERNAL NULLIF (’||column_name||
‘=BLANKS)’, decode (data_scale, 0,
‘INTEGER EXTERNAL NULLIF (’||
column_name||’=BLANKS)’,
‘DECIMAL EXTERNAL NULLIF (’||
column_name||’=BLANKS)’)),
‘DATE’,     ‘DATE “&dformat” NULLIF (’||column_name||’=BLANKS)’, null)
from   user_tab_columns
where  table_name = upper (’&tname’)
order  by column_id;

select ‘)’ from dual;

spool off

new APEX group at LinkedIn 

Filed under: APEX on Tuesday, March 23rd, 2010 by orapunk | No Comments

http://www.linkedin.com/groups?home=&gid=2784198&trk=anet_ug_hm

APEX 4.0 new features 

Filed under: APEX on Monday, February 15th, 2010 by orapunk | No Comments

•Websheets
•Team Development
•Dynamic Actions
•Plug-Ins (Item & Region)
•Improved Charting including Gantts and Maps
•Declarative Tabular Forms
•REST Web Services
•Enhanced Interactive Reports
•Flexible Builder Authentication
•APEX Listener (currently in early adopters)
•Integrated jQuery and jQuery UI
•Improved Item Properties
•Additional Attributes
   Textareas: Resizable
   Combo Box (editable select list)
   Javascript Date pickers
   Autocomplete
•Integrated Oracle EBS Authentication
•APEX Advisor
•Editing Page Zero shows all application level components
•Improved UI Defaults with bi-directional synchronization
•Improved Themes for better out of the box user interfaces (xhtml)
•Support for native Excel Upload

importing csv and creating table at same time 

Filed under: Migration/Import on Monday, February 15th, 2010 by orapunk | No Comments

There is still a lack of possibilities to create a table from scratch from a csv (with 1 line contains the column names).

The best method so far i found is:

1. Import csv into an access db (yes i know, but until you guys come up with a better idea).
Here you will have an access table with column names and datatypes (and your data)

2. Export this table by usng export => into an ODBC DB (which is your Oracle DB)

3. connect and you’ll have your Oracle table, with columns, datatypes and data

Quite easy and fast, if somebody has a better and faster idea (by not passing by an access db), let me know.

OBIEE and dynamic URL 

Filed under: OBIEE on Monday, June 29th, 2009 by orapunk | No Comments

oracle-bi-ee-101332-url-parameters

promptness_please.html

Nologging inserts generates no redo: WRONG!!!!!!!!! 

Filed under: Uncategorized on Thursday, April 23rd, 2009 by orapunk | No Comments

In most case NOLOGGING generetaes no redo; true. But by adding a foreign key constraint to the table it disables direct mode inserts and resorts to conventional mode logging.

The direct load is also disabled for index organized table.

How does one blackout events and jobs during maintenance slots? 

Filed under: Uncategorized on Wednesday, March 18th, 2009 by orapunk | No Comments

Managemnet and data collection activity can be suspended by imposing a blackout. See here some examples:

agentctl start blackout # Blackout the entrire agent
agentctl stop blackout # Resume monitoring and management
agentctl start blackout ORCL # Blackout DB ORCL
agentctl stop blackout ORCL # Resume monitoring DB ORCL
agentctl start blackout -s jobs -d 00:20 # Blackout jobs for 20 min