viernes, 28 de julio de 2017


INSTALACION DE MYSQL EN MANJARO.

Normalmente este tipo de post son muy sencillos y se consiguen un google particularmente hago este post ya que tuve un problema en la instalacion.

Empezamos con actualizar el sistema:

 $ sudo pacman -Syu

Luego instalamos

$ sudo pacman -S mysql

Luego de la instalación recomiendo hacer este paso para no poseer inconvenientes

$ sudo mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/ --force
Continuamos con la configuracion iniciamos el demonio de mysql

$ sudo systemctl start mysqld

Digitamos el comando de configuracion

$ sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
 ... Success!
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
 ... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
 ... Success!
Cleaning up...
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!



Y para terminar entramos a la base de datos.

$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 10.1.25-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show tables;
ERROR 1046 (3D000): No database selected
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)


Espero les sirva. :D

miércoles, 8 de marzo de 2017

De una seceuncia de caracteres obtener el ultimo caracter:

  SELECT SUBSTR('defrgtyh asqw fgvb uijk m,jk 56789',INSTR('defrgtyh asqw fgvb uijk m,jk 56789', ' ', -1) +1) AS ID FROM DUAL; 

el resultado seria : 56789

Gracias.

jueves, 3 de noviembre de 2016

Se necesita que un condicional IN en consulta de oracle se cargue mas de un dato.

https://blogs.oracle.com/aramamoo/entry/how_to_split_comma_separated_string_and_pass_to_in_cl
ause_of_select_statement

Esta seria la sentencia:

 select regexp_substr('SMITH,ALLEN,WARD,JONES','[^,]+', 1, level) from dual
 connect by regexp_substr('SMITH,ALLEN,WARD,JONES', '[^,]+', 1, level) is not null;


REGEXP_SUBSTR('SMITH,A
----------------------
SMITH
ALLEN
WARD
JONES

miércoles, 26 de octubre de 2016

Como  obtener año mes y días entre dos fechas en base de datos oracle:

Esta es la consulta para generar esa información:


SELECT TRUNC (MONTHS_BETWEEN (:end_date, :start_date) / 12) YEARS,
MOD (TRUNC (MONTHS_BETWEEN (:end_date, :start_date)), 12) MONTHS,
(  TO_DATE (:end_date) - ADD_MONTHS (:start_date,TRUNC (MONTHS_BETWEEN (:end_date, :start_date))))  DAYS
  FROM DUAL;

lunes, 13 de junio de 2016

INSTALACION DE ORACLE 11G XE EN LINUX, SOBRE EL SISTEMA OPERATIVO LINUX UBUNTU 14.04.

Despues de instalar la base de datos, utilizando el siguiente link:

http://blog.whitehorses.nl/2014/03/18/installing-java-oracle-11g-r2-express-edition-and-sql-developer-on-ubuntu-64-bit/

obtuve el siguiente error : TNS:listener does not currently know of service requested in connect descriptor

Este lo solucione con el siguiente link:
http://dba.stackexchange.com/questions/36370/oracle-11g-listener-fails-with-ora-12514-and-ora-12505-errors







miércoles, 8 de julio de 2015

Cambiar idioma al libreoffice despues de instalalarlo.

Una vez instalado el libreoffice, puede desear cambiar el idioma ha español , únicamente se debe ejecutar el siguiente comando y listo:

sudo apt-get install libreoffice-l10n-es myspell-es ispanish
 

- Reinicia el libreoffice

- Encaso de no funcionar realiza estos cambios en la interfaz de libreoffice:

     - Para la interfaz: Herramientas → Opciones → Configuración de idioma → Idiomas
     - Revisión ortográfica y gramatical: Herramientas → Opciones  →           Configuración         de          idioma → Asistencia a la escritura
 

viernes, 3 de julio de 2015

Configuracion de SqlPlus en ubuntu 14.04

Despues de instalar oracle express edition 11g, en ubuntu 14.04 -  64 bits, entro al sql plus de mi maquina y me encuentro con la sorpresa que no puedo recuperar los comandos escritos, como se realiza en linux pulsando la tecla flecha hacia a rriba. Los pasos para resolver fueron los siguientes:

1- Instalo el paquete llamado : sudo aptitude install rlwrap

2-  Luego escribo el comando en la terminal:  rlwrap sqlplus

3- En caso de no servir tener en cuenta que en las versiones de 14.04 se debe crear el archivo, en la carpeta home  : sudo gedit ~/.bash_profile ,  despues de crearlo copiar del archivo: ~/.profile , la informacion y pegarla en el archivo creado. Luego guardar y listo.

Atento a sus comentarios.