<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>SQL, perl und Unix/Linux Schulungen in und um Wien &#187; Oracle</title>
	<atom:link href="http://www.trust-box.at/category/oracle/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.trust-box.at</link>
	<description>SQL, perl und Unix/Linux Schulungen in und um Wien</description>
	<pubDate>Tue, 22 Feb 2011 10:24:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Oracle 11.2:IGNORE_ROW_ON_DUPKEY_INDEX - Please No!</title>
		<link>http://www.trust-box.at/2010/05/18/oracle-112-ignore_row_on_dupkey_index/</link>
		<comments>http://www.trust-box.at/2010/05/18/oracle-112-ignore_row_on_dupkey_index/#comments</comments>
		<pubDate>Tue, 18 May 2010 09:02:38 +0000</pubDate>
		<dc:creator>schulung</dc:creator>
		
		<category><![CDATA[Allgemein]]></category>

		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[SQL Beispiele]]></category>

		<guid isPermaLink="false">http://www.trust-box.at/?p=97</guid>
		<description><![CDATA[Oracle hat mit 11.2 neue optimizer hints &#8220;erfunden&#8221; und zwar auch IGNORE_ROW_ON_DUPKEY_INDEX.
Er dient dazu (wie der Name schon sagt) bei einem INSERT  (und  nicht bei einem UPDATE!) auf einen Unique Key die Exception zu  ignorieren und das statement tut dann einfach nichts. Es würde dann also zb funktionieren (ohne unique key violation):
insert into [...]]]></description>
			<content:encoded><![CDATA[<p>Oracle hat mit 11.2 neue optimizer hints &#8220;erfunden&#8221; und zwar auch <a href="http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/sql_elements006.htm#CHDEGDDG">IGNORE_ROW_ON_DUPKEY_INDEX</a>.</p>
<p>Er dient dazu (wie der Name schon sagt) bei einem INSERT  (und  nicht bei einem UPDATE!) auf einen Unique Key die Exception zu  ignorieren und das statement tut dann einfach nichts. Es würde dann also zb funktionieren (ohne unique key violation):</p>
<p><code>insert into testtable (id, text) values (1, 'testtext der erste');<br />
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(testtable(id))*/  into testtable (id, text) values (1, 'testtext der zweite');<br />
</code></p>
<p>Dieser Hint ist eigentlich kein Hint  sondern eine Option (&#8230;), und außerdem aus mehreren Gründen keine gute  Idee:</p>
<ul>
<li>andere Oracle Hints (zb für den Optimizer) verändern das Verhalten des Statments nicht, und sind somit kompatibel mit anderen Datenbanken</li>
<li>es gibt schon ein statment mit dem man den gleichen Effekt erreichen kann und zwar MERGE, welches man mittelfristig sicher auch in <a href="http://petereisentraut.blogspot.com/2010/05/merge-syntax.html?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+PeterEisentraut+%28Peter+Eisentraut%27s+Blog%29">anderen Datenbanken wie Postgres </a>erwarten kann</li>
</ul>
<p>Und gleich der Vollständigkeit halber das MERGE-Statement:</p>
<p><code>merge into testtable<br />
using (select 1 from dual)<br />
on (id = :b_id)<br />
when not matched then<br />
insert (id, text) values (:b_id, :b_text);<br />
</code></p>
<p>ich verwende deswegen bind Variablen weil man ansonsten den Wert :b_id zweimal einsetzen müßte. Entgegen anderslautenden Gerüchten muß es keinen &#8220;when matched &#8230; where 2=1&#8243; (oder Ähnliches)  Abschnitt geben. Das &#8220;select 1 from dual&#8221; dient dazu um genau ein Zeile zum bekommen und somit die Zahl der zu behandelnden Zeilen zu determinieren.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trust-box.at/2010/05/18/oracle-112-ignore_row_on_dupkey_index/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Die Relevanz der Inflationsrate</title>
		<link>http://www.trust-box.at/2010/04/16/die-relevanz-der-inflationsrate/</link>
		<comments>http://www.trust-box.at/2010/04/16/die-relevanz-der-inflationsrate/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 17:59:34 +0000</pubDate>
		<dc:creator>schulung</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.trust-box.at/?p=87</guid>
		<description><![CDATA[Zend, Oracle, perl, php
]]></description>
			<content:encoded><![CDATA[<p>Zend, Oracle, perl, php</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trust-box.at/2010/04/16/die-relevanz-der-inflationsrate/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Zend Guestbook demo with Oracle 11g</title>
		<link>http://www.trust-box.at/2009/11/23/the-zend-guestbook-demo-with-oracle-11g/</link>
		<comments>http://www.trust-box.at/2009/11/23/the-zend-guestbook-demo-with-oracle-11g/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 10:21:14 +0000</pubDate>
		<dc:creator>schulung</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.trust-box.at/?p=80</guid>
		<description><![CDATA[The Zend Guestbook demo implemented with Zend 1.95, Oracle 11g and the xampp package
download the complete example here
First things first. Don&#8217;t, *again* don&#8217;t, use Zend 1.9 which seems to have some bugs, use at least 1.91.
What I&#8217;ve done I changed as few things as possible to get the guestbook quickstart demo running on Oracle.
Only some [...]]]></description>
			<content:encoded><![CDATA[<h2>The <a href="http://framework.zend.com/docs/quickstart" target="_blank">Zend Guestbook</a> demo implemented with Zend 1.95, Oracle 11g and the xampp package</h2>
<p><a href="http://trust-box.at/download/">download </a>the complete example <a href="http://trust-box.at/download/zend-quickstart-oracle.zip">here</a></p>
<p>First things first. Don&#8217;t, *again* don&#8217;t, use Zend 1.9 which seems to have some bugs, use at least 1.91.<br />
What I&#8217;ve done I changed as few things as possible to get the guestbook quickstart demo running on Oracle.<br />
Only some minor yak shaving had to take place:</p>
<ul>
<li>You cannot easily user the Zend .ini style configuration  because you need some Db_Zend constansts, so you either have to use XML style config or hardcode the constants (and the credentials) directly in the Bootstrap.php file (the easy route which I have taken)</li>
<li> In Oracle its not possible to name a column &#8220;COMMENT&#8221; so I have chosen &#8220;COMMENTS&#8221; instead which is equally bad but at least working</li>
<li> Use at least Zend 1.91, have I already mentioned that?</li>
<li> I haven&#8217;t came around to get &#8220;Zend_Db::CASE_FOLDING =&gt; Zend_Db::CASE_UPPER&#8221; working quickly, so all the column names used have to be upper case as they are stored in the Oracle data dictonary views</li>
</ul>
<h3>Installation</h3>
<ul>
<li> Be careful, if you break something it&#8217;s your fault not mine</li>
<li> Everything is you need is in the zip file which should be unpacked in a directory accessable by your webserver, in the many cases (also with the XAMPP and LAMPP packages) this folder is named &#8220;htdocs&#8221;</li>
</ul>
<h3>Database (Oracle) Side</h3>
<ul>
<li> if you have user create privileges (usually SYSTEM or SYS user), you may execute the questbook.sql script found in the INSTALL folder</li>
<li> if you don&#8217;t have user create privileges, but a database user (the name doesn&#8217;t matter) login as the user and start with line 6 (the create sequence command) of the guestbook.sql file</li>
</ul>
<h3>PHP Side</h3>
<ul>
<li> in application/Bootstrap.php change the dbname, username and password to your settings</li>
</ul>
<h3>You are ready</h3>
<ul>
<li>navigate your web browser to http://&lt;yourhostname&gt;/quickstart/public/guestbook and everything should work out fine</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.trust-box.at/2009/11/23/the-zend-guestbook-demo-with-oracle-11g/feed/</wfw:commentRss>
		</item>
		<item>
		<title>20 Jahre Mauerfall im Lichte von RDBMS</title>
		<link>http://www.trust-box.at/2009/11/09/20-jahre-mauerfall-im-lichte-von-rdbms/</link>
		<comments>http://www.trust-box.at/2009/11/09/20-jahre-mauerfall-im-lichte-von-rdbms/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 18:53:05 +0000</pubDate>
		<dc:creator>schulung</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[SQL Beispiele]]></category>

		<guid isPermaLink="false">http://www.trust-box.at/?p=76</guid>
		<description><![CDATA[In jedem meiner Datenbankkurse predige ich ein paar Stehsätze einer davon lautet
jede Tabelle muß eine &#8220;abstrake&#8221; ID haben, und es ist sehr schlecht &#8220;scheinbar&#8221; eindeutige numerische Felder wie zum Beispiel Kontonummer, Personalnummer oder auch die Postleitzahl als ID zu mißbrauchen.
Ich bringe immer das Beispiel das eine Personentabelle mit einer Orte Tabellen über die Postleitzahl verknüpft [...]]]></description>
			<content:encoded><![CDATA[<p>In jedem meiner Datenbankkurse predige ich ein paar Stehsätze einer davon lautet</p>
<blockquote><p>jede Tabelle muß eine &#8220;abstrake&#8221; ID haben, und es ist sehr schlecht &#8220;scheinbar&#8221; eindeutige numerische Felder wie zum Beispiel Kontonummer, Personalnummer oder auch die Postleitzahl als ID zu mißbrauchen.</p></blockquote>
<p>Ich bringe immer das Beispiel das eine Personentabelle mit einer Orte Tabellen über die Postleitzahl verknüpft ist. Was von den meisten Teilnehmer mit einem begeisterten Kopfnicken quittiert wird &#8220;ist ja eh eindeutig und wird sich sicher NIE ändern&#8221;.</p>
<p>Dann kommt mein großer Moment und ich sage: &#8220;Und dann kommt die Wiedervereinigung und das ganze Datenmodell bricht zusammen!&#8221;. Das ist sehr deutlich und einprägsam - nur sind mittlerweile auch so junge Teilnehmer dabei bei denen das große Ereignis eben nicht mehr so präsent ist. Hm ich werde alt. Meine Hoffnungen ruhen auf Nord- und Südkorea für neue Beispiele.</p>
<p>In diesem Sinne ist der positive Beitrag des Mauerfalls zum Thema &#8220;Datenbankdidaktik&#8221; gar nicht hoch genug einzuschätzen!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trust-box.at/2009/11/09/20-jahre-mauerfall-im-lichte-von-rdbms/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Feature for collections in Oracle 11</title>
		<link>http://www.trust-box.at/2009/11/08/new-feature-for-collections-in-oracle-11/</link>
		<comments>http://www.trust-box.at/2009/11/08/new-feature-for-collections-in-oracle-11/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 10:12:12 +0000</pubDate>
		<dc:creator>schulung</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[PLSQL]]></category>

		<category><![CDATA[SQL Beispiele]]></category>

		<guid isPermaLink="false">http://www.trust-box.at/?p=72</guid>
		<description><![CDATA[Starting with Oracle 11 it is now possible to use set operators on &#8220;some&#8221; collection types (ie varrays and nested tables, NOT index by Tables).
A simple example:

PROCEDURE COLL_SET_OP
   IS
   cursor c_emp(c_p_salary number) is
   select first_name, last_name, salary from employees
   where salary > c_p_salary;
  type t_emp is [...]]]></description>
			<content:encoded><![CDATA[<p>Starting with Oracle 11 it is now possible to use set operators on &#8220;some&#8221; collection types (ie varrays and nested tables, NOT index by Tables).</p>
<p>A simple example:<br />
<code><br />
PROCEDURE COLL_SET_OP<br />
   IS<br />
   cursor c_emp(c_p_salary number) is<br />
   select first_name, last_name, salary from employees<br />
   where salary > c_p_salary;</p>
<p>  type t_emp is table of varchar2(50); </p>
<p>   a1_emp t_emp := t_emp();<br />
   a2_emp t_emp := t_emp();</p>
<p>   a_emp_op t_emp := t_emp();<br />
   i number := 0;<br />
BEGIN<br />
   for r in c_emp(5000) loop<br />
     i := i+1;<br />
     a1_emp.extend;<br />
     a1_emp(i) := r.last_name;<br />
   end loop;</p>
<p>   i:=0;<br />
   for r in c_emp(10000) loop<br />
     i := i+1;<br />
     a2_emp.extend;<br />
     a2_emp(i) := r.last_name;<br />
   end loop;</p>
<p>   dbms_output.put_line(cardinality(a1_emp));<br />
   dbms_output.put_line(cardinality(a2_emp));</p>
<p>   a_emp_op := a1_emp multiset except a2_emp;<br />
   i:=a_emp_op.first;<br />
   while (i is not null) loop<br />
   dbms_output.put_line(i ||' '||<br />
                       a_emp_op(i));</p>
<p>   i:=a_emp_op.next(i);<br />
   end loop;<br />
END;<br />
</code></p>
<p>there are operators to mimic all SQL-set operators (union, minus, intersect). Its not exaclty a feature in PLSQL I&#8217;ve been anxiously waiting for, but there may be some uses for it. Please keep in mind that it won&#8217;t work for &#8220;index by varchar2&#8243; tables which would make it a lot more usefull.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trust-box.at/2009/11/08/new-feature-for-collections-in-oracle-11/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Compare available Objects on two Oracle Instances</title>
		<link>http://www.trust-box.at/2009/11/06/compare-available-objects-on-two-oracle-instances/</link>
		<comments>http://www.trust-box.at/2009/11/06/compare-available-objects-on-two-oracle-instances/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 10:13:23 +0000</pubDate>
		<dc:creator>schulung</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[SQL Beispiele]]></category>

		<guid isPermaLink="false">http://www.trust-box.at/?p=70</guid>
		<description><![CDATA[Compare available Objects on two Oracle Instances
For this snippet to work you need a functioning database link

select object_name, object_type from user_objects@;
minus
select object_name, object_type from user_objects

to get the actual DDL (for a package body in this example) statments you have to issue

select referenced_name, dbms_metadata.get_ddl(referenced_type, referenced_name) from (
  select name, type, referenced_name, referenced_type from
   [...]]]></description>
			<content:encoded><![CDATA[<p>Compare available Objects on two Oracle Instances</p>
<p>For this snippet to work you need a functioning database link</p>
<p><code><br />
select object_name, object_type from user_objects@<dblink>;<br />
minus<br />
select object_name, object_type from user_objects<br />
</code></p>
<p>to get the actual DDL (for a package body in this example) statments you have to issue</p>
<p><code><br />
select referenced_name, dbms_metadata.get_ddl(referenced_type, referenced_name) from (<br />
  select name, type, referenced_name, referenced_type from<br />
    user_dependencies where name='<OBJECT_NAME>&#8216; and type=&#8217;PACKAGE BODY&#8217;<br />
    minus<br />
  select name, type, referenced_name, referenced_type from user_dependencies@<dblink>;<br />
) where referenced_name not in (&#8217;STANDARD&#8217;, &#8216;DBMS_OUTPUT&#8217;, &#8216;DUAL&#8217;)<br />
and referenced_name not in (select object_name from user_objects@<dblink>)<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.trust-box.at/2009/11/06/compare-available-objects-on-two-oracle-instances/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

