Show Locking Proccess

SQL> SELECT s1.username || '@' || s1.machine|| ' ( SID=' || s1.sid || ' )  is blocking '|| s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status, s1.SQL_ID
FROM v$lock l1, v$session s1, v$lock l2, v$session s2
WHERE s1.sid=l1.sid AND s2.sid=l2.sid
AND l1.BLOCK=1 AND l2.request > 0
AND l1.id1 = l2.id1
AND l2.id2 = l2.id2;


Moving & Recreate Temp Tablespace

I Recreate the temp tablespace coz my temp tablespace was corrupt,
you can do to the following bellow

  1. create temporary tablespace temp2 tempfile '/rdbms/temp01/temp2.dbf' size 10M extent management local uniform size 1M;
  2. alter database default temporary tablespace temp2;
  3. drop tablespace temp including contents and datafiles;

now change back to temp again with following step bellow:

  1. create temporary tablespace temp tempfile '/rdbms/temp01/temp2_01.dbf' size 1024M extent management local uniform size 1M;
  2. alter database default temporary tablespace temp;
  3. drop tablespace temp2 including contents and datafiles;
  4. alter tablespace temp add tempfile '/rdbms/temp01/temp2_02.dbf' size 1024M;


ORA 29807 - specified operator does not exist

Yesterday,
During Installation of Oracle database 9i base on RHEL 4 ES,
I got Found error occurred when create the database using dbca,
and it keeps failing at the same point (Creating data dictionary Views)
This the error number Detail "ORA 29807 - specified operator does not exist"

Workaround;
just ignore the error and DBCA proceeds normally. Once the database is ready,
login as SYS and run this script manually:

$ORACLE_HOME/rdbms/admin/prvtxml.plb
SQL> @?/rdbms/admin/prvtxml.plb


How to mount an ISO image in Solaris

Q. How do I mount ISO FILE, And Read under it?
A. You can Use lofi(7D)/lofiadm the loopback file driver

Mounting an Existing CD-ROM Image Or File image
Use lofiadm to attach a block device to it:

bash> lofiadm -a /path/to/file.iso
/dev/lofi/1

And Then Use the mount command to mount the image:

bash> mount -F hsfs -o ro /dev/lofi/1 /path/output

lofiadm picks the device and prints the device name to the standard output.

bash> lofiadm
Block Device    File
/dev/lofi/1    /path/to/file.iso

Check to ensure that Solaris understands the image:

bash> df -h
Filesystem    size   used  avail capacity  Mounted on
/dev/lofi/1     0K     0K     0K     0%    /path/output

As a final step, unmount and detach the images:

bash> umount /path/output
bash> lofiadm -d /dev/lofi/1
bash> lofiadm
Block Device    File


kill sesion oracle in windows

path: .../Oracle Home/bin/orakill.exe or find manually
command: orakill <sid> <spid>
example: C:\Oracle9\bin\orakill ORCL 2760


Sql*Loader

Preview a little 'bout sql*loader
SQL*Loader loads data from external files into tables of an Oracle database,
SQL*Loader Can manipulate the data before loading it, using SQL functions,
SQL*Loader Can load data into multiple tables during the same load session, and many more..

SQL*Loader takes as input a control file (*.ctl), which controls the behavior of SQL*Loader, and one or more datafiles. Output of the SQL*Loader is an Oracle database (where the data is loaded), a log file, a bad file, and potentially a discard file.

Requirement..
1. Table
2. Control File
3. Flat File / Data File (optional)

Read the rest of this entry »


Split Busy Datafile to Another Mountpoint

If you want to load balance your datafile, you can split your datafile into another mount point,
here's detail step.

1. lsnrctl stop
2. shutdown immediate
3. copy your datafile

cp /$ora_home/$SID/undo/undo01.dbf /$ora_home/$SID/undo1/
cp /$ora_home/$SID/undo/undo02.dbf /$ora_home/$SID/undo2/
cp /$ora_home/$SID/index1/idx01.dbf /$ora_home/$SID/index2/
cp /$ora_home/$SID/index1/idx02.dbf /$ora_home/$SID/index3/


