Friday, August 29, 2014

Disable WLDF Diagnostics in weblogic

Access the Administration Console for you domain.
Click Lock & Edit to start a new configuration session.
Select the Diagnostics->Diagnostic Modules node in the left pane of the console.
disable or stop or delete the respective module and carry out a restart.
Also please check if any of the options are enabled under console - data source - configuration - diagnostics  

Else

1. Shut down WebLogic Server. 
2. Clear the /data/store/diagnostics directories 
3. Apply the below 3 parameters at JAVA_OPTIONS of your setdomainenv  file

-D_Offline_FileDataArchive=true
To control diagnostics data collected from the server instance and the applications running on them. If true, WLDF archives the data collected (default: false). 

-Dcom.bea.wlw.netui.disableInstrumentation=true
To control Workshop page flow event reporting . Set to false by default in Workshop 10.1 and earlier). Set to true by default (in Workshop 10.2 and later). 

-Dweblogic.connector.ConnectionPoolProfilingEnabled=false
JDBC Connection Pool profiling data (default: false).

4. Restart WebLogic Server.
  

 Else

Take a backup of config.xml and delete the lines from and to
restart

Else
  
You can adopt a retirement policy by rotating the .dat file
console -  diagnostics - archives - select the respective server - create NEW 'Data Retirement Policies' followed by a restart. 

Monday, May 6, 2013

Operating System Tuning for Application Server

Here are some OS tuning tips for application server :
- Packet loss minimization – The operating system buffers must be large enough to handle incoming network traffic while the application is paused during garbage collection. Usually UDP (User Datagram Protocol) is used in order to transmit multicast messages to server instances in a cluster; to limit the need to retransmit UDP messages the size of the operating system buffers must be set appropriately to avoid excessive UDP datagram loss.
- TCP/IP – On some systems the default value for the time wait interval is too high and needs to be adjusted. When the number approaches the maximum number of file descriptors per process, the application’s throughput will degrade, i.e., new connections have to wait for a free space in the application’s file descriptor table.
- Swapping – Swapping, also known as paging, is the use of secondary storage to store and retrieve data for use in RAM. Swapping is automatically performed by the operating system and typically occurs when the available RAM memory is depleted. Swapping can have a significant impact on the performance and should thus be avoided.
- Network interface card (NIC) – Configure the network card at it’s maximum link speed and at full duplex.
- Maximum number of open file descriptors – Most operating systems handle sockets as a form of file access and use file descriptors to keep track of which sockets are open. To contain the resources per process, the operating system restricts the number of file descriptors per process. Linux limits the number of open file descriptors per process, by default this is equal to 1024. It could be that the 1024 limit does not offer optimal performance.
- Large pages – Large pages are essentially blocks of contiguous physical memory addresses that are reserved for a process. Large pages improve performance of applications that access memory frequently. When large pages are used the application uses the translation look-aside buffer (TLB) in the processor more effectively. The TLB is a cache of recently used virtual-to-physical address space translations stored in the processor memory. To obtain data from memory, the processor looks up the TLB to find out the physical addresses (RAM or hard disk) that hold the required data. In the case of large pages, a single entry in the TLB could represent a large contiguous address space and thereby potentially reducing the TLB look-up frequency and avoiding frequent look-ups in the hierarchical page table stored in-memory.
The contents of /etc/sysctl.conf look as follows
Some operating system tweaks are worth considering when we do not want to run against system restrictions:

- Packet loss minimization – The operating system buffers must be large enough to handle incoming network traffic while the application is paused during garbage collection. Usually UDP (User Datagram Protocol) is used in order to transmit multicast messages to server instances in a cluster; to limit the need to retransmit UDP messages the size of the operating system buffers must be set appropriately to avoid excessive UDP datagram loss.
- TCP/IP – On some systems the default value for the time wait interval is too high and needs to be adjusted. When the number approaches the maximum number of file descriptors per process, the application’s throughput will degrade, i.e., new connections have to wait for a free space in the application’s file descriptor table.
- Swapping – Swapping, also known as paging, is the use of secondary storage to store and retrieve data for use in RAM. Swapping is automatically performed by the operating system and typically occurs when the available RAM memory is depleted. Swapping can have a significant impact on the performance and should thus be avoided.
- Network interface card (NIC) – Configure the network card at it’s maximum link speed and at full duplex.
- Maximum number of open file descriptors – Most operating systems handle sockets as a form of file access and use file descriptors to keep track of which sockets are open. To contain the resources per process, the operating system restricts the number of file descriptors per process. Linux limits the number of open file descriptors per process, by default this is equal to 1024. It could be that the 1024 limit does not offer optimal performance.
- Large pages – Large pages are essentially blocks of contiguous physical memory addresses that are reserved for a process. Large pages improve performance of applications that access memory frequently. When large pages are used the application uses the translation look-aside buffer (TLB) in the processor more effectively. The TLB is a cache of recently used virtual-to-physical address space translations stored in the processor memory. To obtain data from memory, the processor looks up the TLB to find out the physical addresses (RAM or hard disk) that hold the required data. In the case of large pages, a single entry in the TLB could represent a large contiguous address space and thereby potentially reducing the TLB look-up frequency and avoiding frequent look-ups in the hierarchical page table stored in-memory.

The contents of /etc/sysctl.conf look as follows

# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Disable netfilter on bridges.
#net.bridge.bridge-nf-call-ip6tables = 0
#net.bridge.bridge-nf-call-iptables = 0
#net.bridge.bridge-nf-call-arptables = 0

# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536

# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296

# increase TCP max buffer size (depending on the type of NIC and the round-trip time these values can be changed)
# Maximum TCP Receive Window
net.core.rmem_max = 8388608
net.core.rmem_default = 8388608
# Maximum TCP Send Window
net.core.wmem_max = 8388608
net.core.wmem_default = 8388608
#  memory reserved for TCP receive buffers (vector of 3 integers: [min, default, max])
net.ipv4.tcp_rmem = 4096 87380 8388608
# memory reserved for TCP send buffers (vector of 3 integers: [min, default, max])
net.ipv4.tcp_wmem = 4096 87380 8388608

