Archive October 2014

clean system data (oracle database)

Following, a useful sql request listing system tables sizes in descending order. It helps to detect which table data could be purged to save more disk space :

select owner, segment_name, segment_type, bytes / 1024 / 1024 "size"
  from dba_segments
 where tablespace_name = 'SYSTEM'
 order by "size" desc;

Audit table SYS.AUD$ could be the cause of full disk space. Administrator must control the growth and size of the audit trail.

upgrade mongodb under ubuntu

To upgrade mongodb follow steps bellow :


$[/home/witr] sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

$[/home/witr] echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

$[/home/witr] sudo apt-get update

$[/home/witr] sudo apt-get install mongodb-10gen

Note
While upgrading you have dpkg-deb error processing at step 4
/var/cache/apt/archives/mongodb-10gen_2.4.11_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

You must remove mongodb-clients before apt-get install :


$[/home/witr] sudo apt-get remove mongodb-clients

$[/home/witr] sudo apt-get install mongodb-10gen

delete one of duplicated rows in table (rownum with postgresql)

You have to delete one of duplicated row within table which doesn’t have a primary key:

delete from  
 where ctid = (select min(ctid) from 
);