{"id":246,"date":"2014-06-16T14:16:14","date_gmt":"2014-06-16T14:16:14","guid":{"rendered":"http:\/\/justmakeit.es\/?p=246"},"modified":"2014-06-16T14:16:14","modified_gmt":"2014-06-16T14:16:14","slug":"oracle-en-aws","status":"publish","type":"post","link":"http:\/\/justmakeit.es\/?p=246","title":{"rendered":"Oracle en AWS"},"content":{"rendered":"<p>A continuaci\u00f3n se detallan los pasos a seguir para poder instalar correctamente un servidor de base de datos Oracle XE.<\/p>\n<p>Para empezar, ser\u00e1 necesario descargar el fichero de instalaci\u00f3n para Linux del Oracle Server; para ello es necesario tener una cuenta en Oracle, que es gratuita, pero que resulta un poco molesta crear, sobre todo porque vas a acceder a un software gratuito, pero es un peaje que hay que pagar.<br \/>\nUna vez descargado el ejecutable procedemos a descomprimirlo<\/p>\n<p><code>sudo unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip -d<br \/>\n<\/code><br \/>\nE intentamos ejecutar el instalable<\/p>\n<p><code>sudo rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm<\/code><\/p>\n<p>Lo cual produce el siguiente mensaje de error<\/p>\n<p><code>Preparing...                ########################################### [100%]<\/p>\n<p>This system does not meet the minimum requirements for swap space.  Based on<br \/>\nthe amount of physical memory available on the system, Oracle Database 11g<br \/>\nExpress Edition requires 2048 MB of swap space. This system has 0 MB<br \/>\nof swap space.  Configure more swap space on the system and retry the<br \/>\ninstallation.<\/p>\n<p>error: %pre(oracle-xe-11.2.0-1.0.x86_64) scriptlet failed, exit status 1<br \/>\nerror:   install: %pre scriptlet failed (2), skipping oracle-xe-11.2.0-1.0<\/code><\/p>\n<p>Para evitar este error<br \/>\n<code>sudo dd if=\/dev\/zero of=\/swapfile bs=1024 count=2097152<br \/>\n2097152+0 records in<br \/>\n2097152+0 records out<br \/>\n2147483648 bytes (2.1 GB) copied, 36.531 s, 58.8 MB\/s<\/code><\/p>\n<p>Generamos la partici\u00f3n de swap<br \/>\n<code>sudo mkswap \/swapfile<br \/>\nmkswap: \/swapfile: warning: don't erase bootbits sectors<br \/>\n        on whole disk. Use -f to force.<br \/>\nSetting up swapspace version 1, size = 2097148 KiB<br \/>\nno label, UUID=132a8739-0156-4c57-b3f8-b35bf8830085<\/p>\n<p>sudo swapon \/swapfile<\/p>\n<p>sudo cp \/etc\/fstab \/etc\/fstab.orig<\/p>\n<p>sudo chmod 777 \/etc\/fstab.orig<br \/>\nsudo chmod 777 \/etc\/fstab<br \/>\nsudo echo '\/swapfile swap swap defaults 0 0' >> \/etc\/fstab <\/code><\/p>\n<p>Para comprobar que esta bien:<br \/>\n<code>sudo swapon -a<br \/>\nsudo swapon -s<br \/>\nFilename                                Type            Size    Used    Priority<br \/>\n\/swapfile                               file            2097148 0       -1<\/code><\/p>\n<p>Y ahora s\u00ed que ejecutamos el instalable<br \/>\n<code>sudo rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm<br \/>\nPreparing...                ########################################### [100%]<br \/>\n   1:oracle-xe              ########################################### [100%]<br \/>\nExecuting post-install steps...<br \/>\nYou must run '\/etc\/init.d\/oracle-xe configure' as the root user to configure the database.<\/p>\n<p>sudo \/etc\/init.d\/oracle-xe configure<\/p>\n<p>Oracle Database 11g Express Edition Configuration<br \/>\n-------------------------------------------------<br \/>\nThis will configure on-boot properties of Oracle Database 11g Express<br \/>\nEdition.  The following questions will determine whether the database should<br \/>\nbe starting upon system boot, the ports it will use, and the passwords that<br \/>\nwill be used for database accounts.  Press <Enter> to accept the defaults.<br \/>\nCtrl-C will abort.<\/p>\n<p>Specify the HTTP port that will be used for Oracle Application Express [8080]:<\/p>\n<p>Specify a port that will be used for the database listener [1521]:<\/p>\n<p>Specify a password to be used for database accounts.  Note that the same<br \/>\npassword will be used for SYS and SYSTEM.  Oracle recommends the use of<br \/>\ndifferent passwords for each database account.  This can be done after<br \/>\ninitial configuration:<br \/>\nConfirm the password:<\/p>\n<p>Do you want Oracle Database 11g Express Edition to be started on boot (y\/n) [y]:<\/p>\n<p>Starting Oracle Net Listener...Done<br \/>\nConfiguring database...Done<br \/>\nStarting Oracle Database 11g Express Edition instance...Done<br \/>\nInstallation completed successfully.<\/code><\/p>\n<p><code>sudo \/u01\/app\/oracle\/product\/11.2.0\/xe\/bin\/oracle_env.sh<br \/>\n<\/code><br \/>\n<strong>Conectar a la base de datos<\/strong><br \/>\nCon el usuario oracle<br \/>\n.\/sqlplus \/ as sysdba<\/p>\n<p>Crear usuario de acceso a base de datos<br \/>\n<code>CREATE USER MYUSER IDENTIFIED BY MYPWD;<\/code><\/p>\n<p>Dar permiso de conexi\u00f3n al usuario reci\u00e9n creado<br \/>\n<code>grant create session to MYUSER;<br \/>\n<\/code><br \/>\n<strong>Iniciar la instancia XE de base de datos<br \/>\n<\/strong>Despu\u00e9s de conectarse como SYS as SYSDBA<br \/>\n<code>.\/sqlplus SYS@XE as SYSDBA<\/code><\/p>\n<p><code>STARTUP pfile=\/RUTA-INSTALACION-ORACLE\/app\/oracle\/product\/11.2.0\/xe\/dbs\/spfileXE.ora<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A continuaci\u00f3n se detallan los pasos a seguir para poder instalar correctamente un servidor de base de datos Oracle XE. &hellip; <a href=\"http:\/\/justmakeit.es\/?p=246\" class=\"btn btn-readmore\">Read More <span class=\"screen-reader-text\"> \u00abOracle en AWS\u00bb<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,14],"tags":[],"class_list":["post-246","post","type-post","status-publish","format-standard","hentry","category-aws","category-programacion"],"_links":{"self":[{"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/posts\/246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/justmakeit.es\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=246"}],"version-history":[{"count":4,"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/posts\/246\/revisions"}],"predecessor-version":[{"id":250,"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/posts\/246\/revisions\/250"}],"wp:attachment":[{"href":"http:\/\/justmakeit.es\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/justmakeit.es\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=246"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/justmakeit.es\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}