martes, 31 de enero de 2017

ORACLE 12C LIBERAR MEMORIA ALTER SYSTEM FLUSH

SQL>alter system flush shared pool;
SQL>alter system flush buffer cache;

Estadisticas Extendidas

SET SERVEROUTPUT ON

select dbms_stats.create_extended_stats('HR','EMPLOYEES','(employee_id, first_name)') from dual

exec dbms_stats.drop_extended_stats('HR','EMPLOYEES','(employee_id, first_name)');

PUEDO CREAR ESTADISTICAS EXTENDIDAS PARA TODA LA TABLA

SQL> SELECT DBMS_STATS.create_extended_stats('HR','EMPLOYEES') from dual;

DBMS_STATS.CREATE_EXTENDED_STATS('HR','EMPLOYEES')
--------------------------------------------------------------------------------
###############################################################################

SQL> 


exec dbms_stats.drop_extended_stats('sh','customers','(CUST_CITY,CUST_STATE_PROVINCE,COUNTRY_ID)');

DECLARE

cg_name VARCHAR2(30);

BEGIN

cg_name := dbms_stats.create_extended_stats('SH','CUSTOMERS',

'(CUST_CITY,CUST_STATE_PROVINCE,COUNTRY_ID)');

dbms_output.put_line('column group name is:'||cg_name);

dbms_stats.gather_table_stats('SH','CUSTOMERS',

method_opt=>'for all columns size 1, for columns (CUST_CITY,CUST_STATE_PROVINCE,COUNTRY_ID) size 3');

END;

/


ESTA ES LA MEJOR

 select dbms_stats.create_extended_stats('HR','EMPLOYEES') from dual; 


miércoles, 25 de enero de 2017

Excel Comandos

A continuación, te mostramos los 46 trucos de Excel que te convertirán en un experto.
Al abrir una nueva hoja de cálculo, ya podemos aprovechar algunos atajos que nos ayudarán a configurarla a nuestro gusto:
Ctrl + T: convierte una selección de celdas en una tabla.
Ctrl + A: selecciona todas las celdas de un documento.
Alt + F1: crea un gráfico con un grupo de datos seleccionados.
Ctrl + Mayúsculas + L: activa o desactiva el auto filtro.
Ctrl + tecla "+": activa o desactiva las fórmulas de celdas seleccionadas.
F9: calcula todas las operaciones de todas las hojas de trabajo
F9 + selección de parte de una fórmula: calcula esa operación
Mayúsculas + F9: calcula las operaciones de la hoja de trabajo actual
ALT + =: realiza una suma de todas las celdas seleccionadas.
Ctrl + suprimir: volvemos a la última celda activa.
Crtl + teclas de dirección: nos lleva a límite de cada dirección en la hoja de trabajo.
F2: al pulsarlo sobre una celda seleccionada, la editamos. Es como el doble click.
Mayúsculas + F2: añade un comentario a una celda.
Ctrl + Inicio: vuelves a la celda A1 del documento.
Ctrl + Pág. arriba/Pág abajo: cambia entre hojas de trabajo.
Mayúscula + F11: añade una nueva hoja de trabajo al documento.
ESC: sobre una celda seleccionada borra todo y sale de la celda.
Ctrl + ;: añade la fecha de hoy a una celda.
Ctrl + Mayúscula + ":": añade la hora actual a una celda.
Ctrl + D: añade en la celda el contenido de la que tiene encima.
Ctrl + R: añade en la celda el contenido de la que tiene a la derecha.
Ctrl + barra de espacio: selecciona toda la línea y la columna de la celda.
Ctrl + Intro: llena todas las celdas del texto "Ctrl + Enter"
Ctrl + ALT + V: abre un cuadro de pegado de datos especial.
Ctrl + 1: abre el cuadro básico de formato para el contenido.
Ctrl + mayúsculas + ~: aplica el formato "general".
Ctrl + mayúsculas + $: pone los datos en formato "moneda".
Ctrl + mayúsculas + %: pone los datos en formato "porcentaje".
Ctrl + mayúsculas + ^: pone los datos en formato "científico".
Ctrl + mayúsculas + #: pone los datos en formato "fecha".
Ctrl + mayúsculas + @: pone los datos en formato "hora".
Ctrl + mayúsculas + !: pone los datos en formato "estándar".
Ctrl + mayúsculas + &: añade un borde alrededor de la selección.
ALT + R: pone un borde a la derecha de la selección.
ALT + L: pone un borde a la izquierda de la selección.
ALT + B: pone un borde en la parte inferior de la selección.
CTRL + ‘: repite el contenido de la celda superior
CTRL + N: poner el contenido de la celda en Negrita
CTRL + S: subrayar el contenido de una celda
CTRL + K: subrayar el contenido de una celda
CTRL + Mayús + 8: ocultar / Recuperar filas
CTRL + Mayús + 9: ocultar / Recuperar columnas
Mayús + F2: insertar un comentario en una celda
ALT + INTRO: más de una línea en la misma celda
Mayús + Alt y =: autosuma
F4: repetir la última acción

lunes, 23 de enero de 2017

Swap

First of all, login as root and have a look at the filesystem:
[root@oracle-em oracle]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_oracleem-lv_root
                       93G   19G   69G  22% /
