Solaris 11.4 (Beta)

Oracle has released a fresh beta of his famous operating system Solaris. This is the last release of this OS. There are many (very importants) persons says that this release (11) would be the last because of Oracle is planning abandoned it in favour of Oracle Linux. Will see we a 12 release?.

If you want try it, please click in the next link;

Solaris 11.4 Beta download



A Easy Way Of Configure Timezone In Databases From Unix

This morning talking with a partner raised the issue of having several databases at different timeszones in the same Unix machine. There are many ways to do this, some more correct than others. In this case I want show an example using the operating system (in this example I use a Solaris 11.3) this will make us independent of the database engine (Oracle, Sybase, SQL Server on linux) that we use, although all the databases have a mechanism for perform this function from inside the engine of database and that is a mandatory feature of the ISO 9075 standard (or ANSI SQL for the USA).

In Solaris by default, if we do not specify anything, when we create a user and we do not tell him anything he will use the machine, we can see it in the /etc/TIMEZONE file

Ghost> cat /etc/TIMEZONE
# Copyright 1992, 1999-2002 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#ident  "@(#)init.dfl   1.7     02/12/03 SMI"
# This file is /etc/default/init.  /etc/TIMEZONE is a symlink to this file.
# This file looks like a shell script, but it is not.  To maintain
# compatibility with old versions of /etc/TIMEZONE, some shell constructs
# (i.e., export commands) are allowed in this file, but are ignored.
# Lines of this file should be of the form VAR=value, where VAR is one of
# TZ, LANG, CMASK, or any of the LC_* environment variables.  value may
# be enclosed in double quotes (") or single quotes (').


If we execute a date at the level of the prompt;

Ghost> date
Tue Feb 13 16:14:00 UTC 2018


If we login to the same machine but with another user and we see his file .profile where we have defined the variable TZ;

Ghost> cat .profile

export TZ=Europe/Madrid

If we execute a date at the level of the prompt;

Ghost> date
Tue Feb 13 17:15:17 CET 2018


Once we have defined the variable TZ we can create/start the database and it must take this time.



Command sleep In CMD

A coworker asked me how I could put a sleep in a windows batch script. Sleep is a very popular command in Unix and Linux environments, it expects the number of seconds indicated as a parameter before continuing with the next instruction.

The problem is that this command does not exist in Windows, there are some implementations that do that function, although Windows implements its own command, if I remember right from Windows 7.

You can ever document it from a cmd, with timeout / ?, as shown below (I have the language of this machine currently in Spanish);


C:\>timeout /?

TIMEOUT [/T] tiempo_espera [/NOBREAK]

    Esta utilidad acepta un parámetro de tiempo de espera para esperar el
    un período de tiempo determinado (en segundos) o hasta que se presiona
    alguna tecla. También acepta un parámetro para omitir la presión de tecla.

Lista de parámetros:
    /T   tiempo_espera     Especifica el número de segundos que hay
                           que esperar.
                           El intervalo válido es de -1 a 99999 segundos.

    /NOBREAK               Omite las presiones de tecla y espera el tiempo

    /?                     Muestra este mensaje de ayuda.

NOTA: un valor de tiempo de espera -1 significa esperar indefinidamente
una presión de teclado.

    TIMEOUT /?
    TIMEOUT /T 10
    TIMEOUT /T -1


To perform a 5-second stop you would have to execute the following command. It will take out a message indicating when it needs to finish the stop.

C:\>timeout /t 5

Esperando 5 segundos, presione una tecla para continuar ...


ORA-32004 And ORA-27102 After Increase Memory

Today I was increasing the Memory_target for a database when I get the next error;

SQL> startup nomount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORA-27102: out of memory
SVR4 Error: 12: Not enough space
Additional information: 1671
Additional information: 16106127360
Additional information: 12851347456

The problem looks clear, Not enough space, of course, in my case (using Solaris 11.3 with ZFS) this is a well know problem, if ZFS is on default it is very easy use all physical memory;

You can see the memory consume from root user executin the next command

echo ::memstat | mdb -k

The output is below, in this case the 56% of memroy is used by ZFS

Page Summary                 Pages             Bytes  %Tot
----------------- ----------------  ----------------  ----
Kernel                     1551129             11.8G   18%
Defdump prealloc            182104              1.3G    2%
ZFS Metadata                258844              1.9G    3%
ZFS File Data              4657165             35.5G   56%
Anon                        637853              4.8G    8%
Exec and libs                97157            759.0M    1%
Page cache                   57244            447.2M    1%
OSM                         469504              3.5G    6%
Free (cachelist)             14532            113.5M    0%
Free (freelist)             530445              4.0G    6%
Total                      8388608               64G

From ZFS Doc;


Determines the maximum size of the ZFS Adaptive Replacement Cache (ARC). However, see user_reserve_hint_pct.

75% of memory on systems with less than 4 GB of memory

physmem minus 1 GB on systems with greater than 4 GB of memory

Free the memory in used by ZFS and limit it solve the problem.




Calculating MD5 In HPUX

Today I need to check a patch downloaded from Oracle. I don’t remember the unix command to verify the md5 code. I put it here.

The MD5 code (is an algorithm) is used to generate a code (in hexadecimal) that is opted after passing this algorithm for the file that is downloaded. Normally the one that offers the software puts the same and a code that is that it has to match when we generate it when passing the MD5 to the downloaded file. This is used to certify that the downloaded file is good and has not been tampered with. Although the MD5 is being discontinued because it is already quite insecure, more robust algorithms are being used instead.

cloudex> openssl dgst -md5 
MD5( 342811de6db4e4d3ac86b35a2e6efb7c 
cloudex> openssl dgst -sha1 
SHA1( 514735cea58a32a0f1c53c87ddb77575d8016b97 

In the example I genereted the code for sha-1 too. Although this patch has code for the SHA-256 algorithm, openssl command not support SHA-256