Tuesday, July 17, 2007

Enabling sql trace in OC4J & system wide

http://rreddy.blogspot.com/2006/09/enabling-sql-trace-in-oc4j.html

Select SID,SERIAL#,USERNAME,STATUS from v$session;

::Session level tracing::

exec dbms_system.set_ev( 375,501,10046,12.' ');
execute sys.dbms_system.set_ev(375,501, 10046, 12, '');
execute sys.dbms_system.set_ev(375,501, 10046, 0, '');

::System Wide SQL Tracing::

alter system set events '10046 trace name context forever,level 12';
alter system set events '10046 trace name context off';

For SYSTEM WIDE use this url:

http://www.orafaq.com/wiki/SQL_Trace

Monday, July 16, 2007

How to use TAR for backup [Oracle_Home]

NAME
tar - The GNU version of the tar archiving utility

SYNOPSIS
tar [ - ] A --catenate --concatenate | c --create | d --diff --compare
| --delete | r --append | t --list | u --update | x --extract --get [
options ] pathname [ pathname ... ]

DESCRIPTION
This manual page documents the GNU version of tar , an archiving pro-
gram designed to store and extract files from an archive file known as
a tarfile. A tarfile may be made on a tape drive, however, it is also
common to write a tarfile to a normal file. The first argument to tar
must be one of the options: Acdrtux, followed by any optional func-
tions. The final arguments to tar are the names of the files or direc-
tories which should be archived. The use of a directory name always
implies that the subdirectories below should be included in the
archive.

EXAMPLES
tar -xvvf foo.tar
extract foo.tar

tar -xvvzf foo.tar.gz
extract gzipped foo.tar.gz

tar -cvvf foo.tar foo/
tar contents of folder foo in foo.tar

For more:
http://unixhelp.ed.ac.uk/CGI/man-cgi?tar

Wednesday, July 11, 2007

Create users.ldif using script for ocs.

i=102
while [ $i -lt 503 ]
do
echo "dn: cn=user$i,cn=Users,dc=idc,dc=oracle,dc=com" >> r.ldif
echo "objectclass: top" >> r.ldif
echo "objectclass: person" >> r.ldif
echo "objectclass: inetorgperson" >> r.ldif
echo "objectclass: organizationalperson" >> r.ldif
echo "objectclass: orcluser" >> r.ldif
echo "objectclass: orcluserv2" >> r.ldif
echo "cn: user$i" >> r.ldif
echo "givenname:" user$i >> r.ldif
echo "sn: user$i" >> r.ldif
echo "mail: user$i@bde.idc.oracle.com" >> r.ldif
echo "uid: user$i" >> r.ldif
echo "userpassword: welcome1" >> r.ldif
echo >> r.ldif
i=`expr $i + 1`
done

Thursday, June 14, 2007

How to add USBHDD having NTFS paritions to your RHEL4 box.

In case you are planning to fix up ur USB Drive (NTFS Partitions) on to a RHEL4 with Kernel Version 2.6.9-5.EL.You will need to do the following:

You'll need 2 files:
=============

kernel-module-ntfs-2.6.9-5.EL-2.1.20-0.rr.4.10.i686.rpm --> RPM / Binaries you need to have
NTFS detection.ntfsprogs-1.13.1.tar.gz --> This module is like a driver in windows which will add the related drivers to the kernel.Download using command like, its actually pretty quick:

#wget http://prdownloads.sourceforge.net/linux-ntfs/kernel-module-ntfs-2.6.9-5.EL-2.1.20-0.rr.4.10.i686.rpm
#wget http://prdownloads.sourceforge.net/linux-ntfs/ntfsprogs-1.13.1.tar.gz

You need to remember:
=================

The volume names of USB Drive.

If not are not aware of you can get from "cat /etc/fstab"Run lsusb & lsmod

lsusb - A utility for displaying information about all USB buses in the system and all devices connected to them.

lsmod - A program to show the status of modules in the Linux Kernel.

You need to logon as ROOT user to install both and mount the partitions.

Steps:
====

1) Once you attach the device to the system.

2) Install the "kernel-module-ntfs-2.6.9-5.EL-2.1.20-0.rr.4.10.i686.rpm" & "ntfsprogs-1.13.1.tar.gz" rpm -ivh kernel-module-ntfs-2.6.9-5.EL-2.1.20-0.rr.4.10.i686.rpm modprobe ntfs

3) Check /etc/fstab you'll see something like this:

/dev/sda2 /media/WD_HDD2 ntfs pamconsole,exec,noauto,managed 0 0

/dev/sda5 /media/WD_HDD1 ntfs pamconsole,exec,noauto,managed 0 0

4) In my case I created 2 folders /WD_HDD1 & /WD_HDD2

5) mount /dev/sda5 /WD_HDD1 (HDD Volume Name Partition1)

6) mount /dev/sda2 /WD_HDD2 (HDD Volume Name Partition2)

PS: Always remember to umount / unmount the devices before unplugging or shutting them down.

Thursday, February 8, 2007

VNC Setup on linux

2 Ways to do that:
===============================
1) Easier way is to edit:

