Archives For March 2013

... still waiting

today I quickly wanted a visual representation of an oracle schema and remembered that oracle provides sql developer data modeler which will do this for me. headed over to the download page, wanted to download … ups, only a rpm available for linux.

but, there is alien and this makes the conversion from a rpm to a deb package straightforward and easy:

$sudo apt-get install alien
$sudo alien datamodeler-
  Warning: Skipping conversion of scripts in package datamodeler: postinst
  Warning: Use the --scripts parameter to include the scripts.
  datamodeler_3.3.0.744-2_all.deb generated

done. installed:

$sudo dpkg -i datamodeler_3.3.0.744-2_all.deb
  Selecting previously unselected package datamodeler.
  (Reading database ... 150737 files and directories currently installed.)
  Unpacking datamodeler (from datamodeler_3.3.0.744-2_all.deb) ...
  Setting up datamodeler ( ...

ready to use:

$which datamodeler
$ datamodeler 

Oracle SQL Developer Data Modeler
 Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 

data modeler

some time ago I blogged about the managed tablespace privilege and pointed out that there is either a software or documentation bug as this privilege also allows renaming tablespaces. according to oracle support this is a documentation issue and not a software bug. additionally these operations are allowed, too, if you grant the privilege:

alter tablespace nologging;
alter tablespace logging;
alter tablespace force logging;
alter tablespace no force logging;

just a little hint that there is another option than top, which is htop. pre-compiled packages are available for the most distributions.

check htop’s sourceforge page for a tiny comparison between htop and top.

(still) waiting for spring

if you want to play with the latest postgresql development snapshot here is a very simple makefile which does the work for you ( given that you have installed all the dependencies required for building postgresql ):

CURRDIR=$(shell pwd)

fromscratch: reset download buildpg initdb startdb

reset: stopdb
        rm -rf build
        rm -rf install
        rm -rf data
        mkdir build
        mkdir install
        mkdir data

        wget ${PG}
        mv ${PGFILE} build/

        ( cd build && tar -axf ${PGFILE} )
        ( cd build/postgresql-${PGBASEVER}* && ./configure --prefix=${CURRDIR}/install )
        ( cd build/postgresql-${PGBASEVER}* && make )
        ( cd build/postgresql-${PGBASEVER}* && make check )
        ( cd build/postgresql-${PGBASEVER}* && make install )

        ( cd install/bin && ./initdb -D ${DATADIR} )

        ( install/bin/pg_ctl -D ${DATADIR} start ) 

        if [ -f ${DATADIR}/ ]; then \
                ( install/bin/pg_ctl -D ${DATADIR} stop -m fast ) \

copy this to a directory where you are the owner of, name the file “Makefile” and execute:

make fromscratch

this will create the directories, download the latest snapshot, compile the source and start the postgresql database ( this takes 4 minutes on my mint workstation ). once the script finished you may connect to the database and start playing:

install/bin/psql postgres
psql (9.3devel)
Type "help" for help.

postgres=# \h create materialized view
Description: define a new materialized view
    [ (column_name [, ...] ) ]
    [ WITH ( storage_parameter [= value] [, ... ] ) ]
    [ TABLESPACE tablespace_name ]
    AS query
    [ WITH [ NO ] DATA ]


of course you may put this in a shell script, too. but this way it was more fun :)

some day