Catatan kerja

Database beberapa permasalahan yang terjadi di tempat kerja

Killing Oracle Session November 12, 2008

Filed under: Oracle — aderahman @ 9:39 am

The SQL*Plus Approach

Sessions can be killed from within oracle using the ALTER SYSTEM KILL SESSION syntax.

First identify the offending session as follows:

SELECT s.sid,
       s.serial#,
       s.osuser,
       s.program
FROM   v$session s;

       SID    SERIAL# OSUSER                         PROGRAM
---------- ---------- ------------------------------ ---------------
         1          1 SYSTEM                         ORACLE.EXE
         2          1 SYSTEM                         ORACLE.EXE
         3          1 SYSTEM                         ORACLE.EXE
         4          1 SYSTEM                         ORACLE.EXE
         5          1 SYSTEM                         ORACLE.EXE
         6          1 SYSTEM                         ORACLE.EXE
        20         60 SYSTEM                         DBSNMP.EXE
        43      11215 USER1                          SQLPLUSW.EXE
        33       5337 USER2                          SQLPLUSW.EXE

The SID and SERIAL# values of the relevant session can then be substituted into the following statement:

SQL> ALTER SYSTEM KILL SESSION 'sid,serial#';

In some situations the Oracle.exe is not able to kill the session immediately. In these cases the session will be “marked for kill”. It will then be killed as soon as possible.

Issuing the ALTER SYSTEM KILL SESSION command is the only safe way to kill an Oracle session. If the marked session persists for some time you may consider killing the process at the operating system level, as explained below. Killing OS processes is dangerous and can lead to instance failures, so do this at your own peril.

It is possible to force the kill by adding the IMMEDIATE keyword:

SQL> ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;

This should prevent you ever needing to use the orakill.exe in Windows, or the kill command in UNIX/Linux.

The NT Approach

To kill the session via the NT operating system, first identify the session as follows:

SELECT s.sid,
       p.spid,
       s.osuser,
       s.program
FROM   v$process p,
       v$session s
WHERE  p.addr = s.paddr;

       SID SPID      OSUSER                         PROGRAM
---------- --------- ------------------------------ ---------------
         1 310       SYSTEM                         ORACLE.EXE
         2 300       SYSTEM                         ORACLE.EXE
         3 309       SYSTEM                         ORACLE.EXE
         4 299       SYSTEM                         ORACLE.EXE
         5 302       SYSTEM                         ORACLE.EXE
         6 350       SYSTEM                         ORACLE.EXE
        20 412       SYSTEM                         DBSNMP.EXE
        43 410       USER1                          SQLPLUSW.EXE
        33 364       USER2                          SQLPLUSW.EXE

The SID and SPID values of the relevant session can then be substituted into the following command issued from the command line:

C:> orakill ORACLE_SID spid

The session thread should be killed immediately and all resources released.

The UNIX Approach

To kill the session via the UNIX operating system, first identify the session in the same way as the NT approach, then substitute the relevant SPID into the following command:

% kill -9 spid

If in doubt check that the SPID matches the UNIX PROCESSID shown using:

% ps -ef | grep ora

The session thread should be killed immediately and all resources released.

 

Windows XP BOOT ERRORS & Fixes: November 6, 2008

Filed under: Windows — aderahman @ 3:50 am

1.Hal.dll missing or corrupt.

If you get an error regarding a missing or corrupt hal.dll file, it might simply be the BOOT.INI file on the root of the C: drive that is misconfigured
1.Insert and boot from your WindowsXP CD.
2.At the first R=Repair option, press the R key
3.Press the number that corresponds to the correct location for the installation of Windows you want to repair.
Typically this will be #1
4.Type bootcfg /list to show the current entries in the BOOT.INI file
5.Type bootcfg /rebuild to repair it
6 Take out the CD ROM and type exit
OR
Better solution: This seems to always work
expand x:\i386\hal.dl_ y:\windows\system32\ X= cd rom drive letter

2.Corrupt or missing WINDOWS\SYSTEM32\CONFIG