# increase the length of the processor input queue
net.core.netdev_max_backlog = 30000
# maximum amount of memory buffers (could be set equal to net.core.rmem_max and net.core.wmem_max)
net.core.optmem_max = 20480
# socket of the listen backlog
net.core.somaxconn = 1024

# tcp selective acknowledgements (disable them on high-speed networks)
net.ipv4.tcp_sack = 1
net.ipv4.tcp_dsack = 1
# Timestamps add 12 bytes to the TCP header
net.ipv4.tcp_timestamps = 1
# Support for large TCP Windows - Needs to be set to 1 if the Max TCP Window is over 65535
net.ipv4.tcp_window_scaling = 1
# The interval between the last data packet sent (simple ACKs are not considered data) and the first keepalive probe
net.ipv4.tcp_keepalive_time = 1800
# The interval between subsequential keepalive probes, regardless of what the connection has exchanged in the meantime
net.ipv4.tcp_keepalive_intvl = 30
# The number of unacknowledged probes to send before considering the connection dead and notifying the application layer
net.ipv4.tcp_keepalive_probes = 5
# The time that must elapse before TCP/IP can release a closed connection and reuse its resources.
net.ipv4.tcp_fin_timeout = 30
# Size of the backlog connections queue.
net.ipv4.tcp_max_syn_backlog=4096
# The tcp_tw_reuse setting is particularly useful in environments where numerous short connections are open and left in TIME_WAIT state, such as web servers.
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_tw_recycle=1

# The percentage of how aggressively memory pages are swapped to disk
vm.swappiness = 0
# The percentage of main memory the pdflush daemon should write data out to the disk.
vm.dirty_background_ratio=25
# The percentage of main memory the actual disk writes will take place.
vm.dirty_ratio=20

# set the number of huge pages based on the Hugepagesize, i.e., 2048kB
# when we want to reserve 1GB in huge pages we have to set the number of huge pages to:
# (1024*1024*1024*1)/(1024*1024*2) = 1073741824/2097152 = 512
vm.nr_hugepages = 512

# give permission to the group that runs the process to access the shared memory segment
# to this end open the /etc/group file and retrieve the group-id (javainstall:x:500:)
vm.hugetlb_shm_group = 500

The contents of /etc/security/limits.conf look as follows

# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#           
#
#Where:
# can be:
#        - an user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#
# can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
# can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open files
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit (KB)
#        - maxlogins - max number of logins for this user
#        - maxsyslogins - max number of logins on the system
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#        - sigpending - max number of pending signals
#        - msgqueue - max memory used by POSIX message queues (bytes)
#        - nice - max nice priority allowed to raise to values: [-20, 19]
#        - rtprio - max realtime priority
#
#                
#

#*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#@student        -       maxlogins       4

# open file descriptors
@javainstall soft nofile 8192
@javainstall hard nofile 8192

# memlock - maximum locked in-memory address space (kB), we set this equal to:
# number_of_huge_pages * huge_page_size = 512 * 2048 = 1048576
@javainstall soft memlock 1048576
@javainstall hard memlock 1048576 

#End of file

Sunday, April 1, 2012

reset weblogic password

Steps to create another superuser in weblogic (when password of existing user is lost)

1. Shutdown WebLogic Server (If Running) – Optional Step

2. Login to WebLogic Server and set environment variable

cd $DOMAIN_HOME/bin   (where DOMAIN_HOME is directory in which your domain exists, default value is $MW_HOME/user_projects/domain/base_domain)

. ./setDomainEnv.sh

3. Create a initialization file using command

java weblogic.security.utils.AdminAccount   .  (Note the DOT at end of this command)

For Example

java weblogic.security.utils.AdminAccount weblogic welcome1 . (Note the DOT at end of this command)

This will create file  DefaultAuthenticatorInit.ldift in directory from which you executed this command .

4. Move file DefaultAuthenticatormyrealmInit.ldift  from $DOMAIN_HOME/security/ and replace it by  DefaultAuthenticatorInit.ldift generated in step 3

5. Move data directory under $DOMAIN_HOME/servers//datato another directory like data.bak (data directory contains files related to embedded LDAP and role mapping file). Replace with WebLogic Server like AdminServer and managed server. Repeat this step for all managed servers which are part of this domain.

This step will remove all existing users/groups from WebLogic’s embedded LDAP server (recreate these users/groups in setp8)

6.Recreate boot.properites (if any) under $DOMAIN_HOME/servers//security with username and password created in step 3 above like
USERNAME=weblogic
PASSWORD=welcome1

7.Start (or restart) Admin Server and test if you can login to weblogic console using new username and password. 

8. Recreate any users/groups(which were part of default authenticator prior to new super user creation) or import existing users (from weblogic’s servers embedded LDAP server backup)

Wednesday, March 21, 2012

Setting Internet Sharing

set ip PC gateway
# ifconfig eth0 192.168.0.6 netmask 255.255.255.0

set default gateway in PC gateway(internet sharing)
# route add default gw 192.168.0.5

- enable IP forwarding
# echo 1 > /proc/sys/net/ipv4/ip_forward

or



# sysctl -w net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1

- set firewall

# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE

or use SNAT

# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j SNAT 192.168.0.6

- show rule

iptables -t nat -nL

- to make permanent set in /etc/rc.local

nb : 192.168.0.5 --> IP DSL Modem / router
192.168.0.6 --> IP PC gateway(Internet Sharing)

Monday, March 12, 2012

Reinstall GRUB in RHEL Linux

# grub
grub> root (hd0,0)
root (hd0,0)
Filesystem type is ext2fs, partition type 0xfd
grub> setup (hd0)
setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.
grub> quit
# reboot

Tuesday, February 21, 2012

Add samba user

At this point you should be able to see the samba server from any windows system in the same workgroup but you won't be able to access the share; not until you add the user(s).