/.vnc/xstartup

Comment all existing lines in the file and ADD

# Red Hat Linux VNC session startup script
exec /etc/X11/xinit/xinitrc

Your /etc/X11/xinit/xinitrc should look like this:

$$$$$$$$$$$$$$$$$$$$$$$$$$$
#!/bin/sh
# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the
# GNU General Public License version 2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

# Mandatorily source xinitrc-common, which is common code shared between the
# Xsession and xinitrc scripts which has been factored out to avoid duplication
. /etc/X11/xinit/xinitrc-common

# The user may have their own clients they want to run. If they don't,
# fall back to system defaults.
if [ -f $HOME/.Xclients ]; then
exec $DBUS_LAUNCH $HOME/.Xclients || \
exec $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
exec $DBUS_LAUNCH /etc/X11/xinit/Xclients || \
exec /etc/X11/xinit/Xclients
else
# failsafe settings. Although we should never get here
# (we provide fallbacks in Xclients as well) it can't hurt.
xclock -geometry 100x100-5+5 &
xterm -geometry 80x50-50+150 &

if [ -x /usr/X11R6/bin/twm ]; then
exec /usr/X11R6/bin/twm
fi
fi
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

================================
2) VNC Setup on linux
cat cd ~/.vnc/xstartup

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
#startkde &
exec gnome-session &

Start the vncserver with the following ,

vncserver -depth 16 -geometry 800x600

Create an alias in $HOME/.bash_profile

alias startvnc='vncserver -depth 16 -geometry 800x600'

Monday, January 22, 2007

HOWTO burn your DVD/CD ISO inside a Windows environment?

Introduction
The Fedora Core distribution is provided in the form of ISO 9660 standard
filesystem images. You can copy these ISO images onto either CDROM or DVD media
to produce a bootable disc.

Before you can install Fedora Core on a computer, you must transfer, or burn,
the ISO files to blank disc media (CD-R/RW or DVD-R/RW). This document
describes the procedure for burning these files using a few common tools. This
document assumes that you have no experience with Linux, and that you are using
Microsoft Windows for the purpose of downloading and burning the files.


Downloading

The ISO files are large, and it may take a long time to download them,
especially using a dial-up modem. You may want to use a download manager.


Choosing CD or DVD

Fedora Core is distributed on multiple CD-sized ISO image files, or a single
DVD-sized ISO image file. You can use the single DVD ISO file if your computer
meets the following requirements:

* It has a DVD-writable or DVD-rewritable drive

* It has a NTFS drive with sufficient space to hold the image file

To write the DVD ISO file to a disc, your computer needs to have a drive that
will write to DVD media. If your computer has a drive that only writes CD media
and not DVD media, download the CD-sized files instead.

Some file systems cannot store files larger than 2 GB, such as the DVD image.
The commonly-used NTFS file system does not have this limitation, but many
other non-NTFS formats do, such as FAT32. To check the format of a drive under
Windows such as C:, select the Start menu and then My Computer. Right-click the
drive you want to check, and choose Properties. The resulting dialog displays
the format for that file system. If you do not have an NTFS drive with enough
free space, download the CD-sized files instead.

Create a new directory where you can download all of these files. You need
approximately 700 MiB of free space available for each CD-sized ISO file, or
approximately 3.5 GiB for the DVD-sized ISO file. This document assumes you
have downloaded the files to the folder C:\Documents and Settings\Owner\My
Documents\My Downloads\Fedora Core.


Choosing the ISO Files

The exact files you need from the download server depend upon your system and
the version of Fedora Core you are downloading. The files you need are named in
the form of FC---disc.iso, where "" is the
version of Fedora Core you wish to download, "" is your computer's
processor architecture, and "" is the disc number for each of the
installation CDs.

The computer processor architecture is usually i386 for 32-bit PCs, including
the Pentium and Athlon processor families. The architecture is usually x86_64
for 64-bit PCs, including the Athlon 64 processor family. The architecture is
usually ppc for PowerPC computers, including most of Apple's Mac offerings. If
in doubt, your system probably requires the i386 versions.

If you are downloading Fedora Core 6 for a Pentium 4 computer, for example, you
need these files:

* FC-6-i386-disc1.iso

* FC-6-i386-disc2.iso

* FC-6-i386-disc3.iso

* FC-6-i386-disc4.iso

* FC-6-i386-disc5.iso

Or, if you prefer to install from a single DVD, you only need this file:

* FC-6-i386-DVD.iso

You may also need the SHA1SUM file to verify that the files you have downloaded
are complete and correct.


Validating the Files

Errors can occur during the download, even if your download manager reports
none. Therefore it is very important to check that the files have not been
corrupted in any way. This is the purpose of the SHA1SUM file. It contains one
line for each of the available ISO files with a content verification code
called a hash computed from the original ISO files.

BitTorrent Automatic Error Checking

BitTorrent automatically performs this error checking during downloads. If your
BitTorrent application reports all files have been successfully downloaded, you
can safely skip this step.


Validating in the Windows Graphical Environment

