<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7852128678850765532</id><updated>2024-11-05T18:51:27.019-08:00</updated><title type='text'>ORACLE Tips</title><subtitle type='html'>Pequeñas ayudas para grandes problemas</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-8881174707986680109</id><published>2012-10-25T08:17:00.001-07:00</published><updated>2012-10-25T08:17:17.827-07:00</updated><title type='text'>Como salimos de: Import file: expdat.dmp &gt;</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #FEFDFA; line-height: 18.0pt; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot; style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.0pt; mso-ansi-language: ES-AR; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Hoy quería compartir con ustedes el
hecho de que cuando escribimos mal el path del archivo .dmp para realizar el
import, como sabrán nos aparece en nuestro prompt lo siguiente:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #FEFDFA; line-height: 18.0pt; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #FEFDFA; line-height: 18.0pt; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;IMP-00002: failed to open /prueba.dmp for read&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Import
file: expdat.dmp &amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;br /&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt;
&lt;!--[endif]--&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #FEFDFA; line-height: 18.0pt; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot; style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.0pt; mso-ansi-language: ES-AR; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Imagino que todos probamos con “quit”, “exit”,
Ctrl+C, etc…&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #FEFDFA; line-height: 18.0pt; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot; style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.0pt; mso-ansi-language: ES-AR; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Pues bien, la respuesta para salir de
dicho prompt no es ninguna de esas alternativas sino que, salimos del mismo con
&lt;b&gt;Ctrl D.&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #FEFDFA; line-height: 18.0pt; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #FEFDFA; line-height: 18.0pt; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot; style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.0pt; mso-ansi-language: ES-AR; mso-bidi-font-size: 11.0pt; mso-bidi-font-weight: bold; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Espero les
haya servido.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #FEFDFA; line-height: 18.0pt; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #FEFDFA; line-height: 18.0pt; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot; style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.0pt; mso-ansi-language: ES-AR; mso-bidi-font-size: 11.0pt; mso-bidi-font-weight: bold; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Saludos!&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.0pt; mso-ansi-language: ES-AR; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #FEFDFA; line-height: 18.0pt; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot; style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.0pt; mso-ansi-language: ES-AR; mso-bidi-font-size: 11.0pt; mso-bidi-font-weight: bold; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Gondalf&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/8881174707986680109/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2012/10/como-salimos-de-import-file-expdatdmp.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/8881174707986680109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/8881174707986680109'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2012/10/como-salimos-de-import-file-expdatdmp.html' title='Como salimos de: Import file: expdat.dmp &gt;'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-7086323057666415248</id><published>2012-05-17T06:40:00.001-07:00</published><updated>2012-05-17T06:40:20.420-07:00</updated><title type='text'>String de conexión JDBC para Oracle RAC</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot; style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12.0pt; mso-ansi-language: ES-AR; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Quizás varios de uds conocen la clásica
conexión por JDBC a una single instance de Oracle, pues bien, si necesitamos
conectarnos a un RAC con x cantidad de nodos dicho string de conexión sufre
algunas modificaciones.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot; style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12.0pt; line-height: 115%; mso-ansi-language: ES-AR; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-US;&quot;&gt;La clásica conexión a una single instance es&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: #666600; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;jdbc:oracle:thin:@&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;host&gt;&lt;/host&gt;&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;:1521:&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;sid&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/sid&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot; style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12.0pt; mso-ansi-language: ES-AR; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;La
conexión a un RAC presenta las siguientes diferencias:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: #666600; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;(ADDRESS=(PROTOCOL=TCP)(HOST=host1)
(PORT=1521))&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;(ADDRESS=(PROTOCOL=TCP)(HOST=host2)
(PORT=1521))&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;(CONNECT_DATA=(SERVICE_NAME=service)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; (FAILOVER_MODE =(TYPE = SELECT)(METHOD
= BASIC))))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot; style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12.0pt; mso-ansi-language: ES-AR; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Espero
les haya servido.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot; style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12.0pt; mso-ansi-language: ES-AR; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Saludos!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot; style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12.0pt; mso-ansi-language: ES-AR; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Gondalf.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/7086323057666415248/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2012/05/string-de-conexion-jdbc-para-oracle-rac.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/7086323057666415248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/7086323057666415248'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2012/05/string-de-conexion-jdbc-para-oracle-rac.html' title='String de conexión JDBC para Oracle RAC'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-3594576355692183886</id><published>2012-04-26T13:36:00.001-07:00</published><updated>2012-04-26T13:40:17.032-07:00</updated><title type='text'>Empezando a trabajar con Fechas</title><content type='html'>Seguramente
tuvimos varios problemas al tratar con fechas en Oracle. Se nos complico en
sumar o restar horas, o cambiar los días.&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;Lo que vamos a tratar ahora es de dar unos ejemplos para que no vuelva a
suceder.&amp;nbsp;Antes de
empezar, tengamos en cuenta que Oracle trabaja con la aritmética en función de
un 1 día.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
Teniendo entendido este concepto nos va a resultar más fácil la explicación.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;Veamos algunos ejemplos:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp; &amp;nbsp;-&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;&gt;Sumar
días:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&lt;fecha&gt;&lt;días a=&quot;&quot; sumar=&quot;&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-family: Calibri, sans-serif; font-size: 11pt;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;fecha&#39; + &#39;días a sumar&#39;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ejemplo: &lt;b&gt;select sysdate + 1 from
dual;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/días&gt;&lt;/fecha&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;font-size: 7pt;&quot;&gt; &amp;nbsp; -&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;&gt;Sumar
horas:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&#39;&lt;fecha&gt;&lt;horas 24=&quot;&quot; a=&quot;&quot; sumar=&quot;&quot;&gt;&lt;i style=&quot;font-family: Calibri, sans-serif; font-size: 15px; text-indent: -24px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;fecha&#39; + &#39;horas a sumar&lt;/span&gt;&lt;/i&gt;&amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;/ 24&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: blue;&quot;&gt;&#39;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ejemplo: &lt;b&gt;select sysdate + 3/24
from dual;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/horas&gt;&lt;/fecha&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;-&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;&gt;Sumar
minutos:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;fecha&gt;&lt;span style=&quot;text-indent: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;fecha style=&quot;text-indent: 0px;&quot;&gt;&lt;horas 24=&quot;&quot; a=&quot;&quot; sumar=&quot;&quot;&gt;&lt;i style=&quot;font-family: Calibri, sans-serif; font-size: 15px; text-indent: -24px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;fecha&#39; + &#39;minutos a sumar&lt;/span&gt;&lt;/i&gt;&amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;nbsp;1440&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: blue;&quot;&gt;&#39;&lt;/span&gt;&lt;/horas&gt;&lt;/fecha&gt;&amp;nbsp;&amp;nbsp;&lt;minutos 1440=&quot;&quot; a=&quot;&quot; sumar=&quot;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ejemplo: &lt;b&gt;select sysdate + 25/1440
from dual;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/minutos&gt;&lt;/fecha&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-size: 7pt;&quot;&gt; -&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;&gt;Sumar
segundos:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-indent: -24px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;fecha style=&quot;text-indent: -24px;&quot;&gt;&lt;span style=&quot;text-indent: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;fecha style=&quot;text-indent: 0px;&quot;&gt;&lt;horas 24=&quot;&quot; a=&quot;&quot; sumar=&quot;&quot;&gt;&lt;i style=&quot;font-family: Calibri, sans-serif; font-size: 15px; text-indent: -24px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;fecha&#39; + &#39;minutos a sumar&lt;/span&gt;&lt;/i&gt;&amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;nbsp;86400&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: blue;&quot;&gt;&#39;&lt;/span&gt;&lt;/horas&gt;&lt;/fecha&gt;&amp;nbsp;&lt;/fecha&gt;&lt;br /&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;&lt;fecha&gt;&lt;segundos 86400=&quot;&quot; a=&quot;&quot; sumar=&quot;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ejemplo: &lt;b&gt;select sysdate + 1/86400
from dual;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/segundos&gt;&lt;/fecha&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;Espero les
haya servido.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;Saludos!&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;
Gondalf.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-AR&quot;&gt;Pd: En el próximo
post trabajaremos más a fondo con las fechas viendo algunas funciones que nos
facilitaran mucho trabajo.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/3594576355692183886/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2012/04/empezando-trabajar-con-fechas.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/3594576355692183886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/3594576355692183886'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2012/04/empezando-trabajar-con-fechas.html' title='Empezando a trabajar con Fechas'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-5416316615265222974</id><published>2012-01-18T11:47:00.000-08:00</published><updated>2012-01-18T12:00:19.578-08:00</updated><title type='text'>ORA-02287: sequence number not allowed here</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; &quot;&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;Comencemos por la causa del mismo., curre cuando intentamos utilizar una secuencia donde no está permitido hacerlo.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; &quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size: 12pt; font-family: Cambria, serif; &quot;&gt;Para ser un poco más explícitos, NO podemos utilizar secuencias en los siguientes casos:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; &quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size: 12pt; font-family: Cambria, serif; &quot;&gt;-  Dentro de una sentencias SELECT:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; &quot;&gt;&lt;span lang=&quot;ES-AR&quot;&gt;&lt;span&gt;            &lt;/span&gt;&lt;b style=&quot;font-family: Cambria, serif; font-size: 12pt; text-indent: 48px; &quot;&gt;*&lt;/b&gt;&lt;span&gt; En la claúsula &lt;/span&gt;&lt;b style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;WHERE&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;font-family: Cambria, serif; font-size: 12pt; text-indent: 0px; &quot;&gt;&lt;span style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt;&lt;b&gt;            * &lt;/b&gt;En las claúsulas &lt;/span&gt;&lt;b style=&quot;font-weight: bold; font-size: 12pt; text-indent: 0.5in; &quot;&gt;GROUP&lt;/b&gt;&lt;span style=&quot;font-weight: bold; font-size: 12pt; text-indent: 0.5in; &quot;&gt; &lt;/span&gt;&lt;b style=&quot;font-weight: bold; font-size: 12pt; text-indent: 0.5in; &quot;&gt;BY&lt;/b&gt;&lt;span style=&quot;font-weight: bold; font-size: 12pt; text-indent: 0.5in; &quot;&gt; u &lt;/span&gt;&lt;b style=&quot;font-weight: bold; font-size: 12pt; text-indent: 0.5in; &quot;&gt;ORDER&lt;/b&gt;&lt;span style=&quot;font-weight: bold; font-size: 12pt; text-indent: 0.5in; &quot;&gt; &lt;/span&gt;&lt;b style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt;BY&lt;br /&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt;&lt;b&gt;            &lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;font-size: 12pt; text-indent: 48px; &quot;&gt;*&lt;/b&gt;&lt;span style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt; En una claúsula &lt;/span&gt;&lt;b style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt;DISTINCT&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-indent: 0px;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;&lt;span style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt;            &lt;/span&gt;&lt;b style=&quot;font-size: 12pt; text-indent: 48px; &quot;&gt;* &lt;/b&gt;&lt;span style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt;Utilizando &lt;/span&gt;&lt;b style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt;UNION&lt;/b&gt;&lt;span style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt; o &lt;/span&gt;&lt;b style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt;INTERSECT&lt;/b&gt;&lt;span style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt; o &lt;/span&gt;&lt;b style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt;MINUS&lt;br /&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt;&lt;b&gt;            &lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;font-size: 12pt; text-indent: 48px; &quot;&gt;*&lt;/b&gt;&lt;span style=&quot;font-size: 12pt; text-indent: 0.5in; &quot;&gt; En un &lt;b&gt;Sub-Query&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; &quot;&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;  &lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;En una VISTA o SNAPSHOT&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;  &lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;En una condición de DEFAULT o CHECK de una tabla&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; &quot;&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;(Cabe aclarar que existen más excepciones pero que estas son las mas representativas)&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; &quot;&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;Algunas posibles &lt;/span&gt;&lt;i style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;&lt;u&gt;soluciones &lt;/u&gt;&lt;/i&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;para nuestro problema serian:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; &quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size: 12pt; font-family: Cambria, serif; &quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;  &lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;Si necesitamos utilizar nuestra secuencia en un WHERE o bien un ORDER BY o un Sub-Query, lo que hacemos es asignarla a una variable previa y dicha variable es la que podemos utilizar en los caso mencionados.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; &quot;&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;  &lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;Si necesitamos utilizar la secuencia para ser insertada tras la creación de las filas de una tabla lo que podemos hacer es utilizar un trigger &quot;before insert&quot; para que realice el trabajo.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; &quot;&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;  &lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;Si quisiéramos una secuencia en una vista podríamos crear la mismas sin la secuencia y luego al momento de llamarla utilizarla (ej: select a, b, &quot;secuencia&quot; from &quot;nuestra vista&quot;).&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; &quot;&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;-&lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;  &lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;Si quisiéramos usar la secuencia en un query con una DISTINCT lo que podemos hacer es utilizar este en un Sub-Query y la secuencia en el query principal&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; &quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size: 12pt; font-family: Cambria, serif; &quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;Espero que les haya servido&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; &quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size: 12pt; font-family: Cambria, serif; &quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; &quot;&gt;Saludos!&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Cambria, serif; font-size: 12pt; line-height: 115%; &quot;&gt;Gondalf.&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/5416316615265222974/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2012/01/ora-02287-sequence-number-not-allowed.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/5416316615265222974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/5416316615265222974'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2012/01/ora-02287-sequence-number-not-allowed.html' title='ORA-02287: sequence number not allowed here'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-735887784619981826</id><published>2011-11-15T05:24:00.000-08:00</published><updated>2011-11-15T05:29:18.992-08:00</updated><title type='text'>Parametros EXCLUDE e INCLUDE en DataPump</title><content type='html'>&lt;div&gt;Los parametros EXCLUDE e INCLUDE están disponibles con DataPump (expdp, impdp), los mismos pueden ser utilizados para limitar lo que se importa o exporta, ya sean &lt;i&gt;tablas, índices, triggers, funciones, vistas, procedures, paquetes o secuencias&lt;/i&gt; (creo que no me olvido de ningún otro).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;La sintaxis de estos parámetros es la siguiente:&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;EXCLUDE=[object_type]:[name_clause],[object_type]:[name_clause]&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;INCLUDE=[object_type]:[name_clause],[object_type]:[name_clause]&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;u&gt;&lt;/u&gt;&lt;/div&gt;&lt;div&gt;&lt;u&gt;Ejemplos:&lt;/u&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;expdp &amp;lt; paramentro varios &amp;gt; SCHEMAS=scott EXCLUDE=SEQUENCE,TABLE:”IN (’EMPLEADOS’,&#39;DEPARTAMENTOS’)”;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;En este ejemplo vemos que excluimos exportar todas las secuencias y tablas que se llamen EMPLEADOS o DEPARTAMENTOS del schema backup&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;impdp &amp;lt; paramentro varios &amp;gt; SCHEMAS=backup INCLUDE=TABLE:”=’OLD_TABLE’”&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;En este ejemplo vemos como hacemos un import incluyendo solo la tabla de nombre OLD_TABLE.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Espero les haya servido&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Saludos!&lt;/div&gt;&lt;div&gt;Gondalf&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/735887784619981826/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/11/parametros-exclude-e-include-en.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/735887784619981826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/735887784619981826'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/11/parametros-exclude-e-include-en.html' title='Parametros EXCLUDE e INCLUDE en DataPump'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-7964128459288420989</id><published>2011-11-10T07:53:00.000-08:00</published><updated>2011-11-10T07:59:27.765-08:00</updated><title type='text'>Diferencias entre los CharacterSet WE8ISO8859P1  y  WE8MSWIN1252</title><content type='html'>Según oracle tenemos que el characterset definido en WE8ISO8859P1 es un “subgrupo” del characterset WE8MSWIN1252, es decir que este ultimo posee characters adicionales al primero.&lt;br /&gt;&lt;br /&gt;Hilando un poco más fino, podemos decir que el characterset WE8MSWIN1252 posee 27 caracteres adicionales.&lt;br /&gt;&lt;br /&gt;A continuación vemos la lista con las 27 diferencias:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table border=&quot;1&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;&lt;tr&gt;&lt;!-- Row 1 --&gt;     &lt;td&gt;Win-1251&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;Unicode Char&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;Charact&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt; Descripción&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 2 --&gt;     &lt;td&gt;0x80&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x20AC&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[€] [€]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;EURO SIGN&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 3 --&gt;     &lt;td&gt;0x82&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x201A&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[‚] [‚]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;SINGLE LOW-9 QUOTATION MARK&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 4 --&gt;     &lt;td&gt;0x83&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x0192&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[ƒ] [ƒ]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;LATIN SMALL LETTER F WITH HOOK&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 5 --&gt;     &lt;td&gt;0x84&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x201E&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[„] [„]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;DOUBLE LOW-9 QUOTATION MARK&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 6 --&gt;     &lt;td&gt;0x85&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x2026&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[…] […]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;HORIZONTAL ELLIPSIS&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 7 --&gt;     &lt;td&gt;0x86&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x2020&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[†] [†]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;DAGGER&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 8 --&gt;     &lt;td&gt;0x87&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x2021&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[‡] [‡]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;DOUBLE DAGGER&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 9 --&gt;     &lt;td&gt;0x88&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x02C6&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[ˆ] [ˆ]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;MODIFIER LETTER CIRCUMFLEX ACCENT&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 10 --&gt;     &lt;td&gt;0x89&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x2030&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[‰] [‰]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;PER MILLE SIGN&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 11 --&gt;     &lt;td&gt;0x8A&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x0160&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[Š] [Š]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;LATIN CAPITAL LETTER S WITH CARON&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 12 --&gt;     &lt;td&gt;0x8B&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x2039&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[‹] [‹]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;SINGLE LEFT-POINTING ANGLE QUOTATION MARK&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 13 --&gt;     &lt;td&gt;0x8C&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x0152&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[Œ] [Œ]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;LATIN CAPITAL LIGATURE OE&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 14 --&gt;     &lt;td&gt;0x8E&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x017D&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[Ž] [Ž]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;LATIN CAPITAL LETTER Z WITH CARON&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 15 --&gt;     &lt;td&gt;0x91&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x2018&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[‘] [‘]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;LEFT SINGLE QUOTATION MARK&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 16 --&gt;     &lt;td&gt;0x92&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x2019&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[’] [’]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;RIGHT SINGLE QUOTATION MARK&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 17 --&gt;     &lt;td&gt;0x93&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x201C&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[“] [“]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;LEFT DOUBLE QUOTATION MARK&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 18 --&gt;     &lt;td&gt;0x94&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x201D&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[”] [”]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;RIGHT DOUBLE QUOTATION MARK&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 19 --&gt;     &lt;td&gt;0x95&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x2022&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[•] [•]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;BULLET&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 20 --&gt;     &lt;td&gt;0x96&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x2013&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[–] [–]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;EN DASH&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 21 --&gt;     &lt;td&gt;0x97&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x2014&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[—] [—]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;EM DASH&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 22 --&gt;     &lt;td&gt;0x98&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x02DC&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[˜] [˜]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;SMALL TILDE&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 23 --&gt;     &lt;td&gt;0x99&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x2122&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[™] [™]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;TRADE MARK SIGN&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 25 --&gt;     &lt;td&gt;0x9A&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x0161&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[š] [š]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;LATIN SMALL LETTER S WITH CARON&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 26 --&gt;     &lt;td&gt;0x9B&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x203A&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[›] [›]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;SINGLE RIGHT-POINTING ANGLE QUOTATION MARK&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 27 --&gt;     &lt;td&gt;0x9C&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x0153&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[œ] [œ]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;LATIN SMALL LIGATURE OE&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 27 --&gt;     &lt;td&gt;0x9E&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x017E&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[ž] [ž]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;LATIN SMALL LETTER Z WITH CARON&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;  &lt;tr&gt;&lt;!-- Row 27 --&gt;     &lt;td&gt;0x9F&lt;/td&gt;&lt;!-- Col 1 --&gt;     &lt;td&gt;0x0178&lt;/td&gt;&lt;!-- Col 2 --&gt;     &lt;td&gt;[Ÿ] [Ÿ]&lt;/td&gt;&lt;!-- Col 3 --&gt;     &lt;td&gt;LATIN CAPITAL LETTER Y WITH DIAERESIS&lt;/td&gt;&lt;!-- Col 4 --&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Esto quiere decir que si necesitamos utilizar por ejemplo el simbolo del Euro y nuestra base esta configurada en P1 deberiamos modificar el characterset de la base siguiente los siguientes pasos:&lt;div&gt;&lt;br /&gt;&lt;b&gt;SQL&amp;gt;&lt;/b&gt; SHUTDOWN IMMEDIATE;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SQL&amp;gt;&lt;/b&gt; STARTUP MOUNT;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SQL&amp;gt;&lt;/b&gt; ALTER SYSTEM ENABLE RESTRICTED SESSION;&lt;div&gt;&lt;br /&gt;&lt;b&gt;SQL&amp;gt;&lt;/b&gt; ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SQL&amp;gt;&lt;/b&gt; Alter DATABASE OPEN;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SQL&amp;gt;&lt;/b&gt; ALTER DATABASE CHARACTER SET WE8MSWIN1252;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SQL&amp;gt;&lt;/b&gt; SHUTDOWN IMMEDIATE;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SQL&amp;gt;&lt;/b&gt; STARTUP;&lt;br /&gt;&lt;br /&gt;Espero les haya servido.&lt;br /&gt;&lt;br /&gt;Saludos!&lt;br /&gt;Gondalf&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/7964128459288420989/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/11/segun-oracle-tenemos-que-el.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/7964128459288420989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/7964128459288420989'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/11/segun-oracle-tenemos-que-el.html' title='Diferencias entre los CharacterSet WE8ISO8859P1  y  WE8MSWIN1252'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-2231281160283931103</id><published>2011-11-08T05:32:00.000-08:00</published><updated>2011-11-08T05:57:26.009-08:00</updated><title type='text'>Un poquito de PL/SQL, Packages</title><content type='html'>Un paquete es una agrupación lógica codigo PL/SQL.&lt;br /&gt;&lt;br /&gt;Una de las ventajas que nos brinda como varios lenguajes de programación es la &lt;font color=&quot;blue&quot;&gt;&lt;b&gt;MODULARIDAD&lt;/b&gt;&lt;/font&gt;. Permitiendo agrupaciones lógicas y un diseño más sencillo, eficaz y un mejor rendimiento.&lt;br /&gt;&lt;br /&gt;Otra ventaja es la de permitirnos la &lt;font color=&quot;blue&quot;&gt;&lt;b&gt;SOBRECARGA*&lt;/b&gt;&lt;/font&gt; de modo que podemos crear procedimientos o funciones con el mismo nombre y con diferentes parámetros en el mismo paquete&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;i&gt;DESCRIPCION&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Un paquete está compuesto de dos partes:&lt;br /&gt;&lt;br /&gt;- Especificación&lt;br /&gt;- Cuerpo&lt;br /&gt;&lt;br /&gt;A su vez este puede contener métodos privados y públicos, todo procedimiento declarado en la &quot;Especificación&quot; tiene carácter público; mientras que todo procedimiento declarado y desarrollado en el cuerpo tiene carácter privado.&lt;br /&gt;&lt;br /&gt;Las variable definida dentro de un subprograma son locales, mientras que las definidas fuera son globales.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;i&gt;SINTAXIS&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Cabecera:&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color=&quot;green&quot;&gt;CREATE [o REPLACE ] PACKAGE &quot;nombre_del_paquete&quot;&lt;br /&gt;IS | AS&lt;br /&gt;&amp;lt; declaración de variables públicas &amp;gt;&lt;br /&gt;&amp;lt; declaración de los miembros y funciones públicas &amp;gt;&lt;br /&gt;END &quot;nombre_del_paquete&quot;;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Cuerpo:&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color=&quot;green&quot;&gt;CREATE [ o REPLACE ] PACKAGE BODY &quot;nombre_del_paquete&quot;&lt;br /&gt;IS | AS&lt;br /&gt;&amp;lt; declaración de las variables privadas &amp;gt;&lt;br /&gt;&amp;lt; cuerpo de los miembros y funciones &amp;gt;&lt;br /&gt;END nombre_del_paquete;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;(*)La sobrecarga de métodos es la técnica mediante la cual se utiliza el mismo nombre para diferentes subprogramas dentro de un paquete.&lt;br /&gt;La diferencia entre los métodos es el número y orden de parámetros.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Espero les haya servido.&lt;br /&gt;&lt;br /&gt;Saludos!&lt;br /&gt;Gondalf.</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/2231281160283931103/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/11/un-poquito-de-plsql-packages.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/2231281160283931103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/2231281160283931103'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/11/un-poquito-de-plsql-packages.html' title='Un poquito de PL/SQL, Packages'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-5727665523414628365</id><published>2011-08-19T11:52:00.000-07:00</published><updated>2011-08-24T05:51:58.789-07:00</updated><title type='text'>Diferencias entre las lecturas &quot;Sequential&quot; y  &quot;Scattered&quot; de los DBfiles</title><content type='html'>Ambos eventos significan tiempo esperado de E / S para completar las solicitudes de lectura.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;- Lectura &quot;sequential&quot; de los DBfile:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Una operación de lectura de datos sequential lo hace dentro de memoria contigua (p3=1, pero pueden ser multiples bloques).&lt;br /&gt;I/Os de single block son normalmente resultado del uso de índices.&lt;br /&gt;&lt;br /&gt;Este evento es tambien utilizado durante los rebuilding de los controlfile y las lecturas de los datafile headers (P2=1).&lt;br /&gt;Por lo general, este evento indica disk contention sobre las ecrituras de los índices.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;- Lectura &quot;scattered&quot; de los DBfile:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Este tipo de lectura es similar a la anterior a excepción de que la sesión lee multiples bloques de datos y los &quot;dispersa&quot; (traduccion&lt;br /&gt;literal de scattered) en diferentes y discontinuos buffers en la SGA.&lt;br /&gt;Normalmente indican disk contention sobre full table scans. Rara vez, la datos proveninetes de un full table scan pueden ser puestos dentro de una buffer area contigua,  entocnes estas esperas podrían mostrarse como lecturas &quot;sequential&quot; en lugar de &quot;scattered&quot;.&lt;br /&gt;Sin embargo estas lecturas nunca leeran solo un bloque (p3 siempre es &amp;gt;= 2)&lt;br /&gt;&lt;br /&gt;Con el siguiente query podemos observar la diferencia de espera entra las lecturas sequential y scattered:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;SELECT a.average_wait &quot;SEQ READ&quot;, b.average_wait &quot;SCAT READ&quot;&lt;br /&gt;FROM sys.v_$system_event a, sys.v_$system_event b&lt;br /&gt;WHERE a.event = &#39;db file sequential read&#39;&lt;br /&gt;AND b.event = &#39;db file scattered read&#39;;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;SEQ READ     &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp   SCAT READ&lt;br /&gt;------------  &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp    ------------&lt;br /&gt;  .68  &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp           1.5&lt;br /&gt;	&lt;br /&gt;Espero les haya servido.&lt;br /&gt;&lt;br /&gt;Saludos!&lt;br /&gt;Gondalf.	  </content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/5727665523414628365/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/08/diferencias-entre-las-lecturas.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/5727665523414628365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/5727665523414628365'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/08/diferencias-entre-las-lecturas.html' title='Diferencias entre las lecturas &quot;Sequential&quot; y  &quot;Scattered&quot; de los DBfiles'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-8802923436774910682</id><published>2011-07-07T11:59:00.000-07:00</published><updated>2011-07-07T12:00:56.350-07:00</updated><title type='text'>Order By Dinámico</title><content type='html'>&lt;div&gt;Gente, en esta oportunidad quería compartir con uds el hecho de generar un ORDER BY dinámico.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Qué quiere decir esto?, sería poder ordernar una consulta con el parámetro que le pasamos a través de un procedure/function.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Vamos directamente a la creacion del procedure:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;create or replace procedure dinamic_text ( pCol in varchar2 )&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;as&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;type tCurr is ref cursor;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;pCursor tCurr;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;begin&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;open pCursor for &lt;span class=&quot;Apple-style-span&quot;&gt;&#39;select * from tablaTest order by &#39; || pCol;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;loop&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;   &lt;aca iria=&quot;&quot; el=&quot;&quot; codigo=&quot;&quot; que=&quot;&quot; necesiten=&quot;&quot; mientras=&quot;&quot; recorren=&quot;&quot; cursor=&quot;&quot;&gt;&lt;/aca&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;end loop;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;close pCursor;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;end;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Haciéndoles un pequeño resumen, lo que hicimos fue definir un cursor, le asignamos un string con nuetro select y le concatenamos&lt;/div&gt;&lt;div&gt;la variable que pasamos por parametro la cual debe contener el nombre de una de las columnas de la tabla, en este caso &quot;tablaTest&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Espero les haya servido&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Saludos!&lt;/div&gt;&lt;div&gt;Gondalf&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Pd: gracias Jona, ultimamente estás con desarrollos raros, ja&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/8802923436774910682/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/07/order-by-dinamico.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/8802923436774910682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/8802923436774910682'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/07/order-by-dinamico.html' title='Order By Dinámico'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-4480168285199357044</id><published>2011-06-24T11:58:00.000-07:00</published><updated>2011-06-24T12:02:44.121-07:00</updated><title type='text'>Cómo determinar si solo son números?</title><content type='html'>&lt;div&gt;Este post está destinado a compartir con uds. 2 formas para determinar si una cadena está formada solo por números.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt; 1)&lt;/b&gt; La primera de estas 2 formas es a través de la siguiente función:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;CREATE OR REPLACE FUNCTION es_numero(v_valor IN VARCHAR2) RETURN NUMBER IS&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;   v_numero NUMBER;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;BEGIN&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;   v_numero := TO_NUMBER(v_valor);&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;   RETURN 0;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;EXCEPTION WHEN VALUE_ERROR THEN&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;   RETURN 1;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;END;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;El comportamiento de la función es devolver un 0 si la cadena que le pasamos esta compuesta solo por numero y un 1 si no lo está.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Lógicamente deberán usar la función en un WHERE con la condición = 0 o = 1.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;2)&lt;/b&gt; La segunda forma que quiero compartir con uds. es a través de expresiones regulares.&lt;/div&gt;&lt;div&gt;Para esto la expresión regular que utilizamos es REGEXP_LIKE junto &lt;/div&gt;&lt;div&gt;con &#39;^[0-9]+$&#39;, esto indica que evaluará en la cadena que le pasemos si está compuesta únicamente por números del 0 al 9 incluyendolos.&lt;/div&gt;&lt;div&gt;REGEXP_LIKE nos devuelve &#39;true&#39; or &#39;false&#39;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ejemplos:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SELECT * &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;FROM dual &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;WHERE REGEXP_LIKE (&#39;788asd975&#39;, &#39;^[0-9]+$&#39;);&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Devolverá &lt;span class=&quot;Apple-style-span&quot;&gt;FALSE&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SELECT * &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;FROM dual &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;WHERE REGEXP_LIKE (&#39;asdasd&#39;, &#39;^[0-9]+$&#39;);&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Devolverá &lt;span class=&quot;Apple-style-span&quot;&gt;FALSE&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SELECT * &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;FROM dual &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;WHERE REGEXP_LIKE (&#39;788975&#39;, &#39;^[0-9]+$&#39;);&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Devolverá &lt;span class=&quot;Apple-style-span&quot;&gt;TRUE&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Espero les haya servido&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Saludos!&lt;/div&gt;&lt;div&gt;Gondalf&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/4480168285199357044/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/06/como-determinar-si-solo-son-numeros.html#comment-form' title='4 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/4480168285199357044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/4480168285199357044'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/06/como-determinar-si-solo-son-numeros.html' title='Cómo determinar si solo son números?'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-8633224942944397225</id><published>2011-06-21T11:23:00.000-07:00</published><updated>2011-06-21T11:24:57.348-07:00</updated><title type='text'>Borrar filas duplicadas</title><content type='html'>&lt;div&gt;De vez en cuando, por ejemplo por la falta de algún índice unico, puede suceder que insertemos registros duplicados en una de nuestras tablas.&lt;/div&gt;&lt;div&gt;Cuando notamos esta &quot;duplicidad&quot; seguramente querremos borrar todos los duplicados y dejar solo 1 registro, o no?&lt;/div&gt;&lt;div&gt;Habitualmente tenemos inconveniente es realizar este trabajo dado que borramos todos los registros involucrados en la duplicidad.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Para solucionar esto y asi poder borrar todos los duplicados salvo 1, debemos seguir algunos pasos.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Por ejemplo, vamos a cerar la tabla DUPLICADOS la cual va a tener 2 columnas:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SQL&amp;gt; create table duplicados (col1 number, col2 varchar2(20))&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hacemos algunos insert en la misma:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SQL&amp;gt; insert into duplicados values (1, &#39;primero&#39;)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SQL&amp;gt; insert into duplicados values (2, &#39;segundo&#39;)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SQL&amp;gt; insert into duplicados values (3, &#39;tercero&#39;)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Provocamos la duplicación de un registro:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SQL&amp;gt; insert into duplicados values (1, &#39;primero&#39;)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SQL&amp;gt; commit;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Bueno, como vemos tenemos un registro duplicado el cual podemos borrar de la siguiente manera:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SQL&amp;gt; delete from duplicados&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;   2 where rowid not in&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;   3 (select min(rowid)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;   4 from duplicados&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;   5 group by col1, col2);&lt;/b&gt;&lt;/div&gt;&lt;div&gt;   &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Para entender un poco lo que acabamos de hacer debemos prestar atención en el min(rowid), el cual de las dos filas duplicadas&lt;/div&gt;&lt;div&gt;solo va a borrar aquella con el menor rowid. Con esto nos aseguramos de borrar solo 1 de los 2 registros.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Para comprobar que ya no tenemos duplicados en la tabla ejecutamos el siguiente SELECT&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SQL&amp;gt; select *&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;   2 from duplicados&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;   3 group by col1, col2&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;   4 having count (*) &amp;gt; 1;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Espero les haya servido&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Saludos!&lt;/div&gt;&lt;div&gt;Gondalf&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/8633224942944397225/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/06/borrar-filas-duplicadas.html#comment-form' title='17 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/8633224942944397225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/8633224942944397225'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/06/borrar-filas-duplicadas.html' title='Borrar filas duplicadas'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-5487882912729188566</id><published>2011-06-16T13:44:00.000-07:00</published><updated>2011-06-16T13:48:08.860-07:00</updated><title type='text'>START WITH .... CONNECT BY</title><content type='html'>&lt;div&gt;Para poder recorrer estructuras en forma de árbol usamos esta clausula.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Para hacer un ejemplo sencillo, supongamos que tenemos una tabla cargada como un arbol de categorías, en donde una categoría posee un posible padre, el mismo marcado por la columna “parent_id”.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Para recorrer todo una rama empezando por su id podemos hacer lo siquiente:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SQL&amp;gt; SELECT *&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;      2  FROM categorías&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;      3  START WITH id = &lt;root de=&quot;&quot; la=&quot;&quot; rama=&quot;&quot;&gt;&lt;/root&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;      4  CONNECT BY PRIOR parent_id = id;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;  &lt;/div&gt;&lt;div&gt;Lo que marca la dirección en que va a ser recorriendo el “arbol” es la claúsula PRIOR.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Si quisiéramos recorrer al revés, es decir desde una hoja hasta la raíz, debemos hacer:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SQL&amp;gt; SELECT *&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;      2  FROM categorías&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;      3  START WITH id = &lt;id de=&quot;&quot; la=&quot;&quot; hoja=&quot;&quot;&gt;&lt;/id&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;      4  CONNECT BY parent_id = PRIOR id;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;  &lt;/div&gt;&lt;div&gt;A su vez, tenemos la pseudo-columna LEVEL, la cual nos brinda el “numero” de nivel en cual estamos, es decir que es un indicador de la profundidad del árbol en la cual nos encontramos (Oracle maneja hasta un nivel de profundidad de 255).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SQL&amp;gt; SELECT RPAD(&#39; &#39;, 2*(LEVEL-1)) || nombre&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;     2   FROM categorías&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;     3   START WITH parent_id IS NULL&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;     4   CONNECT BY PRIOR parent_id = id;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt; &lt;/div&gt;&lt;div&gt;Esto fue pantallazo general del tema pero sepan que existe mucho mas para investigar del START WITH y el CONNECT BY en Oracle&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Espero les haya servido.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Saludos!&lt;/div&gt;&lt;div&gt;Gondalf&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/5487882912729188566/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/06/start-with-connect-by.html#comment-form' title='5 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/5487882912729188566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/5487882912729188566'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/06/start-with-connect-by.html' title='START WITH .... CONNECT BY'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-5461323277333941746</id><published>2011-06-15T11:52:00.000-07:00</published><updated>2011-06-15T12:15:17.273-07:00</updated><title type='text'>Filas Encadenadas</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-top:6.0pt;margin-right:0in;margin-bottom:.05in; margin-left:0in;line-height:24.75pt;mso-outline-level:1&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(78, 78, 78); font-family: &#39;Segoe UI&#39;, sans-serif; font-size: 13px; line-height: 19px; &quot;&gt;Qué son????&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;Cuando el tamaño de una fila supere el tamaño de un bloque de la base de datos, puede generarse una migración o un encadenamiento de la fila.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;Cuando hablamos de filas migradas nos referimos a una fila que se mueve completa de un bloque a otro dejando en el bloque original un puntero.&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(78, 78, 78); font-family: &#39;Segoe UI&#39;, sans-serif; font-size: 13px; &quot;&gt;&lt;br /&gt;Cuando hablamos de filas encadenadas nos referimos a filas que requieren más de un bloque para su almacenamiento.&lt;br /&gt;&lt;br /&gt;Si nos encontramos en presencia de una tabla con gran cantidad de filas encadenadas o migradas quiere decir que la base de datos va a tener que realizar varias lecturas físicas para poder procesar los datos de una misma fila lógica.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;Como evitamos entonces el encadenamientos? Seteando un valor adecuado de pctfree en nuestra tabla.&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(78, 78, 78); font-family: &#39;Segoe UI&#39;, sans-serif; font-size: 13px; &quot;&gt;Otra solución es un expdp/impdp de las tablas en cuestion&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(78, 78, 78); font-family: &#39;Segoe UI&#39;, sans-serif; font-size: 13px; &quot;&gt;Si quisiéramos solucionar el problema de filas encadenadas debemos seguir los siguientes pasos:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;i style=&quot;mso-bidi-font-style:normal&quot;&gt;&lt;u&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;Paso 1:&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;Correr el script &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size: 10pt; font-family: &#39;Segoe UI&#39;, sans-serif; &quot; &gt;utlchain.sql&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;mso-bidi-font-size: 11.0pt;font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#333399;mso-ansi-language:ES-AR&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;el cual&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;mso-bidi-font-size:11.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#333399;mso-ansi-language:ES-AR&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;crea la tabla CHAINED_ROWS.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;i style=&quot;mso-bidi-font-style:normal&quot;&gt;&lt;u&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;Paso 2:&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(78, 78, 78); font-family: &#39;Segoe UI&#39;, sans-serif; font-size: 13px; &quot;&gt;Revisamos la/s tabla para ver si poseen filas encadenadas. De poseerlas se insertaran en la tabla CHAINED_ROWS.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;SQL&amp;gt; ANALYZE TABLE &lt;nuestra tabla=&quot;&quot;&gt; LIST CHAINED ROWS INTO chained_rows;&lt;/nuestra&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;i style=&quot;mso-bidi-font-style:normal&quot;&gt;&lt;u&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;Paso 3:&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(78, 78, 78); font-family: &#39;Segoe UI&#39;, sans-serif; font-size: 13px; &quot;&gt;Creamos una tabla auxiliar la cual llenaremos con las “filas duplicadas” de nuestra tabla&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;SQL&amp;gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;CREATE TABLE aux&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;AS&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;     2&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;SELECT * from &lt;nuestra tabla=&quot;&quot;&gt;&lt;br /&gt;&lt;/nuestra&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;     3 &lt;span style=&quot;mso-spacerun:yes&quot;&gt; &lt;/span&gt;WHERE rowid IN&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;     4&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;(SELECT head_rowid&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;     5&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;FROM chained_rows&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;     6&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;WHERE table_name = ‘nuestra tabla’);&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:9.6pt;line-height:14.25pt&quot;&gt;&lt;i style=&quot;mso-bidi-font-style:normal&quot;&gt;&lt;u&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;Paso 4:&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:9.6pt;line-height:14.25pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;Borramos las filas encadenadas de nuestra tabla&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;SQL&amp;gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;DELETE FROM &lt;nuestra table=&quot;&quot;&gt;&lt;br /&gt;&lt;/nuestra&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;     2&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;WHERE rowid IN &lt;span style=&quot;mso-spacerun:yes&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;     3&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;(SELECT head_rowid&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;     4&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;FROM chained_rows&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;     &lt;/span&gt;5&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;WHERE table_name = ‘nuestra tabla’);&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;i style=&quot;mso-bidi-font-style:normal&quot;&gt;&lt;u&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;Paso 5:&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:9.6pt;line-height:14.25pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;Volvemos a insertar las tablas antes encadenadas en nuestra tabla&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:9.6pt;line-height:14.25pt&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt;font-family: &amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:#4E4E4E&quot;&gt;SQL&amp;gt; INSERT INTO &lt;nuestra tabla=&quot;&quot;&gt; SELECT * FROM aux;&lt;o:p&gt;&lt;/o:p&gt;&lt;/nuestra&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:9.6pt;line-height:14.25pt&quot;&gt;&lt;i style=&quot;mso-bidi-font-style:normal&quot;&gt;&lt;u&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;Paso 6:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:9.6pt;line-height:14.25pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:10.0pt;font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:#4E4E4E;mso-ansi-language:ES-AR&quot;&gt;Realizar nuevamente la verificación para cerciorarse de que no queden filas encadenadas&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;SQL&amp;gt; DELETE CHAINED_ROWS WHERE table_name = &#39;nuestra tabla&#39;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;SQL&amp;gt; ANALYZE TABLE nombre_de_la_tabla&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;     &lt;/span&gt;2 &lt;span style=&quot;mso-spacerun:yes&quot;&gt; &lt;/span&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt; &lt;/span&gt;LIST CHAINED ROWS INTO chained_rows;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 14.25pt&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight:normal&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Segoe UI&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:#4E4E4E&quot;&gt;SQL&amp;gt; SELECT * FROM chained_rows WHERE table_name = &#39;nuestra tabla&#39;;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(78, 78, 78); font-family: &#39;Segoe UI&#39;, sans-serif; font-size: 13px; line-height: 19px; &quot;&gt;Espero les haya servido&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(78, 78, 78); font-family: &#39;Segoe UI&#39;, sans-serif; font-size: 13px; line-height: 19px; &quot;&gt;Saludos!&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(78, 78, 78); font-family: &#39;Segoe UI&#39;, sans-serif; font-size: 13px; line-height: 19px; &quot;&gt;Gondalf&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/5461323277333941746/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/06/filas-encadenadas.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/5461323277333941746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/5461323277333941746'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/06/filas-encadenadas.html' title='Filas Encadenadas'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-814874346152913367</id><published>2011-06-01T13:43:00.000-07:00</published><updated>2011-06-01T13:45:30.623-07:00</updated><title type='text'>Diferentes seteos del parametro AUDIT_TRAIL</title><content type='html'>Seteando este parámetro, una vez seteado debemos reiniciar la base, podemos comenzar a auditar objetos en nuestra base de datos.&lt;br /&gt;&lt;br /&gt;Los diferentes valores que le podemos setear son:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;- none:&lt;/b&gt;  Desactiva la auditoria en la base de datos.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;- os&lt;/b&gt;:  Activa la auditoria, dejando los registros de auditoría en un archivo en nuestro sistema operativo.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;- db:&lt;/b&gt;  Activa la auditoria, los registros de auditoría son escritos en nuestra base de datos. Mas precisamente en la tabla SYS.AUD$.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;- db,extended:&lt;/b&gt;  Activa la auditoria, dejando los registros de auditoría en nuestra base de datos. Mas precisamente en la tabla SYS.AUD$.&lt;br /&gt;Ademas, completa los campos SQLBIND and SQLTEXT de la tabla SYS.AUD$, cabe aclarar que dichos campos son del tipo CLOB.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;- xml:&lt;/b&gt;  Activa la auditoria, en donde los registros de auditoría son escritos en formato XML en un archivo en el sistema operativo&lt;br /&gt;&lt;br /&gt;&lt;b&gt;- xml,extended:&lt;/b&gt;  Igual a la opción anterior pero agregando los valores SQLBIND and SQLTEXT al archivo.&lt;br /&gt;&lt;br /&gt;Espero les haya servido.&lt;br /&gt;&lt;br /&gt;Saludos!&lt;br /&gt;Gondalf</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/814874346152913367/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/06/diferentes-seteos-del-parametro.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/814874346152913367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/814874346152913367'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/06/diferentes-seteos-del-parametro.html' title='Diferentes seteos del parametro AUDIT_TRAIL'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-7806441295323044748</id><published>2011-05-31T08:06:00.000-07:00</published><updated>2011-05-31T08:09:12.251-07:00</updated><title type='text'>ORA-00600:[qcsgpvc3], [], [], [], [], [], [], []</title><content type='html'>Si bien estamos en presencia de un un error 600 de oracle, no es nada por lo que debamos alarmarnos.&lt;br /&gt;&lt;br /&gt;Se trata de una compilación errónea de un package, por ejemplo, pasarle un argumento como parámetro cuyo nombre sea igual al de una columna de una tabla que se utilice en el mismo.&lt;br /&gt;&lt;br /&gt;La solución es tan simple como rever el package.&lt;br /&gt;&lt;br /&gt;Este error siempre viene de la mano de un trace en el cual podemos identificar la sesión, les copio un extracto de donde ubicar dicha sesión:&lt;br /&gt;&lt;b&gt;*** ACTION NAME:() 2011-05-30 17:38:14.816&lt;br /&gt;*** MODULE NAME:(TOAD 9) 2011-05-30 17:38:14.816&lt;br /&gt;*** SERVICE NAME:(xxxxx) 2011-05-30 17:38:14.816&lt;br /&gt;*** SESSION ID:(&lt;span class=&quot;Apple-style-span&quot; &gt;243&lt;/span&gt;.17186) 2011-05-30 17:38:14.816&lt;br /&gt;*** 2011-05-30 17:38:14.816&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Espero les haya servido.&lt;br /&gt;&lt;br /&gt;Saludos!&lt;br /&gt;Gondalf</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/7806441295323044748/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/05/ora-00600qcsgpvc3.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/7806441295323044748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/7806441295323044748'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/05/ora-00600qcsgpvc3.html' title='ORA-00600:[qcsgpvc3], [], [], [], [], [], [], []'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-1319726777881149163</id><published>2011-05-13T12:39:00.000-07:00</published><updated>2011-05-13T13:03:16.318-07:00</updated><title type='text'>Global Temporary Table</title><content type='html'>El comando &quot;create global temporary tables&quot; crea una tabla temporal para cada sesión. Eso significa que los datos no se comparten entre sesiones y&lt;br /&gt;se eliminan al final de la misma.&lt;br /&gt;Todos los usuarios que tengan permisos sobre la tabla podrán realizar operaciones DML sobre la misma.&lt;br /&gt;&lt;br /&gt;Existen 2 tipos de datos temporales de acuerdo al tipo de tabla temporal:&lt;br /&gt;&lt;br /&gt;- Datos con la duración de una transacción.&lt;br /&gt;- Datos con la duración de una sesión.&lt;br /&gt;&lt;br /&gt;Esto lo podemos hacer mediante las claúsulas:&lt;br /&gt;&lt;br /&gt;- ON COMMIT DELETE ROWS: las filas que se insertan en la tabla son removidas de la misma ante un COMMIT o un ROLLBACK.&lt;br /&gt;- ON COMMIT PRESERVE ROWS: las filas insertadas en la tabla permaneceran en la misma hasta que la sesion de usuario finalice.&lt;br /&gt;&lt;br /&gt;A modo de ejemplificar esta explicación, veamos un pequeño ejemplo&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; create global temporary table prueba ( id int) &lt;span class=&quot;Apple-style-span&quot;&gt;on commit delete rows;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;Table created.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; insert into prueba values (1);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;1 row created.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; insert into prueba values (2);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;1 row created.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; insert into prueba values (3);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;1 row created.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; select * from prueba;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;ID&lt;br /&gt;---------&lt;br /&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; commit;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;Commit complete.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; select * from prueba;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;no rows selected&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*****************/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; create global temporary table prueba2 ( id int) on commit preserve rows;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;Table created.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; insert into prueba2 values (1);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;1 row created.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; insert into prueba2 values (2);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;1 row created.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; insert into prueba2 values (3);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;1 row created.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; select count(1) from prueba;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt; COUNT(*)&lt;br /&gt;----------&lt;br /&gt;   153&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; commit;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;Commit complete.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;SQL&amp;gt; select * from prueba;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt; COUNT(*)&lt;br /&gt;----------&lt;br /&gt;   153&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Espero les haya servido.&lt;br /&gt;&lt;br /&gt;Saludos!&lt;br /&gt;Gondalf.</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/1319726777881149163/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/05/global-temporary-table.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/1319726777881149163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/1319726777881149163'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/05/global-temporary-table.html' title='Global Temporary Table'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-4304622674677261320</id><published>2011-05-06T12:46:00.000-07:00</published><updated>2011-05-06T12:56:50.199-07:00</updated><title type='text'>Convertir un LONG RAW a un VARCHAR</title><content type='html'>Para poder visualizar una columna LONG RAW o bien si la queremos comparar contra otro varchar, lo que podemos hacer es lo siguiente:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Paso 1:&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Creamos el paquete ULT_RAW, para debemos buscar su script de creacion en el direcotrio $ORACLE_HOME\rdbms\admin\.&lt;br /&gt;En este directorio vamos utilizar dos .sql, uno es utlraw.sql y el otro prvtrawb.plb&lt;br /&gt;&lt;br /&gt;Con estos scripts vamos a crear el paquete que nos va a permitir convertir nuestros LONG RAW&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;&lt;i&gt;SQL&amp;gt;&lt;/i&gt;&lt;/b&gt; @utlraw.sql&lt;br /&gt;&lt;br /&gt;Package created.&lt;br /&gt;&lt;br /&gt;No errors.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;SQL&amp;gt;&lt;/i&gt;&lt;/b&gt; @prvtrawb.plb&lt;br /&gt;&lt;br /&gt;Package body created.&lt;br /&gt;&lt;br /&gt;No errors.&lt;br /&gt;&lt;br /&gt;Synonym created.&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Paso 2:&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Ahora estamos en condiciones de realizar un mini-script el cual nos permita justamente ver/comparar nuestro dato&lt;br /&gt;&lt;br /&gt;&lt;i&gt;declare&lt;br /&gt;salida varchar(4000);&lt;br /&gt;var long raw;&lt;br /&gt;cursor cur1 is select &lt;span class=&quot;Apple-style-span&quot; &gt;&quot;columna tipo long raw&quot;&lt;/span&gt; from &lt;span class=&quot;Apple-style-span&quot; &gt;&quot;tabla&quot;&lt;/span&gt;;&lt;br /&gt;begin&lt;br /&gt;open cur1;&lt;br /&gt;loop&lt;br /&gt;fetch cur1 into var;&lt;br /&gt;exit when cur1%notfound;&lt;br /&gt;salida:=UTL_RAW.CAST_TO_VARCHAR2(var);&lt;br /&gt;dbms_output.put_line(salida);&lt;br /&gt;end loop;&lt;br /&gt;end;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;Debemos reemplazar solo &quot;columna tipo long raw&quot; y &quot;tabla&quot;, por el nombre de nuestra tabla y del campo a evaluar.&lt;br /&gt;&lt;br /&gt;Espero les haya servido&lt;br /&gt;&lt;br /&gt;Saludos!&lt;br /&gt;Gondalf.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/4304622674677261320/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/05/convertir-un-long-raw-un-varchar.html#comment-form' title='4 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/4304622674677261320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/4304622674677261320'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/05/convertir-un-long-raw-un-varchar.html' title='Convertir un LONG RAW a un VARCHAR'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-1253895600567243174</id><published>2011-03-30T13:08:00.000-07:00</published><updated>2011-03-30T13:41:59.035-07:00</updated><title type='text'>Table Partitioning</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;Las tablas particionadas son un feature el cual nos permite particionar una tabla siguiendo un determinado criterio.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;Por ejemplo imaginemos una tabla de facturas, en donde tenemos el detalle de nuestra facturación a lo largo de 5 años, 2005, 2006… 2009, si quisiéramos hacer:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;b&gt;SELECT SUM(precio) FROM facturación WHERE ano = 2006;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;En este ejempo se deberia recorrer toda la table (imaginemos que hablamos de 30 millones de registros en total,es mucho no?), por este motivo un criterio posible para particionar la tabla seria por el año de efectuada la fatura&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;Luego de esta pequeña intro, veamos algunos ejemplos:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size: 12pt; font-family: &#39;Times New Roman&#39;, serif; &quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;1-) Creación de tablas particionadas&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; &quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;mso-margin-top-alt:auto;margin-bottom:0in;margin-bottom: .0001pt;line-height:normal&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;CREATE TABLE facturacion (id number, precio number(10,2), ano (number 4))&lt;br /&gt;PARTITION BY RANGE (ano)&lt;br /&gt;PARTITION p1 VALUES LESS THAN (2007) TABLESPACE tab1,&lt;br /&gt;PARTITION p2 VALUES LESS THAN (2009) TABLESPACE tab2,&lt;br /&gt;PARTITION p3 VALUES LESS THAN (MAXVALUE) TABLESPACE tab3;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size: 12pt; font-family: &#39;Times New Roman&#39;, serif; &quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;Con este simple script creamos una tabla particionada con 3 particiones teniendo como criterio de separación el campo “ano”, todas estas particiones las estamos almacenando en tablespaces separados (aunque esto no es necesario es aconsejable)&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;Existen distintos tipos de “partition” pero lo vamos a dejar para otro post ya que la intención de este es que sea sencillo como para empezar a comprender el tema.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-outline-level:4&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size: 12pt; font-family: &#39;Times New Roman&#39;, serif; &quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;2-) Cambiar una tabla particionada &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;Podemos agregar una partición adicional a nuestra tabla particionada, para esto debemos utilizar la clausula SPLIT PARTITION &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt; Por ejemplo podemos agregar una partición a nuetra tabla de ejemplo:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;b&gt;ALTER TABLE facturacion ADD PARTITION p4 VALUES LESS THAR (2010); &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Arial Unicode MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; color:black&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;Cabe aclarar que podríamos determinar el tablespaces que almacenará la nueva partición.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size: 12pt; font-family: &#39;Times New Roman&#39;, serif; &quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;3-)  Eliminar particiones&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;b&gt;ALTER TABLE facturacion DROP PARTITION p2;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;En este caso si existiese un indice deberiamos hacerle un REBUILD.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;Tenemos otra forma para no rebuildear el índice y es:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;b&gt;ALTER TABLE facturacion DROP PARTITION p2 UPDATE GLOBAL INDEX;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size: 12pt; font-family: &#39;Times New Roman&#39;, serif; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;4-) &lt;i&gt;Unir particiones&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;Si quisieramos unir 2 o mas particiones debemos hacer lo siguiente&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;b&gt;ALTER TABLE facturacion MERGE PARTITION p2 AND p3 INTO PARTITION pnueva;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size: 12pt; font-family: &#39;Times New Roman&#39;, serif; &quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;5-) Modificar particiones&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;Para agregar o quitar valores de una particion utilizamos la clausula &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;MODIFY PARTITION …. &lt;span style=&quot;mso-spacerun:yes&quot;&gt; &lt;/span&gt;ADD/DROP VALUES&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;b&gt;ALTER TABLE nacionalidad MODIFY PARTITION sud ADD VALUES (‘ARGENTINA’, ‘PERU’);&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size: 12pt; font-family: &#39;Times New Roman&#39;, serif; &quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;6-) Separar particiones&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;Podemos separar una particion en una o mas particiones de la siguiente manera:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;&quot;&gt;ALTER TABLE facturacion SPLIT PARTITION p1 INTO&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;&quot;&gt;(PARTITION p11 VALUES LESS THAN (2006)&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;&quot;&gt;(PARTITION p11 VALUES LESS THAN (MINVALUE));&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; &quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;7-) Truncar una partición&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;b&gt;ALTER TALE facturacion TRUNCATE PARTITION p11;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;Espero les haya servido.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;Saludos!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt&quot;&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black&quot;&gt;Gondalf.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/1253895600567243174/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/03/table-partitioning.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/1253895600567243174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/1253895600567243174'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2011/03/table-partitioning.html' title='Table Partitioning'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-2465685909059790256</id><published>2010-12-02T12:32:00.000-08:00</published><updated>2010-12-02T12:40:52.921-08:00</updated><title type='text'>Claúsula SELECT INTO</title><content type='html'>&lt;p class=&quot;heading2&quot; style=&quot;margin-top:12.0pt;margin-right:0in;margin-bottom:12.0pt; margin-left:0in;page-break-after:avoid&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:Arial, sans-serif;font-size:13px;&quot;&gt;Se utiliza para almacenar lo que retorna el select en variables predefinidas.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;heading2&quot; style=&quot;margin-top:12.0pt;margin-right:0in;margin-bottom:12.0pt; margin-left:0in;page-break-after:avoid&quot;&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;font-family:&amp;quot;;font-size:10.0pt;&quot;&gt;A modo de ejemplo&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;SQL&gt; declare&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3333FF;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;var dual&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier; mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;.&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:black;&quot;&gt;dummy&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;%type;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;2&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;begin&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;3&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;select&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier; mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:black;&quot;&gt; dummy &lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;into&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:black;&quot;&gt; var&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;4&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;from&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier; mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:black;&quot;&gt; dual&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:Courier;font-size:13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3333FF;&quot;&gt;5&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;6&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;dbms_output.put_line(&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot; font-family:Courier;mso-bidi-mso-ansi-language: ES-ARfont-family:Courier;font-size:10.0pt;color:red;&quot;&gt;&#39;Name: &#39;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family: Courier;mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:black;&quot;&gt;||var&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;7&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;end;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;8&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;/&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:&#39;Courier New&#39;;font-size:100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:11px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ansi-language:ES-ARfont-family:&amp;quot;;font-size:10.0pt;color:black;&quot;&gt;En este caso lo que devuelve el select, es decir el valor de la columna “dummy”, va a parar a la variable de nombre “var” que fue definida con el tipo de dato dual.dummy%type, es decir que adopta el tipo de dato de la columna dummy de la tabla dual.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ansi-language:ES-ARfont-family:&amp;quot;;font-size:10.0pt;color:black;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ansi-language:ES-ARfont-family:&amp;quot;;font-size:10.0pt;color:black;&quot;&gt;Otra forma de utilizarlo es cuando se devuelve toda una fila, es decir:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;Courier New&amp;quot;;mso-ansi-language: ES-ARfont-family:&amp;quot;;font-size:8.0pt;color:black;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;SQL&gt; declare&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3333FF;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;var dual&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier; mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;%rowtype;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;2&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;begin&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;3&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;select&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier; mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:black;&quot;&gt; * &lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;into&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:black;&quot;&gt; var&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;4&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;from&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier; mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:black;&quot;&gt; dual&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:Courier;font-size:13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3333FF;&quot;&gt;5&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;6&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;dbms_output.put_line(&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot; font-family:Courier;mso-bidi-mso-ansi-language: ES-ARfont-family:Courier;font-size:10.0pt;color:red;&quot;&gt;&#39;Name: &#39;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family: Courier;mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:black;&quot;&gt;||var.dummy&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;7&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;end;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;8&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;/&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;Courier New&amp;quot;;mso-ansi-language: ES-ARfont-family:&amp;quot;;font-size:8.0pt;color:black;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ansi-language:ES-ARfont-family:&amp;quot;;font-size:10.0pt;color:black;&quot;&gt;En este caso, dentro de la variable var tenemos toda la fila devuelta por el select, y a cada campo de la fila que devolvió lo podemos acceder mediante &lt;nombre&gt;.&lt;nombre&gt;, como es el caso de var.dummy.&lt;o:p&gt;&lt;/o:p&gt;&lt;/nombre&gt;&lt;/nombre&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ansi-language:ES-ARfont-family:&amp;quot;;font-size:10.0pt;color:black;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ansi-language:ES-ARfont-family:&amp;quot;;font-size:10.0pt;color:black;&quot;&gt;Cabe aclarar que también podemos utilizar variables de los tipos de datos que nos provee la base, por ejemplo varchar2, integer, clob, etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ansi-language:ES-ARfont-family:&amp;quot;;font-size:10.0pt;color:black;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ansi-language:ES-ARfont-family:&amp;quot;;font-size:10.0pt;color:black;&quot;&gt;Aunque como estamos viendo con esta sentencia, solo podemos devolver una fila, lo que si podemos es devolver múltiples columnas y asignarlas a múltiples variables. &lt;/span&gt;&lt;span style=&quot; Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;font-family:&amp;quot;;font-size:10.0pt;color:black;&quot;&gt;Por ejemplo &lt;/span&gt;&lt;span style=&quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;font-family:&amp;quot;;font-size:8.0pt;color:black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span style=&quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;font-family:&amp;quot;;font-size:8.0pt;color:black;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-family:Courier;mso-bidi-font-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;SQL&gt; declare&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;1&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:black;&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;var1 prueba.columna1&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family: Courier;mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;%type;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;2&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier; mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:black;&quot;&gt;var2 prueba.columna2&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi-mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;%type;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;3&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;begin&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:Courier;mso-bidi-font-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;4&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;select&lt;/span&gt;&lt;span style=&quot; font-family:Courier;mso-bidi-font-family:Courier;font-size:10.0pt;color:black;&quot;&gt; columna1, columna2 &lt;/span&gt;&lt;span style=&quot;font-family:Courier;mso-bidi-font-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;into&lt;/span&gt;&lt;span style=&quot;font-family: Courier;mso-bidi-font-family:Courier;font-size:10.0pt;color:black;&quot;&gt; col1, col2&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:Courier;mso-bidi-font-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;5&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;from&lt;/span&gt;&lt;span style=&quot; font-family:Courier;mso-bidi-font-family:Courier;font-size:10.0pt;color:black;&quot;&gt; prueba&lt;/span&gt;&lt;span style=&quot;font-family:Courier;mso-bidi- font-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;6&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- mso-ansi-language:ES-ARfont-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;7 &lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;font-family:Courier;mso-bidi- font-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;&lt;span style=&quot;mso-spacerun:yes&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family:Courier;mso-bidi- font-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;dbms_output.put_line(&lt;/span&gt;&lt;span style=&quot; font-family:Courier;mso-bidi-font-family:Courier;font-size:10.0pt;color:red;&quot;&gt;&#39;Name: &#39;&lt;/span&gt;&lt;span style=&quot;font-family:Courier;mso-bidi- font-family:Courier;font-size:10.0pt;color:black;&quot;&gt;||var1||&lt;/span&gt;&lt;span style=&quot;font-family:Courier; mso-bidi-font-family:Courier;font-size:10.0pt;color:red;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span style=&quot; font-family:Courier;mso-bidi-font-family:Courier;font-size:10.0pt;color:black;&quot;&gt;||var2||&lt;/span&gt;&lt;span style=&quot;font-family:Courier;mso-bidi- font-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;8&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;end;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;9&lt;span style=&quot;mso-spacerun:yes&quot;&gt;  &lt;/span&gt;/&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;bodytext&quot; style=&quot;margin:0in;margin-bottom:.0001pt;text-align:justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:Arial, sans-serif;font-size:13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:Georgia, serif;font-size:180%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:17px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Si devolviésemos más de 1 fila en nuestro select, tendríamos el siguiente error:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;Courier New&amp;quot;;mso-ansi-language: ES-ARfont-family:&amp;quot;;font-size:8.0pt;color:black;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;font-family:Courier;mso-bidi-font-family:Courier;font-size:10.0pt;color:#0000F0;&quot;&gt;declare&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;*&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;ERROR at line 1:&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;ORA-01422: exact fetch returns more than requested number of rows&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;ORA-06512: at line 4&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;bodytext&quot; style=&quot;margin-top:0in;margin-right:0in;margin-bottom:0in; margin-left:.2in;margin-bottom:.0001pt;text-align:justify&quot;&gt;&lt;span style=&quot;font-size:13.0pt;color:black;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;bodytext&quot; style=&quot;margin:0in;margin-bottom:.0001pt;text-align:justify&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ansi-language:ES-ARfont-family:&amp;quot;;font-size:10.0pt;color:black;&quot;&gt;Otro posible error se presentaría en el caso de que nuestro select no devuelva filas&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;coderesults&quot; style=&quot;margin:0in;margin-bottom:.0001pt&quot;&gt;&lt;span style=&quot;Courier New&amp;quot;;font-family:&amp;quot;;font-size:8.0pt;color:black;&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;declare&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;*&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;ERROR at line 1:&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;ORA-01403: no data found&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  color: rgb(0, 0, 240); font-family:Courier;font-size:13px;&quot;&gt;ORA-06512: at line 4&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:Arial, sans-serif;font-size:13px;&quot;&gt;Cabe aclarar que ambos errores se puede salvar dentro de nuestro PL/SQL con la estructura “WHEN …. THEN”&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;bodytext&quot; style=&quot;margin-top:0in;margin-right:0in;margin-bottom:0in; margin-left:.2in;margin-bottom:.0001pt;text-align:justify&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-ansi-language:ES-ARfont-family:&amp;quot;;font-size:10.0pt;color:black;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;line-height:115%; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;; mso-ansi-language:ES-ARfont-family:&amp;quot;;font-size:10.0pt;color:black;&quot;&gt;Espero les haya servido&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-AR&quot;    style=&quot;line-height:115%; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;; mso-ansi-language:ES-ARfont-family:&amp;quot;;font-size:10.0pt;color:black;&quot;&gt;Saludos!&lt;br /&gt;Gondalf.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/2465685909059790256/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/12/clausula-select-into.html#comment-form' title='7 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/2465685909059790256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/2465685909059790256'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/12/clausula-select-into.html' title='Claúsula SELECT INTO'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-4959688295959596605</id><published>2010-10-15T12:12:00.000-07:00</published><updated>2010-10-15T12:16:38.820-07:00</updated><title type='text'>Library cache lock</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Este post si bien es cortito creo que es de bastante de utilidad.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Con los siguientes querys vamos a ser capaces de identificar las sesiones que están generando el evento “Library cache lock”&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal&quot;&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;SQL&gt; select saddr from v$session where sid in (select sid from v$session_wait where event like &#39;library cache lock&#39;);&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; line-height:normal&quot;&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Sesión Bloqueante&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; line-height:normal&quot;&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;SQL&gt; SELECT SID,USERNAME,TERMINAL,PROGRAM FROM V$SESSION&lt;br /&gt;2  WHERE SADDR in&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;3  (SELECT KGLLKSES FROM X$KGLLK LOCK_A&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;4  WHERE KGLLKREQ = 0&lt;br /&gt;5  AND EXISTS (SELECT LOCK_B.KGLLKHDL FROM X$KGLLK LOCK_B&lt;br /&gt;6  WHERE KGLLKSES = &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: red; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&#39;el saddr del primer query&#39;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; /* BLOCKED SESSION */&lt;br /&gt;7  AND LOCK_A.KGLLKHDL = LOCK_B.KGLLKHDL&lt;br /&gt;8  AND KGLLKREQ &gt; 0)&lt;br /&gt;9  );&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; line-height:normal&quot;&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Sesión Bloqueada&lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; line-height:normal&quot;&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;SQL&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;SELECT SID,USERNAME,TERMINAL,PROGRAM FROM V$SESSION&lt;br /&gt;2  WHERE SADDR in&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;3  (SELECT KGLLKSES FROM X$KGLLK LOCK_A&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;4  WHERE KGLLKREQ &gt; 0&lt;br /&gt;5  AND EXISTS (SELECT LOCK_B.KGLLKHDL FROM X$KGLLK LOCK_B&lt;br /&gt;6  WHERE KGLLKSES = &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: red; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&#39;el saddr del primer query&#39;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; /* BLOCKING SESSION */&lt;br /&gt;7  AND LOCK_A.KGLLKHDL = LOCK_B.KGLLKHDL&lt;br /&gt;8  AND KGLLKREQ = 0)&lt;br /&gt;9  );&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-size:12.0pt;font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; line-height:normal&quot;&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Espero les haya servido.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; line-height:normal&quot;&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Saludos!&lt;br /&gt;Gondalf.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; line-height:normal&quot;&gt;&lt;span style=&quot;font-family: Tahoma, sans-serif; color: black; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/4959688295959596605/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/10/library-cache-lock.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/4959688295959596605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/4959688295959596605'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/10/library-cache-lock.html' title='Library cache lock'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-43708174759221360</id><published>2010-09-27T12:36:00.000-07:00</published><updated>2010-10-15T12:18:46.610-07:00</updated><title type='text'>Insert sobre una columna CLOB</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;Paso &lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;1&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;  Creamos una tabla modo de prueba (que contenga una columna CLOB)&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;SQL&gt;&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;CREATE&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;TABLE&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt; prueba&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;    &lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;2&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;titulo &lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;VARCHAR2&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;40&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;),&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; author &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;VARCHAR2&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;),&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; texto &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;CLOB&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;Table&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; created&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;&lt;br /&gt;Paso &lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;2&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;  &lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;Realizamos el insert que queremos realizar, llamando a la función EMPTY_CLOB() la cual deja un &lt;i&gt;puntero&lt;/i&gt; vacio a un objeto CLOB.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;SQL&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;INSERT&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;INTO&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt; prueba &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;VALUES&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;&#39;Hobbit&#39;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;,&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;&#39;Tolkien&#39;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;,&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;EMPTY_CLOB&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;());&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; created&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;SQL&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;commit;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;Paso &lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;3&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; Updeteamos la columna CLOB utilizando PL/SQL&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:Courier;font-size:13px;&quot;&gt;DECLARE&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;my_text_handle &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;CLOB&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;my_buffer &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;VARCHAR2&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;32767&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;my_add_amt &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;NUMBER&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;:=&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;my_offset &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;INTEGER&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;:=&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;BEGIN&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;my_buffer &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;:=&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&#39;prueba con clob&#39;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;my_add_amt &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;:=&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; length&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;my_buffer&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; text&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;INTO&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; my_text_handle&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; prueba&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;WHERE&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; title &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&#39;Hobbit&#39;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;FOR&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;UPDATE;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;DBMS_LOB&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;.WRITE(&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;my_text_handle&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; my_add_amt&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; my_offset&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; my_buffer&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;COMMIT;&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;END;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;PL&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;/SQL&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;procedure&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; successfully completed&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;SQL&gt;&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;select&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt; texto &lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;from&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt; prueba&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:Courier;font-size:13px;&quot;&gt;TEXT&lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot;  ;font-family:Courier;font-size:10pt;&quot;&gt;-----------------------&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot; line-height: 115%;  font-family:Courier;font-size:10pt;&quot;&gt;Prueba con &lt;/span&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot; line-height: 115%;  font-family:Courier;font-size:10pt;&quot;&gt;clob&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot; line-height: 115%;  font-family:Courier;font-size:10pt;&quot;&gt;Espero les haya servido&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none&quot;&gt;&lt;span lang=&quot;ES-AR&quot;   style=&quot; line-height: 115%;  font-family:Courier;font-size:10pt;&quot;&gt;Saludos!&lt;br /&gt;Gondalf&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/43708174759221360/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/09/insert-sobre-una-columna-clob.html#comment-form' title='4 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/43708174759221360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/43708174759221360'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/09/insert-sobre-una-columna-clob.html' title='Insert sobre una columna CLOB'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-7113564154764890928</id><published>2010-09-16T07:48:00.000-07:00</published><updated>2010-09-16T07:53:39.014-07:00</updated><title type='text'>ORA-16826: apply service state is inconsistent with the DelayMins property</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt;Quería compartir con uds la solución a este particular error que se genera al utilizar Dataguard.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt;El origen del error está asociado a dos posibles causas:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;1-   El “Apply service” se levantó con la especificación de la opción “real time apply” o con la opción NODELAY siempre que el parámetro DelayMins es mayor a 0&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;2-   El “Apply service” se levantó sin la especificación de la opción “real time apply” o sin la opción NODELAY siempre que el parámetro DelayMins es 0&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt;Pues bien, sabiendo ahora como se origina el error podemos decir que la solución es bastante sencilla, lo único que necesitamos realizar es poner la configuración del dataguard bróker en el estado disable para luego hacer un reenable del mismo.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt;A continuación mostraremos los pasos a seguir:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366FF;&quot;&gt;Paso 1:&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt; Nos conecatamos al bróker&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;b&gt;testbd@serverTEST ]&lt;/b&gt; dgmgrl&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;DGMGRL for HPUX: Version 10.2.0.4.0 - 64bit Production&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;Copyright (c) 2000, 2005, Oracle. All rights reserved.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;Welcome to DGMGRL, type &quot;help&quot; for information.&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;b&gt;DGMGRL&gt;&lt;/b&gt; connect sys&lt;br /&gt;Password:&lt;br /&gt;Connected.&lt;br /&gt;&lt;b&gt;DGMGRL&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366FF;&quot;&gt;Paso 2:&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt; Ponemos en disable la configuración&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;b&gt;DGMGRL&gt;&lt;/b&gt; disable configuration&lt;br /&gt;Disabled.&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#3366FF;&quot;&gt;Paso 3:&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt; Ponemos en enable nuevamente la configuracion y el error desaparecerá&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot;&gt;&lt;b&gt;DGMGRL&gt;&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt; enable configuration&lt;br /&gt;Enabled.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt;&lt;br /&gt;En este momento cuando hagan un “show configuration” verán que el estado de la misma es SUCCESS.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;&lt;span lang=&quot;ES-AR&quot; style=&quot;mso-ansi-language:ES-AR&quot;&gt;Espero les haya servido&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt&quot;&gt;Saludos!&lt;br /&gt;Gondalf&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/7113564154764890928/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/09/ora-16826-apply-service-state-is.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/7113564154764890928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/7113564154764890928'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/09/ora-16826-apply-service-state-is.html' title='ORA-16826: apply service state is inconsistent with the DelayMins property'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-9164600397481072757</id><published>2010-08-20T11:28:00.000-07:00</published><updated>2010-08-20T11:33:07.838-07:00</updated><title type='text'>Creación de un SQL Tuning Advisor</title><content type='html'>&lt;div&gt;&lt;b&gt;==================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;= Eliminamos la tarea de tuning&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;==================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;exec  dbms_sqltune.drop_tuning_task(&#39;task1&#39;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;==================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;= Creamos la tarea de tuning&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;==================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;DECLARE&lt;/div&gt;&lt;div&gt;  tarea_tuning VARCHAR2(30);&lt;/div&gt;&lt;div&gt;  sql CLOB;&lt;/div&gt;&lt;div&gt;BEGIN&lt;/div&gt;&lt;div&gt;  sql := &#39;SELECT * from dual&#39;;&lt;/div&gt;&lt;div&gt;  tarea_tuning := DBMS_SQLTUNE.CREATE_TUNING_TASK(&lt;/div&gt;&lt;div&gt;  sql_text =&gt; sql,&lt;/div&gt;&lt;div&gt;  user_name =&gt; USER,&lt;/div&gt;&lt;div&gt;  scope =&gt; &#39;COMPREHENSIVE&#39;,&lt;/div&gt;&lt;div&gt;  time_limit =&gt; 60,&lt;/div&gt;&lt;div&gt;  task_name =&gt; &#39;task1&#39;,&lt;/div&gt;&lt;div&gt;  description =&gt; &#39;prueba de tarea de tuning&#39;);&lt;/div&gt;&lt;div&gt;END;&lt;/div&gt;&lt;div&gt;/&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;/* hay un parametro mas de bind_list */&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;==================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;= Verificamos que la tarea este creada&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;==================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT task_name FROM DBA_ADVISOR_LOG WHERE owner = USER;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;======================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;= Ejecutamos la tarea &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;======================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;BEGIN&lt;/div&gt;&lt;div&gt;  DBMS_SQLTUNE.EXECUTE_TUNING_TASK( task_name =&gt; &#39;task1&#39; );&lt;/div&gt;&lt;div&gt;END;&lt;/div&gt;&lt;div&gt;/&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;===================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;= Controlamos el estado de la tarea&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;===================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT task_id, status FROM USER_ADVISOR_TASKS WHERE task_name = &#39;task1&#39;;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;======================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;= Controlamos el progreso del SQL Tuning Advisor&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;======================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT sofar, totalwork  &lt;/div&gt;&lt;div&gt;FROM V$ADVISOR_PROGRESS  &lt;/div&gt;&lt;div&gt;WHERE task_id = (SELECT task_id FROM USER_ADVISOR_TASKS WHERE task_name = &#39;task1&#39;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;=====================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;= Mostramos el resultado del SQL Tuning Advisor&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;=====================================&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( &#39;task1&#39;) FROM DUAL;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/9164600397481072757/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/08/creacion-de-un-sql-tuning-advisor.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/9164600397481072757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/9164600397481072757'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/08/creacion-de-un-sql-tuning-advisor.html' title='Creación de un SQL Tuning Advisor'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-3158814357410110870</id><published>2010-08-20T06:55:00.000-07:00</published><updated>2010-08-20T07:14:20.369-07:00</updated><title type='text'>Numero del día</title><content type='html'>&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;ES-AR&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;A muchos les habrá pasado que de acuerdo a como se conecten a la base de datos, sea desde una terminal, desde el server, a través de un ODBC cambia la manera en que Oracle les devuelve el numero de día de una fecha en particular.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;  &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;Esto sucede ya que una terminal puede tomar otro NLS_LANG distinto al del servidor.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;A continuación vamos a ver como cambia el numero de día (por lo general se utiliza el domingo o el lunes como 1) de acuerdo al cambio de parámetro en el NLS_LANG&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt; &lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;ora1@test ] export NLS_LANG=&#39;AMERICAN&#39;;&lt;br /&gt;ora1@test ] sqlplus / as sysdba&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;SQL*Plus: Release 10.2.0.4.0 - Production on Mon Aug 20 10:35:15 2005&lt;br /&gt;Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;Connected to:&lt;br /&gt;Oracle9i Enterprise Edition Release 10.2.0.4.0 - Production&lt;br /&gt;With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options&lt;br /&gt;JServer Release 10.2.0.4.0 - Production&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;SQL&gt; select to_char(sysdate, &#39;D&#39;) from dual;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;T&lt;br /&gt;-&lt;br /&gt;2&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt; &lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;ora1@test ] export NLS_LANG=&#39;ENGLISH&#39;&lt;br /&gt;ora1@test ] sqlplus / as sysdba&lt;br /&gt;&lt;/span&gt; &lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.4.0 - Production on Mon Aug 20 10:40:43 2010&lt;br /&gt;Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;Connected to:&lt;br /&gt;Oracle10g Enterprise Edition Release 10.2.0.4.0 - Production&lt;br /&gt;With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options&lt;br /&gt;JServer Release 10.2.0.4.0 - Production&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;  &lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;SQL&gt; select to_char(sysdate, &#39;D&#39;) from dual;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;T&lt;br /&gt;-&lt;br /&gt;1&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;&lt;br /&gt;Espero les haya servido&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;Saludos!&lt;br /&gt;Gondalf.&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/3158814357410110870/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/08/numero-del-dia.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/3158814357410110870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/3158814357410110870'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/08/numero-del-dia.html' title='Numero del día'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7852128678850765532.post-5643240921592108761</id><published>2010-06-10T14:12:00.000-07:00</published><updated>2010-06-10T14:17:44.115-07:00</updated><title type='text'>Resultado de un query de varias filas concatenadas en una</title><content type='html'>La idea de este post es acercarles una función que quizás en algún momento les sea de utilidad.&lt;br /&gt;&lt;br /&gt;El propósito de la función es concatenar el resultado de un query que devolvió varias filas en solo 1,&lt;br /&gt;la función es la siguiente:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;CREATE OR REPLACE FUNCTION&lt;/strong&gt; concatfilas(qry IN VARCHAR2) RETURN VARCHAR2 IS&lt;br /&gt;filaFinal VARCHAR2(4000);&lt;br /&gt;result VARCHAR2(4000);&lt;br /&gt;cur sys_refcursor;&lt;br /&gt;BEGIN OPEN cur FOR qry;&lt;br /&gt;LOOP&lt;br /&gt;FETCH cur INTO result;&lt;br /&gt;EXIT WHEN cur%NOTFOUND;&lt;br /&gt;IF filaFinal IS NULL THEN&lt;br /&gt;filaFinal := resul;&lt;br /&gt;ELSE&lt;br /&gt;filaFinal := filaFinal &#39;,&#39; result;&lt;br /&gt;END IF;&lt;br /&gt;END LOOP;&lt;br /&gt;RETURN filaFinal;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;u&gt;Ejemplo&lt;/u&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; create table prueba (nombre varchar2(30));&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Table created.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; insert into prueba values(‘Luis’);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;1 row created.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; insert into prueba values(‘Bruno’);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;1 row created.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; insert into prueba values(‘Matias’);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;1 row created.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; insert into prueba values(‘Gonzalo’);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;1 row created.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; commit;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;1 row created.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;strong&gt;SQL&gt; select concatfilas(&#39;SELECT nombre FROM prueba&#39;) as nombres&lt;br /&gt;&lt;/strong&gt;2&lt;strong&gt; FROM dual;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;NOMBRES&lt;br /&gt;------------------------------------------------------------------&lt;br /&gt;Luis, Bruno, Matias, Gonzalo&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Espero les haya servido&lt;br /&gt;&lt;br /&gt;Saludos!&lt;br /&gt;Gondalf.&lt;br /&gt;&lt;br /&gt;&lt;/u&gt;&lt;/u&gt;&lt;u&gt;&lt;u&gt;&lt;/u&gt;&lt;/u&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracletipsencastellano.blogspot.com/feeds/5643240921592108761/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/06/resultado-de-un-query-de-varias-filas.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/5643240921592108761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7852128678850765532/posts/default/5643240921592108761'/><link rel='alternate' type='text/html' href='http://oracletipsencastellano.blogspot.com/2010/06/resultado-de-un-query-de-varias-filas.html' title='Resultado de un query de varias filas concatenadas en una'/><author><name>Gondalf</name><uri>http://www.blogger.com/profile/08833449795708787009</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>