Samba authenticates its users through its local database. Once you have saved the changes to smb.conf , you need to add the users.

Since you enabled the encrypted password option in your smb.conf, you need to add the users with encrypted password.

Add your existing users to samba or create new users and then add them to samba.



[root@server2 samba]# smbpasswd –a agustin
New SMB password: ********
Retype new SMB password:********

Enter the password in 8 character length or more, if you enabled the user name length specification, then it must meet the requirement. Note that agustin is an existing user in the system.

Note. If the command fails it is because the password file does not exist. Retouch the file with the following command and try again.

[root@server2 samba]# touch /etc/samba/smbpasswd

Finally change the smbpasswd security to 644

[root@server2 samba]# chmod 644 smbpasswd

That command will make it read only!

Tuesday, December 27, 2011

Install Apache mod_proxy_balancer

Install Apache mod_proxy_balancer

#cd /u01/source
#tar xvzf httpd-2.2.21.tar.gz
#cd httpd-2.2.21
#./configure --prefix=/u01/apache --enable-so

#make
#make install

cd httpd-2.2.21/modules/metadata
#/u01/apache/bin/apxs -a -i -c mod_headers.c

cd httpd-2.2.21/modules/proxy
#/u01/apache/bin/apxs -a -i -c mod_proxy.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_ajp.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_balancer.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_connect.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_http.c

if error when start apache, solve with running below
#/u01/apache/bin/apxs -a -i -c mod_proxy.c proxy_util.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_ajp.c proxy_util.c ajp_utils.c ajp_header.c ajp_msg.c ajp_link.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_balancer.c proxy_util.c


#cd /u01/apache/conf
#echo "Include conf/proxy-pass.conf" >> httpd.conf

#vi proxy-pass.conf

Header add Set-Cookie "ROUTEID=%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED

BalancerMember http://localhost:6001 route=node1
BalancerMember http://localhost:6002 route=node2
ProxySet stickysession=ROUTEID


ProxyPass /context balancer://cluster/context
ProxyPassReverse /context balancer://cluster2/context

--start apache
#/u01/apache/bin/apachectl start

--stop apache
#/u01/apache/bin/apachectl stop

Wednesday, October 19, 2011

Apache as Load Balancer for Weblogic Server

1. gzip -d httpd*.tar.gz
2. tar -xvf httpd*.tar
3. ./configure --prefix=/u01/apache --enable-module=so --enable-rule=SHARED_CORE
4. make
5. make install
6. copy mod_wl.so to $apache_home/modules
7. vi $apache_home/conf/httpd.conf

8. add line to httpd.conf
-------
LoadModule weblogic_module modules/mod_wl.so
-------
Include conf/weblogic.conf
9. create file weblogic.conf


SetHandler weblogic-handler
weblogicCluster 192.168.10.1:7002,192.168.10.2:7002


10. start httpd
$apache_home/bin/apachectl start
11. check apache running
ps -ef | grep httpd

Wednesday, August 24, 2011

Search largest directory or file size

Here is command to seach largest directory size or file size in linux

Go to directory that want to search, here i try with root directory

[root@localhost /]# pwd
/

Run below command to sarch as tree

du -a | sort -nr | head -10



[root@localhost /]# du -a | sort -nr | head
4895036 .
2534040 ./u01
2491840 ./u01/app
2491824 ./u01/app/Middleware
1974680 ./usr
1178384 ./usr/share
944184 ./u01/app/Middleware/wls1033_generic.jar
691292 ./u01/app/Middleware/wlserver_10.3
663968 ./u01/app/Middleware/wlserver_10.3/server
481796 ./u01/app/Middleware/wlserver_10.3/server/lib


Run below command to search parent directory only

du -sm * | sort -nr | head

[root@localhost /]# du -sm * | sort -nr | head

2475 u01
1929 usr
129 lib
109 etc
58 var
37 sbin
21 lib64
9 bin
7 boot
6 root



Sunday, July 3, 2011

Make local yum repository

- run mount command to mount repo file :
ex: mount -t iso9660 -o loop /dev/hdc /u02
- go to yum repo directory
cd /etc/yum.repos.d
- make file local.repo in this directory
insert below script in local.repo
[localrepo]
name=My local repo
baseurl=file:///u02/Server
enabled=1
gpgcheck=0
#gpgkey=file:///path/to/you/RPM-GPG-KEY
- run df -h to check the repo file already mounted

Filesystem Size Used Avail Use% Mounted on
/dev/sda1 3.8G 1.8G 1.9G 50% /
tmpfs 494M 0 494M 0% /dev/shm
/dev/hdc 2.9G 2.9G 0 100% /u02



Saturday, January 1, 2011

Extend swap space on linux

Actually, yes. You can supplement your swap partition with a swap file. It goes something like this:

First, create a large empty file:
Code:
sudo dd if=/dev/zero of=/swap_file bs=1M count=1000
Replace 1000 with the size of the swap file desired, in MB. You can also put the swap_file in a different location if desired.


Next, we'll secure the swapspace, so ordinary users cannot read the contents (potential security breach):
Code:
sudo chown root:root /swap_file
sudo chmod 600 /swap_file
Then, turn it into swap space:

Code:
sudo mkswap /swap_file
Next, turn it on:
Code:
sudo swapon /swap_file

To make it turn on at every bootup, open up /etc/fstab:
Code:
sudo gedit /etc/fstab
Add this line to the end of the file:
Code:
/swap_file none swap sw 0 0
__________________

Wednesday, December 8, 2010

Install Oracle di ubuntu 9.10 (Karmic)

Install oracle di ubuntu 9.10, silahkan download masternya di http://oss.oracle.com/debian/dists/unstable/non-free/binary-i386/oracle-xe_10.2.0.1-1.1_i386.deb

kemudian paket yang diperlukan:

install kedua libaio setelah itu install oracle-xe

dpkg -i libaio_0.3.104-1_i386.deb