tmpfs                 5.9G  112K  5.9G   1% /dev/shm
/dev/sda1             485M   99M  362M  22% /boot
So we can see that tmpfs has a size of 6GB. We can change the size of that filesystem by issuing the following command (where “12g” is the size I want for my MEMORY_TARGET):
[root@oracle-em oracle]# mount -t tmpfs shmfs -o size=12g /dev/shm
This command (re)mounts the shmfs filesystem (check this post for more information about shmfs) with the option “size=12g“.
The shared memory file system should be big enough to accommodate the MEMORY_TARGET and MEMORY_MAX_TARGET values, or Oracle will throw the ORA-00845 error. Note that when changing something with the mount command, the changes are not permanent.
To make the change persistent, edit your /etc/fstab file to include the option you specified above:
[root@oracle-em ~]# cat /etc/fstab
[..]
tmpfs                   /dev/shm                tmpfs   size=12g        0 0

jueves, 5 de enero de 2017

Troubleshooting Guide ORA-3136: WARNING Inbound Connection Timed Out (Doc ID 465043.1)

To BottomTo Bottom

In this Document
Purpose
Troubleshooting Steps
References

Applies to:

Oracle Net Services - Version 10.2.0.5 to 12.1.0.2 [Release 10.2 to 12.1]
Information in this document applies to any platform.
***Checked for relevance on 23-SEPT-2015***

Purpose

Troubleshooting guide for "ORA-3136  WARNING inbound connection timed out" seen in the alert log.

Troubleshooting Steps

The "WARNING: inbound connection timed out (ORA-3136)" in the alert log indicates that the client was not able to complete  the  authentication process within the period of time specified by the parameter SQLNET.INBOUND_CONNECT_TIMEOUT.

You might also see the errors ORA-12170 or TNS-12535 in the sqlnet.log that is generated on the server.
Check $ORACLE_HOME/network/log for this file.  This entry should contain client address from which the timeout originated and may be helpful in determining how to troubleshoot the issue.  Some applications or JDBC thin driver applications may not have these details.  The sqlnet.log file is not generated  by default in 11g and newer. 

From 10.2.0.1 onwards the default setting for the parameter SQLNET.INBOUND_CONNECT_TIMEOUT is 60 seconds.  If the client is not able to authenticate within 60 seconds, the warning would appear in the alert log and the client connection will be terminated.
Note: This timeout restriction was introduced to combat Denial of Service (DoS) attack whereby malicious clients attempt to flood database servers with connect requests that consumes resources.

The following are the most likely reasons for this error -
  1. Server gets a connection request from a malicious client which is not supposed to connect to the database.  In this case the error thrown would be the expected and desirable behavior. You can get the client address for which the error was thrown in the sqlnet.log file that is local to the database.
  2. The server receives a valid client connection request but the client takes a long time to authenticate more than the default 60 seconds.
  3. The DB server is heavily loaded due to which it cannot finish the client logon within the timeout specified.
To understand what is causing this issue, following checks can be done
The default value of 60 seconds is good enough in most conditions for the database server to authenticate a client connection. If it is taking longer, then it's worth checking the following items before implementing the workaround:

1. Check whether local connection on the database server is successful & quick.
2. If local connections are quick ,then check for underlying network delay with the help of your network administrator.
3. Check whether your Database performance has degraded in anyway.
4. Check alert log for any critical errors for eg, ORA-600 or ORA-7445 and get them  resolved first.
These critical errors might have triggered the slowness of the database server.

It is often necessary to increase the values for INBOUND CONNECT TIMEOUT at  both the listener and the database in order to resolve this issue.    It is usually advisable to set the database (sqlnet.ora) value slightly higher than the listener (listener.ora).    The authentication process is more demanding for the database than the listener.


To set these parameters to use values higher than the default of 60 seconds, follow these instructions and restart the listener.  There is no need to restart Oracle:

Edit the server side sqlnet.ora file and add this parameter:

SQLNET.INBOUND_CONNECT_TIMEOUT=  Where is the value in seconds.

E.g.:

SQLNET.INBOUND_CONNECT_TIMEOUT = 120

Edit the listener.ora file and add this parameter:
INBOUND_CONNECT_TIMEOUT_ =   Again, where is the timeout value in seconds. 

For example if the listener name is LISTENER then use:

INBOUND_CONNECT_TIMEOUT_LISTENER = 110

From Oracle version 10.2.0.1 onwards the default value of INBOUND_CONNECT_TIMEOUT_ is 60 seconds. For previous releases it is zero or OFF by default.

How to check whether inbound timeout is active for the listener:

For example,  INBOUND_CONNECT_TIMEOUT_ =110

You can check whether the parameter is active or not by simply doing telnet to the listener port.
$ telnet
for eg.

$ telnet 123.23.23.23 1521

The telnet session should disconnect after 110 seconds which indicates that the inbound connection timeout for the listener is active.

Alternatively, check at the LSNRCTL prompt using:

LSNRCTL>set current_listener
LSNRCTL>show inbound_connect_timeout

To check whether database server SQLNET.INBOUND_CONNECT_TIMEOUT is active:
Eg.

SQLNET.INBOUND_CONNECT_TIMEOUT=120

miércoles, 4 de enero de 2017

Comandos Solaris

COMANDO SCP

scp letodb-02-11-11.dmp.gz oracle@172.20.101.16:/u01

CAMBIAR FECHA

 date 1021.00

route
route -p add default 10.1.2.1
route -p delete 10.1.3.0 10.1.2.1
Comunidad snmp
svcadm restart net-snmp
snmpwalk -v 2c -m all -c mcsmgmtRO 10.57.130.22 | more
redes
netstat -nr
cat /etc/vfstab
mount 192.168.1.3:/export/NFS/NFS_USBFS0001 /u03
umount /u03