If you get the error:
Windows could not start because the following files is missing or corrupt
\WINDOWS\SYSTEM32\CONFIG\SYSTEM or \WINDOWS\SYSTEM32\CONFIG\SOFTWARE
1.Insert and boot from your Windows XP CD.
2.At the first R=Repair option, press the R key
3.Press the number that corresponds to the correct location for the installation of Windows you want to repair.
Typically this will be #1
4.Enter in the administrator password when requested
5.cd \windows\system32\config
6.Depending on which section was corrupted:
ren software software.bad or ren system system.bad
7.Depending on which section was corrupted
copy \windows\repair\system
copy \windows\repair\software
8.Take out the CD ROM and type exit

3. NTOSKRNL not found
If you get an error that NTOSKRNL not found:
1.Insert and boot from your WindowsXP CD.
2.At the first R=Repair option, press the R key
3.Press the number that corresponds to the correct location for the installation of Windows you want to repair.
Typically this will be #1
4.Change to the drive that has the CD ROM.
5.CD i386
6.expand ntkrnlmp.ex_ C:\Windows\System32\ntoskrnl.exe
7.If WindowsXP is installed in a different location, just make the necessary change to C:\Windows
8Take out the CD ROM and type exit

4. NTLDR NOT FOUND DURING BOOTUP

If you have FAT32 partitions, it is much simpler than with NTFS. Just boot with a Win98 floppy and copy the NTLDR or NTDETECT.COM files from the i386 directory to the root of the C:\ drive.
For NTFS:
1.Insert and boot from your Windows XP CD.
2.At the first R=Repair option, press the R key
3.Press the number that corresponds to the correct location for the installation of Windows you want to repair. Typically this will be #1
4.Enter in the administrator password when requested
5.Enter in the following commands (X: is replaced by the actual drive letter that is assigned to the CD ROM drive)
COPY X:\i386\NTLDR C\:
COPY X:\i386\NTDETECT.COM C:\
6.Take out the CD and type exit

5. Isapnp.sys error message at startup:

To replace the Isapnp.sys file in Windows XP, follow these steps:1. Start the computer from the Windows XP CD-ROM.
2. At the Welcome to Setup screen, press R to start Recovery Console.
3. If you have a dual-boot or a multiple-boot computer, type the number that corresponds to your Windows XP installation when you are prompted to select the Windows installation to log on to, and then press ENTER.
4. When you are prompted for the Administrator password, type the password, and then press ENTER.
Note If the administrator password is blank, just press ENTER.
5. At the C:\Windows prompt, type the following command, and then press ENTER:
ren c:\windows\system32\drivers\isapnp.sys isapnp.old
Note The steps in this article assume that you installed Windows XP to the C: drive. The actual location of your Windows installation may vary.
6. At the C:\Windows prompt, type the following command, and then press ENTER:
expand cd-romdrive:\i386\isapnp.sy_ c:\windows\system32\drivers\isapnp.sys
For example, type:
expand d:\i386\isapnp.sy_ c:\windows\system32\drivers
7. After the file is successfully expanded, type exit, and then press ENTER to exit Recovery Console.
8. Restart the computer.

6. ntfs.sys missing or corrupt error message:

To resolve this problem do the followings:-
1] Boot computer with the Windows XP CD-ROM in the CD-ROM drive.
2] To repair a Windows XP installation using Recovery Console, press R.
3] At the command prompt, type the following commands:-

cd \windows\system32\drivers [Press the ENTER Key]
ren ntfs.sys ntfs.old [Press the ENTER Key]

If the ntfs.sys file is there and corrupt it will rename it. If it is not there then it was missing.

4]At the command prompt, type the following command, and then press ENTER:
copy X:\i386\ntfs.sys drive:\windows\system32\drivers [Where X=CD-ROM Drive]

5]Remove the Windows XP CD from CD-ROM drive, type quit, and then
press ENTER to quit the Recovery Console.

6. Restart the system.

7. Windows XP Will Not Start

System files may be corrupted.