There are a number of free (as in cost) products available for file validation
and hashing that have point and click interfaces. Here are links to a few of
them:

* HashCalc: http://www.slavasoft.com/hashcalc/

* eXpress CheckSum Calculator (XCSC): http://www.irnis.net/soft/xcsc/

Follow the instructions provided to install the program. When you run the
program, use the file selection tools provided to select your downloaded ISO
image files. Then select the SHA-1 algorithm for calculation, and run the tool.
The program takes some time to complete, since it must read the entire ISO
file.

Open the file SHA1SUM with a text editor, such as WordPad, to display its
contents. Make sure the hash displayed by the hash tool for each of the
downloaded ISO files exactly matches the corresponding hash in the SHA1SUM
file.

If all of the hashes match, you can then burn the ISO files to media. If a file
does not match, you may have to download it again.

CAVEAT EMPTOR

The Fedora Project and Red Hat, Inc. have no control over external sites such
as the ones listed above, or the programs they provide.


Validating at the Windows Command Prompt

To check the files using the command prompt, you need to download the program
sha1sum.exe. For instructions and the link to download the program, refer to
http://lists.gnupg.org/pipermail/gnupg-announce/2004q4/000184.html.

The sha1sum.exe program computes and displays hashes. To use it, save
sha1sum.exe to the same directory as the ISO files. Select Run... from the
Start menu and then enter cmd for the name of the program to start a Command
Prompt window. Then change into the download directory. Run sha1sum with each
ISO file like this:

cd "C:\Documents and Settings\Owner\My Documents\My Downloads\Fedora Core"
sha1sum.exe FC5-i386-disc1.iso

The program takes some time to complete, since it must read the entire ISO
file.

Open the file SHA1SUM with a text editor, such as WordPad, to display its
contents. Make sure the hash displayed by sha1sum.exe for each of the
downloaded ISO files exactly matches the corresponding hash in the SHA1SUM
file.

If all of the hashes match, the ISO files can be burned to media. If a file
does not match, you may have to download it again.


Burning

The process of burning a CD is not always obvious to the users of Windows.
Windows applications often let users burn data discs by simply dragging the
source files into a box and clicking the Burn button.

In reality, though, the burning software performs two operations. First, it
creates an ISO 9660 standard image, just like the ones used to install Fedora
Core, from the source files that were dragged into the box. Second, it
transfers that ISO file onto the blank CD. If the original source file was
already an ISO image, the resulting CD is not usable for installation purposes.

To create the Fedora installation CDs, it is vital that you only perform the
second step with the Fedora Core ISO files. The steps required to do this using
several popular CD burning applications are listed below.


Using The ISO Recorder V2 Power Toy

Obtain and install the ISO Recorder power toy from the http://
isorecorder.alexfeinman.com/isorecorder.htm web site.

1. In Explorer, right click on the first Fedora Code ISO file

2. In the context menu, select "Copy image to CD"

3. Follow the steps given by the "CD Recording Wizard" pop-up

4. Repeat for the remaining ISO files


Using Roxio Easy Media Creator 7

1. Start "Creator Classic"

2. Select "Other Tasks"

3. Select "Burn from Disc Image File"

4. Choose the first Fedora Core ISO file and burn it

5. Repeat the above steps for each of the other ISO files


Using Nero Burning ROM 5

1. Start the program

2. Open the "File" menu

3. Select "Burn Image"

4. Choose the first Fedora Core ISO file and burn it

5. Repeat the above steps for each of the other ISO files


Using Nero Express 6

1. Start the program

2. Select "Disc Image or Saved Project"

3. An Open dialog appears. Select the first Fedora Core ISO file. Click Open.

4. The next screen allows you to select Writing Speed. You should set this to
4x for DVD, or 16x for CD, for best performance.

5. Click Next to Burn

6. Repeat the steps above for the other ISO files


Using cdrecord or growisofs

cdrecord (CD and DVD iso's) :
# cdrecord -v dev=ATA:1,0,0 driveropts=burnfree -dao FC5-i386-disc1.iso

growisofs (DVD iso's) :
# growisofs -dvd-compat -Z /dev/hdc=FC5-i386-disc1.iso

For more detailed information see e.g. HOWTO-ossdvd.html


Testing Your Discs

In order to be certain the CDs will work on your system, you may wish to burn
only disc 1 and then perform the following process before burning the others:

1. Following the directions from your computer's manufacturer, make sure your
computer's BIOS is set to boot from the CD drive.

2. Reboot the computer with disc 1 in the CD drive. The boot menu for the
Fedora Core installer appears.

3. Press Enter.

4. Follow the directions on-screen until you are asked if you would like to
perform a media check.

5. Conduct the check against the first disc. If the check succeeds, your disc
is correct. At this point the installer has changed nothing on your
computer. Remove the Fedora Core installation disc and restart the system
so that the computer boots into Windows.

6. Burn the other three ISO images. After burning the other discs, you can
repeat the media check to test them all.


Comments and Feedback

If you have suggestions for this document, send an email to relnotes AT
fedoraproject.org. We welcome directions for other tools and platforms.