dpkg -i libaio1_0.3.104-1ubuntu6_i386.deb

dpkg -i oracle-xe_10.2.0.1-1.1_i386.deb

kemudian jalankan

/etc/init.d/oracle-xe configure

masih dalam konsole

export PATH=$PATH:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin

export ORACLE_HOME=”/usr/lib/oracle/xe/app/oracle/product/10.2.0/server”

export ORACLE_SID=XE

kalo tahap ini sudah selesai, silahkan test oraclenya

sqlplus sys as sysdba

kalo sudah masuk berarti sudah sukses

Thursday, December 2, 2010

How To Read ISO File in Linux

1. Login with root user ID
2. Create a directory to serve as mount point. You may also skip the directory creation by using default directory that created during Linux installation (e.g. /media/cdrom or /mnt/cdrom in some Red Hat Linux editions).
3. Suppose you want to mount /ISO/rhel4-cd1.iso image file to /media/cdrom directory mount point, execute this mount command

mount -o loop -t iso9660 /ISO/rhel4-cd1.iso /media/cdrom


4. Now, you can read / access the CD image file that is mounted to /media/cdrom directory, as if you’re accessing the physical CD-ROM loaded into hardware drive.

5. To un-mount the loaded CD image file, simply execute
umount /media/cdrom
or eject /media/cdrom command will do.

Monday, March 22, 2010

Cold backup and hot backup

Having the right backup and recovery procedures is crucial to the operation of any database. It is the responsibility of the database administrator to protect the database from system faults, crashes, and natural calamities resulting from a variety of circumstances. Learn how to choose the best backup and recovery mechanism for your Oracle system.

Having the right backup and recovery procedures is the lifeblood of any database. Companies live on data, and, if that data is not available, the whole company collapses. As a result, it is the responsibility of the database administrator to protect the database from system faults, crashes, and natural calamities resulting from a variety of circumstances.



The choice of a backup and recovery mechanism depends mainly on the following factors:

* Database mode (ARCHIVELOG, NOARCHIVELOG)
* Size of the database
* Backup and recovery time
* uptime
* Type of data (OLTP, DSS, Data Warehouse).

The types of backup are

* Offline backup (Cold or closed database backup)
* Online backup (Hot or open database backup)
* Logical export

Logical exports create an export file that contains a list of SQL statements to recreate the database. Export is performed when the database is open and does not affect users work. Offline backups can only be performed when the database is shut down cleanly, and the database will be unavailable to users while the offline backup is being performed. Online backups are performed when the database is open, and it does not affect users work. The database needs to run in ARCHIVELOG mode to perform online backups.

The database can run in either ARCHIVELOG mode or NOARCHIVELOG mode. In ARCHIVELOG mode, the archiver (ARCH) process archives the redo log files to the archive destination directory. These archive files can be used to recover the database in the case of a failure. In NOARCHIVELOG mode, the redo log files are not archived.

When the database is running in ARCHIVELOG mode, the choice can be one or more of the following:

* Export
* Hot backup
* Cold backup

When the database is running in NOARCHIVELOG mode, the choice of backup is as follows:

* Export
* Cold backup

Cold Backup

Offline or cold backups are performed when the database is completely shutdown. The disadvantage of an offline backup is that it cannot be done if the database needs to be run 24/7. Additionally, you can only recover the database up to the point when the last backup was made unless the database is running in ARCHIVELOG mode.

The general steps involved in performing a cold backup are shown in Figure 3.1. These general steps are used in writing cold backup scripts for Unix and Windows NT.

Figure 3.1 Steps for cold backup.

The steps in Figure 3.1 are explained as follows.

Step 1—Generating File List

An offline backup consists of physically copying the following files:

* Data files
* Control files
* Init.ora and config.ora files

CAUTION

Backing up online redo log files is not advised in all cases, except when performing cold backup with the database running in NOARCHIVELOG mode. If you make a cold backup in ARCHIVELOG mode do not backup redo log files. There is a chance that you may accidentally overwrite your real online redo logs, preventing you from doing a complete recovery.

If your database is running in ARCHIVELOG mode, when you perform cold backup you should also backup archive logs that exist.

Before performing a cold backup, you need to know the location of the files that need to be backed up. Because the database structure changes day to day as more files get added or moved between directories, it is always better to query the database to get the physical structure of database before making a cold backup.

To get the structure of the database, query the following dynamic data dictionary tables:

* V$datafile Lists all the data files used in the database

SQL>select name from v$datafile;

* Backup the control file and perform a trace of the control file using

SQL>alter database backup controlfile to '/u10/backup/control.ctl';

SQL>alter database backup controlfile to trace;

* Init.ora and config.ora Located under $ORACLE_HOME/dbs directory

Step 2—Shut down the database

You can shut down a database with the following commands:

$su – oracle
$sqlplus "/ as sysdba"
SQL>shutdown

Step 3—Perform a backup

In the first step, you generated a list of files to be backed up. To back up the files, you can use the Unix copy command (cp) to copy it to a backup location, as shown in the following code. You have to copy all files that you generated in Step 1.

$cp /u01/oracle/users01.dbf /u10/backup

You can perform the backup of the Init.ora and config.ora files as follows:

$cp $ORACLE_HOME/dbs/init.ora /u10/backup
$cp $ORACLE_HOME/dbs/config.ora /u10/backup

Step 4—Start the database

After the backup is complete, you can start the database as follows:

$su – oracle
$sqlplus "/ as sysdba"
SQL> startup

Hot Backup

An online backup or hot backup is also referred to as ARCHIVE LOG backup. An online backup can only be done when the database is running in ARCHIVELOG mode and the database is open. When the database is running in ARCHIVELOG mode, the archiver (ARCH) background process will make a copy of the online redo log file to archive backup location.

An online backup consists of backing up the following files. But, because the database is open while performing a backup, you have to follow the procedure shown in Figure 3.2 to backup the files:

* Data files of each tablespace
* Archived redo log files
* Control file
* Init.ora and config.ora files

