January 18th, 2012
This error may have a variety of causes, and this is how I fixed it:
1. Dropped old Database Console
$ emca -deconfig dbcontrol db
2. Recreated Database Console
$ emca -config dbcontrol db
In the above step, the operation log ended up with:
SEVERE: Error starting Database Control
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Error starting Database Control
at oracle.sysman.emcp.EMDBPostConfig.performConfiguration(EMDBPostConfig.java:649)
at oracle.sysman.emcp.EMDBPostConfig.invoke(EMDBPostConfig.java:227)
at oracle.sysman.emcp.EMDBPostConfig.invoke(EMDBPostConfig.java:196)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:184)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:494)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1161)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:478)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:426)
After having repeated steps 1 and 2 a couple of times, checked environment variables were correctly set and checked users SYS, DBSNMP and SYSMAN were not locked, I started looking for this issue in oracle forums and I found the following:
https://forums.oracle.com/forums/thread.jspa?threadID=2173463
The root certificate used to secure communications via the Secure Socket Layer (SSL) protocol expires on 31-Dec-2010 00:00:00O , so If you try to configure Database Console after that date the certificate will cause errors.
Luckyly, Oracle released patch 8350262 which solves this issue.
3. So the obviously following step is to apply patch 8350262 which doesn't need to put the database offline. Just check the provided README.txt from the patch zip file and you'll be safe.
4. Repeat steps 1 and 2 again, and your OEM will be up this time
Tags: oem, oracle
Posted in oracle | No Comments »
December 29th, 2011
#!perl
use warnings;
use strict;
use Net::SMTP;
my $smtpserver = 'xxx.yyy.zzz.www';
my $smtpuser = 'foo@bar.com';
my $fromemail = 'bleh@bar.com';
my $smtp = Net::SMTP->new($smtpserver, Timeout => 10, Debug => 1);
die "Could not connect to server!\n" unless $smtp;
$smtp->auth ( 'user', 'secret' ) or die "Could not authenticate $!";
$smtp->mail($smtpuser);
$smtp->to('somebody@bar.com');
$smtp->data();
$smtp->datasend("To: somebody\@bar.com\n");
$smtp->datasend("From: $fromemail\n");
$smtp->datasend("\n");
$smtp->datasend("Body message\n");
$smtp->dataend();
$smtp->quit;
Tags: linux, perl, smtp
Posted in linux | No Comments »
November 29th, 2011
If you try to install the Recovery console into a Windows 2003 Server SP2 computer (or any windows service-packed computer) from the installation media, you may receive the error:
"Setup cannot continue because the version of Windows on your computer is newer than the version on the CD."
This happens because windows expects a Windows xxx SPyyy CD. If you don't have a CD suitable for the service pack currently installed, follow this link.
If when running FolderPath:\i386\winnt32.exe /cmdcons you receive the message "No valid system partitions were found" follow this other link as well.
As a plus, if you need the Recovery console commands syntax, go here.
Tags: recovery console, service pack, windows
Posted in windows | No Comments »
November 21st, 2011
Sometimes, a stale NFS mount point can be a real PITA, specially if you can't mount the share somewhere else.
The following command line have helped me a lot lately:
umount -f -l /path/to/nfs/share
The first parameter forces umount, the second makes a "lazy umount", detaching the filesystem and cleaning up all references.
Easy isn't it?
Tags: nfs, share, stale
Posted in linux | No Comments »
November 7th, 2011
René "Nepomusemo" Mayorga shared with me the following script to find out duplicate mp3 files in a specific directory:
find /media/music/ -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find /media/music/ -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate
This script might be used to find duplicate files, though
Tags: duplicate, mp3
Posted in linux, nancing | 2 Comments »
October 5th, 2011
Si en php al intentar utilizar fopen obtienen un resultado como:
Download Failed: Remote Server connection failed: fopen(http://jsitepoint.com/update/packages/joomla/update.xml) [function.fopen]: failed to open stream: no suitable wrapper could be found; Using Proxy: No(42)
La solución es editar php.ini modificando/agregando:
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-fopen
allow_url_fopen = On
Tags: fopen, php, url
Posted in linux | No Comments »
September 23rd, 2011
MySQL puede ser un poco delicado al momento de manipular usuarios. Al intentar crear un usuario, el cual yo sabía que existió en algún momento, me devolvió el error 1396
mysql> CREATE USER 'foo'@'localhost' IDENTIFIED BY 'lacontraseña';
ERROR 1396 (HY000): Operation CREATE USER failed for 'foo'@'localhost'
Entonces procedí a verificar si existía en la tabla mysql.user:
mysql> select user,host from mysql.user where user = 'foo';
Empty set (0.00 sec)
Lo anterior sucede porque el usuario todavía existe en la tabla mysql.db , lo cual se puede solucionar de la siguiente manera:
1. Utilizando comandos mysql de manejo de usuarios:
REVOKE priv1,priv2,priv3,etc... FROM 'foo'@'localhost';
DROP USER 'foo'@'localhost';
2. Eliminandolo directamente de la tabla mysql.db
delete from mysql.db where user=foo
Tags: create, mysql, user
Posted in linux | 1 Comment »
August 31st, 2011
El día de hoy alguien en un canal de irc me preguntaba como se instalaba software en una distribución X Linux. Nada del otro mundo, todos tenemos dudas. Luego me preguntaba ciertas opciones del software de instalación, luego acerca de como se actualizaba y luego porque no le funcionaba.
El usuario llevaba una semana preguntando lo mismo y me dijo que ya había leído la documentación varias veces. La documentación responde claramente a las preguntas que hacía.
Recuerdo que hace unos 6 años, en los canales de irc no se hacían ese tipo de preguntas dia y noche. Generalmente el que preguntaba ya había leído la documentación y en lugar de preguntar "cómo instalo" preguntaba si la forma en que había hecho el procedimiento era el correcto.
De hecho leer lo que pasaba en esos canales era interesante, ya que siempre se aprendía algo. Se aprendía sobre software, trucos en la línea de comandos, seguridad, etc.
Ahora realmente los canales en español son deprimentes. A menos que tengas un grupo de amigos en ese canal, no dan ganas de estar ahí. Ves usuarios preguntando lo obvio, y cuando le das un vínculo con la solución no desean leer o insultan diciendote elitista.
Lo mismo pasa en las listas y en muchos foros.
Menciono latinoamérica porque he estado presente en canales de irc en español de las principales distribuciones, pero con el tiempo he decidido ya no entrar.
También otra cosa que he notado es que la calidad del usuario ha disminuido asi como ha aumentado la popularidad de distribuciones como ubuntu, que sacrificando calidad intentan ofrecer interfaces que faciliten la vida del usuario.
Me imagino que este es el precio que hay que pagar al intentar hacer de Linux un sistema operativo más popular y menos técnico.
Tags: desarrollo, linux, usuario
Posted in linux | 7 Comments »
August 30th, 2011
En GNU/Linux, estamos acostumbrados a nombres de discos tales como /dev/hda /dev/sda e incluso algo como /dev/cciss/c0d0
En cambio en Windows® siempre hemos visto algo como "C:" o "D:". Tienen nombres específicos dentro del sistema operativo?
Pues la respuesta se encuentra ejecutando el comando wmic dentro de una ventana de comandos de windows:
wmic diskdrive list
C:\>wmic diskdrive list
Availability BytesPerSector Capabilities CapabilityDescriptions Caption CompressionMethod ConfigManagerErrorCode ConfigManagerUserConfig CreationClassName DefaultBlockSize Description DeviceID ErrorCleared ErrorDescription ErrorMethodology Index InstallDate InterfaceType LastErrorCode Manufacturer MaxBlockSize MaxMediaSize MediaLoaded
MediaType MinBlockSize Model Name Ne
edsCleaning NumberOfMediaSupported Partitions PNPDeviceID
PowerManagem
entCapabilities PowerManagementSupported SCSIBus SCSILogicalUnit SCSIPort S
CSITargetId SectorsPerTrack Signature Size Status StatusInfo System
CreationClassName SystemName TotalCylinders TotalHeads TotalSectors TotalTracks TracksPerCylinder
512 {3, 4} WDC WD800BB-
23FJA0 0 FALSE Win3
2_DiskDrive Unidad de disco \\.\PHYSICALDRIVE0
0 IDE
(Unidades de disco estándar) TRUE
Fixed hard disk media WDC WD800BB-23FJA0 \\.\PHYSICALDRIVE0
3 IDE\DISKWDC_WD800BB-23FJA0____
__________________13.03G13\4457572D4143394A363335343934203620202020
0 0 0
1 63 43808126 80031974400 OK Win32
_ComputerSystem CERVERO 9730 255 156312450 248115
0 255
Y nos mostrará toda clase de información sobre unidades de disco, siendo el nombre del dispositivo \\.\PHYSICALDRIVE0
Tags: diskdrive, wmic
Posted in windows | No Comments »
August 8th, 2011
Antes de realizar lo que sigue, es recomendable hacer un respaldo del directorio adonde se encuentren los logs binarios de mysql.
En una instalación básica de mysql, no se requieren los logs binarios de MySQL, debido a que estos son utilizados principalmente en las siguientes situaciones:
- Replicación
- Algunas operaciones de recuperación de información
En mi caso, deseaba eliminarlos, ya que estaban consumiendo varios GBs de espacio en disco, utilizando los siguientes comandos:
mysql> FLUSH LOGS;
mysql> RESET MASTER;
El
primer comando cierra y vuelve a abrir todos los archivos de logs ,
el segundo borra todos los logs binarios listados en el archivo índice (normalmente mysql-bin.index ) , resetea dicho archivo y crea un nuevo archivo de log binario.
Para realizar lo anterior no es necesario reiniciar la instancia.
Tags: bin, flush, logs, master, mysql
Posted in linux | No Comments »