viernes, 18 de agosto de 2023

Un esquema de SQL interesante.



 


martes, 27 de febrero de 2018

SHARED FOLDER BETWEEN WINDOWS AND MANJARO (VIRTUAL) IN VIRTUALBOX

With Manjaro in the virtual machine you need to run a sequence of commands and then your ROOT file manager will be able to access your shared folder...


su
systemctl enable vboxservice
systemctl start vboxservice
groupadd vboxsf
gpasswd -a $USER vboxsf
exit

Open Thunar as ROOT and you will have access to your shared folders in the VM assuming you have them automounted. In the future, when you have an issue which is different than the ORIGINAL topic, please start a NEW thread so we can keep things organized for the benefit of others who may need this solution.

take  from -> http://www.cupoflinux.com/SBB/index.php?topic=4627.0

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