Figure 3.2 Steps for hot backup.

The general steps involved in performing hot backup are shown in Figure 3.2. These general steps are used in writing hot backup scripts for Unix and Windows NT.

The steps in Figure 3.2 are explained as follows.

Step 1—Put the tablespace in the Backup mode and copy the data files.

Assume that your database has two tablespaces, USERS and TOOLS. To back up the files for these two tablespaces, first put the tablespace in backup mode by using the ALTER statement as follows:

SQL>alter tablespace USERS begin backup;

After the tablespace is in Backup mode, you can use the SELECT statement to list the data files for the USERS tablespace, and the copy (cp) command to copy the files to the backup location. Assume that the USERS tablespace has two data files—users01.dbf and users02.dbf.

SQL>select file_name from dba_data_files
where tablespace_name='USERS';
$cp /u01/oracle/users01.dbf /u10/backup
$cp /u01/oracle/users01.dbf /u10/backup

The following command ends the backup process and puts the tablespace back in normal mode.

SQL>alter tablespace USERS end backup;

You have to repeat this process for all tablespaces. You can get the list of tablespaces by using the following SQL statement:
SQL>select tablespace_name from dba_tablespaces;

Step 2—Back up the control and Init.ora files.

To backup the control file,

SQL>alter database backup controlfile to '/u10/backup/control.ctl';

You can copy the Init.ora file to a backup location using

$cp $ORACLE_HOME/dbs/initorcl.ora /u10/backup

Step 3—Stop archiving.

Archiving is a continuous process and, without stopping archiver, you might unintentionally copy the file that the archiver is currently writing. To avoid this, first stop the archiver and then copy the archive files to backup location. You can stop the archiver as follows:

SQL>alter system switch logfile;
SQL>alter system archive log stop;

The first command switches redo log file and the second command stops the archiver process.

Step 4—Back up the archive files.

To avoid backing up the archive file that is currently being written, we find the least sequence number that is to be archived from the V$LOG view, and then backup all the archive files before that sequence number. The archive file location is defined by the LOG_ARCHIVE_DEST_n parameter in the Init.ora file.

select min(sequence#) from v$log
where archived='NO';

Step 5—Restart the archive process.

The following command restarts the archiver process:

SQL>alter system archive log start;

Now you have completed the hot backup of database.

An online backup of a database will keep the database open and functional for 24/7 operations. It is advised to schedule online backups when there is the least user activity on the database, because backing up the database is very I/O intensive and users can see slow response during the backup period. Additionally, if the user activity is very high, the archive destination might fill up very fast.

Database Crashes During Hot Backup

There can be many reasons for the database to crash during a hot backup—a power outage or rebooting of the server, for example. If these were to happen during a hot backup, chances are that tablespace would be left in backup mode. In that case you must manually recover the files involved, and the recovery operation would end the backup of tablespace. It's important to check the status of the files as soon as you restart the instance and end the backup for the tablespace if it's in backup mode.

select a.name,b.status from v$datafile a, v$backup b
where a.file#=b.file# and b.status='ACTIVE';

or

select a.tablespace_name,a.file_name,b.status from dba_data_files a,
v$backup b
where a.file_id=b.file# and b.status='ACTIVE';

This statement lists files with ACTIVE status. If the file is in ACTIVE state, the corresponding tablespace is in backup mode. The second statement gives the tablespace name also, but this can't be used unless the database is open. You need to end the backup mode of the tablespace with the following command:

alter tablespace tablespace_name end backup;

Logical Export

Export is the single most versatile utility available to perform a backup of the database, de-fragment the database, and port the database or individual objects from one operating system to another operating system.

Export backup detects block corruption

Though you perform other types of backup regularly, it is good to perform full export of database at regular intervals, because export detects any data or block corruptions in the database. By using export file, it is also possible to recover individual objects, whereas other backup methods do not support individual object recovery.

Export can be used to export the database at different levels of functionality:

* Full export (full database export) (FULL=Y)
* User-level export (exports objects of specified users) (OWNER=userlist)
* Table-level export (exports specified tables and partitions) (TABLES=tablelist)
* Transportable tablespaces (TABLESPACES=tools, TRANSPORT_TABLESPACE=y)

There are two methods of Export:

* Conventional Path (default)—Uses SQL layer to create the export file. The fact is that the SQL layer introduces CPU overhead due to character set, converting numbers, dates and so on. This is time consuming.
* Direct path (DIRECT=YES)—Skips the SQL layer and reads directly from database buffers or private buffers. Therefore it is much faster than conventional path.

We will discuss scripts to perform the full, user-level, and table-level export of database. The scripts also show you how to compress and split the export file while performing the export. This is especially useful if the underlying operating system has a limitation of 2GB maximum file limit.

Understand scripting

This chapter requires understanding of basic Unix shell and DOS batch programming techniques that are described in Chapter 2 "Building Blocks." That chapter explained some of the common routines that will be used across most of the scripts presented here.

This book could have provided much more simple scripts. But, considering standardization across all scripts and the reusability of individual sections for your own writing of scripts, I am focusing on providing a comprehensive script, rather than a temporary fix. After you understand one script, it is easy to follow the flow for the rest of the scripts.

Source : www.informit.com

Sunday, July 5, 2009

Slackware 12.2

This Slackware edition combines Slackware's legendary simplicity (and
close tracking of original sources), stability, and security with some
of the latest advances in Linux technology. Expect no less than the best
Slackware yet.

Among the many program updates and distribution enhancements, you'll find
two of the most advanced desktop environments available today: Xfce 4.4.3,
a fast and lightweight but visually appealing and easy to use desktop
environment, and KDE 3.5.10, the final 3.x version of the award-winning K
Desktop Environment. Properly set up, Slackware's desktop is suitable for
any level of Linux experience.