4. startup exclusive mount
5. rename your old datafile path with alter command

alter db rename file '/$ora_home/$SID/undo/undo01.dbf' to '/$ora_home/$SID/undo1/undo1.dbf';
alter db rename file '/$ora_home/$SID/undo/undo02.dbf' to '/$ora_home/$SID/undo2/undo2.dbf';
alter db rename file '/$ora_home/$SID/index1/idx01.dbf' to '/oradata/$SID/index2/idx01.dbf';
alter db rename file '/$ora_home/$SID/index1/idx02.dbf' to '/oradata/$SID/index3/idx02.dbf';


6. shutdown immediate
7. startup
8. lsnrctl start

Note:
DB=database


Installing Sudo On Solaris (*update)

Sudo (su "do") allows a system administrator to give certain users (or groups of users) the ability to run some (or all) commands as root while logging all commands and arguments
Sudo is supplied in source form and you need to compile it.
This isn't difficult! Before doing so, you need to have installed the g(un)zip program and a C compiler.

Installing sudo

Prefare the source download it from http://www.courtesan.com/sudo/download.html,

bash> uname -sr
SunOS  5.9
bash> wget ftp://ftp.sudo.ws/pub/sudo/sudo-1.6.9p5.tar.gz
bash> gunzip -dc sudo-1.6.9p56.tar.gz |tar xvf -
bash> cd sudo-1.6.9p5
bash> ./configure
bash> ./make
bash> ./make install

Add environment Parameter ( added in .profile User$)

bash> export PATH=$PATH:/usr/local/bin:/usr/local/sbin:/usr/ccs/bin
bash> export MANPATH=$MANPATH:/usr/man/:/usr/local/man

Added Sudoers

bash> visudo

find
# User privilege specification
root ALL=(ALL) ALL

Add user id to make him power like root

hendra  ALL=(ALL) NOPASSWD:ALL

The power of root

bash> sudo vi /etc/passwd

UPDATE
This post was old, so I will update and try on my Solaris 10 x86.
so enjoy this technically tutor.

First install your compiler, make, wget and don't forget with the dependencies, grab your packet from http://sunfreeware.com

uname -sr
SunOS 5.10
bash> gunzip libiconv-1.11-sol10-x86-local.gz 
bash> gunzip db-4.2.52.NC-sol10-intel-local.gz 
bash> gunzip gcc-3.4.6-sol10-x86-local.gz 
bash> gunzip libgcc-3.4.6-sol10-x86-local.gz 
bash> gunzip make-3.81-sol10-x86-local.gz 
bash> gunzip wget-1.11.4-sol10-x86-local.gz
bash> pkgadd -d libiconv-1.11-sol10-x86-local 
bash> pkgadd -d db-4.2.52.NC-sol10-intel-local 
bash> pkgadd -d libgcc-3.4.6-sol10-x86-local 
bash> pkgadd -d libgcc-3.4.6-sol10-x86-local 
bash> pkgadd -d make-3.81-sol10-x86-local 
bash> pkgadd -d wget-1.11.4-sol10-x86-local

Now install the sudo

bash> export PATH=$PATH:/usr/local/bin:/usr/local/sbin
bash> wget ftp://ftp.sudo.ws/pub/sudo/sudo-1.7.0.tar.gz
bash> gunzip sudo-1.7.0.tar.gz 
bash> tar -xvf sudo-1.7.0.tar 
bash> cd sudo-1.7.0
bash> ./configure 
bash> make
bash> make install

Last try to add anything user as you like

bash> visudo

and find code like here..
# User privilege specification
root ALL=(ALL) ALL

then add user id to make him power like root

hendra  ALL=(ALL) NOPASSWD:ALL

The power of root (part 2)

bash> id
uid=100(hendra) gid=101(jagoan)
bash> export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin
bash> sudo useradd -d /dev/null -s /bin/false tes

Done.