1.Start the Operating System from the CD-ROM
When the computer starts from the CD, the system checks your hardware and then prompts you to select one of the following options:
2.To set up Windows XP now, press ENTER.
3.To repair a Windows XP installation using Recovery Console, press R.
To quit Setup without installing Windows XP, press F3.
4.Press ENTER.
5.Press F8 to accept the Licensing Agreement.
A box lists your current Windows XP installation, and then the system prompts you to select one of the following options:
6.To repair the selected Windows XP installation, press R.
To continue installing a fresh copy of Windows XP without repairing, press ESC.
7.Press R to start the automatic repair process.
Note: After repairing Windows XP, you may need re-download all updates.

8. Error message: Unmountable boot volume

When booting up to Windows XP you may get an error that reads: Unmountable Boot Volume.

This is probably because your boot.ini file is messed up. Here is a possible remedy:
1. Start Windows XP with the Windows XP CD in your CD/DVD drive.
Once you see the “Welcome to setup” message, press the letter ‘R’ on your keyboard to enter the Recovery Console.
2. Select the Windows installation to be repaired (you will need to know the administrator password.
3. You will then get a DOS prompt. from here, type: chkdsk /p [Enter]
4. When that is done type: fixboot [Enter]
5. Type: Y at the next prompt [Enter]
6. Then type: exit [Enter]
The system will now reboot into Windows.
If for some reason that didn’t work, you can boot to the recovery console (example above).
Type: “chkdsk /r” [Enter]
When done type: exit [Enter].
This takes a bit longer, but the system should boot back into Windows.
If none of these work do a repair, follow the directions from previous solution.# 7

 

Sites

Filed under: Other — aderahman @ 3:48 am

Study

http://www.adp-gmbh.ch/ora/sql/

http://www.praetoriate.com/oracle_tips.htm

http://www.sadikhov.com

ftp://194.44.214.3/pub/e-books/

http://www.xpressionsz.com/

http://yourbooklib.com/

http://www.4shared.com/

http://katz.cd/

IOS

http://www.sadikhov.com/forum/index.php?showtopic=134556

Jobs and Career

http://www.gulftalent.com/home/index.php

 

K3b, The CD/DVD Creator for Linux October 30, 2008

Filed under: Uncategorized — aderahman @ 7:58 am

Source and Installation procedure

http://k3b.plainblack.com/

 

Make an ISO Image on Linux

Filed under: Linux — aderahman @ 7:40 am

To make an ISO from your CD/DVD, place the media in your drive but do not mount it. If it automounts, unmount it.

dd if=/dev/dvd of=dvd.iso # for dvd
dd if=/dev/cdrom of=cd.iso # for cdrom
dd if=/dev/scd0 of=cd.iso # if cdrom is scsi

To make an ISO from files on your hard drive, create a directory which holds the files you want. Then use the mkisofs command.

mkisofs -o /tmp/cd.iso /tmp/directory/

This results in a file called cd.iso in folder /tmp which contains all the files and directories in /tmp/directory/.

For more info, see the man pages for mkisofs, losetup, and dd, or see the CD-Writing-HOWTO at http://www.tldp.org.

If you want to create ISO images from a CD and you’re using Windows, Cygwin has a dd command that will work. Since dd is not specific to CDs, it will also create disk images of floppies, hard drives, zip drives, etc.

For the Windows users, here are some other suggestions:

WinISO ~ http://www.winiso.com

VaporCD ~ http://vaporcd.sourceforge.net ~ “You can create ISOs from CD and mount them as ‘virtual’ CD drives. Works flawlessly with games and other CD based software.

 

Configuring samba on Solaris 9 October 29, 2008

Filed under: Unix — aderahman @ 6:31 am

I learn how to configure samba using SWAT . It’s quite simple anf easier.

first of all , you need to download samba package from samba.org or sunfreeware.com

Then install the samba on the Solaris:

pkgadd -d /gdm002/ade/samba_3.0_25.ab.spacr9.pkg

If you want to remove the samba from the solaris,

pkgrm SMCsamba

If you want to know what package installed related with samba :

pkginfo -a | grep samba

How to check what version of samba is using :

root# /usr/sfw/sbin/smbd -V
Version 3.0.21b

Configuring Samba server and how to connect via SWAT and Netbios

Edit /etc/services and make the following changes.

Immediately after the line which reads:

	sunrpc		111/tcp		rpcbind

insert the two lines:

	netbios-ns      137/udp		# Samba nmbd
	netbios-ssn     139/tcp		# Samba smbd

and, after the line which reads:

	ldaps		636/udp		# LDAP protocol over TLS/SSL (was sldap)

insert the line:

	swat 		901/tcp		# Samba swat

Now edit /etc/inetd.conf and add the following three lines to the end of the file:

	netbios-ssn	stream	tcp	nowait	root	/usr/local/samba/bin/smbd smbd
	netbios-ns	dgram	udp	wait	root	/usr/local/samba/bin/nmbd nmbd
	swat		stream	tcp	nowait.400	root	/usr/local/samba/bin/swat swat

If you have TCP wrappers installed , the three lines to be added should read:

	netbios-ssn	stream	tcp	nowait	root	/usr/sbin/tcpd /usr/local/samba/bin/smbd smbd
	netbios-ns	dgram	udp	wait	root	/usr/sbin/tcpd /usr/local/samba/bin/nmbd nmbd
	swat		stream	tcp	nowait.400	root	/usr/sbin/tcpd /usr/local/samba/bin/swat swat

Tell the inetd daemon to re-read its configuration file:

	# pkill -HUP inetd

and Samba is installed and working.

Using SWAT to configure Samba on Solaris 9 :

testing : open browser then open http://localhost:901 or you can connect remotly by using hostname or IP address , for example :

http://163.184.169.159:901

Configure Samba :

Find the smb.conf , it is placed under directory /usr/local/samba/lib/smb.conf or /etc/samba/lib/smb.conf or /etc/sfw/lib/smb.conf

Create a basic configuration file containing the following lines:

	# Global parameters
		workgroup = HOME
		security = Share
		hosts allow = localhost, local-machine-name, 192.168.1.
		hosts deny = All
	[root]
		path = /
		comment = Solaris root
		guest ok = Yes
		read only = Yes
	[share]
		path = /share
		comment = Solaris share
		guest ok = Yes
		read only = No

Note that “# Global parameters”, “[root]” and “[share]” should be positioned at the start of their lines and all other lines should be prefixed with a tab character.

In this file, replace HOME with the name of your Windows workgroup or domain. On a Windows 95 or 98 system, this is the “Workgroup” name set on the Identification tab in Start -> Settings -> Control Panel -> Network. On NT 4, this name is found in the same place but is called the “Domain”.

Also, replace local-machine-name with the name of your Solaris system so that it can connect to the swat Web server described later, and replace 192.168.1 with the first three components of the IP addresses used on your local network. The range 192.168.1.1 to 192.168.1.254 is reserved for private use and is a good choice to use for a local network. Note the presence of a dot after the partial IP address in the configuration file.

The effect of this basic configuration file is to allow access to your Solaris system from Windows machines on the local network only (those with IP addresses starting 192.168.1) and a password is not required to browse the Solaris system. The root file system is shared but is read-only and the /share directory is shared with both read and write access. Incoming connections to the Solaris system have a User and Group identity (uid and gid) of the “nobody” user by default

For more detail, you can see on this page http://www.oregontechsupport.com/samba/

 

Change Hostid Solaris 8

Filed under: Unix — aderahman @ 4:59 am

You may need to change the hostid for licensing issues
when moving a software from one machine to another one.

Here is the procedure:

1. Download hid_solaris2 binary from http://yenigul.net/change_hostid
If you want to compile the code yourself you can download it from http://yenigul.net/change_hostid/hid-1.7.4.tar.gz

2. Save the original hostid to somewhere. (just for safety)

# hostid >/etc/hostid_orig

3. set permission of hid_solaris2 as 755
# chmod 755 /var/hid_solaris2
(I assume that hid_solaris2 is under /var/ directory)

4.To set new hostid (i.e 84abe39d) issue the following command

# /var/hid_solaris2 84abe39d |sh

physmem 2e694
hw_serial: 0×32323130 = 0×32323235
hw_serial+4: 0×39313931 = 0×38353734
hw_serial+8: 0×36390000 = 0×33370000

5. new hostid will be active until next reboot. To enable it again at startup add this command to
solaris startup scripts.