Jun 30, 2005

I guess this guy doesn't like Oracle.


Lsof - LiSt Open File

Lsof lists open files for running UNIX processes.

It has been tested recently on these UNIX dialects:
  • AIX 5.[123]
  • Apple Darwin 7.7.0 for Power Macintosh Systems
  • BSDI BSD/OS 4.3.1 for x86-based systems
  • FreeBSD 4.[2-9], 4.1[01], 5.[012] and 6.0 for x86-based systems
  • FreeBSD 5.[01234] and 6.0 for Alpha, AMD64 and Sparc64 based systems
  • HP-UX 11.00, 11.11 and 11.23
  • Linux 2.1.72 and above for x86-based systems
  • NetBSD 1.[456] and 2.x for Alpha, x86, and SPARC-based systems
  • NEXTSTEP 3.[13] for NEXTSTEP architectures
  • OpenBSD 2.[89] and 3.[0123456] for x86-based systems
  • OpenStep 4.x
  • SCO OpenServer Release 5.0.6 for x86-based systems
  • SCO|Caldera UnixWare 7.1.4 for x86-based systems
  • Solaris 2.6, 8, 9 and 10
  • Tru64 UNIX 5.1


Please download source code from ftp://vic.cc.purdue.edu/pub/tools/unix/lsof

=========================
Example of Making Lsof on RedHat9
=========================
$ cd lsof_4.75_src
$ ./Configure linux
$ make

=========================
Example of Using Lsof
=========================
Finding Processes Blocking Umount
=================================

When you need to unmount a file system with the umount command,
you may find the operation blocked by a process that has a file
open on the file systems. Lsof may be able to help you find the
process. In response to:

$ lsof


Lsof will display all open files on the named file system. It
will also set its exit code zero when it finds some open files
and non-zero when it doesn't, making this type of lsof call
useful in shell scripts. (See section 16.)

Consult the output of the df command for file system names.

See the caveat in the preceding section about file references
that persist in the kernel without open file traces. That
situation may hamper lsof's ability to help with umount, too.



More example please see 00QUICKSTART, you will know it might be very helpful to you.

Jun 20, 2005

bzip2 and bunzip2

Good to know bzip2 is a high-quality data compressor. It typically compresses files to within 10% to 15% of the best available techniques (the PPM family of statistical compressors), whilst being around twice as fast at compression and six times faster at decompression.

Download it from http://www.bzip.org/

Jun 17, 2005

Swap space on Solaris

My colleagues argues how to check swap space on Solaris for Oracle database server. They use different coommands and get the different results.
Here is what I found from http://www.princeton.edu/~psg/unix/solaris/troubleshoot/ram.html

The Solaris virtual memory system combines physical memory with available swap space via swapfs. If insufficient total virtual memory space is provided, new processes will be unable to open.

Swap space can be added, deleted or examined with the swap command.
swap -l
reports total and free space for each of the swap partitions or files that are available to the system. Note that this number does not reflect total available virtual memory space, since physical memory is not reflected in the output.

swap -s
reports the total available amount of virtual memory, as does sar -r.

If swap is mounted on /tmp via tmpfs, df -k /tmp will report on total available virtual memory space, both swap and physical.

Jun 13, 2005

ORA-04030: out of process memory when trying to allocate 33352 bytes (pga heap,ksm stack)

Sat Jun 11 17:33:26 2005
Errors in file /dbhomeams/ams/admin/amsora/bdump/amsora_ckpt_10317.trc:
ORA-04030: out of process memory when trying to allocate 33352 bytes (pga heap,ksm stack)
Sat Jun 11 17:33:26 2005
Errors in file /dbhomeams/ams/admin/amsora/bdump/amsora_ckpt_10317.trc:
ORA-04030: out of process memory when trying to allocate 33352 bytes (pga heap,ksm stack)
Sat Jun 11 17:33:26 2005
CKPT: terminating instance due to error 4030
Instance terminated by CKPT, pid = 10317


What does an ORA-4030 mean?
---------------------------
This error indicates that the oracle server process is unable to allocate more memory from the operating system.This memory consists of the PGA (Program Global Area) and its contents depend upon the server configuration.For dedicated server processes it contains the stack and the UGA (User Global Area) which holds user session data, cursor information and the sort area. In a multithreaded configuration (shared server), the UGA is allocated in the SGA (System Global Area) and will not be responsible for ORA-4030 errors. The ORA-4030 thus indicates the process needs more memory (stack UGA or PGA) to perform its job.

What causes this error?
-----------------------
Since you run into this error, you can't allocate memory from the operating system. This could be caused by your process itself, like your process is just requesting too much memory, or some other reasons cause the operating system memory to be depleted, like a too big SGA or too many processes to be accomadated for the systems virtual memory (physical memory + swap space). Many operating systems impose limits on the amout of memory a single process can acquire to protect itself.

Jun 5, 2005

ORA-29952: cannot issue DDL on a domain index partition marked as LOADING

Error in 9.0.1.3.0:
ORA-29902: error in executing ODCIIndexStart() routine

Fixed in 9.2.0.3.

Sounds it comes back again in 9.2.0.6 as reproduced by oracle

TESTCASE
-----------------------
Unfortunately, ctx_adm.mark_failed does not fix the problem:
.
SQL> alter index story_test_text_idx rebuild partition p1985 parameters
('resume');
alter index story_test_text_idx rebuild partition p1985 parameters ('resume')
*
ERROR at line 1:
ORA-29952: cannot issue DDL on a domain index partition marked as LOADING
.
SQL> connect ctxsys/ctxsys;
Connected.
.
SQL> begin
2 ctx_adm.mark_failed('TEST','STORY_TEST_TEXT_IDX');
3 end;
4 /
.
PL/SQL procedure successfully completed.
.
SQL> connect test/test;
Connected.
.
SQL> alter index story_test_text_idx rebuild partition p1985 parameters
('resume');
alter index story_test_text_idx rebuild partition p1985 parameters ('resume')
*
ERROR at line 1:
ORA-29952: cannot issue DDL on a domain index partition marked as LOADING