Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
Dimension table load - PLSQL question

Dimension table load - PLSQL question

2005-09-29       - By Edgar Chupit

Reply:     <<     11     12     13     14     15     16     17     18     19     20     >>  

First of all I would like to suggest that you trade code simpleness to
efficiency. If you will remove all this small lookup select statements and
construct one "big" statement instead (something like I was showing in my
example), this function will perform better, because there will be less
context switches between SQL Engine and PLSQL engine.

Than I would suggest you to review your "Dimension table load" algorithm,
because from what I see here, I can deduce (I hope I'm wrong on this one)
that you are populating this table row by row and somewhere in the code you
have procedure that does:

for r in ( select x from y ) loop
z := f_d_address_category_desc( r.x );
update t set t.z = z;
end loop;

If you can construct single SQL statement that will perform this task, it
will perform much much better and will save you a lot of time. Tom Kyte has
written dozen of articles on this, for example: http://tinyurl.com/9hznb or
just search for the ETL on asktom.oracle.com <http://asktom.oracle.com>

And the third point that I would like to mention, is that you can make your
code look beautifier if you will use %rowtype variable or record type to
store variables/pass parameters, but basically the code will do the same
thing.

Unfortunately there is no good way to reduce this code, because SQL is
designed this way. SQL has to know tablename in advance, you can trick SQL
engine using PLSQL and Native SQL, but this will not perform as good as
hardcoded tablename values.

So I would suggest you to try different approaches and measure the
performance/code quality benefits of each approach and than make proved
decision.

On 9/29/05, Ranko Mosic <ranko.mosic@(protected)> wrote:
> Because this is how it looks now ( cursor can be removed because it will
> return only one row );
> and we could do you when no_data_found thing. But this logic has to be
> repeated for dozens of tables.
>
>
> CREATE OR REPLACE PACKAGE BODY DW_OLAP_UTIL
> IS

--
Best regards,
Edgar Chupit
callto://edgar.chupit

First of all I would like to suggest that you trade code simpleness to
efficiency. If you will remove all this small lookup select statements
and construct one &quot;big&quot; statement instead (something like I was
showing
in my example), this function will perform better, because there will
be less context switches between SQL Engine and PLSQL engine. <br><br>Than
I would suggest you to review your &quot;Dimension table load&quot; algorithm,
because from what I see here, I can deduce (I hope I'm wrong on this
one) that you are populating this table row by row and somewhere in the
code you have procedure that does:<br>
<br>
for r in ( select x from y ) loop<br>
&nbsp; z := f_d_address_category_desc( r.x );<br>
&nbsp; update t set t.z = z;<br>
end loop;<br><br>
If you can construct single SQL statement that will perform this task,
it will perform much much better and will save you a lot of time. Tom
Kyte has written dozen of articles on this, for example: <a href="http:/
/tinyurl.com/9hznb">http://tinyurl.com/9hznb</a>  or just search for the ETL on
<a href="http://asktom.oracle.com">asktom.oracle.com</a><br>
<br>
And the third point that I would like to mention, is that you can make
your code look beautifier if you will use %rowtype variable or record
type to store variables/pass parameters, but basically the code will do
the same thing.<br>
<br>
Unfortunately there is no good way to reduce this code, because SQL is
designed this way. SQL has to know tablename in advance, you can trick
SQL engine using PLSQL and Native SQL, but this will not perform as
good as hardcoded tablename values. <br>
<br>
So I would suggest you to try different approaches and measure the
performance/code quality benefits of each approach and than make proved
decision.<br>
<br>On 9/29/05, Ranko Mosic &lt;<a href="mailto:ranko.mosic@(protected)">ranko
.mosic@(protected)</a>&gt; wrote:<br>&gt; Because this is how it looks now (
cursor can be removed because it will<br>&gt; return only one row );&nbsp;&nbsp
;
<br>&gt; and we could do you when no_data_found thing. But this logic has to be
<br>&gt; repeated for dozens of tables.&nbsp;&nbsp; <br>&gt;&nbsp;&nbsp;<br>&gt;
<br>&gt; CREATE OR REPLACE PACKAGE BODY DW_OLAP_UTIL<br>&gt; IS<br><br>
-- <br>Best regards,<br>&nbsp;&nbsp;Edgar Chupit<br>&nbsp;&nbsp;<a href="callto
://edgar.chupit">callto://edgar.chupit</a><br><br><br>