Monday, April 23, 2007

Oracle TOP otop

Before you can run otop.pl you will have to have an active connection to your Oracle database, meaning you will have to have Perl DBI and DBD Oracle. The installation of those 2 is described in a previous post.

[root@pubjo root]# ./otop.pl
Can't locate Curses.pm in @INC (@INC contains: /usr/lib/perl5/i386-linux /usr/lib/perl5 /usr/lib/perl5/site_perl/i386-linux /usr/lib/perl5/site_perl /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .) at ./otop.pl line 75.
BEGIN failed--compilation aborted at ./otop.pl line 75.

To fix this problem you will need to install the Perl Module Cursus. You can download the Cursus module from CPAN.

1) Download the latest version of curses
2) Unpack curses
- [root@pubjo root]# gunzip Curses-1.15.tar.gz
- [root@pubjo root]# tar -xvf Cusres.1.15.tar
3) make/install curses
[root@pubjo root]# perl makefile.PL FORMS
[root@pubjo root]# make
[root@pubjo root]# make install
4) cleanup the tar file and the temp directory.

It could be that your installation is failing with the following error message:

c-config.h:9:21: ncurses.h: No such file or directory
Curses.c:91: parse error before `WINDOW'
Curses.c:91: warning: data definition has no type or storage class
Curses.c:94: parse error before `{'
Curses.c:96: initializer element is not constant
Curses.c:98: parse error before `return'
Curses.c: In function `c_chtype2sv':
Curses.c:142: `ERR' undeclared (first use in this function)
Curses.c:142: (Each undeclared identifier is reported only once
Curses.c:142: for each function it appears in.)
Curses.c: At top level:
Curses.c:284: parse error before `*'
Curses.c: In function `c_sv2window':
Curses.c:290: `WINDOW' undeclared (first use in this function)
Curses.c:290: `ret' undeclared (first use in this function)
Curses.c:290: parse error before `)'
Curses.c: In function `c_window2sv':
Curses.c:303: parse error before `WINDOW'
In file included from Curses.c:358:
CursesFun.c: In function `XS_Curses_longname':
CursesFun.c:3125: warning: initialization makes pointer from integer without a cast
CursesFun.c: In function `XS_Curses_touchline':
CursesFun.c:3226: `WINDOW' undeclared (first use in this function)
CursesFun.c:3226: `stdscr' undeclared (first use in this function)
CursesFun.c:3227: parse error before `int'
CursesFun.c:3233: `ret' undeclared (first use in this function)
make: *** [Curses.o] Error 1
/usr/bin/make -- NOT OK

The line “c-config.h:9:21: ncurses.h: No such file or directory” is telling you that you have to install ncurses first. The Ncurses (new curses) library is a free software emulation of curses in System V Release 4.0, and more. It uses Terminfo format, supports pads and color and multiple highlights and forms characters and function-key mapping, and has all the other SYSV-curses enhancements over BSD Curses. You can find the ncurses library project site at GNU. To find the latest version of GNU ncurses go to there ftp download site.

To install ncurses take the following steps:
1) Download the latest version of ncurses from ftp://ftp.gnu.org/pub/gnu/ncurses/
2) Unpack ncurses
- [root@pubjo root]# gunzip ncurses-5.6.tar.gz
- [root@pubjo root]# tar -xvf ncurses-5.6.tar
3) make/install ncurses
- [root@pubjo ncurses-5.6]# ./configure
- [root@pubjo ncurses-5.6]# make
- [root@pubjo ncurses-5.6]# make install

When you have successfully installed ncurses you can try to install the Perl curses again. Besides the way to install Perl curses by compiling it from the source code you can also install it by using the –MCPAN shell :

[root@pubjo root]# perl -MCPAN -e shell

This will get you into the cpan shell:

Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.7602)
ReadLine support available (try 'install Bundle::CPAN')

cpan>

Here you will also be able to install the the perl curses by executing the following command:

cpan> install Curses::Forms

If you have successfully installed al those required options you will be able to use otop and monitor you Oracle Database.

No comments: