Thursday, September 24, 2009

How to find your usb external harddisk on Solaris 9.

There are many ways to know control number of your usb external harddisk

#iostat -En
iostat -En
c0t0d0 Soft Errors: 1 Hard Errors: 0 Transport Errors: 31
Vendor: TOSHIBA Product: DVD-ROM SD-C2612 Revision: 1011 Serial No:
Size: 0.00GB <0>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 1 Predictive Failure Analysis: 0
c4t0d0 Soft Errors: 1 Hard Errors: 0 Transport Errors: 0 Vendor: WD Product: 1600BEV External Revision: 1.05 Serial No: Size: 160.04GB <160039272960> Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0 Illegal Request: 1 Predictive Failure Analysis: 0

-- or --
# format -e
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010a7d191,0
1. c1t1d0 mirror
/pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010a7d2e1,0
2. c2t5006016810209AB5d0
/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w5006016810209ab5,0
3. c2t5006016110209AB5d0
/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w5006016110209ab5,0
4. c4t0d0 /pci@9,700000/usb@1,3/storage@2/disk@0,0
5. emcpower0a
/pseudo/emcp@0


-- Dmesg doesn't tell the controll number

#dmesg
Sep 24 18:45:28 onestopII usba: [ID 855233 kern.info] USB-device: storage@2, scsa2usb1 at bus address 2
Sep 24 18:45:28 onestopII usba: [ID 593373 kern.info] Western Digital External HDD 575843373038433030363435
Sep 24 18:45:28 onestopII genunix: [ID 936769 kern.info] scsa2usb1 is /pci@9,700000/usb@1,3/storage@2
Sep 24 18:45:28 onestopII genunix: [ID 408114 kern.info] /pci@9,700000/usb@1,3/storage@2 (scsa2usb1) online
Sep 24 18:45:28 onestopII scsi: [ID 193665 kern.info] sd2 at scsa2usb1: target 0 lun 0
Sep 24 18:45:28 onestopII genunix: [ID 936769 kern.info] sd2 is /pci@9,700000/usb@1,3/storage@2/disk@0,0
Sep 24 18:45:28 onestopII genunix: [ID 408114 kern.info] /pci@9,700000/usb@1,3/storage@2/disk@0,0 (sd2) online



Waiting for Job queue slaves to complete

SQL> shutdown immediate

..
..
Stopping background process CJQ0
Thu Sep 24 17:07:47 2009
Stopping background process MMNL
Thu Sep 24 17:07:48 2009
Stopping background process MMON
Thu Sep 24 17:07:49 2009
Shutting down instance (immediate)
License high water mark = 11
Thu Sep 24 17:07:49 2009
Stopping Job queue slave processes
Thu Sep 24 17:07:52 2009
Waiting for Job queue slaves to complete
.
.
Thu Sep 24 17:18:37 2009
Job queue slave processes stopped

I found this message in alter log file after I waiting for the database shutdown.
wait .. wait .. wait .. wait..and wait...


Finally my database was shutdown after issue the command around 10 minutes.

--TaTsHuYa--

ORA-00600: internal error code, arguments: [kccrbl_stale]

This error is related with previous my blog [ ORA-00214: controlfile xxx version yyyy consistent with file zzz ]

It happen because I changed to use the wrong control file when I try to start database after server crashed. I never see the version of checkpoint before choosen.

So after I try to mount the database this error occur.

alter database mount
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [kccrbl_stale], [0], [61176],
[61127], [], [], [], []

I resolve this problem by shutdown database and change the control file in init file to use the lastest update.

--TaTsHuYa--

ORA-00214: controlfile xxx version yyy inconsistent with file zzzz.

My database server was crashed and when I try start the database, it show error.

SQL> startup
ORACLE instance started.

Total System Global Area 536870912 bytes
Fixed Size 780056 bytes
Variable Size 275519720 bytes
Database Buffers 260046848 bytes
Redo Buffers 524288 bytes
ORA-00214: controlfile '/oracle/product/10.2.0/oradata/emrep/control01.ctl'
version 61130 inconsistent with file
'/oracle/product/10.2.0/oradata/emrep/control02.ctl' version 61127

resolve by
look in the version of checkpoint in control file which one is lastest update.
In this situation 'control01.ctl' is the lastest update so I will change init file to use only 'control01.ctl'

Existing:
*.control_files='/oracle/product/10.2.0/oradata/emrep/control01.ctl','/oracle/product/10.2.0/oradata/emrep/control02.ctl','/oracle/product/10.2.0/oradata/emrep/control03.ctl'

New:
*.control_files='/oracle/product/10.2.0/oradata/emrep/control01.ctl'


SQL> shutdown immediate
SQL> startup pfile=inittatshuya.ora
ORACLE instance started.

Total System Global Area 536870912 bytes
Fixed Size 780056 bytes
Variable Size 275519720 bytes
Database Buffers 260046848 bytes
Redo Buffers 524288 bytes
Database mounted.
Database opened.



You should to shutdown again and copy control01.ctl to control02.ctl and control03.ctl.
and change your init file to the old.

Tuesday, September 22, 2009

ORA-00600: internal error code, arguments: [17059]

What's happen of our database today??????????

Today we just found one of our database has many errors on alert log ORA-00600 with argument [ 17059 ] , actually this error occur since around 1 a.m. but nobody known until we received SMS in the evening ( 7 p.m. ) that has lower free spaces in the system.

My co-worker access to that server, he found the service has been shutdown already because Oracle Path is out of space and it's full of dump file in udump directory.

When he clear the space and oracle back to the online state, he found the ORA-00600 argument [ 17059 ] occur every time when user call a package.
He to find the solution on the Oracle Metalink, that may be a bug of the oracle again. The short term to resolve this problem is flush shard pool by command "alter system flush shared pool".

After solve the problem, we saw the database back to the normal state, we dicided to go back home. And when I'm home, I want to make sure the database back to the normal state really, Yep!!!! there are no error with ORA-00600 agument [ 17059 ] again but I found the new error in the another database.

.............. T-T .................

--TaTsHuYa--

configure: error: C++ compiler cannot create executables

When you found this error while you use "configure" on ubuntu that mean, you need some package before you're trying to compile program.

..
..
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking for C++ compiler default output file name... configure: error: C++ comp
iler cannot create executables
See `config.log' for more details.

try to install "build-essential" package, It can resolve this problem.
#sudo apt-get install build-essential

-TaTsHuYa-

Saturday, September 19, 2009

How to build Tora 2.1 with Oracle support

How to build Tora 2.1 with Oracle support

In ubuntu 8.10, "tora" package version is 1.3.23 and not support Oracle, If you want to use the new version use must download TORA souce code from "http://torasql.com" and then if you want to use TORA connect to Oracle use must download Oracle Instantclient or Oracle Client from Oracle Website.

Download Oracle Instantclient 11 from Oracle's webstie
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html
There are 2 packages that you need

- Instant Client Package - Basic
- Instant Client Package - SDK
- Instant Client Package - SQL Plus ( Optional for test connection only )

Then when you have everything already, let go to next step
unzip Instant Client Package - Basic
# unzip instantclient-basic-linux32-11.2.0.1.zip
unzip Instant Client Package - SDK
# unzip instantclient-sdk-linux32-11.2.0.1.zip
unzip Instant Client Package - SQL Plus
# unzip instantclient-sqlplus-linux32-11.2.0.1.zip

Create soft link for Oracle Instantclient library:
#cd /home/tatshuya/instantclient_11_2
#ln -s libclntsh.so.11.1 libclntsh.so

Before you compile you need some library
#apt-get install libqt4-dev libqscintilla2-dev build-essential

Prepare Variable environment before compile the tora
#export LD_LIBRARY_PATH=/home/tatshuya/instantclient_11_2
#export CPPFLAGS="-I/home/tatshuya/instantclient_11_2/sdk/include"

Compile TORA
#cd ../tora-2.1.0
#./configure --with-instant-client=/home/tatshuya/instantclient_11_2
#make
#make install

Then use tora program
#export LD_LIBRARY_PATH=/home/tatshuya/instantclient_11_2
#/usr/local/tora/bin/tora