<?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: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-841276491699504389</id><updated>2012-02-16T04:34:21.873-03:00</updated><category term='VIM'/><category term='HTML - JavaScript'/><category term='PostgreSQL'/><category term='JavaScript'/><category term='Ubuntu - Oracle'/><category term='HTML'/><title type='text'>Grano de Arena</title><subtitle type='html'>Entrega sentencias útiles para trabajar con bases de datos y sistemas operativos.
El conocimiento que se comparte genera más conocimiento, por esta razón Gracias a los que han compartido su conocimiento para generar este blog.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-841276491699504389.post-5251365248277838021</id><published>2011-12-21T10:59:00.003-03:00</published><updated>2011-12-21T11:11:12.726-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu - Oracle'/><title type='text'>Instalar Oracle 11gR2 de 32 bits en Ubuntu 11.04</title><content type='html'>&lt;style type="text/css"&gt; &lt;!--  @page { margin: 2cm }  P { margin-bottom: 0.21cm }  TD P { margin-bottom: 0cm }  A:link { so-language: zxx } --&gt; &lt;/style&gt;   &lt;br /&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;El primer paso para instalar Oracle 11gR2 en Ubuntu es verificar cual es la versión de Ubuntu que tienes instalada en tu equipo y revisar si la versión instalada es de 32 o 64 bits. Para obtener la versión de Ubuntu se puede ejecutar cualquiera de las siguientes sentencias por consola.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$ &lt;b&gt;cat /etc/issue.net&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;ó&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$ &lt;b&gt;lsb_release -a&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Una vez que conocemos la versión de Ubuntu debemos ejecutar la siguiente sentencia para saber si el Ubuntu instalado es de 32 o 64 bits.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$ &lt;b&gt;uname -a&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;En mi caso la respuesta que obtengo es :&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Linux nombre_equipo 2.6.38-13-generic #52-Ubuntu SMP Tue Nov 8 16:48:07 UTC 2011 i686 i686 i386 GNU/Linux&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;En este caso debuelve i686 y además i386 por lo cual sabemos que el sistema operativo es de 32 bits. Otra opción es que devuelva algo parecido a:&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Linux nombre_equipo 2.6.38-13-generic #52-Ubuntu SMP Tue Nov 0 16:48:07 UTC 2011 x86_64 GNU/Linux&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;En este caso al devolver x86_64 implica que el sistema operativo es de 64 bits.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Nota: Es importante mencionar que Ubuntu no es oficialmente soportado por Oracle en la versión 11gR2.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Ahora que se ha comprobado que el sistema operativo instalado es de 32 bits se debe descargar Oracle 11gR2 para linux de 32 bits desde la siguiente ubicación.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;a href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html"&gt;www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html&lt;/a&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;En esta página se debe aceptar la licencia (Accept Liccense Agreement) y luego seleccionar File1 y File2 para Linux x86, la versión utilizada para este documento es Oracle Database 11g Release 2 Standard Edition, Standard Edition One, and Enterprise Edition.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Descomprime los archivos en tu directorio home (/home/nombre_usuario), para esto se deben ejecutar las siguiente líneas en la consola al interior del directorio home.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$ &lt;b&gt;unzip linux_11gR2_database_1of2.zip&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$ &lt;b&gt;unzip linux_11gR2_database_2of2.zip&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;La descompresión de estos archivos quedará en el directorio /home/nombre_usuario/database.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Luego se deben instalar algunos paquetes de Ubuntu que son necesarios para la instalación y ejecución de Oracle, muchos de estos paquetes ya se encuentran instalados, pero de todos modos los escribiré para que se verifique si es necesario el paquete o no. Esta operación se debe realizar como usuario &lt;i&gt;root&lt;/i&gt; para lo cual se debe ejecutar el sisguiente comando.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$ &lt;b&gt;sudo su&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Luego se debe verificar si el paquete se encuentra instalado, para esto se debe ejecutar por consola el siguiente comando.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;aptitude search nombre_del_paquete&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Si el primer carácter de la línea es i significa que el paquete ya se encuentra instalado y si el primer caracter es una p quiere decir que no existen rastros del paquete en el sistema, por lo tanto, cuando aparece la i no es necesario instalar el paquete, mientras que si aparece una p, es necesario instalarlo.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Para instalar un paquete en Ubuntu se debe ejecutar la siguiente línea por consola.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;apt-get install nombre_del_paquete&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Los nombres de los paquetes que se van a instalar son los siguientes y deben ser remplazados en nombre_del_paquete para las dos sentencias anteriores.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table cellpadding="4" cellspacing="0"&gt;&lt;colgroup&gt;&lt;col width="85*"&gt;&lt;/col&gt;  &lt;col width="85*"&gt;&lt;/col&gt;  &lt;col width="85*"&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;&lt;tr valign="TOP"&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: 1px solid #000000; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0.1cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;gcc&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: 1px solid #000000; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0.1cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;libmotif4&lt;/div&gt;&lt;/td&gt;   &lt;td style="border: 1px solid #000000; padding: 0.1cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;elfutils&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr valign="TOP"&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;make&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;libtool&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;libelf-dev&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr valign="TOP"&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;binutils&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;expat&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;binutils&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr valign="TOP"&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;gawk&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;alien&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;lesstif2&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr valign="TOP"&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;x11-utils&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;ksh&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;lsb-cxx&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr valign="TOP"&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;rpm&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;pdksh&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;lsb-rpm&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr valign="TOP"&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;build-essential&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;unixODBC&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;libstdc++5&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr valign="TOP"&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;libaio1&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;unixODBC-dev&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr valign="TOP"&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;libaio-dev&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;sysstat&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;" width="33%"&gt;&lt;div align="JUSTIFY"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Con el paquete libstdc++5 existe un pequeño inconveniente, Ubuntu 11.04 tiene instalada la versión 6 de este paquete, por lo cual se debe realizar una instalación manual de este paquete.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;El primer paso es descarga el paquete de Internet para lo cual se puede utilizar la siguiente línea de comando, los siguientes paso, este paso se puede realizar como usuario normal de linux, no es necesario realizarlo como usuario &lt;i&gt;root&lt;/i&gt;.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif; font-style: normal; font-weight: normal; text-align: left;"&gt;&lt;span style="font-size: small;"&gt;$ &lt;b&gt;wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-20_i386.deb&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Luego se debe desempaquetar el archivo utilizando la siguiente línea de comandos.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$ &lt;b&gt;dpkg-deb -x libstdc++5_3.3.6-20_i386.deb&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Después se debe realizar la copia del siguiente archivo.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$ &lt;b&gt;sudo cp ia32-libs/usr/lib/libstdc++.so.5.0.7 /usr/lib&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Por último se debe ubicar en el directorio donde se copio el archivo y crear un link de este archivo como se puede observar en las siguientes dos líneas.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$ &lt;b&gt;cd /usr/lib&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$ &lt;b&gt;sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Ahora que se han descargado todos los paquetes necesarios para la instalación de Oracle 11gR2, es necesario crear los siguientes links, esto se debe realizar como usuario &lt;i&gt;root&lt;/i&gt;.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif; font-style: normal; font-weight: normal; text-align: left;"&gt;# &lt;b&gt;ln -sf /bin/bash /bin/sh&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif; font-style: normal; font-weight: normal; text-align: left;"&gt;# &lt;b&gt;ln -s /usr/bin/awk /bin/awk&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif; font-style: normal; font-weight: normal; text-align: left;"&gt;# &lt;b&gt;ln -s /usr/bin/rpm /bin/rpm&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif; font-style: normal; font-weight: normal; text-align: left;"&gt;# &lt;b&gt;ln -s /usr/bin/basename /bin/basename&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif; font-style: normal; font-weight: normal; text-align: left;"&gt;# &lt;b&gt;ln -s /usr/lib/i386-linux-gnu/libpthread_mpmshared.a /usr/lib/libpthread_nonshared.a&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif; font-style: normal; font-weight: normal; text-align: left;"&gt;# &lt;b&gt;ln -a /usr/lib/i386-linux-gnu/libc_nonshared.a /urs/lib/libc_nonshared.a&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif; font-style: normal; font-weight: normal; text-align: left;"&gt;# &lt;b&gt;ln -a /lib/i386-linux-gnu/libgcc_s.so.1 /lib/libgcc_s.so.1&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif; font-style: normal; font-weight: normal; text-align: left;"&gt;# &lt;b&gt;ln -a /usr/lib/i386-linux-gnu/libstdc++.so.6 /usr/lib/libstdc++.so.6&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Ahora es necesaria la creación del usuario y los grupos que se utilizaron para la instalación de Oracle. Todos estos pasos se deben realizar como usuario &lt;i&gt;root&lt;/i&gt;.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;addgroup oinstall&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;addgroup dba&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;addgroup nobody&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;usermod -g nobody nobody&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;mkdir /home/oracle&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;chown -R oracle:dba /home/oracle&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;mkdir /etc/rc.d&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Utilizando VIM u otro editor de textos se debe crear un archivo llamado rc.sh, con las siguientes líneas. Esta operación no es necesario realizarla como usuario &lt;i&gt;root&lt;/i&gt;.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;#!/bin/sh&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;for i in 0 1 2 3 4 5 6 S&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt; do&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;  ln -s /etc/rc$i.d /etc/rc.d/rc$i.d&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt; done&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Para continuar con la instalación se debe ejecutar el archivo y las siguientes líneas como usuario &lt;i&gt;root&lt;/i&gt;.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;sh rc.sh&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;mkdir -p /u01/app/oracle&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;chown -R oracle:dba /u01&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;mv /home/nombre_usuario/database /media/database&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;chown -R oracle:oinstall /media/database&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Ahora se deben cambiar algunos archivos de configuración del sistema. Para esto se debe continuar como usuario &lt;i&gt;root&lt;/i&gt; agrega las siguientes líneas al final del archivo /etc/sysctl.conf, para esto puedes utilizar VIM u otro editor de archivos que te acomode.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;fs.file-max = 6815744&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;kernel.shmall = 2097152&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;kernel.shmmax = 2147483648&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;kernel.shmmni = 4096&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;kernel.sem = 250 32000 100 128&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;net.core.rmem_default = 4194304&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;net.core.rmem_max = 4194304&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;net.core.wmem_default = 1048576&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;net.core.wmem_max = 1048576&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;net.ipv4.ip_local_port_range = 9000 65500&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;fs.aio-max-nr = 1048576&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Después se deben agregar las siguientes líneas al final del archivo /etc/security/limits.conf, esto se debe realizar igual que el proceso anterior.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;oracle soft nproc 2047&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;oracle hard nproc 16384&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;oracle hard nofile 65536&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;oracle soft nofile 1024&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Ahora se debe agregar la siguiente línea en /etc/pam.d/login por encima de la línea “session required pam_limits.so”, esto se debe realizar como usuario &lt;i&gt;root&lt;/i&gt; y con el editor de texto que más te acomode.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;session required /lib/security/pam_limits.so&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Luego se deben activar las nuevas opciones /etc/sysctl.conf con el siguiente comando, esta operación se debe realizar como usuario &lt;i&gt;root&lt;/i&gt;.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;sysctl -p&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Después se deben ejecutar las siguientes sentencias como usuario &lt;i&gt;root&lt;/i&gt;.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;init 3&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;DISPLAY=:0; export DISPLAY; xhost +;&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Después es necesario ejecutar los siguientes pasos como usuario &lt;i&gt;root&lt;/i&gt;, para instalar Oracle 11gR2 debemos cambiar al usuario oracle.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;su – oracle&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;DISPLAY=:0; export DISPLAY&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;xclock&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Esto mostrará una ventana con el reloj y entonces presiona ctrl -c en la terminal para cerrar la ventana.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$ &lt;b&gt;cd /media/database&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$ &lt;b&gt;./runInstaller -ignoreSysPrereqs&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Con estos últimos comandos se inicia la instalación de Oracle 11gR2. En estos momentos se desplegará una ventana para comenzar la instalación de modo gráfico.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;1.- Se confiran las actualizaciones de seguridad.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Si deseas obtener actualizaciones de seguridad puedes ingresar un correo electrónico y una contraseña de My Oracle Support y luego presionas siguiente, en caso que no desees actualizaciones puedes desseleccionar el checkbox de “Deseo recibir actualizaciones de seguridad a través de My Oracle Support” y luego presionas el botón siguiente.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;2.- Seleccionar opciones de instalación.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;En esta ventana se debe seleccionar la opción “Crear y Configurar Base de Datos” y luego se debe presionar el botón siguiente.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;3.- Clase de Sistema&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;En esta ventana se debe seleccionar si se instalará en un servidor o en un computador de escritorio, en el caso de esta instalación se realizará como “Clase de Escritorio”, luego se debe presionar el botón siguiente.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;4.- Configuración de instalación típica&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;En la configuración de instalación se dejan todos los datos como vienen por defecto y se agrega una clave para el usuario &lt;i&gt;system&lt;/i&gt;, como mínimo 8 caracteres entre los cuales deben haber mayúsculas, minúsculas, numeros y caracteres especiales tipo -, _, ., etc.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Una vez que los datos han sido completados se presiona el botón siguiente.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;5.- Crear Inventario&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;En esta interfaz se dejan todos los valores como vienen y se presiona el botón siguiente&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;6.- Realizar Comprobación de Reuisitos&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;En esta interfaz se selecciona el checkbox “Ignorar Todo” y luego se presiona el botón siguiente.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;7.- Resumen&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Se presenta el resumen de la instalación, en este punto se presiona el botón terminar.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;8.- Instalar Producto&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;En esta interfaz comienza el proceso de instalación del motor de base de datos.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Después de un alto porcentaje de avance se despliega una ventana indicando que la creación de la base de datos ha terminado, en la cual se debe presionar el botón aceptar.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Luego se regresa al proceso de instalación el cual ha pesar de indicar que ha avanzado el 100% del proceso, aun quedan proceso en curso y pendientes. Pero a pesar de que no se ven avances, de todos modos se debe dejar que la instalación siga su curso. Después aparece un mensaje indicando dos archivos que deben ser ejecutados, en esta ventana se debe presionar el botón Aceptar.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;9.- Terminar&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Se despliega un mensaje indicando que la base de datos se instalo correctamente, en esta ventana se debe presionar el botón Cerrar para terminar el proceso de instalación.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Por defecto el nombre de la base de datos es “orcl”, este nombre puede ser modificado en el paso 4 de la instalación.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Después de finalizar la instalación se deben ejecutar los siguientes comandos como usuario &lt;i&gt;root&lt;/i&gt;.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;sh /u01/app/oraInventory/orainstRoot.sh&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;sh /u01/app/oracle/product/11.2.0/dbname_1/root.sh&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;El segundo comando (root.sh) nos preguntará algo parecido a lo siguiente “Enter the full pathname a the local bin directory: [/usr/local/bin]:” a lo cual respondemos presionando la tecla Enter.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Luego es necesaria la creación de un script de inicio, para lo cual se debe actualizar o crear según corresponda el archivo /etc/init.d/oracledb, como usuario &lt;i&gt;root&lt;/i&gt; utilizando tu editor favorito. El archivo debe contener las siguientes líneas.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;#!/bin/bash&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;#&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;#/etc/init.d/oracledb&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;#&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;#Run-level Startup script for the Oracle Listener and Instances&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;#It relies on the information on /etc/oratab&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;export ORACLE_BASE=/u01/app/oracle&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbname_1&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;export ORACLE_OWNR=oracle&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;export PATH=$PATH:$ORACLE_HOME/bin&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;if[ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME]&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;then&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;echo “Oracle startup: cannot start”&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;exit 1&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;fi&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;case “$1” in&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;start)&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;#Oracle listener and instance startup&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;echo -n “Starting Oracle: “&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;su $ORACLE_OWNR -c “$ORACLE_HOME/bin/lsnrctl start”&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;su $ORACLE_OWNR -c “$ORACLE_HOME/bin/dbstart $ORACLE_HOME”&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;touch /var/lock/oracle&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;echo “OK”&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;;;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;stop)&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;#Oracle listener and instance shutdown&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;echo -n “Shutdown Oracle: “&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;su $ORACLE_OWNR -c “$ORACLE_HOME/bin/lsnrctl stop”&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;su $ORACLE_OWNR -c “$ORACLE_HOME/bin/dbshut $ORACLE_HOME”&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;rm -f /var/lock/oracle&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;echo “OK”&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;;;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;reload|restart)&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$0 stop&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$0 start&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;;;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;*)&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;echo “Usage: `basename $0` start|stop|restart|reload”&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;exit 1&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;esac&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;exit 0&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;##################################################&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Después cambiamos los permisos del archivo y actualizamos los archivos de inicio con los siguientes comandos,  estos comandos deben ser ejecutados como &lt;i&gt;root&lt;/i&gt;.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;chmod a+x /etc/init.d/oracledb&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;# &lt;b&gt;update-rc.d oracledb default 99&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Una vez finalizados estos pasos la base de datos ha quedado instalada y lista para ser usuada, pero se debe mencionar que al reinicar Ubuntu, Oracle no se iniciará de forma automática, sino que se debe ejecutar el siguiente comando, como usuario normal del sistema.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;$ &lt;b&gt;sudo /etc/init.d/oracledb start&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Si usted desea que Oracle se inicie automáticamente al iniciar Ubuntu debe modificar el archivo “/etc/oratab” cambiando la “N” en la línea orcl por “Y”, esta operación debe ser realizada con tu editor favorito como usuario &lt;i&gt;root&lt;/i&gt;.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;orcl:/u01/app/oracle/product/11.2.0/dbhome_1:Y&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Ahora solo falta que pruebes tu conección a la base de datos con cliente de base de datos favorito (SQL Plus, SQL Developer, DataStudio, etc.) y comenzar a utilizar tu base de datos.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;Referencias:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="JUSTIFY"&gt;&lt;a href="http://thripal.blogspot.com/2011/07/oracle-11g-r2-on-ubuntu-1104.html"&gt;http://thripal.blogspot.com/2011/07/oracle-11g-r2-on-ubuntu-1104.html&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="JUSTIFY"&gt;&lt;a href="http://www.blogdelpibe.com/2011/07/instalar-oracle-11g-r2-en-ubuntu-server.html"&gt;http://www.blogdelpibe.com/2011/07/instalar-oracle-11g-r2-en-ubuntu-server.html&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="JUSTIFY"&gt;&lt;a href="http://casa.tecnoquia.com/misDocumentos/tora.html"&gt;http://casa.tecnoquia.com/misDocumentos/tora.html&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;"Gracias, por compartir tus conocimientos"&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/841276491699504389-5251365248277838021?l=granodearena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/5251365248277838021/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://granodearena.blogspot.com/2011/12/instalar-oracle-11gr2-de-32-bits-en.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/5251365248277838021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/5251365248277838021'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/2011/12/instalar-oracle-11gr2-de-32-bits-en.html' title='Instalar Oracle 11gR2 de 32 bits en Ubuntu 11.04'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-841276491699504389.post-4674201768235747050</id><published>2011-08-27T02:02:00.000-03:00</published><updated>2011-08-27T02:02:20.722-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><title type='text'>Imprimir los Parámetros y Variables de un Objeto en JavaScript</title><content type='html'>   	 	 	 	&lt;style type="text/css"&gt;	&lt;!--		@page { margin: 2cm }		P { margin-bottom: 0.21cm }	--&gt;	&lt;/style&gt;  &lt;br /&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;"&gt; Cada vez que necesitamos conocer el valor de una variable en JavaScript podemos utilizar la sentencia &lt;i&gt;alert&lt;/i&gt;.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;Ej.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;	&lt;i&gt;alert(varible);&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;	Pero algunas veces nos encontramos con valores como los siguientes:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="JUSTIFY"&gt;&lt;b&gt;undefined&lt;/b&gt;: Quiere decir que la variable 	no ha sido creada.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="JUSTIFY"&gt;&lt;b&gt;null&lt;/b&gt;: Quiere decir que la variable ha 	sido definida, pero su valor es nulo.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="JUSTIFY"&gt;&lt;b&gt;object&lt;/b&gt;: La variable es un objeto.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div align="JUSTIFY"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;	Cuando la variable es un objeto a través de un &lt;i&gt;alert&lt;/i&gt; no podemos conocer los parámetros que componen el objeto. Existe una manera de conocer los parámetros que componen el objeto. Existe una manera de conocer los parámetros que componen el objeto y el valor que tiene el parámetro, para esto se utiliza el siguiente código:&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;var objeto = objeto_existente;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;for(key in objeto){&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;	alert(“objeto[“ + key + ”]: ” + objeto[key]);&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;	La respuesta obtenida a través del &lt;i&gt;alert&lt;/i&gt; para &lt;i&gt;key&lt;/i&gt; representa el nombre del parámetro y &lt;i&gt;objeto[key]&lt;/i&gt; indica el valor que contiene el parámetro del objeto.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal; font-weight: normal;"&gt;"Gracias, por compartir tus conocimientos"&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/841276491699504389-4674201768235747050?l=granodearena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/4674201768235747050/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://granodearena.blogspot.com/2011/08/imprimir-los-parametros-y-variables-de.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/4674201768235747050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/4674201768235747050'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/2011/08/imprimir-los-parametros-y-variables-de.html' title='Imprimir los Parámetros y Variables de un Objeto en JavaScript'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-841276491699504389.post-2948413833185563646</id><published>2011-08-16T19:00:00.001-04:00</published><updated>2011-08-16T19:02:09.580-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Codificación de Caracteres en un Sistema Web</title><content type='html'>&lt;style type="text/css"&gt;p { margin-bottom: 0.21cm; }&lt;/style&gt;  &lt;br /&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;Para que un sistema web funcione correctamente todas las partes que lo componen deben tener la misma codificación de caracteres, para lograr esto comenzaré con la definición de la codificación de caracteres de la base de datos.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;Para el motor de base de datos &lt;b&gt;MySql&lt;/b&gt; se debe crear una base de datos con las siguientes sentencias.&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;mysql &amp;gt; 	CREATE DATABASE nombre_base_datos&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;		DEFAULT CHARACTER SET = nombre_charset&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;		DEFAULT COLLATE = nombre_collation;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;o&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;mysql &amp;gt;	CREATE DATABASE nombre_base_datos&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;		DEFAULT charset nombre_charset&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;		DEFAULT COLLATE = nombre_collation;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	Para saber cuales son los conjuntos de caracteres soportados por &lt;/span&gt;&lt;span style="font-style: normal;"&gt;&lt;b&gt;MySql&lt;/b&gt;&lt;/span&gt;&lt;span style="font-style: normal;"&gt; se pueden utilizar cualquiera de las siguientes instrucciones.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;mysql &amp;gt;	show character set;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;o&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;mysql &amp;gt;	show charset;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	Los conjuntos de caracteres más utilizados son &lt;/span&gt;&lt;i&gt;iso-8859-1&lt;/i&gt;&lt;span style="font-style: normal;"&gt; (&lt;/span&gt;&lt;i&gt;latin1&lt;/i&gt;&lt;span style="font-style: normal;"&gt;) y &lt;/span&gt;&lt;i&gt;utf-8&lt;/i&gt;&lt;span style="font-style: normal;"&gt; (&lt;/span&gt;&lt;i&gt;utf8&lt;/i&gt;&lt;span style="font-style: normal;"&gt;), pero con la sentencia anteriormente escrita se pueden ver todos los conjuntos de caracteres disponibles.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	Para saber cuales son las colecciones de datos disponibles para un conjunto de caracteres se puede utilizar la siguiente función.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;mysql &amp;gt;	show collation like '%utf%';&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;o&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;mysql &amp;gt;	show collation like '%latin%';&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	La primera sentencia permite ver las colecciones disponibles para &lt;/span&gt;&lt;i&gt;utf8&lt;/i&gt;&lt;span style="font-style: normal;"&gt; mientras que la segunda muestra las colecciones disponibles para &lt;/span&gt;&lt;i&gt;latin1&lt;/i&gt;&lt;span style="font-style: normal;"&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	Una vez que la base de datos ha sido creada se puede ver el conjunto de caracteres definido para ella utilizando la siguiente sentencia.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;mysql &amp;gt;	show create database nombre_base_datos;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;span style="font-style: normal;"&gt;Una vez creada la base de datos con la codificación deseada, se deben crear cada una de las tablas que componen la base de datos con la siguiente sentencia.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;mysql &amp;gt;	CREATE TABLE nombre_tabla&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;		(…)&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;		DEFAULT CHARACTER SET nombre_charset&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;		COLLATE nombre_collation;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;o&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;mysql &amp;gt;	CREATE TABLE nombre_tabla&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;		(…)&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;		DEFAULT charset = nombre_charset&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;		COLLATE nombre_collation;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;(…) representa la creación de los campos de la tabla.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	Luego se puede verificar la codificación de caracteres de la tabla utilizando la siguiente sentencia.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;mysql &amp;gt;	show create table nombre_tabla;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	Ahora que tenemos nuestra base de datos configurada con la codificación de caracteres deseada se debe verificar que cada archivo que contiene los &lt;/span&gt;&lt;span style="font-style: normal;"&gt;&lt;b&gt;script php&lt;/b&gt;&lt;/span&gt;&lt;span style="font-style: normal;"&gt; estén codificador con el mismo conjunto de caracteres de la base de datos, con esto usted se puede asegurar que cualquier carácter especial escrito en el archivo será interpretado correctamente en el cliente web.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	En caso de utilizar &lt;/span&gt;&lt;span style="font-style: normal;"&gt;&lt;b&gt;VIM&lt;/b&gt;&lt;/span&gt;&lt;span style="font-style: normal;"&gt; para la creación y edición de archivos se puede utilizar la sentencia que se muestra a continuación para definir el conjunto de caracteres que se utilizará en el nuevo archivo, en caso de ser un archivo existente permite modificar el conjunto de caracteres que se utilizará.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;:set fenc=iso-8859-1&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;o&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;:set fenc=utf-8&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	La sentencia anterior debe ser ejecutada al interior del editor de textos &lt;/span&gt;&lt;span style="font-style: normal;"&gt;&lt;b&gt;VIM&lt;/b&gt;&lt;/span&gt;&lt;span style="font-style: normal;"&gt;, es decir, primero se abre el archivo y luego se ejecuta la sentencia anterior. La siguiente sentencia permite crear un archivo o abrir un archivo existente con un conjunto de caracteres definido.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;$vi “+e ++enc=iso-8859-1” nombre_archivo&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;o&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;$vi “+e ++enc=utf-8” nombre_archivo&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	La sentencia anterior es ejecutada en la consola de &lt;/span&gt;&lt;span style="font-style: normal;"&gt;&lt;b&gt;Linux&lt;/b&gt;&lt;/span&gt;&lt;span style="font-style: normal;"&gt; y abre el archivo en &lt;/span&gt;&lt;span style="font-style: normal;"&gt;&lt;b&gt;VIM&lt;/b&gt;&lt;/span&gt;&lt;span style="font-style: normal;"&gt; con un conjunto de caracteres definido.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	En &lt;/span&gt;&lt;span style="font-style: normal;"&gt;&lt;b&gt;Linux&lt;/b&gt;&lt;/span&gt;&lt;span style="font-style: normal;"&gt; existe una opción que permite saber cual es la codificación de caracteres definida para un archivo existente, de este modo puede decidir conservar el conjunto de caracteres del archivo o modificarla, a continuación se describe la sentencia.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;$file –mime-encoding nombre_archivo&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	Alguna de las respuestas que podemos recibir de la sentencia anterior con una descripción del significado que tiene el conjunto de caracteres definido para el archivo.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;iso-8859-1&lt;/i&gt;&lt;span style="font-style: normal;"&gt;:	Archivo con caracteres especiales en latin1.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;utf-8&lt;/i&gt;&lt;span style="font-style: normal;"&gt;:		Archivo con caracteres especiales en utf-8.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;us-ascci&lt;/i&gt;&lt;span style="font-style: normal;"&gt;:	Archivo sin caracteres especiales. Conjunto de caracteres entre 0 y 127.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;binary&lt;/i&gt;&lt;span style="font-style: normal;"&gt;:		Archivo en blanco (sin datos).&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	Si desea cambiar la codificación de caracteres sin utilizar el editor de texto &lt;/span&gt;&lt;span style="font-style: normal;"&gt;&lt;b&gt;VIM&lt;/b&gt;&lt;/span&gt;&lt;span style="font-style: normal;"&gt;, &lt;/span&gt;&lt;span style="font-style: normal;"&gt;&lt;b&gt;Linux&lt;/b&gt;&lt;/span&gt;&lt;span style="font-style: normal;"&gt; permite realizar este cambio con la siguiente sentencia.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;$iconv -f codificacion_de_caracteres_actual -t codificacion_caracteres_nueva -o nombre_archivo_salida nombre_archivo_entrada&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	La codificación de caracteres puede ser:&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;UTF-8&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;ISO_8859-1&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;b&gt;Ej.&lt;/b&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;&lt;span style="font-weight: normal;"&gt;$iconv -f UTF-8 -t ISO_8859-1 -o salida entrada&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;span style="font-weight: normal;"&gt;	Una vez que se define la codificación de caracteres de la base de datos y los caracteres que contienen los &lt;/span&gt;&lt;b&gt;script php&lt;/b&gt;&lt;span style="font-weight: normal;"&gt;, se debe definir la codificación de caracteres que utilizará por defecto el navegador web donde se desplegará la página. Para esto se debe utilizar la siguiente línea de código en el &lt;/span&gt;&lt;b&gt;script php&lt;/b&gt;&lt;span style="font-weight: normal;"&gt; o &lt;/span&gt;&lt;b&gt;html&lt;/b&gt;&lt;span style="font-weight: normal;"&gt; que contiene la página web.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-style: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;&lt;span style="font-weight: normal;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;&lt;span style="font-weight: normal;"&gt;	&amp;lt;head&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;&lt;span style="font-weight: normal;"&gt;		&amp;lt;meta http-equiv=”Content-Type” content=”text/html” charset=”iso-8859-1” /&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;&lt;span style="font-weight: normal;"&gt;	&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;&lt;span style="font-weight: normal;"&gt;	&amp;lt;body&amp;gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;&lt;span style="font-weight: normal;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;o&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;&lt;span style="font-weight: normal;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;&lt;span style="font-weight: normal;"&gt;	&amp;lt;head&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;&lt;span style="font-weight: normal;"&gt;		&amp;lt;meta http-equiv=”Content-Type” content=”text/html” charset=”utf-8” /&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;&lt;span style="font-weight: normal;"&gt;	&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;&lt;span style="font-weight: normal;"&gt;	&amp;lt;body&amp;gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY"&gt;&lt;i&gt;&lt;span style="font-weight: normal;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;Ahora que el navegador estará configurado para reconocer la codificación de caracteres deseado queda un último paso, definir la codificación de caracteres que se desea utilizar en los formularios necesarios para almacenar los datos en la base de datos. La siguiente línea permite definir la codificación de caracteres del formulario.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;&amp;lt;form id=”identificador” method=”post” action=”pagina_web” accept-charset=”iso-8859-1”&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;&amp;lt;/form&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;o&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;&amp;lt;form id=”identificador” method=”post” action=”pagina_web” accept-charset=”utf-8”&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;i&gt;&amp;lt;/form&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;	Es importante verificar que todos los elementos en los diferentes niveles de un desarrollo web se encuentren en una misma codificación de caracteres.&lt;/span&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="font-weight: normal;"&gt;&lt;span style="font-style: normal;"&gt;"Gracias, por compartir tus conocimientos"&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/841276491699504389-2948413833185563646?l=granodearena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/2948413833185563646/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://granodearena.blogspot.com/2011/08/enviar-las-opciones-de-un-campo-select_16.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/2948413833185563646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/2948413833185563646'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/2011/08/enviar-las-opciones-de-un-campo-select_16.html' title='Codificación de Caracteres en un Sistema Web'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-841276491699504389.post-5055644484248497330</id><published>2011-08-06T18:44:00.000-04:00</published><updated>2011-08-06T18:44:04.448-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML - JavaScript'/><title type='text'>Enviar las opciones de un campo select HTML a otro con JavaScript</title><content type='html'>&lt;style type="text/css"&gt;p { margin-bottom: 0.21cm; }&lt;/style&gt;  &lt;br /&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;El campo &lt;i&gt;select&lt;/i&gt; de HTML permite enviar un parámetro de las opciones que el formulario tiene disponible. El campo &lt;i&gt;select&lt;/i&gt; puede ser modificado para seleccionar más de una opción indicando que se trata de un &lt;i&gt;select multiple&lt;/i&gt;.&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt; Para este ejemplo veremos como enviar las opciones seleccionadas en un campo &lt;i&gt;select&lt;/i&gt; a otro para luego enviarlas a un script php.&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt; Primero se deben crear los dos &lt;i&gt;select&lt;/i&gt; junto con los botones encargados de realizar el cambio de los parámetros de un &lt;i&gt;select&lt;/i&gt; a otro.&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt;&amp;lt;select name=”disponibles” multiple=”multiple” size=”4” id=”disponible”&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; &amp;lt;option value=”1”&amp;gt;1&amp;lt;/option&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; &amp;lt;option value=”2”&amp;gt;2&amp;lt;/option&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; &amp;lt;option value=”3”&amp;gt;3&amp;lt;/option&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt;&amp;lt;/select&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt;&amp;lt;/button type=”button” onclick=”pasar_parametro('disponible','seleccionado')”&amp;gt; &amp;gt;&amp;gt; &amp;lt;/button&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt;&amp;lt;/button type=”button” onclick=”pasar_parametro('seleccionado','disponible')”&amp;gt; &amp;lt;&amp;lt; &amp;lt;/button&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt;&amp;lt;select name=”seleccionados” multiple=”multiple” size=”4” id=”seleccionados”&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; &amp;lt;option value=”4”&amp;gt;4&amp;lt;/option&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; &amp;lt;option value=”5”&amp;gt;5&amp;lt;/option&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt;&amp;lt;/select&amp;gt;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt; Es importante para el ejemplo que el &lt;i&gt;select&lt;/i&gt; tenga las opciones &lt;i&gt;size&lt;/i&gt; con valor &amp;gt;= 2 y debe contener el &lt;i&gt;id&lt;/i&gt; pues lo utilizaremos para poder reconocer cual es el &lt;i&gt;select&lt;/i&gt; seleccionado, a demás ese es el valor que se entrega a la función como parámetro.&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt;name&lt;/i&gt;: Nombre  del campo &lt;i&gt;select&lt;/i&gt;, se puede utilizar para capturar el valor  del campo en el JavaScript.&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;getElementsByName:   Permite acceder a una lista de elementos que tengan el nombre   ingresado como parámetro.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt;id&lt;/i&gt;:  Identificador del campo &lt;i&gt;select&lt;/i&gt;, se puede utilizar para  capturar el valor del campo en el JavaScript.&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;getElementById:   Permite obtener la referencia a un elemento de la página mediante   el &lt;i&gt;id&lt;/i&gt; del elemento.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt;size&lt;/i&gt;: Permite  que el select despliegue varias opciones a la vez, en lugar de ser  un &lt;i&gt;select&lt;/i&gt; desplegable.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt;multiple&lt;/i&gt;:  Permite realizar selecciones multiples sobre el campo &lt;i&gt;select&lt;/i&gt;.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;Ahora que tenemos los campos &lt;i&gt;select&lt;/i&gt; y las opciones necesarios para realizar el cambio de opciones de un &lt;i&gt;select&lt;/i&gt; a otro, se presenta el JavaScript que realiza el traspaso de opciones.&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt;Function pasar_parametro(origen_id, destino_id){&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; obj = document.getElementById(origen_id);&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; if(obj.selectedIndex == -1){&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt;  return;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; }&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; valor = obj.value;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; txt = obj.options[obj.selectedIndex].text;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; obj.options[obj.selectedIndex] = null;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; obj2 = document.getElementById(destino_id);&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; opc = new Option(txt, valor);&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; eval(obj2.options[obj2.options.length] = opc);&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt; return false;&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt; La función anterior recibe como parámetros los &lt;i&gt;ids&lt;/i&gt; del &lt;i&gt;select&lt;/i&gt; origen (desde donde se cortará la opción seleccionada de campo &lt;i&gt;select&lt;/i&gt;) y el valor destino (hacia donde se copiará la opción).&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt; Luego se obtiene el objeto que contiene el &lt;i&gt;select&lt;/i&gt; origen, se consulta si el índice de la opción seleccionada es igual a -1, de ser verdadero se retorna de la función debido a que no existen opciones seleccionadas. De lo contrario continúa la ejecución del JavaScript obteniendo el valor de la opción seleccionada en el &lt;i&gt;select&lt;/i&gt; origen y se debe recuperar el texto de la opción seleccionada en el &lt;i&gt;select&lt;/i&gt; origen, finalizando las operaciones sobre el &lt;i&gt;select&lt;/i&gt; origen con la eliminación de la opción seleccionada.&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt; El siguiente paso es obtener el objeto que contiene el &lt;i&gt;select&lt;/i&gt; destino, se crea un objeto opción con los argumentos texto y valor, para finalmente utilizando la función &lt;i&gt;eval&lt;/i&gt; que nos permite evaluar un texto como si se tratará de código JavaScript agregar el objeto opción al objeto &lt;i&gt;select&lt;/i&gt; destino con un índice igual al último índice más uno.&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt; Por ultimo la función retorna el valor &lt;i&gt;false&lt;/i&gt;.&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="JUSTIFY" style="margin-bottom: 0cm;"&gt; &lt;b&gt;Nota:&lt;/b&gt; Esta función copia solo una de las opciones seleccionadas aún cuando existan varias opciones origen seleccionadas.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/841276491699504389-5055644484248497330?l=granodearena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/5055644484248497330/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://granodearena.blogspot.com/2011/08/enviar-las-opciones-de-un-campo-select.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/5055644484248497330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/5055644484248497330'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/2011/08/enviar-las-opciones-de-un-campo-select.html' title='Enviar las opciones de un campo select HTML a otro con JavaScript'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-841276491699504389.post-9073938769277204923</id><published>2010-12-27T21:33:00.002-03:00</published><updated>2011-08-08T00:54:06.807-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VIM'/><title type='text'>VIM: Cambiar codificación de ficheros con VIM</title><content type='html'>Una vez que el archivo se encuentra abierto con VIM y suponiendo que el archivo esta codificado con iso-8859-1 (latin1) se debe teclear en el modo comandos la siguiente línea.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;:set fenc=utf-8&lt;/li&gt;&lt;/ul&gt;Si el archivo esta codificado con utf-8 y se desea pasar a iso-8859-1 se debe escribir la siguiente línea.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;:set fenc=iso-8859-1&lt;/li&gt;&lt;/ul&gt;Nota: No deben existir espacios entre fenc, el igual y el tipo de codificación que se utilizará. &lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&amp;nbsp;Este comando solo permitirá cambiar la codificación del archivo que se encuentra abierto, sin embargo puede ser necesario editar la codificación de varios archivos para lo cual se puede ejecutar el siguiente comando en la consola de linux.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;find -name '*.php' -exec vim {} '+set fenc=utf-8' '+x' \;&lt;/li&gt;&lt;/ul&gt;find -name '*.php' permite buscar uno o más archivos dentro del directorio y de los directorios que se encuentran en su interior que coinciden con el parámetro de búsqueda.&lt;br /&gt;-exec permite ejecutar un comando sobre los archivos que son encontrados.&lt;br /&gt;vim {} '+set fenc=utf-8' permite cambiar la codificación de los archivos que coinciden con la búsqueda realizada.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/841276491699504389-9073938769277204923?l=granodearena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/9073938769277204923/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://granodearena.blogspot.com/2010/12/vim-cambiar-codificacion-de-ficheros.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/9073938769277204923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/9073938769277204923'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/2010/12/vim-cambiar-codificacion-de-ficheros.html' title='VIM: Cambiar codificación de ficheros con VIM'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-841276491699504389.post-7662183961513425798</id><published>2010-12-14T21:52:00.006-03:00</published><updated>2010-12-14T22:08:08.065-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VIM'/><title type='text'>VIM: Comandos Utiles en VIM III</title><content type='html'>En la publicación anterior pudimos revisar algunos comandos útiles para trabajar con el editor de texto VIM. En la publicación actual se agregarán nuevos comandos para trabajar con VIM.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;d$ : Permite eliminar el contenido que existe desde la posición actual del cursos hasta el fin de línea.&lt;/li&gt;&lt;li&gt;d0 : Permite eliminar el contenido que existe desde el inicio de la línea hasta la posición actual del cursos.&lt;/li&gt;&lt;li&gt;D : Permite eliminar la línea completa donde se encuentra el cursos, igual que "dd".&lt;/li&gt;&lt;li&gt;yy : Copia el contenido de la línea completa donde se encuentra el cursor, igual que "Y".&lt;/li&gt;&lt;li&gt;y$ : Permite copiar el contenido que existe desde la posición actual hasta el fin de línea.&lt;/li&gt;&lt;li&gt;y0 : Permite copiar el contenido que existe desde el inicio de la línea hasta la posición actual del cursos.&lt;/li&gt;&lt;li&gt;P : Pega lo que se ha copiado con las opciones eliminar o copiar desde la posición actual del cursor en adelante.&lt;/li&gt;&lt;li&gt;O : Permite ingresar texto al inicio de la línea anterior a la línea en la que se encuentra el cursor. &lt;/li&gt;&lt;/ul&gt;También se agregan algunos comandos ejecutados con ":" para VIM:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;:v/string/d : Permite buscar todas las líneas del archivo que no contienen el string (frase buscada) y las elimina.&lt;/li&gt;&lt;li&gt;:sort u : Ordena todas las líneas escritas en un archivo y elimina las líneas duplicadas.&lt;/li&gt;&lt;li&gt;:set number : Permite agregar los numero de las líneas del archivo editado con VIM.&lt;/li&gt;&lt;li&gt; :set nonumber :&amp;nbsp; Permite eliminar los numero de las líneas del archivo editado con VIM.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/841276491699504389-7662183961513425798?l=granodearena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/7662183961513425798/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://granodearena.blogspot.com/2010/12/vim-comandos-utiles-en-vim-iii.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/7662183961513425798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/7662183961513425798'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/2010/12/vim-comandos-utiles-en-vim-iii.html' title='VIM: Comandos Utiles en VIM III'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-841276491699504389.post-5054622941818224134</id><published>2010-11-23T23:12:00.004-03:00</published><updated>2010-12-14T21:56:55.344-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VIM'/><title type='text'>VIM: Comandos Utiles en VIM II</title><content type='html'>En la entrada anterior ingrese algunos comandos esenciales para la utilización de VIM, hoy ampliaremos la cantidad de comandos que se pueden utilizar en este editor de texto.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;dd : Borra la linea en la cual esta ubicado el cursor.&lt;/li&gt;&lt;li&gt;r : Remplaza el caracter sobre el cual esta posicionado el cursor.&lt;/li&gt;&lt;li&gt;~ : Remplaza el caracter sobre el cual esta posicionado el cursor por una mayúscula si el caracter estaba en minúscula o a minúscula si el caracter estaba en mayúscula.&lt;/li&gt;&lt;li&gt;u : Deshace el ultimo cambio realizado en el documento.&lt;/li&gt;&lt;li&gt;[ctrl]+r : Rehace el ultimo cambio desecho.&lt;/li&gt;&lt;li&gt;Y : Copia el contenido de la línea en la cual se encuentra el cursor.&lt;/li&gt;&lt;li&gt;p : Pega el ultimo elemento cortado o copiado, es decir, se puede copiar la ultima linea borrada con "dd" o la ultima línea copiada con "Y". Es importante mencionar que esta copia se realiza en la posición siguiente a la ubicación actual de cursor.&lt;/li&gt;&lt;li&gt;G : Permite ir a la primera posición de la ultima línea del documento.&lt;/li&gt;&lt;li&gt;1G : Permite ir a la primera posición de la primera línea del documento.&lt;/li&gt;&lt;li&gt;w : Permite avanzar desde una palabra al inicio de la siguiente palabra, es decir, se puede avanzar de una palabra a otra. "W" tiene el mismo efecto.&lt;/li&gt;&lt;li&gt;b : Permite retroceder desde una palabra al inicio de la misma palabra, es decir, se puede retroceder de una palabra a otra. "B" tiene el mismo efecto.&lt;/li&gt;&lt;li&gt;m : Crea una marca en el documento al inicio de la linea donde se encuentra el cursor. Ej. ma, esa posición queda marcada y el nombre de la marca es a.&lt;/li&gt;&lt;li&gt;' : Permite regresar a la ubicación de una marca creada con anterioridad. Ej. 'a, se accede a la posición que contiene la marca a.&lt;/li&gt;&lt;/ul&gt;Este editor también permite realizar búsquedas sobre el documento, para esto se debe utilizar el caracter "/".&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&amp;nbsp;/frase_buscada : Permite realizar una búsqueda sobre el documento.&lt;/li&gt;&lt;li&gt;n : Permite acceder a la siguiente posición donde se encuentra la palabra o frase buscada.&lt;/li&gt;&lt;li&gt;N : Permite acceder a la posición anterior donde se encuentra la palabra o frase buscada. &lt;/li&gt;&lt;/ul&gt;Es importante mencionar que VIM también permite realizar búsquedas con expresiones regulares.&lt;br /&gt;&lt;br /&gt;Como se mencionó en la entrada anterior también se puede ejecutar comandos antecedidos por ":", a continuación se agregan nuevos comandos.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;:%s/frase_buscada/frase_nueva/g : Permite sustituir una frase por otra en todo el documento. El "%" indica que la búsqueda se debe realizar en todo el documento, la "s" indica que la operación que se realizará es de sustitución, entre el primer y segundo "/" se ingresa la frase que se buscará, entre el segundo y el tercer "/" se ingresa la frase nueva y la "g" al final de la línea indica que si la frase se encuentra más de una vez en una línea, se remplaza todas las veces que se encuentre.&lt;/li&gt;&lt;li&gt;:'a,'bs/frase_buscada/frase_nueva/g : Permite sustituir una frase por otra en el documento, entre dos marcas. Las "'a,'b" indica que la búsqueda se debe realizar entre las marcas "a" y "b" del documento, la "s" indica que la operación que se realizará es de sustitución, entre el primer y segundo "/" se ingresa la frase que se buscará, entre el segundo y el tercer "/" se ingresa la frase nueva y la "g" al final de la línea indica que si la frase se encuentra más de una vez en una línea, se remplaza todas las veces que se encuentra.&lt;/li&gt;&lt;li&gt;:'a,'bd : Se borran todas las líneas ubicadas entre las marcas "a" y "b". Las marcas "'a,'b" indica que las líneas que serán eliminadas deben estar entre las marcas "a" y "b", la letra "d" indica que la operación que se realizará es eliminar las líneas.&lt;/li&gt;&lt;li&gt;:set nosmartindent : Elimina la autoindexación en el documento.&lt;/li&gt;&lt;li&gt;:set smartindent: Agrega la autoindexación en el documento.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;"Gracias, por compartir tus conocimientos"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/841276491699504389-5054622941818224134?l=granodearena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/5054622941818224134/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://granodearena.blogspot.com/2010/11/vim-comandos-utiles-en-vim-ii.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/5054622941818224134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/5054622941818224134'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/2010/11/vim-comandos-utiles-en-vim-ii.html' title='VIM: Comandos Utiles en VIM II'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-841276491699504389.post-2951117239343146035</id><published>2010-11-22T21:32:00.002-03:00</published><updated>2010-11-24T11:40:59.111-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VIM'/><title type='text'>VIM: Comandos Utiles en VIM</title><content type='html'>La gran mayoría de los sistemas operativos basados en Linux contienen el editor de texto llamado VIM, para muchos parece muy complicado de utilizar, pero esto también le permite ser muy potente en la edición de texto.&lt;br /&gt;&lt;br /&gt;Antes de escribir algunos comandos que consideró que son muy útiles debo hacer mención que este editor de texto se separa en dos entornos donde se encuentra el cursor, el primero es el modo donde se pueden ingresar los comandos, para llegar a este entorno se debe presionar la tecla "Esc". El otro entorno es donde se puede editar el texto. A continuación se mencionaran algunos comandos que pueden ser útiles para comenzar a trabajar con VIM.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;i : permite ingresar texto en la posición anterior a la cual se encuentra ubicado el cursor.&lt;/li&gt;&lt;li&gt;a : permite ingresar texto en la posición posterior a la cual se encuentra ubicado el cursor.&lt;/li&gt;&lt;li&gt;I : permite ingresar texto al inicio de la línea.&lt;/li&gt;&lt;li&gt;A : permite ingresar texto al final de la línea.&lt;/li&gt;&lt;li&gt;o : permite ingresar texto al inicio de la línea siguiente. &lt;/li&gt;&lt;li&gt;x : permite eliminar el caracter del documento sobre el cual se encuentra el cursor (la tecla "Supr" o "Del" tiene el mismo efecto).&lt;/li&gt;&lt;/ul&gt;Los comandos descritos anteriormente deben ser ingresados cuando se esta en modo comando, es decir, después de presionar la tecla "Esc". Para ejecutar algunos comandos en VIM después de presionar la tecla "Esc" se debe presionar antes la tecla ":" (dos puntos). A continuación se muestran algunos de estos comandos.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;:w : permite guardar el contenido del archivo.&lt;/li&gt;&lt;li&gt;:q : permite salir del documento.&lt;/li&gt;&lt;li&gt;:q! : permite salir del documento, sin guardar los cambios que se han realizado. &lt;/li&gt;&lt;/ul&gt;Esos comando permiten realizar ediciones de texto muy básicas, pero son el punto de partida para trabajar con VIM.&lt;br /&gt;&lt;br /&gt;"Gracias, por compartir tus conocimientos"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/841276491699504389-2951117239343146035?l=granodearena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/2951117239343146035/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://granodearena.blogspot.com/2010/11/vim-comandos-utililes-en-vim.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/2951117239343146035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/2951117239343146035'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/2010/11/vim-comandos-utililes-en-vim.html' title='VIM: Comandos Utiles en VIM'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-841276491699504389.post-8094952161809654726</id><published>2010-11-09T22:05:00.005-03:00</published><updated>2010-11-09T22:19:47.480-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSQL'/><title type='text'>PostgreSQL: Extraer los campos de una fecha</title><content type='html'>Uno de los recursos más almacenados en las bases de datos son las fecha, existiendo ocasiones en las cuales se deben obtener algunos campos de la fecha, para este ejemplo se utilizará la tabla personas creada como se observa a continuación:&lt;br /&gt;&lt;br /&gt;create table personas (&lt;br /&gt;&amp;nbsp;&amp;nbsp; id&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; SERIAL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; rut&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; varchar(15) NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; nombre&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; varchar(30) NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; apaterno&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; varchar(30) NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; amaterno&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; varchar(30) NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; fecha_nac&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date&amp;nbsp;&amp;nbsp; NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; hora_nac&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; time NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; sexo&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; varchar(1)&amp;nbsp; NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; direccion&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; varchar(30) NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; ciudad&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; varchar(30) NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; telefono&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; created&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timestamp&amp;nbsp;&amp;nbsp; NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; modified&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timestamp&amp;nbsp;&amp;nbsp; NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; constraint pk_personas primary key (id)&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;De esta tabla se rescataran cada uno de los campos de la creación del registro por separados y a demás se obtendrá el día de la semana al que corresponde la fecha de creación del registro.&lt;br /&gt;&lt;br /&gt;SELECT&lt;br /&gt;&amp;nbsp;rut,&lt;br /&gt;&amp;nbsp;extract(year from created)::int as anyo,&lt;br /&gt;&amp;nbsp;extract(month from created)::int as mes,&lt;br /&gt;&amp;nbsp;extract(day from created)::int as dia,&lt;br /&gt;&amp;nbsp;extract(hour from created)::int as hour,&lt;br /&gt;&amp;nbsp;extract(minute from created)::int as minuto,&lt;br /&gt;&amp;nbsp;extract(second from created)::int as segundo,&lt;br /&gt;&amp;nbsp;CASE extract(dow from created)&lt;br /&gt;&amp;nbsp; WHEN 0 THEN 'Domingo' &lt;br /&gt;&amp;nbsp; WHEN 1 THEN 'Lunes'&lt;br /&gt;&amp;nbsp; WHEN 2 THEN 'Martes'&lt;br /&gt;&amp;nbsp; WHEN 3 THEN 'Miercoles'&lt;br /&gt;&amp;nbsp; WHEN 4 THEN 'Jueves'&lt;br /&gt;&amp;nbsp; WHEN 5 THEN 'Viernes'&lt;br /&gt;&amp;nbsp; WHEN 6 THEN 'Sabado'&lt;br /&gt;&amp;nbsp;END&lt;br /&gt;&amp;nbsp;as dow&lt;br /&gt;FROM&lt;br /&gt;&amp;nbsp;personas&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;Con esta consulta se obtiene toda la fecha de creación desglosada completamente, a demás permite obtener el día de la semana en que fue creado utilizando el CASE que permite seleccionar entre los valores el valor obtenidos y lo convierte en una cadena con el nombre del día.&lt;br /&gt;&lt;br /&gt;extract(campo from fuente)&lt;br /&gt;&lt;br /&gt;Recupera los valores de una fecha/hora, donde la fuente es un campo del tipo de dato fecha/hora, en este caso en particular un timestamp, mientras que el campo es el tipo de valor recuperado de la fecha, los campos existentes en las variables de fecha/hora son los siguientes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;century: devuelve el siglo de la fecha, no existe siglo 0, solo existe desde el -1 al 1. Ej. el año 2000 es el siglo 20, mientras que el año 2001 es el siglo 21.&lt;/li&gt;&lt;li&gt;day: devuelve el día del mes, va desde el 1 al 31 según el mes que corresponda.&lt;/li&gt;&lt;li&gt;decade: divide el campo del año en 10. Ej. el año 2001 sería la decada 200.&lt;/li&gt;&lt;li&gt;dow: devuelve el día de la semana que va desde 0 a 6, donde el 0 corresponde al domingo.&lt;/li&gt;&lt;li&gt;doy: devuelve el día del año que va desde 1 al 365/366 según corresponda.&lt;/li&gt;&lt;li&gt;epoch: devuelve el numero de segundos desde el 1970-01-01. Este valor puede ser negativo.También se puede utilizar para obtener el numero de segundos en un intervalo de tiempo. Ej. SELECT EXTRACT(EPOCH FROM INTERVAL'5 day 3 hours');&lt;/li&gt;&lt;li&gt;hour: devuelve la hora de la fecha, este valor esta entre 0 y 23.&lt;/li&gt;&lt;li&gt;microseconds: El tiempo en segundos, incluyendo la parte fraccionaria multiplicada por 1.000.000.&lt;/li&gt;&lt;li&gt;millennium: devuelve el valor del milenio del año. Ej. el año 1990 es el milenio 2 y el año 2001 es el milenio 3.&lt;/li&gt;&lt;li&gt;milliseconds: devuelve los segundos del campo tiempo multiplicado por 1.000.&lt;/li&gt;&lt;li&gt;minute: devuelve los minutos del campo, este valor esta definido entre 0 y 59.&lt;/li&gt;&lt;li&gt;month: Para valores timestamp, devuelve el numero del mes sin el año, los valores están definidos entre 0 y 12. También permite obtener intervalos de meses. Ej. SELECT EXTRACT (MONTH FROM INTERVAL '2 years 3 months');&lt;/li&gt;&lt;li&gt;quarter: Divide el año en cuatro y devuelve valores entre 1 y 4, según el intervalo en que se encuentre el día en el año.&lt;/li&gt;&lt;li&gt;second: devuelve la cantidad de segundos incluyendo la parte fraccionaria del campo.&lt;/li&gt;&lt;li&gt;timezone: La zona horaria en UTC, medida en segundos, los valores positivos corresponden a la zona horaria este de UTC y los valores negativos a la zona horaria oeste de UTC.&lt;/li&gt;&lt;li&gt;timezone_hour: La hora correspondiente de la zona horaria. &lt;/li&gt;&lt;li&gt;timezone_minute: Los minutos correspondientes a la zona horaria.&lt;/li&gt;&lt;li&gt;week: El número de la semana del año.&lt;/li&gt;&lt;li&gt;year: devuelve el año de la fecha, no hay año 0, así que hay años antes de Cristo y después de Cristo.&lt;/li&gt;&lt;/ul&gt;"Gracias, por compartir tus conocimientos"&amp;nbsp; &lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/841276491699504389-8094952161809654726?l=granodearena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/8094952161809654726/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://granodearena.blogspot.com/2010/11/postgresql-extraer-los-campos-de-una.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/8094952161809654726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/8094952161809654726'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/2010/11/postgresql-extraer-los-campos-de-una.html' title='PostgreSQL: Extraer los campos de una fecha'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-841276491699504389.post-4842967288734160807</id><published>2010-10-28T22:44:00.000-03:00</published><updated>2010-10-28T22:44:07.062-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSQL'/><title type='text'>PostgreSQL: Ingreso a la base de datos sin clave</title><content type='html'>El usuario de una base de datos postgres puede desear acceder al motor de base de datos sin tener que ingresar la clave.&lt;br /&gt;Para lograr esto se debe crear el archivo ".pgpass" en el directorio home del usuario que desea ingresar sin la password.&lt;br /&gt;El archivo debe contener líneas con el siguiente formato.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;hostname:port:database:username:password&lt;/li&gt;&lt;/ul&gt;En el archivo los campos descritos contienen la siguiente información:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;hostname -&amp;gt; debe escribir "localhost" si la base de datos se encuentra en el mismo equipo, de encontrarse en otro se debe escribir la ip del equipo o el nombre del equipo en la red.&lt;/li&gt;&lt;li&gt;port -&amp;gt; se debe ingresar el numero del puerto de conexión al postgres, por defecto el puerto de conexión de postgres es "5432".&lt;/li&gt;&lt;li&gt;database -&amp;gt; se debe escribir el nombre de la base de datos a la cual se desea ingresar.&lt;/li&gt;&lt;li&gt;username -&amp;gt; se debe escribir el nombre de usuario con el cual se desea acceder a la base de datos.&lt;/li&gt;&lt;li&gt;password -&amp;gt; se debe ingresar la password utilizada por el usuario para ingresar a la base de datos.&lt;/li&gt;&lt;/ul&gt;Este archivo debe tener estrictamente los permisos de lectura y escritura solo para el usuario y ningún permiso para el grupo u otros. Para revisar los permisos del archivo se puede ejecutar el siguiente comando.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;ls -la .pgpass&lt;/li&gt;&lt;/ul&gt;Esto entregara la siguiente línea como respuesta.&lt;br /&gt;&lt;ul&gt;&lt;li&gt; -rw-------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nombreusuario&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nombregrupo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tamaño&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fechamodificacion&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .pgpass&lt;/li&gt;&lt;/ul&gt;Si los permisos del archivo no están como se observa en la línea anterior, se debe utilizar el siguiente comando para cambiar los permisos del archivo.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;chmod 600 .pgpass&lt;/li&gt;&lt;/ul&gt;"Gracias, por compartir tus conocimientos"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/841276491699504389-4842967288734160807?l=granodearena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/4842967288734160807/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://granodearena.blogspot.com/2010/10/postgresql-ingreso-la-base-de-datos-sin.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/4842967288734160807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/4842967288734160807'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/2010/10/postgresql-ingreso-la-base-de-datos-sin.html' title='PostgreSQL: Ingreso a la base de datos sin clave'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-841276491699504389.post-4636648101751565391</id><published>2010-10-27T21:07:00.002-03:00</published><updated>2010-10-27T21:11:49.713-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSQL'/><title type='text'>PostgreSQL: Copiar resultado de un SELECT a un archivo</title><content type='html'>Existen ocasiones en las que es deseable pasar los resultados de un SELECt a un archivo, postgres permite que realices esta operación. Para esto debes ejecutar el siguiente comando en la consola del postgres.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;postgres=#copy (select * from nombre_tabla) to 'directorio_name/file_name';&lt;/li&gt;&lt;/ul&gt;Esto permite copiar todos los datos obtenidos en el select al archivo ubicado en el directorio seleccionado. Para que quede más claro se puede observar el siguiente ejemplo que es ejecutado en la consola de postgres en un equipo con linux instalado.&lt;br /&gt;&lt;ul&gt;&lt;li&gt; postgres=#copy (select * from alumnos) to '/tmp/datos.txt';&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;IMPORTANTE:&lt;br /&gt;Es importante recordar algunos comandos de postgres que permiten obtener ayuda.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;postgres=#\h =&amp;gt; permite obtener ayuda de los comandos de postgres.&lt;/li&gt;&lt;li&gt;postgres=#\help comando =&amp;gt; permite obtener ayuda de un comando especifico de postgres.&lt;/li&gt;&lt;li&gt;postgres=#\? =&amp;gt; permite obtener ayuda de los comandos del cliente de postgres.&lt;/li&gt;&lt;/ul&gt;Antes de terminar debo aclarar que "postgres=#" indica que el comando es ejecutado en la consola del postgres.&lt;br /&gt;&lt;br /&gt;"Gracias, por compartir tus conocimientos"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/841276491699504389-4636648101751565391?l=granodearena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/4636648101751565391/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://granodearena.blogspot.com/2010/10/postgresql-copiar-resultado-de-un.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/4636648101751565391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/4636648101751565391'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/2010/10/postgresql-copiar-resultado-de-un.html' title='PostgreSQL: Copiar resultado de un SELECT a un archivo'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-841276491699504389.post-2237317875291913630</id><published>2010-10-26T22:54:00.004-03:00</published><updated>2010-10-27T15:12:43.515-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSQL'/><title type='text'>PostgreSQL: Modos de ingreso, creación de usuarios y base de datos</title><content type='html'>Después de instalar PostgreSQL en un equipo con Ubuntu se debe ingresar al sistema con un usuario y a una base de datos existentes en el motor de base de datos, para esto se puede utilizar el siguiente comando.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;sudo -u usuario psql base_de_datos&lt;/li&gt;&lt;/ul&gt;Como usuario se debe utilizar postgres y como base de datos postgres, esto permitirá al usuario ingresar al motor de base de datos sin necesidad de una clave más que la del superusuario.&lt;br /&gt;&lt;br /&gt;Una vez que se ha ingresado se debe crear un usuario para trabajar con las bases de datos, esto se puede realizar con el siguiente comando.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;CREATE USER "usuario" WITH CREATEDB CREATEUSER PASSWORD 'password'&lt;/li&gt;&lt;/ul&gt;Como usuario se debe ingresar el nombre del usuario que se creará y como password la clave de ingreso del usuario, por ejemplo para crear como usuario el mismo de php se debe escribir lo siguiente.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;CREATE USER "www-data" WITH CREATEDB CREATEUSER PASSWORD 'www-data'&lt;/li&gt;&lt;/ul&gt;Para crear una base de datos que sea propiedad del usuario que se ha creado se debe utilizar el comando escrito a continuación.&lt;br /&gt;&lt;ul&gt;&lt;li&gt; CREATE DATABASE nombre_base_datos WITH OWNER = "usuario"&lt;/li&gt;&lt;/ul&gt;Una vez que el usuario y la base de datos del mismo han sido creados se puede ingresar a PostgreSQL con el siguiente comando.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;psql -h localhost -U usuario nombre_base_datos&lt;/li&gt;&lt;/ul&gt;Luego el motor solicita la password ingresada para el usuario en el proceso de creación. Ahora puedes realizar todas las operaciones que desees con la base de datos que acabas de crear.&lt;br /&gt;&lt;br /&gt;"Gracias, por compartir tus conocimientos"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/841276491699504389-2237317875291913630?l=granodearena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/2237317875291913630/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://granodearena.blogspot.com/2010/10/postgresql-modos-de-ingreso-creacion-de.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/2237317875291913630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/2237317875291913630'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/2010/10/postgresql-modos-de-ingreso-creacion-de.html' title='PostgreSQL: Modos de ingreso, creación de usuarios y base de datos'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-841276491699504389.post-8912899153361520247</id><published>2010-10-25T21:08:00.002-03:00</published><updated>2010-10-27T15:13:05.872-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSQL'/><title type='text'>PostgreSQL: Control de Secuencias</title><content type='html'>En PostgreSQL se pueden crear tablas con "primary key" autoincrementables, como se pude observar en el siguiente ejemplo.&lt;br /&gt;&lt;br /&gt;create table alumnos (&lt;br /&gt;&amp;nbsp;&amp;nbsp; id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SERIAL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; not null,&lt;br /&gt;&amp;nbsp;&amp;nbsp; nombre varchar(255) NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp; constraint pk_beneficios primary key (id));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Esto creara una secuencia autoincrementable para la "primary key" como se observa a continuación.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; not null valor por omisión nextval('alumnos_id_seq'::regclass)&lt;br /&gt;&lt;br /&gt;En ocaciones es necesario observar o modificar los valores de la secuencia, para realizar estas operaciones, se pueden utilizar las siguientes sentencias.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;"SELECT last_value FROM nombre_secuencia;": Retorna el último valor de la secuencia.&lt;/li&gt;&lt;li&gt;"SELECT nextval('nombre_secuencia');": Retorna el valor del último número de la secuencia y lo incrementa en 1. &lt;/li&gt;&lt;li&gt;"SELECT setval ('nombre_secuencia', valor);": Asigna el valor a la secuencia, obligando a nextval a retornar (valor + 1).&lt;/li&gt;&lt;li&gt;"SELECT setval('nombre_secuencia',valor,true);": Funciona del mismo modo que la sentencia anterior.&lt;/li&gt;&lt;li&gt;"SELECT setval('nombre_secuencia',valor,false);": Asigna el valor a la secuencia, obligando a nextval a retornar (valor).&lt;/li&gt;&lt;li&gt;"SELECT currval('nombre_secuencia');": Retorna el valor del último número de la secuencia.&lt;/li&gt;&lt;/ul&gt;El nombre_secuencia puede ser remplazado por "alumno_id_seq" del primer ejemplo, mientras que el valor debe ser un entero mayor que 0 (cero).&lt;br /&gt;&lt;br /&gt;"Gracias, por compartir tus conocimientos"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/841276491699504389-8912899153361520247?l=granodearena.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://granodearena.blogspot.com/feeds/8912899153361520247/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://granodearena.blogspot.com/2010/10/postgres-control-de-secuencias.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/8912899153361520247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/841276491699504389/posts/default/8912899153361520247'/><link rel='alternate' type='text/html' href='http://granodearena.blogspot.com/2010/10/postgres-control-de-secuencias.html' title='PostgreSQL: Control de Secuencias'/><author><name>jp</name><uri>http://www.blogger.com/profile/11288003304062565813</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
