2007/08/08
resolve lack aio library problem
rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' | grep binutils
ORBit-0.5.17-14.i386.rpm
ORBit-0.5.17-14.x86_64.rpm
binutils-2.15.92.0.2-21.x86_64.rpm
compat-db-4.1.25-9.i386.rpm
compat-db-4.1.25-9.x86_64.rpm
compat-libstdc++-33-3.2.3-47.3.x86_64.rpm
compat-libstdc++-296-2.96-132.7.2.i386.rpm
compat-libstdc++-33-3.2.3-47.3.i386.rpm
control-center-2.8.0-12.rhel4.5.x86_64.rpm
gcc-3.4.6-3.x86_64.rpm
gcc-c++-3.4.6-3.x86_64.rpm
glibc-2.3.4-2.25.x86_64.rpm
glibc-2.3.4-2.25.i686.rpm
glibc-common-2.3.4-2.25.x86_64.rpm
glibc-devel-2.3.4-2.25.i386.rpm
glibc-devel-2.3.4-2.25.x86_64.rpm
glibc-headers-2.3.4-2.25.x86_64.rpm
glibc-kernheaders-2.4-9.1.98.EL.x86_64.rpm
gnome-libs-1.4.1.2.90-44.1.x86_64.rpm
gnome-libs-1.4.1.2.90-44.1.i386.rpm
libaio-0.3.105-2.i386.rpm
libaio-0.3.105-2.i386.rpm
lack libaio-0.3.105-2.x86_64.rpm
libaio-devel-0.3.105-2.x86_64.rpm
libgcc-3.4.6-3.i386.rpm
libgcc-3.4.6-3.x86_64.rpm
libstdc++-3.4.6-3.x86_64.rpm
libstdc++-3.4.6-3.i386.rpm
libstdc++-devel-3.4.6-3.i386.rpm
libstdc++-devel-3.4.6-3.x86_64.rpm
make-3.80-6.EL4.x86_64.rpm
pdksh-5.2.14-30.3.x86_64.rpm
sysstat-5.0.5-11.rhel4.x86_64.rpm
xorg-x11-deprecated-libs-6.8.2-1.EL.13.36.x86_64.rpm
xorg-x11-deprecated-libs-6.8.2-1.EL.13.36.i386.rpm
xorg-x11-deprecated-libs-devel-6.8.2-1.EL.13.36.x86_64.rpm
xscreensaver-4.18-5.rhel4.11.x86_64.rpm
# run with root
rpm -ivh libaio-0.3.105-2.x86_64.rpm
rpm -ivh libaio-devel-0.3.105-2.x86_64.rpm
# run with oracle
$ORACLE_HOME/bin/relink all
$ORACLE_HOME/bin/ldd oracle
2007/08/06
perl CPAM install ReadLine::Gnu
[root@test pkg]# perl pmlist.pl
IO::Tty -- 1.07
Perl -- 5.8.0
Confirm the error message
I resolved it finally with
IO::Tty -- 1.07
Perl -- 5.8.0
pmlist.pl
#!/usr/bin/perl
use ExtUtils::Installed;
my $instmod = ExtUtils::Installed->new();
foreach my $module ($instmod->modules()) {
my $version = $instmod->version($module) || "???";
print "$module -- $version\n";
}
[root@test pkg]# perl -MCPAN -e shell
cpan shell -- CPAN exploration and modules installation (v1.61)
ReadLine support available (try 'install Bundle::CPAN')
cpan> install Term::ReadLine::Gnu
Running install for module Term::ReadLine::Gnu
Running make for H/HA/HAYASHI/Term-ReadLine-Gnu-1.16.tar.gz
CPAN: Digest::MD5 loaded ok
Checksum for /root/.cpan/sources/authors/id/H/HA/HAYASHI/Term-ReadLine-Gnu-1.16.tar.gz ok
Scanning cache /root/.cpan/build for sizes
Term-ReadLine-Gnu-1.16/
Term-ReadLine-Gnu-1.16/eg/
Term-ReadLine-Gnu-1.16/eg/fileman
Term-ReadLine-Gnu-1.16/eg/perlsh
Term-ReadLine-Gnu-1.16/eg/pftp
Term-ReadLine-Gnu-1.16/eg/ptksh+
Term-ReadLine-Gnu-1.16/Gnu/
Term-ReadLine-Gnu-1.16/Gnu/euc_jp.pm
Term-ReadLine-Gnu-1.16/Gnu/XS.pm
Term-ReadLine-Gnu-1.16/Gnu.pm
Term-ReadLine-Gnu-1.16/Gnu.xs
Term-ReadLine-Gnu-1.16/INSTALL
Term-ReadLine-Gnu-1.16/Makefile.PL
Term-ReadLine-Gnu-1.16/MANIFEST
Term-ReadLine-Gnu-1.16/META.yml
Term-ReadLine-Gnu-1.16/ppport.h
Term-ReadLine-Gnu-1.16/README
Term-ReadLine-Gnu-1.16/t/
Term-ReadLine-Gnu-1.16/t/button.pl
Term-ReadLine-Gnu-1.16/t/callback.t
Term-ReadLine-Gnu-1.16/t/comptest/
Term-ReadLine-Gnu-1.16/t/comptest/0123
Term-ReadLine-Gnu-1.16/t/comptest/012345
Term-ReadLine-Gnu-1.16/t/comptest/023456
Term-ReadLine-Gnu-1.16/t/comptest/a_b
Term-ReadLine-Gnu-1.16/t/comptest/README
Term-ReadLine-Gnu-1.16/t/history.t
Term-ReadLine-Gnu-1.16/t/inputrc
Term-ReadLine-Gnu-1.16/t/readline.t
Term-ReadLine-Gnu-1.16/typemap
Removing previously used /root/.cpan/build/Term-ReadLine-Gnu-1.16
CPAN.pm: Going to build H/HA/HAYASHI/Term-ReadLine-Gnu-1.16.tar.gz
Found `/usr/lib/libtermcap.a'.
gcc -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -DHAVE_STRING_H rlver.c -o rlver -L/usr/local/lib -lreadline -ltermcap
It seems that you have the GNU Readline Library version 4.3.
Checking if your kit is complete...
Looks good
Writing Makefile for Term::ReadLine::Gnu
cp Gnu.pm blib/lib/Term/ReadLine/Gnu.pm
cp Gnu/XS.pm blib/lib/Term/ReadLine/Gnu/XS.pm
AutoSplitting blib/lib/Term/ReadLine/Gnu/XS.pm (blib/lib/auto/Term/ReadLine/Gnu/XS)
cp Gnu/euc_jp.pm blib/lib/Term/ReadLine/Gnu/euc_jp.pm
/usr/bin/perl /usr/lib/perl5/5.8.0/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.0/ExtUtils/typemap -typemap typemap Gnu.xs > Gnu.xsc && mv Gnu.xsc Gnu.c
gcc -c -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -march=i386 -mcpu=i686 -DVERSION=\"1.16\" -DXS_VERSION=\"1.16\" -fPIC "-I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE" -DHAVE_STRING_H Gnu.c
Running Mkbootstrap for Term::ReadLine::Gnu ()
chmod 644 Gnu.bs
rm -f blib/arch/auto/Term/ReadLine/Gnu/Gnu.so
LD_RUN_PATH="/usr/lib:/lib" gcc -shared -L/usr/local/lib Gnu.o -o blib/arch/auto/Term/ReadLine/Gnu/Gnu.so -lreadline -ltermcap
chmod 755 blib/arch/auto/Term/ReadLine/Gnu/Gnu.so
cp Gnu.bs blib/arch/auto/Term/ReadLine/Gnu/Gnu.bs
chmod 644 blib/arch/auto/Term/ReadLine/Gnu/Gnu.bs
Manifying blib/man3/Term::ReadLine::Gnu.3pm
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/callback....ok
4/7 skipped: since Tk is not installed.
t/history.....FAILED tests 73-74
Failed 2/82 tests, 97.56% okay
t/readline....ok Try `/usr/bin/perl -Mblib t/readline.t verbose', if you will.
t/readline....ok
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/history.t 82 2 2.44% 73-74
4 subtests skipped.
Failed 1/3 test scripts, 66.67% okay. 2/193 subtests failed, 98.96% okay.
make: *** [test_dynamic] エラー 29
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force
cpan> quit
Lockfile removed.
Confirm the error message
[root@test Term-ReadLine-Gnu-1.16]# pwd
/root/.cpan/build/Term-ReadLine-Gnu-1.16
I resolved it finally with
force install ...
uniread - the best oracle command mate
uniread adds readline (line editing, command history, etc.) support to any
existing interactive command-line program. You can use this to add support
to annoying programs which do not provide it built-in (a good example is
Oracle's sqlplus, or jython) or to easily add it to your own programs.
To build this distribution, run:
uniread requires:
- GNU readline
http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
- Term::ReadLine::Gnu
http://search.cpan.org/dist/Term-ReadLine-Gnu/
- IO::Tty
http://search.cpan.org/dist/IO-Tty/
or http://sourceforge.net/projects/expectperl
The latter two can be installed using the CPAN shell. Run:
-----
By me:
Add a command to .bash_profile/profile will help common user to uniread
existing interactive command-line program. You can use this to add support
to annoying programs which do not provide it built-in (a good example is
Oracle's sqlplus, or jython) or to easily add it to your own programs.
To build this distribution, run:
perl Makefile.PL
make
make install
uniread requires:
- GNU readline
http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
- Term::ReadLine::Gnu
http://search.cpan.org/dist/Term-ReadLine-Gnu/
- IO::Tty
http://search.cpan.org/dist/IO-Tty/
or http://sourceforge.net/projects/expectperl
The latter two can be installed using the CPAN shell. Run:
perl -MCPAN -e shell
install Term::ReadLine::Gnu
install IO::Tty
-----
By me:
Add a command to .bash_profile/profile will help common user to uniread
# proxy
export http_proxy=http://proxy:8080/
export ftp_proxy=http://proxy:8080/
# initialize CPAN, just press enter except download site
perl -MCPAN -e shell
# install the pre-required modules, force for 86-64
perl -MCPAN -e shell << __EOF__
force install Term::ReadLine::Gnu
install IO::Tty
__EOF__
# copy and install uniread package
cd ~
[ ! -d pkg ] && mkdir pkg
pushd pkg
cp -a ~oracle/work/fyang/ofpkg/uniread*.tar.gz .
tar -zxvf uniread*.tar.gz
cd uniread*
perl Makefile.PL
make install
popd
# profile
cat >> /etc/profile << __EOF__
alias ufsqlplus="echo enter popd to return to original dir. ; pushd ~oracle/work/fyang ; uniread --quiet sqlplus "
alias sqlplusuf="echo enter popd to return to original dir. ; pushd ~oracle/work/fyang ; uniread --quiet sqlplus "
alias usqlplus="uniread --quiet sqlplus "
alias sqlplusu="uniread --quiet sqlplus "
__EOF__
2007/08/05
2007/08/03
Note of Hibernate & Spring Testing
Recently, I complete tested the function of Hibernate and Spring.
I wrote this note to memo the experience.
* install the version is a point of hibernate
download the version at least the same major version software.
it may be the permenant weak point of the open source.
* midgen maps bit (boolean) to object
manually modify the attibute of the field to make it map to right java type.
* to make the update effact to all related object
add cascade="save-update" to set tag
* add named query
* to make spring handle the transaction
* generate hbm.xml from java soruce with xdoclet
ant generate-hbm-from-xdoclet
I wrote this note to memo the experience.
* install the version is a point of hibernate
download the version at least the same major version software.
it may be the permenant weak point of the open source.
* midgen maps bit (boolean) to object
manually modify the attibute of the field to make it map to right java type.
* to make the update effact to all related object
add cascade="save-update" to set tag
* add named query
* to make spring handle the transaction
PROPAGATION_REQUIRED
* generate hbm.xml from java soruce with xdoclet
ant generate-hbm-from-xdoclet
Oracle Killing Sessions Version 10.2
kill oracle sessions scrit (with sqlplus)
Oracle Killing Sessions
Version 10.2
UNIX
Killing sessions in the UNIX environment ps -ef | grep ora to find Oracle processes. Be sure to get the process id of the session you are trying to kill.
kill -1
or
kill -9
kill -9 5745
All in one kill ps -ef | grep pmon_$ORACLE_SID | awk '{print $2}' | xargs kill -9
Windows
Killing sessions in the Windows environment with ORAKILL. orakill
SELECT instance_name
FROM gv$instance;
col program format a30
SELECT spid, osuser, s.program, schemaname
FROM gv$process p, gv$session s
WHERE p.addr = s.paddr;
c:\oracle\product\ora102\bin> orakill orabase spid
All
Killing sessions from inside the database To kill sessions within the database requires the ALTER SYSTEM privilege and the sid and serial# of the session to be killed
GRANT alter system TO;
SELECT sid, serial#, username, schemaname, osuser
FROM gv$session
WHERE username =;
ALTER SYSTEM KILL SESSION '< sid>,';
conn / as sysdba
GRANT alter system TO aqadmin;
conn aqadmin/aqadmin
SELECT sid, serial# , username, schemaname, osuser
FROM gv$session
WHERE username = 'AQUSER';
SQL> ALTER SYSTEM KILL SESSION '9,177' IMMEDIATE;
Kill All Sessions
Kill All Instance Sessions conn / as sysdba
set heading off
set termout off
set verify off
set echo off
set feedback off
ALTER SYSTEM enable restricted session;
ALTER SYSTEM checkpoint global;
spool kill_all.sql
SELECT 'execute kill_session('|| chr(39) || sid || chr(39) || ',' || chr(39) || serial# || chr(39) || ');'
FROM gv_$session
WHERE (username IS NOT NULL OR username <> 'SYS');
spool off
@kill_all
Session Kill Demo Procedure
An infinite loop for testing CREATE OR REPLACE PROCEDURE infinite_loop IS
BEGIN
LOOP
NULL;
END LOOP;
END infinite_loop;
/
SQL> exec infinite_loop
select s.sid, s.serial#, s.username, spid,
osuser, s. program, schemaname
from v$session s, v$process p
where machine like '%ta%' and s.program like '%%' and s.paddr = p.addr
/
select 'alter system kill session '''
|| s.sid || ',' || s.serial# || '''; -- '
|| s.machine || ',' || s.program
from v$session s, v$process p
where machine like '%%' and s.program like '%%' and s.paddr = p.addr
/
Oracle Killing Sessions
Version 10.2
UNIX
Killing sessions in the UNIX environment ps -ef | grep ora to find Oracle processes. Be sure to get the process id of the session you are trying to kill.
kill -1
or
kill -9
kill -9 5745
All in one kill ps -ef | grep pmon_$ORACLE_SID | awk '{print $2}' | xargs kill -9
Windows
Killing sessions in the Windows environment with ORAKILL. orakill
SELECT instance_name
FROM gv$instance;
col program format a30
SELECT spid, osuser, s.program, schemaname
FROM gv$process p, gv$session s
WHERE p.addr = s.paddr;
c:\oracle\product\ora102\bin> orakill orabase spid
All
Killing sessions from inside the database To kill sessions within the database requires the ALTER SYSTEM privilege and the sid and serial# of the session to be killed
GRANT alter system TO
SELECT sid, serial#, username, schemaname, osuser
FROM gv$session
WHERE username =
ALTER SYSTEM KILL SESSION '< sid>,
conn / as sysdba
GRANT alter system TO aqadmin;
conn aqadmin/aqadmin
SELECT sid, serial# , username, schemaname, osuser
FROM gv$session
WHERE username = 'AQUSER';
SQL> ALTER SYSTEM KILL SESSION '9,177' IMMEDIATE;
Kill All Sessions
Kill All Instance Sessions conn / as sysdba
set heading off
set termout off
set verify off
set echo off
set feedback off
ALTER SYSTEM enable restricted session;
ALTER SYSTEM checkpoint global;
spool kill_all.sql
SELECT 'execute kill_session('|| chr(39) || sid || chr(39) || ',' || chr(39) || serial# || chr(39) || ');'
FROM gv_$session
WHERE (username IS NOT NULL OR username <> 'SYS');
spool off
@kill_all
Session Kill Demo Procedure
An infinite loop for testing CREATE OR REPLACE PROCEDURE infinite_loop IS
BEGIN
LOOP
NULL;
END LOOP;
END infinite_loop;
/
SQL> exec infinite_loop
Oracle SQL*Plus Version 10.2
Oracle SQL*Plus
Version 10.2
General
Constants Constant Usage Example
SQL.LNO Line Number SELECT COUNT(*)
FROM all_objects;
show lno
SQL.PNO Page Number SELECT object_name
FROM all_objects;
show pno
SQL.RELEASE Oracle Version show release
SQL.SQLCODE Current error code show sqlcode
SQL.USER Currently connected user show user
Startup Parameters: Usage 1
Flags
Description
-H Displays the SQL*Plus version and the usage help
-V Displays the SQL*Plus version
sqlplus -C | -H
Startup Parameters: Usage 2
Flags
Description
-C Sets the compatibility of affected commands to the version specified. The version has the form "x.y[.z]. For example -C 10.2.0
-L Attempts to log on just once, instead of reprompting on error
-M
Version 10.2
General
Constants Constant Usage Example
SQL.LNO Line Number SELECT COUNT(*)
FROM all_objects;
show lno
SQL.PNO Page Number SELECT object_name
FROM all_objects;
show pno
SQL.RELEASE Oracle Version show release
SQL.SQLCODE Current error code show sqlcode
SQL.USER Currently connected user show user
Startup Parameters: Usage 1
Flags
Description
-H Displays the SQL*Plus version and the usage help
-V Displays the SQL*Plus version
sqlplus -C | -H
Startup Parameters: Usage 2
Flags
Description
-C
-L Attempts to log on just once, instead of reprompting on error
-M
2007/08/02
Subscribe to:
Posts (Atom)