Slackware uses the 2.6.27.7 kernel bringing you advanced performance
features such as journaling filesystems, SCSI and ATA RAID volume support,
SATA support, Software RAID, LVM (the Logical Volume Manager), and
encrypted filesystems. Kernel support for X DRI (the Direct Rendering
Interface) brings high-speed hardware accelerated 3D graphics to Linux.

There are two kinds of kernels in Slackware -- the huge kernels, which
contain support for just about every driver in the Linux kernel. These are
primarily intended to be used for installation, but there's no real reason
that you couldn't continue to run them after you have installed. The
other type of kernel is the generic kernel, in which nearly every driver
is built as a module. To use a generic kernel you'll need to build an
initrd to load your filesystem module and possibly your drive controller
or other drivers needed at boot time, configure LILO to load the initrd at
boot, and reinstall LILO. See the docs in /boot after installing for more
information. Slackware's Linux kernels come in both SMP and non-SMP types
now. The SMP kernel supports multiple processors, multi-core CPUs,
HyperThreading, and about every other optimization available. In our own
testing this kernel has proven to be fast, stable, and reliable. We
recommend using the SMP kernel even on single processor machines if it
will run on them.

From the beginning, Slackware has offered a stable and secure Linux
distribution for UNIX veterans as well as an easy-to-use system for
beginners. Slackware includes everything you'll need to run a powerful
server or workstation. Each Slackware package follows the setup and
installation instructions from its author(s) as closely as possible,
offering you the most stable and easily expandable setup.

Here are some of the advanced features of Slackware 12.2:

- Runs the 2.6.27.7 version of the Linux kernel from ftp.kernel.org.
Also included is a kernel patched with Speakup to support speech
synthesizers providing access to Linux for the visually impaired
community. The 2.6.x kernel series has matured into a stable
kernel, and provides reliable performance for your desktop or
your production server.

- System binaries are linked with the GNU C Library, version 2.7.
This version of glibc also has excellent compatibility with
existing binaries.

- X11 based on the X.Org Foundation's modular X Window System.
There's been much activity in the X development world, and the
improvements in terms of performance and hardware support are
too numerous to mention them all here.

- Installs gcc-4.2.4 as the default C, C++, Objective-C,
Fortran-77/95, and Ada 95 compiler.

- Support for fully encrypted network connections with OpenSSL,
OpenSSH, OpenVPN, and GnuPG.

- Apache (httpd) 2.2.10 web server with Dynamic Shared Object
support, SSL, and PHP 5.2.8.

- PCMCIA, CardBus, USB, IEE1394 (FireWire) and ACPI support. This
makes Slackware a great operating system for your laptop.

- The udev dynamic device management system for Linux 2.6.x.
This locates and configures most hardware automatically as it
is added (or removed) from the system, and creates the access
nodes in /dev. It also loads the kernel modules required by
sound cards and other hardware at boot time.

- New development tools, including Perl 5.10.0, Python 2.5.2,
Ruby 1.8.7-p72, Subversion 1.5.4, git-1.6.0.3, mercurial-1.0.2,
graphical tools like Qt designer and KDevelop, and much more.

- Updated versions of the Slackware package management tools make it
easy to add, remove, upgrade, and make your own Slackware packages.
Package tracking makes it easy to upgrade from Slackware 12.1 to
Slackware 12.2 (see CHANGES_AND_HINTS.TXT). The slackpkg tool can
also help update from an older version of Slackware to a newer one,
and keep your Slackware system up to date. In addition, the
slacktrack utility (in extra/) will help you build and maintain
your own packages.

- Web browsers galore! Includes KDE's Konqueror 3.5.10,
SeaMonkey 1.1.13 (this is the replacement for the Mozilla
Suite), and the immensely popular Firefox 3.0.4, as well as
the Thunderbird 2.0.0.18 email and news client with advanced
junk mail filtering.

- The complete K Desktop Environment (KDE) version 3.5.10, including
the KOffice productivity suite, networking tools, GUI development
with KDevelop, multimedia tools (including the amazing Amarok
music player and K3B disc burning software), the Konqueror web
browser and file manager, dozens of games and utilities,
international language support, and more.

- A collection of GTK+ based applications including pidgin-2.5.2,
gimp-2.4.7, gkrellm-2.3.2, gxine-0.5.903, xchat-2.8.6, xsane-0.996,
and pan-0.133.

- Large repository of extra software packages compiled and ready to
run. This includes various window managers, the Java(TM) 2 Software
Development Kit Standard Edition, libsafe (buffer overflow protection
for additional security), and much more (see the /extra directory).

- Many more improved and upgraded packages than we can list here. For
a complete list of core packages in Slackware 12.2, see this file:

ftp://ftp.slackware.com/pub/slackware/slackware-12.2/PACKAGES.TXT


Downloading Slackware 12.2:
---------------------------

The full version of Slackware Linux 12.2 is available for download from
the central Slackware FTP sites hosted by our friends at www.cwo.com
and osuosl.org:

ftp://slackware.osuosl.org/pub/slackware/slackware-12.2/
ftp://ftp.slackware.com/pub/slackware/slackware-12.2/

If the sites are busy, see the list of official mirror sites here:

http://slackware.com/getslack/

We will be setting up BitTorrent downloads for the official ISO images.
Stay tuned to http://slackware.com for the latest updates.

Instructions for burning the Slackware tree onto install discs may be
found in the isolinux directory.



Tuesday, June 30, 2009

Running UNIX Commands Immune to Hangups (nohup)

by Jeff Hunter, Sr. Database Administrator

Overview

This month, I introduce the UNIX nohup utility. Most of the information included in this article are taken directly from the nohup man page.

As a DBA, you have more than likely been faced with the need to run a command in UNIX that you know will take a long time to complete. Most often, you will want to run the command and "exit" from the terminal. When the shell exits though, it sends its children a SIGHUP signal, which by default causes them to be killed. All stopped, running and background jobs will ignore SIGHUP and continue running if their invocation is preceded by the nohup or if the process programmatically has chosen to ignore SIGHUP.



