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

<channel>
	<title>Weblog</title>
	<atom:link href="http://www.poveravoce.net/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.poveravoce.net/blog</link>
	<description>Weblog de conocimiento</description>
	<pubDate>Fri, 23 Jul 2010 10:19:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>LINUX: Montar una unidad samba (cifs) con permisos Read/Write</title>
		<link>http://www.poveravoce.net/blog/?p=156</link>
		<comments>http://www.poveravoce.net/blog/?p=156#comments</comments>
		<pubDate>Fri, 23 Jul 2010 10:11:53 +0000</pubDate>
		<dc:creator>josepcoves</dc:creator>
		
		<category><![CDATA[General]]></category>

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

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

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

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

		<guid isPermaLink="false">http://www.poveravoce.net/blog/?p=156</guid>
		<description><![CDATA[Existe un bug en la configuración de fstab al montar una unidad samba mediante cifs que no deja modificar los ficheros después de crearlos a pesar de especificar las directrices del manual.
Después de investigar un poco sobre el tema he encontrado la solución. Supondremos que estamos trabajando en un entorno windows y que queremos compartir [...]]]></description>
			<content:encoded><![CDATA[<p>Existe un bug en la configuración de fstab al montar una unidad samba mediante cifs que no deja modificar los ficheros después de crearlos a pesar de especificar las directrices del manual.</p>
<p>Después de investigar un poco sobre el tema he encontrado la solución. Supondremos que estamos trabajando en un entorno windows y que queremos compartir una carpeta en ese directorio windows accediendo mediante un usuario del active directory.</p>
<p>En primer lugar debermos crear un fichero con el nombre de usuario y password del active directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">gksu gedit <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.smbcredentials</pre></div></div>

<p>y lo llenamos con</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #007800;">username</span>=USUARIO_WINDOWS
<span style="color: #007800;">password</span>=PASSWORD_WINDOWS</pre></div></div>

<p>Después editamos el fichero fstab para que la unidad se monte automáticamente con los siguientes parámetros:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">gksu gedit <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab</pre></div></div>

<p>Y añadimos la línea:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">//</span>RUTA<span style="color: #000000; font-weight: bold;">/</span>SAMBA <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>DIRECTORIO_A_MONTAR cifs auto,<span style="color: #007800;">uid</span>=LINUXUSER,<span style="color: #007800;">gid</span>=LINUXGROUP,nocase,noperm,<span style="color: #007800;">file_mode</span>=0777,<span style="color: #007800;">dir_mode</span>=0777,<span style="color: #007800;">credentials</span>=<span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.smbcredentials 0 0</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.poveravoce.net/blog/?feed=rss2&amp;p=156</wfw:commentRss>
		</item>
		<item>
		<title>UBUNTU: Compartición de carpetas en red</title>
		<link>http://www.poveravoce.net/blog/?p=144</link>
		<comments>http://www.poveravoce.net/blog/?p=144#comments</comments>
		<pubDate>Thu, 22 Jul 2010 08:41:11 +0000</pubDate>
		<dc:creator>josepcoves</dc:creator>
		
		<category><![CDATA[General]]></category>

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

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

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

		<guid isPermaLink="false">http://www.poveravoce.net/blog/?p=144</guid>
		<description><![CDATA[

Para poder compartir carpetas en un entorno de red en linux debemos usar samba. Nos podemos encontrar con dos situaciones diferentes, que requieren pasos de configuración distintos.  En un primer caso explicaremos como compartir una carpeta del propio linux hacia el exterior y en el segundo caso hablaremos de cómo montar una unidad de red [...]]]></description>
			<content:encoded><![CDATA[<p style="padding-left: 30px; ">
<ul>
<li>Para poder compartir carpetas en un entorno de red en linux debemos usar samba. Nos podemos encontrar con dos situaciones diferentes, que requieren pasos de configuración distintos.  En un primer caso explicaremos como compartir una carpeta del propio linux hacia el exterior y en el segundo caso hablaremos de cómo montar una unidad de red externa como si fuera local en el propio linux.</li>
</ul>
<p><strong>Compartiendo una carpeta interna</strong></p>
<p>Crearemos una carpeta, y le asignaremos los permisos adecuados para que un usuario externo pueda escribir en ella:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>shared_folder
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>shared_folder</pre></div></div>

<p>Estamos asumiendo que hablamos de un entorno seguro (una red local de casa o de la oficina) en el caso que se quiera compartir públicamente sería necesario afinar un poco más este paso, asignando solamente los permisos necesarios.</p>
<p>Si compartimos la carpeta como está actualmente, los ficheros se guardarán como usuario root, con lo que nuestro usuario de SO no tendrá acceso a los ficheros que se dejen allí. Para ello, debemos especificar en el fichero de configuración samba con qué usuario y grupo queremos que se guarden los ficheros. Para ello editaremos el fichero:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">gksu gedit <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>samba<span style="color: #000000; font-weight: bold;">/</span>smb.conf</pre></div></div>

<p>y especificaremos los siguientes parámetros:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">security = share
create mask = 0775
security mask = 0775
force user = linuxosuser
force group = linuxosgroup</pre></div></div>

<p>A continuación, procederemos a compartir la carpeta (lo podemos hacer visualmente pulsando con el botón derecho del mouse y accediendo a Sharing), especificaremos el nombre del recurso de red que queremos asignar a la carpeta y guardaremos los cambios.</p>
<p>Después reiniciaremos samba y ya tendremos el share creado.</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>samba restart</pre></div></div>

<p>En el caso que queramos compartir la carpeta en una red windows es posible que queramos integrar la carpeta en el workgroup de windows y con el active directory para aprovechar la autenticación de los usuarios windows. Para ello deberíamos seguir los siguientes pasos:</p>
<ol></ol>
<ol></ol>
<ul>
<li>Instalar Likewiseopen (se encuentra en synaptic)</li>
<li>Seguir los pasos indicados en la guia (<span lang="EN-GB"><a href="http://www.ubuntu.com/system/files/AD_whitepaper_20090807.pdf">http://www.ubuntu.com/system/files/AD_whitepaper_20090807.pdf</a>)</span></li>
<li>Instalar winbind:</li>
</ul>
<ol>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> winbind</pre></div></div>

</ol>
<ul>
<li>Realizar los siguientes pasos de configuración (<a href="http://chrplunk.blogspot.com/2008/06/allow-windows-clients-in-active.html">http://chrplunk.blogspot.com/2008/06/allow-windows-clients-in-active.html</a>):</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>samba<span style="color: #000000; font-weight: bold;">/</span>idmap<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>likewise-open<span style="color: #000000; font-weight: bold;">/</span>idmap<span style="color: #000000; font-weight: bold;">/</span>lwopen.so
gksu gedit <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>samba<span style="color: #000000; font-weight: bold;">/</span>smb.conf</pre></div></div>

<ul>
<li>Añadir las siguientes lineas:</li>
</ul>
<ol></ol>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">security = ads
workgroup = WINDOWS_WORKGROUP
realm = WINDOWS_WORKGROUP.EXT
idmpa backend = lwopen
idmap uid = <span style="color: #000000;">50</span>-<span style="color: #000000;">9999999999</span>
idmap gid = <span style="color: #000000;">50</span>-<span style="color: #000000;">9999999999</span></pre></div></div>

<ul>
<li>Modificar los ficheros y reiniciar los servicios:</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>samba<span style="color: #000000; font-weight: bold;">/</span>secrets.tdb <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>samba<span style="color: #000000; font-weight: bold;">/</span>secrets.tdb.orig
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>samba<span style="color: #000000; font-weight: bold;">/</span>secrets.tdb <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>samba<span style="color: #000000; font-weight: bold;">/</span>secrets.tdb
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>samba restart
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>likewise-open restart
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>winbind restart</pre></div></div>

<li>A continuación seguimos los mismos pasos que antes para compartir la carpeta y ésta pedirá un login de un usuario del active directory.</li>
<div><strong>Montando una unidad de red (carpeta externa compartida)</strong></div>
<div>Uno de los problemas típicos es que al montar una unidad de red sobre una carpeta compartida externa es que no tengamos permisos para escribir ficheros en el destino o que una vez creados,  no podamos modificarlos ni borrarlos. Esto es debido a que se monta la unidad como usuario root y el usuario del S.O. linux no tiene permisos suficientes para modificarlos. Para ello, haremos que la unidad se monte como un usuario de windows creando un fichero de configuración al que apuntaremos desde fstab.</div>
<div>Creamos un fichero con el usuario de windows (asumimos que la carpeta compartida es en windows):</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">gksu gedit  <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.smbpasswd</pre></div></div>

<p>Añadimos las siguientes líneas al fichero vacío:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #007800;">username</span>=mywindowsusername
<span style="color: #007800;">password</span>=mywindowspassword</pre></div></div>

<div>Le damos los permisos necesarios:</div>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.smbpasswd</pre></div></div>

<div>Editamos el fichero fstab:</div>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">gksu gedit <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab</pre></div></div>

<div>Añadimos la línea:</div>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">//servername/sharename /mountdirectory cifs credentials=/root/.smbpasswd 0 0</pre></div></div>

</div>
<div>Y montamos la carpeta:</div>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>mountdirectory</pre></div></div>

<div>Más información en: <a href="http://www.justlinux.com/nhf/Filesystems/Mounting_smbfs_Shares_Permanently.html">http://www.justlinux.com/nhf/Filesystems/Mounting_smbfs_Shares_Permanently.html</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.poveravoce.net/blog/?feed=rss2&amp;p=144</wfw:commentRss>
		</item>
		<item>
		<title>SQLServer2005: Enlazar logins de instancia con logins de BD</title>
		<link>http://www.poveravoce.net/blog/?p=142</link>
		<comments>http://www.poveravoce.net/blog/?p=142#comments</comments>
		<pubDate>Wed, 10 Mar 2010 08:43:55 +0000</pubDate>
		<dc:creator>josepcoves</dc:creator>
		
		<category><![CDATA[BD]]></category>

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

		<category><![CDATA[administración]]></category>

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

		<guid isPermaLink="false">http://www.poveravoce.net/blog/?p=142</guid>
		<description><![CDATA[En SQL Server se tiene una capa doble de autenticación, por una parte se tienen los usuarios de instancia  (Security - Logins) y luego a nivel de BD tenemos otros logins (DB - &#60;DB_Name&#62; - Security - Users). Después de realizar un restore de base de datos, estos logins pueden quedar descoordinados con lo que [...]]]></description>
			<content:encoded><![CDATA[<p>En SQL Server se tiene una capa doble de autenticación, por una parte se tienen los usuarios de instancia  (Security - Logins) y luego a nivel de BD tenemos otros logins (DB - &lt;DB_Name&gt; - Security - Users). Después de realizar un restore de base de datos, estos logins pueden quedar descoordinados con lo que es necesario volver a enlazar los logins de instancia con los de BD. Para ello podemos usar la siguiente instrucción por cada usuario a enlazar (para ello se requiere una cuenta de administrador de BD):</p>

<div class="wp_syntax"><div class="code"><pre class="sql sql" style="font-family:monospace;">&nbsp;
<span style="color: #993333; font-weight: bold;">USE</span> DATABASE_NAME;
&nbsp;
GO
&nbsp;
EXEC sp_change_users_login <span style="color: #ff0000;">'Auto_Fix'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'username'</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span>;
&nbsp;
GO</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.poveravoce.net/blog/?feed=rss2&amp;p=142</wfw:commentRss>
		</item>
		<item>
		<title>SSIS Expresión: Como obtener un DT_STR con el formato de la fecha y hora de ejecución</title>
		<link>http://www.poveravoce.net/blog/?p=140</link>
		<comments>http://www.poveravoce.net/blog/?p=140#comments</comments>
		<pubDate>Tue, 02 Feb 2010 09:12:32 +0000</pubDate>
		<dc:creator>josepcoves</dc:creator>
		
		<category><![CDATA[BD]]></category>

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

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

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

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

		<category><![CDATA[Integration Services]]></category>

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

		<guid isPermaLink="false">http://www.poveravoce.net/blog/?p=140</guid>
		<description><![CDATA[La siguiente expresión nos permite obtener la fecha y la hora de ejecución de un package de SSIS.
Por ejemplo, si la fecha es 02/01/2010 10:09, la expresión devolverá el siguiente DT_STR:
&#8220;20100102_1009&#8243;.
Lo publico porqué no me ha parecido trivial el modo de conseguir obtener dos dígitos para todos los campos, pues la función DatePart solamente devuelve [...]]]></description>
			<content:encoded><![CDATA[<p>La siguiente expresión nos permite obtener la fecha y la hora de ejecución de un package de SSIS.</p>
<p>Por ejemplo, si la fecha es 02/01/2010 10:09, la expresión devolverá el siguiente DT_STR:</p>
<p>&#8220;20100102_1009&#8243;.</p>
<p>Lo publico porqué no me ha parecido trivial el modo de conseguir obtener dos dígitos para todos los campos, pues la función DatePart solamente devuelve un integer sin 0&#8217;s a la izquierda, para ello, usamos la función RIGHT, que nos añade los ceros faltantes. Esta función puede resultar muy útil para renombrar ficheros de carga con la fecha y hora de carga y guardarnos un histórico.</p>

<div class="wp_syntax"><div class="code"><pre class="visual" style="font-family:monospace;">(DT_STR, 4, 1252) Year( @[System::StartTime] ) +  right(&quot;0&quot;+(DT_STR, 4, 1252)  Month( @[System::StartTime] ),2) +  right(&quot;0&quot;+(DT_STR, 4, 1252)  Day ( @[System::StartTime] ),2) +&quot;_&quot;+  right(&quot;0&quot;+(DT_STR, 2, 1252)  Datepart (&quot;hh&quot;, @[System::StartTime] ),2) +  right(&quot;0&quot;+(DT_STR, 2, 1252)  Datepart (&quot;mi&quot;, @[System::StartTime] ),2)</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.poveravoce.net/blog/?feed=rss2&amp;p=140</wfw:commentRss>
		</item>
		<item>
		<title>Stored Procedure SQL Server generador de fechas</title>
		<link>http://www.poveravoce.net/blog/?p=134</link>
		<comments>http://www.poveravoce.net/blog/?p=134#comments</comments>
		<pubDate>Fri, 04 Dec 2009 11:23:50 +0000</pubDate>
		<dc:creator>josepcoves</dc:creator>
		
		<category><![CDATA[General]]></category>

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

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

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

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

		<category><![CDATA[Stored Procedures]]></category>

		<guid isPermaLink="false">http://www.poveravoce.net/blog/?p=134</guid>
		<description><![CDATA[El siguiente Stored Procedure nos sirve para generar fechas hasta la fecha actual. Útil para rellenar una tabla de dimensión fecha (DIM_FECHA)  con los campos:
id_data: idenfitificador de la fecha en integer (ejp: 20091001)

date: fecha en sql
dia: dia en integer
dia_text: texto del dia (ejp: Sábado)
mes: mes en integer
mes_text: mes en texto (Marzo)
anyo: año en integer
periode: [...]]]></description>
			<content:encoded><![CDATA[<p>El siguiente Stored Procedure nos sirve para generar fechas hasta la fecha actual. Útil para rellenar una tabla de dimensión fecha (DIM_FECHA)  con los campos:</p>
<p>id_data: idenfitificador de la fecha en integer (ejp: 20091001)</p>
<ul>
<li><strong>date:</strong> fecha en sql</li>
<li><strong>dia:</strong> dia en integer</li>
<li><strong>dia_text</strong>: texto del dia (ejp: Sábado)</li>
<li><strong>mes:</strong> mes en integer</li>
<li><strong>mes_text: </strong>mes en texto (Marzo)</li>
<li><strong>anyo: </strong>año en integer</li>
<li><strong>periode</strong>: período en integer (ejp: 200910)</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> PROCEDURE generar_dim_fecha
&nbsp;
<span style="color: #993333; font-weight: bold;">AS</span>
&nbsp;
BEGIN
&nbsp;
<span style="color: #993333; font-weight: bold;">SET</span> NOCOUNT <span style="color: #993333; font-weight: bold;">ON</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">SET</span> XACT_ABORT <span style="color: #993333; font-weight: bold;">ON</span>
&nbsp;
declare @Date smalldatetime<span style="color: #66cc66;">,</span>
&nbsp;
@i int<span style="color: #66cc66;">,</span>
@id_data int<span style="color: #66cc66;">,</span>
@id_data_text varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
@dia int<span style="color: #66cc66;">,</span>
@dia_setmana int<span style="color: #66cc66;">,</span>
@dia_text varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
@mes int<span style="color: #66cc66;">,</span>
@mes_text varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
@anyo int<span style="color: #66cc66;">,</span>
@periode int<span style="color: #66cc66;">,</span>
@max_data_bd smalldatetime
&nbsp;
<span style="color: #993333; font-weight: bold;">SELECT</span> @max_data_bd <span style="color: #66cc66;">=</span> isnull<span style="color: #66cc66;">&#40;</span>max<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">DATA</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'2008-01-01'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> DIM_FECHA
&nbsp;
<span style="color: #993333; font-weight: bold;">SET</span> @Date <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'2008-01-01'</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">IF</span> @max_data_bd &amp;gt; @Date <span style="color: #993333; font-weight: bold;">SET</span> @Date <span style="color: #66cc66;">=</span> dateadd<span style="color: #66cc66;">&#40;</span>d<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span>@max_data_bd<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">SET</span> @i <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span>
&nbsp;
while @date &amp;lt;<span style="color: #66cc66;">=</span> getDate<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
begin
&nbsp;
<span style="color: #993333; font-weight: bold;">SET</span> @id_data_text <span style="color: #66cc66;">=</span> CONVERT<span style="color: #66cc66;">&#40;</span>varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> @date<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">112</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">SET</span> @periode <span style="color: #66cc66;">=</span> SUBSTRING<span style="color: #66cc66;">&#40;</span>@id_data_text<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
 <span style="color: #993333; font-weight: bold;">SET</span> @id_data <span style="color: #66cc66;">=</span> CONVERT<span style="color: #66cc66;">&#40;</span>varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> @date<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">112</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">SET</span> @dia <span style="color: #66cc66;">=</span> SUBSTRING<span style="color: #66cc66;">&#40;</span> @id_data_text<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">7</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
 <span style="color: #993333; font-weight: bold;">SET</span> @mes <span style="color: #66cc66;">=</span> SUBSTRING<span style="color: #66cc66;">&#40;</span> @id_data_text<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
 <span style="color: #993333; font-weight: bold;">SET</span> @anyo <span style="color: #66cc66;">=</span> SUBSTRING<span style="color: #66cc66;">&#40;</span> @id_data_text<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">SET</span> @dia_setmana <span style="color: #66cc66;">=</span> DATEPART <span style="color: #66cc66;">&#40;</span> dw <span style="color: #66cc66;">,</span>@date<span style="color: #66cc66;">&#41;</span>
&nbsp;
 <span style="color: #993333; font-weight: bold;">SET</span> @dia_text <span style="color: #66cc66;">=</span>
&nbsp;
CASE 
&nbsp;
WHEN @dia_setmana <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span> THEN <span style="color: #ff0000;">'Domingo'</span>
&nbsp;
WHEN @dia_setmana <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">2</span> THEN <span style="color: #ff0000;">'Lunes'</span>
&nbsp;
WHEN @dia_setmana <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">3</span> THEN <span style="color: #ff0000;">'Martes'</span>
&nbsp;
WHEN @dia_setmana <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">4</span> THEN <span style="color: #ff0000;">'Miércoles'</span>
&nbsp;
WHEN @dia_setmana <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">5</span> THEN <span style="color: #ff0000;">'Jueves'</span>
&nbsp;
WHEN @dia_setmana <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">6</span> THEN <span style="color: #ff0000;">'Viernes'</span>
&nbsp;
WHEN @dia_setmana <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">7</span> THEN <span style="color: #ff0000;">'Sábado'</span>
&nbsp;
 END
&nbsp;
<span style="color: #993333; font-weight: bold;">SET</span> @mes_text <span style="color: #66cc66;">=</span>
&nbsp;
CASE
&nbsp;
WHEN @mes <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span> THEN <span style="color: #ff0000;">'Enero'</span>
&nbsp;
WHEN @mes <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">2</span> THEN <span style="color: #ff0000;">'Febrero'</span>
&nbsp;
WHEN @mes <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">3</span> THEN <span style="color: #ff0000;">'Marzo'</span>
&nbsp;
WHEN @mes <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">4</span> THEN <span style="color: #ff0000;">'Abril'</span>
&nbsp;
WHEN @mes <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">5</span> THEN <span style="color: #ff0000;">'Mayo'</span>
&nbsp;
WHEN @mes <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">6</span> THEN <span style="color: #ff0000;">'Junio'</span>
&nbsp;
WHEN @mes <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">7</span> THEN <span style="color: #ff0000;">'Julio'</span>
&nbsp;
WHEN @mes <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">8</span> THEN <span style="color: #ff0000;">'Agosto'</span>
&nbsp;
WHEN @mes <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">9</span> THEN <span style="color: #ff0000;">'Septiembre'</span>
&nbsp;
WHEN @mes <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">10</span> THEN <span style="color: #ff0000;">'Octubre'</span>
&nbsp;
WHEN @mes <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">11</span> THEN <span style="color: #ff0000;">'Novembre'</span>
&nbsp;
WHEN @mes <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">12</span> THEN <span style="color: #ff0000;">'Desembre'</span>
&nbsp;
END
&nbsp;
<span style="color: #808080; font-style: italic;">/*PRINT @id_data
&nbsp;
PRINT @dia
&nbsp;
PRINT @dia_setmana
&nbsp;
PRINT @dia_text
&nbsp;
PRINT @mes
&nbsp;
PRINT @mes_text
&nbsp;
PRINT @anyo
&nbsp;
PRINT @periode*/</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">INSERT</span> DIM_FECHA
&nbsp;
 <span style="color: #66cc66;">&#40;</span>id_data<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">DATA</span><span style="color: #66cc66;">,</span> dia<span style="color: #66cc66;">,</span>dia_text<span style="color: #66cc66;">,</span>mes<span style="color: #66cc66;">,</span>mes_text<span style="color: #66cc66;">,</span>anyo<span style="color: #66cc66;">,</span>periode<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>@id_data<span style="color: #66cc66;">,</span>@date<span style="color: #66cc66;">,</span>@dia<span style="color: #66cc66;">,</span> @dia_text<span style="color: #66cc66;">,</span> @mes<span style="color: #66cc66;">,</span> @mes_text<span style="color: #66cc66;">,</span> @anyo<span style="color: #66cc66;">,</span> @periode<span style="color: #66cc66;">&#41;</span>
&nbsp;
 <span style="color: #993333; font-weight: bold;">SET</span> @i <span style="color: #66cc66;">=</span> @i <span style="color: #66cc66;">+</span> <span style="color: #cc66cc;">1</span>
&nbsp;
 <span style="color: #993333; font-weight: bold;">SET</span> @Date <span style="color: #66cc66;">=</span> DateAdd<span style="color: #66cc66;">&#40;</span>d<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> @Date<span style="color: #66cc66;">&#41;</span>
&nbsp;
end
&nbsp;
END</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.poveravoce.net/blog/?feed=rss2&amp;p=134</wfw:commentRss>
		</item>
		<item>
		<title>JavaScript para emular radiobutton con checkboxes</title>
		<link>http://www.poveravoce.net/blog/?p=130</link>
		<comments>http://www.poveravoce.net/blog/?p=130#comments</comments>
		<pubDate>Tue, 17 Nov 2009 13:00:25 +0000</pubDate>
		<dc:creator>josepcoves</dc:creator>
		
		<category><![CDATA[javascript]]></category>

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

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

		<guid isPermaLink="false">http://www.poveravoce.net/blog/?p=130</guid>
		<description><![CDATA[Para hacer que todos los checkboxes de una página en concreto se comporten como un radiobutton (que solamente se muestre uno activo en cada momento). Podemos usar el siguiente Javascript:

function set_change&#40;a&#41; &#123;
     if &#40;a.checked==true&#41;&#123;       
       var inputs = document.getElementsByTagName&#40;'input'&#41;;
 [...]]]></description>
			<content:encoded><![CDATA[<p>Para hacer que todos los checkboxes de una página en concreto se comporten como un radiobutton (que solamente se muestre uno activo en cada momento). Podemos usar el siguiente Javascript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> set_change<span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>a.<span style="color: #660066;">checked</span><span style="color: #339933;">==</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>       
       <span style="color: #003366; font-weight: bold;">var</span> inputs <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span>;
       <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span>0; i<span style="color: #339933;">&lt;</span>inputs.<span style="color: #660066;">length</span>; i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
         <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>inputs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'type'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #3366CC;">'checkbox'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
           <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>inputs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">!=</span>a<span style="color: #009900;">&#41;</span>
             inputs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">checked</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span>;
         <span style="color: #009900;">&#125;</span>
       <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Para ello solamente tendremos que informar la acción onclick de cada elemento checkbox que queramos que se comporte así:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">  &lt;input type=&quot;checkbox&quot; name=&quot;Chk1&quot; onclick=&quot;set_change(this)&quot;&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.poveravoce.net/blog/?feed=rss2&amp;p=130</wfw:commentRss>
		</item>
		<item>
		<title>APEX 3.1 y 3.2 solución al bug de &#8220;Post Element Text&#8221; en checkboxes, popup lovs, etc. + Ejemplo de eliminar valor en Popup Lov</title>
		<link>http://www.poveravoce.net/blog/?p=119</link>
		<comments>http://www.poveravoce.net/blog/?p=119#comments</comments>
		<pubDate>Tue, 14 Jul 2009 11:32:23 +0000</pubDate>
		<dc:creator>josepcoves</dc:creator>
		
		<category><![CDATA[APEX]]></category>

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

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

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

		<guid isPermaLink="false">http://www.poveravoce.net/blog/?p=119</guid>
		<description><![CDATA[A partir de la versión de APEX 3.1 si añadimos un texto en la casilla &#8220;Post Element&#8221; en ciertos elementos (checkboxes, popup lovs, etc.) veremos que el texto aparece debajo del elemento en lugar de aparecer a la derecha del elemento.
Esto es debido a un error en la especificación del CSS que define el fieldset. [...]]]></description>
			<content:encoded><![CDATA[<p>A partir de la versión de APEX 3.1 si añadimos un texto en la casilla &#8220;Post Element&#8221; en ciertos elementos (checkboxes, popup lovs, etc.) veremos que el texto aparece debajo del elemento en lugar de aparecer a la derecha del elemento.</p>
<p>Esto es debido a un error en la especificación del CSS que define el fieldset. A partir de APEX 3.1 se ha cambiado la declaración de la clase del CSS. Según los de APEX esto no se cambiará de momento. Aquí va un workaround.</p>
<p>Voy a partir de un ejemplo en concreto (con el que me encontré el problema) vamos a añadir un icono para eliminar el valor de una Popup LOV. Para ello podemos añadir el siguiente código en el Post Element Text:</p>

<div class="wp_syntax"><div class="code"><pre class="htmlcss" style="font-family:monospace;">&lt;img onclick=&quot;document.getElementById('#CURRENT_ITEM_NAME#_HIDDENVALUE').value='';
document.getElementById('#CURRENT_ITEM_NAME#').value=''&quot; src=&quot;#IMAGE_PREFIX#delete.gif&quot; alt=&quot;&quot; /&gt;</pre></div></div>

<p>Esto añadirá un icono con una X al lado del Popup-lov que nos permitirá eliminar el valor seleccionado. Si usamos APEX &gt; 3.0 veremos como esta X aparece debajo del elemento en lugar de la derecha. Aquí esta el problema del CSS que he comentado. Para ello, debemos redeclarar la clase &#8220;lov&#8221;.</p>
<p>Añadimos el siguiente código en el HTML header de la página en concreto:</p>

<div class="wp_syntax"><div class="code"><pre class="css css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
<span style="color: #6666ff;">.lov</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">inline</span>;
<span style="color: #000000; font-weight: bold;">vertical-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">baseline</span>;
<span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>Como veremos no quedará perfectamente alineado. Para ello podemos hacer una pequeña trampa y modifcar el Post Element Text y encapsular el código dentro de un SPAN con vertical-alignment:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;span style=&quot;vertical-align: middle;&quot;&gt;
&nbsp;
&lt;img onclick=&quot;document.getElementById('#CURRENT_ITEM_NAME#_HIDDENVALUE').value='';
document.getElementById('#CURRENT_ITEM_NAME#').value=''&quot; src=&quot;#IMAGE_PREFIX#delete.gif&quot; alt=&quot;&quot; /&gt;;
&nbsp;
&lt;/span&gt;</pre></div></div>

<p>Más información en el post del foro de APEX:</p>
<p><a href="http://forums.oracle.com/forums/thread.jspa?threadID=659658&amp;start=0&amp;tstart=0">http://forums.oracle.com/forums/thread.jspa?threadID=659658&amp;start=0&amp;tstart=0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poveravoce.net/blog/?feed=rss2&amp;p=119</wfw:commentRss>
		</item>
		<item>
		<title>Montar una unidad SAMBA con fstab en Ubuntu</title>
		<link>http://www.poveravoce.net/blog/?p=114</link>
		<comments>http://www.poveravoce.net/blog/?p=114#comments</comments>
		<pubDate>Wed, 01 Apr 2009 10:17:30 +0000</pubDate>
		<dc:creator>josepcoves</dc:creator>
		
		<category><![CDATA[samba]]></category>

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

		<category><![CDATA[montar unidad de red]]></category>

		<guid isPermaLink="false">http://www.poveravoce.net/blog/?p=114</guid>
		<description><![CDATA[Para montar automáticamente una unidad de red (nombre equivalente en windows) en Ubuntu debemos editar el fichero /etc/fstab:

$ gksu gedit /etc/fstab


//servidor/unidad /media/directorio_destino cifs    auto,user=username,password=password,noexec,user,rw,nounix,iocharset=utf8    0    0

Debemos rellenar los campos username y password en el caso que querramos acceder medianto contraseña, por el contrario borramos las entradas. Es importante notar que para que la codificación de [...]]]></description>
			<content:encoded><![CDATA[<p>Para montar automáticamente una unidad de red (nombre equivalente en windows) en Ubuntu debemos editar el fichero /etc/fstab:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">$ gksu gedit <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">//</span>servidor<span style="color: #000000; font-weight: bold;">/</span>unidad <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>directorio_destino cifs    auto,<span style="color: #007800;">user</span>=username,<span style="color: #007800;">password</span>=password,noexec,user,rw,nounix,<span style="color: #007800;">iocharset</span>=utf8    0    0</pre></div></div>

<p>Debemos rellenar los campos username y password en el caso que querramos acceder medianto contraseña, por el contrario borramos las entradas. Es importante notar que para que la codificación de caracteres se muestre correctamente (al menos para Español) hay que añadir la opción  <strong>iocharset=utf8</strong></p>
<p>En el caso que se produzcan cuelgues cuando no se esté conectado a la red podemos cambiar el <strong>auto </strong>por <strong>noauto </strong>y montar manualmente las unidades con el comando mount cuando sea necesario.</p>
<p>Espero que os sirva!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.poveravoce.net/blog/?feed=rss2&amp;p=114</wfw:commentRss>
		</item>
		<item>
		<title>ORACLE: Importar CLOBS</title>
		<link>http://www.poveravoce.net/blog/?p=108</link>
		<comments>http://www.poveravoce.net/blog/?p=108#comments</comments>
		<pubDate>Sun, 11 Jan 2009 19:08:11 +0000</pubDate>
		<dc:creator>josepcoves</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

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

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

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

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

		<guid isPermaLink="false">http://www.poveravoce.net/blog/?p=108</guid>
		<description><![CDATA[¿Cómo importar CLOBS en Oracle?
Si probamos de hacer un export desde el SQLDeveloper, veremos que solamente podemos exportar la estructura de la tabla sin poder volver a recrear el contenido del CLOB. Seguramente una vez llegados a este punto, decidamos realizar un export mediante las utilidades EXP/IMP. Si intentamos esto nos encontraremos con la sorpresa [...]]]></description>
			<content:encoded><![CDATA[<p><strong>¿Cómo importar CLOBS en Oracle?</strong></p>
<p>Si probamos de hacer un export desde el SQLDeveloper, veremos que solamente podemos exportar la estructura de la tabla sin poder volver a recrear el contenido del CLOB. Seguramente una vez llegados a este punto, decidamos realizar un export mediante las utilidades EXP/IMP. Si intentamos esto nos encontraremos con la sorpresa que para poder recrear la tabla, si no tenemos el mismo TABLESPACE creado en la BD destino no nos dejará crear la tabla dándonos el siguiente error:</p>
<pre>ORA-00959: tablespace 'XXXXX' does not exist</pre>
<p>Después de darle varias vueltas he encontrado una solución y es la siguiente:</p>
<p>1) Hacer export mediante comando EXP, por ejemplo:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">EXP schema_origen<span style="color: #000000; font-weight: bold;">/</span>pass <span style="color: #007800;">OWNER</span>=schema_orgien <span style="color: #007800;">FILE</span>=file_destino.dmp <span style="color: #007800;">DIRECT</span>=Y <span style="color: #007800;">ROWS</span>=Y <span style="color: #007800;">LOG</span>=file.log</pre></div></div>

<p>2) Crear la estructura de la tabla mediante DDL:</p>

<div class="wp_syntax"><div class="code"><pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> tabla <span style="color: #66cc66;">&#40;</span>col1 tipo<span style="color: #66cc66;">,</span> <span style="color: #66cc66;">....</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Nota: La estructura debe ser la misma que en la de la tabla en el export</p>
<p>3) Realizar un import con el flag IGNORE=Y</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">IMP <span style="color: #007800;">USERID</span>=schema_destino<span style="color: #000000; font-weight: bold;">/</span>pass <span style="color: #007800;">FROMUSER</span>=schema_origen<span style="color: #000000; font-weight: bold;">/</span>pass <span style="color: #007800;">TOUSER</span>=schema_destino <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">file</span></span>=file_destino.dmp <span style="color: #007800;">LOG</span>=file_import.log <span style="color: #007800;">TABLES</span>=nombre_tabla <span style="color: #007800;">IGNORE</span>=Y</pre></div></div>

<p>Fuente de la notícia con la explicación técnica detallada:</p>
<p><a title="AskTOM" href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:66890284723848" target="_blank">http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:66890284723848</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poveravoce.net/blog/?feed=rss2&amp;p=108</wfw:commentRss>
		</item>
		<item>
		<title>Mi xorg.conf</title>
		<link>http://www.poveravoce.net/blog/?p=103</link>
		<comments>http://www.poveravoce.net/blog/?p=103#comments</comments>
		<pubDate>Sun, 28 Dec 2008 11:48:01 +0000</pubDate>
		<dc:creator>josepcoves</dc:creator>
		
		<category><![CDATA[linux]]></category>

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

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

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

		<guid isPermaLink="false">http://www.poveravoce.net/blog/?p=103</guid>
		<description><![CDATA[Hola, posteo mi xorg.conf después de haberlo configurado durante meses. Entre ellos he conseguido solucionar los problemas relacionados con Compiz y los problemas de vídeo, los problemas de segmentation fault por culpa del display, etc.
El fichero está configurado para la última versión del driver de ATI 8.12 (aceleradora HD 3400) y portátil vaio FW11M.

&#160;
# xorg.conf [...]]]></description>
			<content:encoded><![CDATA[<p>Hola, posteo mi xorg.conf después de haberlo configurado durante meses. Entre ellos he conseguido solucionar los problemas relacionados con Compiz y los problemas de vídeo, los problemas de segmentation fault por culpa del display, etc.</p>
<p>El fichero está configurado para la última versión del driver de ATI 8.12 (aceleradora HD 3400) y portátil vaio FW11M.</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;"># xorg.conf (X.Org X Window System server configuration file)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This file was generated by dexconf, the Debian X Configuration tool, using</span>
<span style="color: #666666; font-style: italic;"># values from the debconf database.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Edit this file with caution, and see the xorg.conf manual page.</span>
<span style="color: #666666; font-style: italic;"># (Type &quot;man xorg.conf&quot; at the shell prompt.)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This file is automatically updated on xserver-xorg package upgrades *only*</span>
<span style="color: #666666; font-style: italic;"># if it has not been modified since the last upgrade of the xserver-xorg</span>
<span style="color: #666666; font-style: italic;"># package.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># If you have edited this file but would like it to be automatically updated</span>
<span style="color: #666666; font-style: italic;"># again, run the following command:</span>
<span style="color: #666666; font-style: italic;">#   sudo dpkg-reconfigure -phigh xserver-xorg</span>
&nbsp;
Section <span style="color: #ff0000;">&quot;ServerLayout&quot;</span>
	Identifier     <span style="color: #ff0000;">&quot;Default Layout&quot;</span>
	Screen      0  <span style="color: #ff0000;">&quot;Default Screen&quot;</span> 0 0
	InputDevice    <span style="color: #ff0000;">&quot;Synaptics Touchpad&quot;</span>
EndSection
&nbsp;
Section <span style="color: #ff0000;">&quot;Files&quot;</span>
EndSection
&nbsp;
Section <span style="color: #ff0000;">&quot;Module&quot;</span>
EndSection
&nbsp;
Section <span style="color: #ff0000;">&quot;ServerFlags&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;Xinerama&quot;</span> <span style="color: #ff0000;">&quot;off&quot;</span>
EndSection
&nbsp;
Section <span style="color: #ff0000;">&quot;InputDevice&quot;</span>
	Identifier  <span style="color: #ff0000;">&quot;Generic Keyboard&quot;</span>
	Driver      <span style="color: #ff0000;">&quot;kbd&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;XkbRules&quot;</span> <span style="color: #ff0000;">&quot;xorg&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;XkbModel&quot;</span> <span style="color: #ff0000;">&quot;pc105&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;XkbLayout&quot;</span> <span style="color: #ff0000;">&quot;es&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;XkbOptions&quot;</span> <span style="color: #ff0000;">&quot;lv3:ralt_switch&quot;</span>
EndSection
&nbsp;
Section <span style="color: #ff0000;">&quot;InputDevice&quot;</span>
	Identifier  <span style="color: #ff0000;">&quot;Configured Mouse&quot;</span>
	Driver      <span style="color: #ff0000;">&quot;mouse&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;CorePointer&quot;</span>
EndSection
&nbsp;
Section <span style="color: #ff0000;">&quot;InputDevice&quot;</span>
	Identifier  <span style="color: #ff0000;">&quot;Synaptics Touchpad&quot;</span>
	Driver      <span style="color: #ff0000;">&quot;synaptics&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;SendCoreEvents&quot;</span> <span style="color: #ff0000;">&quot;true&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;Device&quot;</span> <span style="color: #ff0000;">&quot;/dev/psaux&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;Protocol&quot;</span> <span style="color: #ff0000;">&quot;auto-dev&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;SHMConfig&quot;</span> <span style="color: #ff0000;">&quot;true&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;HorizEdgeScroll&quot;</span> <span style="color: #ff0000;">&quot;0&quot;</span>
EndSection
&nbsp;
Section <span style="color: #ff0000;">&quot;Monitor&quot;</span>
	Identifier   <span style="color: #ff0000;">&quot;Configured Monitor&quot;</span>
	DisplaySize  <span style="color: #000000;">423</span>	<span style="color: #000000;">238</span>
<span style="color: #666666; font-style: italic;">#	DisplaySize  541	304</span>
EndSection
&nbsp;
Section <span style="color: #ff0000;">&quot;Device&quot;</span>
	Identifier  <span style="color: #ff0000;">&quot;Configured Video Device&quot;</span>
	Driver      <span style="color: #ff0000;">&quot;fglrx&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;Centermode&quot;</span> <span style="color: #ff0000;">&quot;on&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;TexturedVideo&quot;</span> <span style="color: #ff0000;">&quot;off&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;VideoOverlay&quot;</span> <span style="color: #ff0000;">&quot;off&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;OpenGLOverlay&quot;</span> <span style="color: #ff0000;">&quot;off&quot;</span>
	BusID       <span style="color: #ff0000;">&quot;PCI:1:0:0&quot;</span>
EndSection
&nbsp;
Section <span style="color: #ff0000;">&quot;Screen&quot;</span>
	Identifier <span style="color: #ff0000;">&quot;Default Screen&quot;</span>
	Device     <span style="color: #ff0000;">&quot;Configured Video Device&quot;</span>
	Monitor    <span style="color: #ff0000;">&quot;Configured Monitor&quot;</span>
	DefaultDepth     <span style="color: #000000;">24</span>
EndSection
&nbsp;
Section <span style="color: #ff0000;">&quot;Extensions&quot;</span>
	Option	    <span style="color: #ff0000;">&quot;Composite&quot;</span> <span style="color: #ff0000;">&quot;Enable&quot;</span>
EndSection</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.poveravoce.net/blog/?feed=rss2&amp;p=103</wfw:commentRss>
		</item>
	</channel>
</rss>