The nohup utility invokes the named command with the arguments supplied. When the command is invoked, nohup arranges for the SIGHUP signal to be ignored by the process.

Syntax

/usr/bin/nohup command [ argument ...]

Processes run by /usr/bin/nohup are immune to SIGHUP (hangup) and SIGQUIT (quit) signals.

/usr/xpg4/bin/nohup command [ argument ...]

Processes run by /usr/xpg4/bin/nohup are immune to SIGHUP.

Other Notes

The nohup utility does not arrange to make processes immune to a SIGTERM (terminate) signal, so unless they arrange to be immune to SIGTERM or the shell makes them immune to SIGTERM, they will receive it.

If nohup.out is not writable in the current directory, output is redirected to $HOME/nohup.out. If a file is created, the file will have read and write permission "600". If the standard error is a terminal, it is redirected to the standard output, otherwise it is not redirected. The priority of the process run by nohup is not altered.

If you are running the Korn shell as your login shell, and have nohup'ed jobs running when you attempt to logout, you will be warned with the message

You have jobs running.

You will then need to logout a second time to actually logout; however, your background jobs will continue to run.

The C-shell has a built-in command nohup that provides immunity from SIGHUP, but does not redirect output to nohup.out. Commands executed with `&' are automatically immune to HUP signals while in the background.

nohup does not recognize command sequences. In the case of the following command

example$ nohup command1; command2

The nohup utility applies only to command1. The command

example$ nohup (command1; command2)

is syntactically incorrect.

Operands

The following operands are supported:

command

The name of a command that is to be invoked. If the command operand names any of the special shell_builtins(1) utilities, the results are undefined.

argument

Any string to be supplied as an argument when invoking the command operand.

Examples

It is frequently desirable to apply nohup to pipelines or lists of commands. This can be done only by placing pipe- lines and command lists in a single file, called a shell script. One can then issue:

example$ nohup sh file

and the nohup applies to everything in file. If the shell script file is to be executed often, then the need to type sh can be eliminated by giving file execute permission.

Add an ampersand and the contents of file are run in the background with interrupts also ignored (see sh(1)):

example$ nohup file &

Thursday, June 25, 2009

Difference RMAN and EXPDP

Question: I've been using data pump (the export utility) to backup my database, but I wonder if I should be using RMAN instead. They both do backups, so what's the advantages of each?

Answer: Yes, RMAN and export both backup tables, and they both support flashback database, but there are some important differences:

* Data Pump Export (expdp) - The export utility is a "logical" backup, usually done by specifying specific tables. If you fail to do a "consistent" export, or if you fail to include related tables and use RESTRICTED and CONSISTENT mode (with referential integrity constraints), you may not be able to recover properly. Also, export can only read "cooked" files, and database with raw files (e.g. RAC) cannot be copied with export. Hence, export is often used as a supplement to RMAN, usually for the restore of specific tables.



* Recovery manager (rman) - RMAN is designed for backup and recovery, a extension of the Enterprise Backup Utility (EBU). RMAN reads raw files, takes time-consistent backups. manages referential integrity.

Advantages & disadvantages of Export:

* Free, and easy to use
* Very slow, compared to RMAN (examines every data block)
* Easy restore of a specific table
* Does not require ARCHIVELOG mode
* Export will discover the SCN that is closest to the specified time. This SCN is used to enable flashback with export.

Advantages & disadvantages of RMAN:

* Supports raw devices
* RMAN has block-level media recovery
* Has a catalog for backup tracking and a report utility
* Fast - If you dedicate a backup device for each production disk, you can backup terabytes in the time it takes to backup any single disk.
* Does hot or cold backups
* Backups and restores can be done in parallel
* Allows incremental backups (block change tracking)
* Interfaces with media management systems (TMS)
* RMAN can be used to backup changed data even after a nologging operation, and you can move away from archivelog mode.


by Burleson Consulting - www.dba-oracle.com

Sunday, January 25, 2009

Install .rpm Files in Debian and Ubuntu

Some time you might find some applications are having only .rpm files but you want a .deb package for your debian,Ubuntu and other debian derived ditributions.If you can’t find .deb debian package in any of the debian,ubuntu repositories or elsewhere, you can use the alien package converter to install the .rpm file.

Alien is a program that converts between the rpm, dpkg, stampede slp, and slackware tgz file formats. If you want to use a package from another distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it.


Despite the large version number, alien is still (and will probably always be) rather experimental software. It has been used by many people for many years, but there are still many bugs and limitations.

Alien should not be used to replace important system packages, like sysvinit, shared libraries, or other things that are essential for the functioning of your system. Many of these packages are set up differently by Debian and Red Hat, and packages from the different distributions cannot be used interchangably. In general, if you can’t uninstall the package without breaking your system, don’t try to replace it with an alien version.

Install alien in debian

#apt-get install alien

This will install all the required packages.Now you can start converting your .rpm files to .deb packages.

Available Options for alien

Convert the package.rpm into a package.deb

#alien -d package-name.rpm

Convert the package.rpm into a package.deb, and install the generated package.

#alien -i package-name.rpm

If you want to keeps alien from changing the version number use the following command

#alien -k rpm-package-file.rpm

Example

Suppose we have a avg antivirus avg71lms-r30-a0782.i386.rpm file

To convert .rpm to debian

#alien -k avg71lms-r30-a0782.i386.rpm

Now you should be having avg71lms-r30-a0782.i386.deb file

To install .deb file

#dpkg -i avg71lms-r30-a0782.i386.deb

If you don’t use -k option you should see avg71lms_r30-1_i386.deb file the difference is it will add 1

Install alien in Ubuntu

$sudo apt-get install alien

You can check the above section for available options

Example

Suppose we have a avg antivirus avg71lms-r30-a0782.i386.rpm file

To convert .rpm to debian

$sudo alien -k avg71lms-r30-a0782.i386.rpm

Now you should be having avg71lms-r30-a0782.i386.deb file

To install .deb file

$sudo dpkg -i avg71lms-r30-a0782.i386.deb

If you don’t use -k option you should see avg71lms_r30-1_i386.deb file the difference is it will add 1

Recover Data from a Damaged hard disk using dd_rhelp

dd_rhelp is a bash script that handles a very usefull program written in C which is called dd_rescue, it roughly act as the dd linux command with the caracteristic to NOT stop when it falls on read/write errors.

This makes dd_rescue the best tool for recovering hard drive having bad sectors.In short, it’ll use dd_rescue on your entire disc, but will try to gather the maximum valid data before trying for ages on badsectors. So if you leave dd_rhelp work for infinite time, it’ll have the same effect as a simple dd_rescue. But because you might not have this infinite time , dd_rhelp will jump over bad sectors and rescue valid data. In the long run, it’ll parse all your device with dd_rescue.


You can Ctrl-C it whenever you want, and rerun-it at will, it’ll resume it’s job as it depends on the log files dd_rescue creates.In addition, progress will be shown in a ASCII picture of your device beeing rescued.

Why use dd_rhelp and not dd_rescue ?

dd_rhelp uses dd_rescue to compute a recovery path through the device that will focus on valid data recovering. This recovery path will go through all the device, exactly as dd_rescue could do it on its own without any path. This means that dd_rhelp will save you time ONLY IF YOU INTEND TO CANCEL ITS JOB BEFORE THE END of a full recovery.

Because a considerable amount of time is taken to try to rescue badsectors. This amount of time can be mesured in days,
month, years, depending on your device capacity and its defectiveness. You might not want to spend this time knowing that 99 percent of this time will be taken to look at badsector and won’t lead to any more data recovering.

dd_rhelp shifts this useless waiting time to the end. Using dd_rescue strait throughout your device make your waiting time dependent on the badsector distribution.

Install dd_rhelp

First you need to download latest version from here

Preparing your system

#apt-get install make gcc g++ ddrescue

If you are using ubuntu linux use the following command

sudo apt-get install make gcc g++ ddrescue

Download dd_rhelp using the follwoing command

wget http://www.kalysto.org/pkg/dd_rhelp-0.0.6.tar.gz

Now you have dd_rhelp-0.0.6.tar.gz file

Extract this file using the following command

tar xzvf dd_rhelp-0.0.6.tar.gz

cd dd_rhelp-0.0.6

Run the following commands

# ./configure

# make

# make install

If you are using ubuntu linux use the following command

sudo ./configure

sudo make

sudo make install

This will complete the installation and this will install program under /usr/local/bin/dd_rhelp

dd_rhelp Syntax

dd_rhelp {filename|device} {output-file} [{info}]
or dd_rhelp --help
or dd_rhelp --version

Now we will see how to use ddrescue under damaged disk

If you have a damaged hard disk /dev/sda1 and you have an empty space hard disk /dev/sda2 Now if you want to copy data from /dev/sda1 to /dev/sda2 use the following command

#dd_rhelp /dev/sda1 /dev/sda2/backup.img

If you are using ubuntu linux use the following command

sudo dd_rhelp /dev/sda1 /dev/sda2/backup.img

Output looks like below

/usr/bin/tail: Warning: “+number” syntax is deprecated, please use “-n +number”
=== launched via ‘dd_rhelp’ at 0k, 0 >>> ===
dd_rescue: (info): ipos: 104384.0k, opos: 104384.0k, xferd: 104384.0k
errs: 0, errxfer: 0.0k, succxfer: 104384.0k
+curr.rate: 10178kB/s, avg.rate: 8532kB/s, avg.load: 31.3%
dd_rescue: (info): /dev/sda2 (104391.0k): EOF
Summary for /dev/sda2 -> backup.img:
dd_rescue: (info): ipos: 104391.0k, opos: 104391.0k, xferd: 104391.0k
errs: 0, errxfer: 0.0k, succxfer: 104391.0k
+curr.rate: 355kB/s, avg.rate: 8519kB/s, avg.load: 31.3%
/usr/bin/tail: Warning: “+number” syntax is deprecated, please use “-n +number”

This copies an image of /dev/sda1 to sda2

Now you need to check the backup image consistency this will check for is there any problems with this image.

#fsck -y /dev/sda2/backup.img

If you are using ubuntu linux use the following command

sudo fsck -y /dev/sda2/backup.img

After finishing this checking you need to mount your disk image in to your other hard disk

#mount /dev/sda2/backup.img /mnt/recoverydata

If you are using ubuntu linux use the following command

sudo mount /dev/sda2/backup.img /mnt/recoverydata

This will mount all the data from the backup.img under /mnt/recoverydata now you can try to access the data it should
work without any problem.

Restore image

If you want to restore this image use the following command

#dd_rhelp /dev/sda2/backup.img /dev/sda1

If you are using ubuntu linux use the following command

sudo dd_rhelp /dev/sda2/backup.img /dev/sda1

Copy Disk Image to remote machine using SSH

If you want to copy your disk image to remote machine over ssh you need to use the following command

#dd_rhelp /dev/sda1 - | ssh username@machineip ‘cat /datarecovery/backup.img’

If you are using ubuntu linux use the following command

sudo dd_rhelp /dev/sda1 - | ssh username@machineip ‘cat /datarecovery/backup.img’

This will be prompetd for password of the username you have menctioned in the above command after entering the password

dd_rhelp strats copying obviously it will take some time to copy over the network

Kill Session in Oracle DB

Now I try to write about kill session in oracle database. First time please login to oracle server. Type sqlplus then enter


$ sqlplus

SQL*Plus: Release 10.2.0.3.0 - Production on Sat Jan 24 07:26:59 2009

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

Enter user-name:
$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.3.0 - Production on Sat Jan 24 07:27:17 2009

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

To get serial of the session that will kill type @sql_sid then enter

SQL> @sql_sid
enter value for sid: session_id

Now kill session

SQL> alter system kill session 'session,serial';

System altered.

SQL>

If the message showed System Altered the killing session is done