samedi 21 novembre 2009

How do I Use the Linux Top Command?

The Unix top command is designed to help users determine which processes are running and which applications are using more memory or processing power than they should be.

The top command is very easy to use but you should know the things in details. The output of to is :

top output:
top - 22:09:08 up 14 min, 1 user, load average: 0.21, 0.23, 0.30
Tasks: 81 total, 1 running, 80 sleeping, 0 stopped, 0 zombie
Cpu(s): 9.5%us, 31.2%sy, 0.0%ni, 27.0%id, 7.6%wa, 1.0%hi, 23.7%si, 0.0%st
Mem: 255592k total, 167568k used, 88024k free, 25068k buffers
Swap: 524280k total, 0k used, 524280k free, 85724k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3166 apache 15 0 29444 6112 1524 S 6.6 2.4 0:00.79 httpd
3161 apache 15 0 29444 6112 1524 S 5.9 2.4 0:00.79 httpd
3164 apache 15 0 29444 6112 1524 S 5.9 2.4 0:00.75 httpd
3169 apache 15 0 29444 6112 1524 S 5.9 2.4 0:00.74 httpd
3163 apache 15 0 29444 6112 1524 S 5.6 2.4 0:00.76 httpd
3165 apache 15 0 29444 6112 1524 S 5.6 2.4 0:00.77 httpd
3167 apache 15 0 29444 6112 1524 S 5.3 2.4 0:00.73 httpd
3162 apache 15 0 29444 6112 1524 S 5.0 2.4 0:00.77 httpd
3407 root 16 0 2188 1012 816 R 1.7 0.4 0:00.51 top
240 root 15 0 0 0 0 S 0.3 0.0 0:00.08 pdflush
501 root 10 -5 0 0 0 S 0.3 0.0 0:01.20 kjournald
2794 root 18 0 12720 1268 560 S 0.3 0.5 0:00.73 pcscd
1 root 15 0 2060 636 544 S 0.0 0.2 0:03.81 init
2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.07 events/0


The first line in top:


top - 22:09:08 up 14 min, 1 user, load average: 0.21, 0.23, 0.30

“22:09:08″ is the current time; “up 14 min” shows how long the system has been up for; “1 user” how many users are logged in; “load average: 0.21, 0.23, 0.30″ the load average of the system (1minute, 5 minutes, 15 minutes).

Load average is an extensive topic and to understand its inner workings can be daunting. The simplest of definitions states that load average is the cpu utilization over a period of time. A load average of 1 means your cpu is being fully utilized and processes are not having to wait to use a CPU. A load average above 1 indicates that processes need to wait and your system will be less responsive. If your load average is consistently above 3 and your system is running slow you may want to upgrade to more CPU’s or a faster CPU.

The second line in top:

Tasks: 82 total, 1 running, 81 sleeping, 0 stopped, 0 zombie

Shows the number of processes and their current state.

The third lin in top:

Cpu(s): 9.5%us, 31.2%sy, 0.0%ni, 27.0%id, 7.6%wa, 1.0%hi, 23.7%si, 0.0%st

Shows CPU utilization details. “9.5%us” user processes are using 9.5%; “31.2%sy” system processes are using 31.2%; “27.0%id” percentage of available cpu; “7.6%wa” time CPU is waiting for IO.

When first analyzing the Cpu(s) line in top look at the %id to see how much cpu is available. If %id is low then focus on %us, %sy, and %wa to determine what is using the CPU.

The fourth and fifth lines in top:

Mem: 255592k total, 167568k used, 88024k free, 25068k buffers
Swap: 524280k total, 0k used, 524280k free, 85724k cached


Describes the memory usage. These numbers can be misleading. “255592k total” is total memory in the system; “167568K used” is the part of the RAM that currently contains information; “88024k free” is the part of RAM that contains no information; “25068K buffers and 85724k cached” is the buffered and cached data for IO.

So what is the actual amount of free RAM available for programs to use ?

The answer is: free + (buffers + cached)

88024k + (25068k + 85724k) = 198816k

How much RAM is being used by progams ?

The answer is: used - (buffers + cached)

167568k - (25068k + 85724k) = 56776k

The processes information:

Top will display the process using the most CPU usage in descending order. Lets describe each column that represents a process.

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3166 apache 15 0 29444 6112 1524 S 6.6 2.4 0:00.79 httpd


PID - process ID of the process

USER - User who is running the process

PR - The priority of the process

NI - Nice value of the process (higher value indicates lower priority)

VIRT - The total amount of virtual memory used

RES - Resident task size

SHR - Amount of shared memory used

S - State of the task. Values are S (sleeping), D (uninterruptible sleep), R (running), Z (zombies), or T (stopped or traced)

%CPU - Percentage of CPU used

%MEM - Percentage of Memory used

TIME+ - Total CPU time used

COMMAND - Command issued
Interacting with TOP

Now that we are able to understand the output from TOP lets learn how to change the way the output is displayed.

Just press the following key while running top and the output will be sorted in real time.

M - Sort by memory usage

P - Sort by CPU usage

T - Sort by cumulative time

z - Color display

k - Kill a process

q - quit

If we want to kill the process with PID 3161, then press “k” and a prompt will ask you for the PID number, and enter 3161.
Command Line Parameters with TOP

You can control what top displays by issuing parameters when you run top.

- d - Controls the delay between refreshes

- p - Specify the process by PID that you want to monitor

-n - Update the display this number of times and then exit

If we want to only monitor the http process with a PID of 3166

$ top -p 3166

If we want to change the delay between refreshes to 5 seconds

$ top -d 5

jeudi 12 novembre 2009

oracle 10g RAC administration, two official books

10g RAC for Administrators
hxxp://rapidshare.com/files/61294558/10gRACforAdministratorsR2_Vol1_pwd_-_racr2.pdf
hxxp://rapidshare.com/files/61295444/10gRACforAdministratorsR2_Vol2_pwd_-_racr2.pdf
Password: racr2

Oracle Database Administration Fundamentals I & II VTC Training CD

This is the second in a series of courses, aimed at preparing the user for Oracle Certification Exam # 1Z0-031. This course will teach Oracle database administration fundamentals; installing Oracle, creating databases, managing objects in the database and more. This course expands on the first course offered by VTC (Introduction to Oracle SQL and PL/SQL). Following courses will include: Oracle Database Administration Fundamentals II and Oracle Database Performance Tuning. To get started, click one of the movie topics below.

http://rapidshare.com/files/46014180/VTC.C...ntals.part1.rar
http://rapidshare.com/files/46014024/VTC.C...ntals.part2.rar
http://rapidshare.com/files/46014101/VTC.C...ntals.part3.rar
http://rapidshare.com/files/46014050/VTC.C...ntals.part4.rar

Fundamental II

http://rapidshare.com/files/46664910/___OS..._NADU.part1.rar
http://rapidshare.com/files/46664896/___OS..._NADU.part2.rar
http://rapidshare.com/files/46664904/___OS..._NADU.part3.rar
http://rapidshare.com/files/46664898/___OS..._NADU.part4.rar
http://rapidshare.com/files/46664900/___OS..._NADU.part5.rar

Oracle Training Certification - Complete Collection

1Z0-001 Introduction to Oracle: SQL and PL/SQL 130 Questions 2/24/2009
1Z0-007 Introduction to Oracle9i: SQL 203 Questions 2/10/2009
1Z0-020 Oracle8i: New Features for Administrators 83 Questions 10/31/2008
1Z0-023 Architecture and Administration 151 Questions 3/18/2009
1Z0-024 Performance Tuning 92 Questions 3/18/2009
1Z0-025 Backup and Recovery 127 Questions 3/18/2009
1Z0-026 Network Administration 126 Questions 3/19/2009
1Z0-030 Oracle9i: New Features for Administrators 134 Questions 10/30/2008
1Z0-031 Oracle9i: Database Fundamentals I 389 Questions 10/31/2008
1Z0-032 Oracle9i: Database Fundamentals II 348 Questions 10/31/2008
1Z0-033 Oracle9i: Performance Tunning 510 Questions 11/4/2008
1Z0-035 Oracle 7.3 & 8 to Oracle9i DBA OCP Upgrade 905 Questions 11/4/2008
1Z0-036 Managing Oracle 9i on Linux 144 Questions 11/3/2008
1Z0-040 Oracle Database 10g: New Features for Administrators 200 Questions 11/3/2008
1Z0-041 Oracle Database 10g: DBA Assessment 65 Questions 3/19/2009
1Z0-042 Oracle Database 10g: Administration I 286 Questions 2/10/2009
1Z0-043 Oracle Database 10g: Administration II 185 Questions 11/3/2008
1Z0-045 Oracle Database 10g: New Features for Oracle8i OCPs 200 Questions 11/4/2008
1Z0-048 Oracle Database 10g R2: Administering RAC 130 Questions 4/8/2009
1Z0-050 Oracle Database 11g: New Features for Administrators 183 Questions 1/29/2009
1Z0-101 Develop PL/SQL Program Units 92 Questions 11/7/2008
1Z0-131 Oracle9i, Build Internet Applications I 153 Questions 11/10/2008
1Z0-132 Oracle9i, Build Internet Applications II 157 Questions 11/7/2008
1Z0-140 Oracle9i Forms Developer: New Features 120 Questions 11/21/2008
1Z0-141 Oracle9i Forms Developer: Build Internet Applications 186 Questions 11/10/2008
1Z0-147 Oracle 9i: Program with PL/SQL 111 Questions 11/10/2008
1Z0-200 Oracle 11i E-Business Essentials 64 Questions 11/7/2008
1Z0-211 Oracle 11i General Ledger 152 Questions 11/10/2008
1Z0-212 Oracle Payables 11i Fudamentals 70 Questions 1/27/2009
1Z0-213 Oracle Receivables 11i Fundamentals 75 Questions 11/7/2008
1Z0-221 Oracle 11i Inventory Management Fundamentals 150 Questions 1/29/2009
1Z0-222 Oracle Purchasing 11i Fundamentals 85 Questions 11/7/2008
1Z0-223 Oracle Order Management 11i Fundamentals 81 Questions 11/7/2008
1Z0-231 Oracle 11i/2.6 Implementing Workflow 76 Questions 11/6/2008
1Z0-232 Oracle 11i System Administration 164 Questions 11/6/2008
1Z0-233 11i Install Patch and Maintain Oracle Applications 130 Questions 11/6/2008
1Z0-301 Oracle9iAS: Basic Administrations 90 Questions 11/6/2008
1Z0-311 Oracle Application Server 10g: Administration I 152 Questions 11/6/2008
http://rapidshare.com/files/236264299/Oracle_Training_Certification_Complete_Collection.rar

Oracle certification free prep materials

1Z0-042 Oracle Database 10g: Administration I
1Z0-043 Oracle Database 10g: Administration II
1Z0-052 Oracle Database 11g: Administration I
1Z0-255 Hyperion Essbase 7.1.2 Cnsultant
1Z0-108 Oracle WebLogic Server 10g System Administration

ITS Oracle Education Official Material

It covers only 10g and 11g technologies and they are mainly powerpoint slides and e-books on PL/SQL, development and database administration :

D17171GC20 - 10g Develop Applications Using HTML Db 2nd Edition
http://rapidshare.com/files/102856123/D17171GC20_-_10g_Develop_Applications_Using_HTML_Db_Ed_2.rar

D50325GC11 - 11g Change Management Overview Seminar
http://rapidshare.com/files/102854889/D50325GC11_ppt.rar

D47045GC10 - 10g QuickStart for DBAs
http://rapidshare.com/files/102853797/D47045GC10_ppt.rar

D46590GC11 - 10g Managing Oracle on Linux for DBAs
http://rapidshare.com/files/102852659/D46590GC11_ppt.rar

D44810GC10 - 10g Warehouse Builder - Administrations
http://rapidshare.com/files/101720578/D44810GC10_ppt.rar

D22057GC10 - 10g Backup and Recovery
http://rapidshare.com/files/101719973/D22057GC10_ppt.rar

D18957GC10 - 10g Implement and Administer a Data Warehouse
http://rapidshare.com/files/101719479/D18957GC10_ppt.rar

D18422GC10 - 10g 2-Day DBA for Windows
http://rapidshare.com/files/101717770/D18422GC10_ppt.rar

D17333GC20 - 10g Implement Streams
http://rapidshare.com/files/101717123/D17333GC20_ppt.rar

D17316GC20 - 10g Dataguard Administration
http://rapidshare.com/files/101716105/D17316GC20_ppt.rar

D17276GC20 - 10g RAC for Administrators
http://rapidshare.com/files/101715902/D17276GC20_ppt.rar

D17265GC20 - 10g SQL Tuning
http://rapidshare.com/files/101714827/D17265GC20_ppt.rar

D17169GC21 - 10g Develop PL/SQL Program Units
http://rapidshare.com/files/101714449/d17169gc21_ppt.rar

D17108GC21 - 10g SQL Fundamentals I
http://rapidshare.com/files/101713435/D17108GC21_ppt.rar

D17111GC21 - 10g SQL Fundamentals II
http://rapidshare.com/files/101713775/D17111GC21_ppt.rar

D17092GC30 - 10g Administration Workshop II
http://rapidshare.com/files/101712763/D17092GC30-Oracle_Database_10g-Administration_Workshop_II.Jan.2006.rar

D17090GC30 - 10g Administration Workshop I
http://rapidshare.com/files/101711813/D17090GC30-Oracle_Database_10g-Administration_Workshop_I.Nov.2005.rar

D50000GC10 - 11g SQL and PL/SQL New Features
http://rapidshare.com/files/101605951/D50000GC10_ppt.rar

D46592GC11 - 10g Managing Oracle on Linux for System Administrators
http://rapidshare.com/files/102853129/D46592GC11_ppt.rar

D46590GC11 - 10g Managing Oracle on Linux for DBAs
http://rapidshare.com/files/101605359/10gManagingOracleonLinuxforDBA.pdf

D50081GC10 - 11g New Features for Administrators
http://rapidshare.com/files/101603860/d50081gc10_ppt.rar

D44422GC10 - 10g RAC Basic Concepts & Architecture Seminar
http://rapidshare.com/files/101576907/coursepptd44422gc10.rar

D50079GC10 - 11g Administration Workshop II
http://rapidshare.com/files/100322117/d50079gc10_ppt1.rar

D50102GC10 - 11g Administration Worshop I
http://rapidshare.com/files/94588473/D50102GC10_ppt.rar

D49990GC10 - 11g PL/SQL Fundamentals I
http://rapidshare.com/files/94580385/D49990GC10_ppt.rar

D49996GC10 - 11g SQL Fundamentals I
http://rapidshare.com/files/92312629/D49996GC10_ppt.rar

D49994GC10 - 11g SQL Fundamentals II
http://rapidshare.com/files/94579314/D49994GC10_ppt.rar

mercredi 11 novembre 2009

Initialization Parameter files: PFILEs vs. SPFILEs



When an Oracle Instance is started, the characteristics of the Instance are established by parameters specified within the initialization parameter file. These initialization parameters are either stored in a PFILE or SPFILE. SPFILEs are available in Oracle 9i and above. All prior releases of Oracle are using PFILEs.

SPFILEs provide the following advantages over PFILEs:

  • An SPFILE can be backed-up with RMAN (RMAN cannot backup PFILEs)

  • Reduce human errors. The SPFILE is maintained by the server. Parameters are checked before changes are accepted.

  • Eliminate configuration problems (no need to have a local PFILE if you want to start Oracle from a remote machine)

  • Easy to find - stored in a central location


What is the difference between a PFILE and SPFILE:

A PFILE is a static, client-side text file that must be updated with a standard text editor like "notepad" or "vi". This file normally reside on the server, however, you need a local copy if you want to start Oracle from a remote machine. DBA's commonly refer to this file as the INIT.ORA file.

An SPFILE (Server Parameter File), on the other hand, is a persistent server-side binary file that can only be modified with the "ALTER SYSTEM SET" command. This means you no longer need a local copy of the pfile to start the database from a remote machine. Editing an SPFILE will corrupt it, and you will not be able to start your database anymore.

How will I know if my database is using a PFILE or SPFILE:

Execute the following query to see if your database was started with a PFILE or SPFILE:
SQL> SELECT DECODE(value, NULL, 'PFILE', 'SPFILE') "Init File Type" 
FROM sys.v_$parameter WHERE name = 'spfile';

You can also use the V$SPPARAMETER view to check if you are using a PFILE or not: if the "value" column is NULL for all parameters, you are using a PFILE.

Viewing Parameters Settings:

One can view parameter values using one of the following methods (regardless if they were set via PFILE or SPFILE):

  • The "SHOW PARAMETERS" command from SQL*Plus (i.e.: SHOW PARAMETERS timed_statistics)

  • V$PARAMETER view - display the currently in effect parameter values

  • V$PARAMETER2 view - display the currently in effect parameter values, but "List Values" are shown in multiple rows

  • V$SPPARAMETER view - display the current contents of the server parameter file.


Starting a database with a PFILE or SPFILE:

Oracle searches for a suitable initialization parameter file in the following order:

  • Try to use the spfile${ORACLE_SID}.ora file in $ORACLE_HOME/dbs (Unix) or ORACLE_HOME/database (Windows)

  • Try to use the spfile.ora file in $ORACLE_HOME/dbs (Unix) or ORACLE_HOME/database (Windows)

  • Try to use the init${ORACLE_SID}.ora file in $ORACLE_HOME/dbs (Unix) or ORACLE_HOME/database (Windows)


One can override the default location by specifying the PFILE parameter at database startup:

SQL> STARTUP PFILE='/oradata/spfileORCL.ora'

Note that there is not an equivalent "STARTUP SPFILE=" command. One can only use the above option with SPFILE's if the PFILE you point to (in the example above), contains a single 'SPFILE=' parameter pointing to the SPFILE that should be used. Example:

SPFILE=/path/to/spfile

Changing SPFILE parameter values:

While a PFILE can be edited with any text editor, the SPFILE is a binary file. The "ALTER SYSTEM SET" and "ALTER SYSTEM RESET" commands can be used to change parameter values in an SPFILE. Look at these examples:
SQL> ALTER SYSTEM SET open_cursors=300 SCOPE=SPFILE;

SQL> ALTER SYSTEM SET timed_statistics=TRUE
COMMENT='Changed by Frank on 1 June 2003'
SCOPE=BOTH
SID='*';

The SCOPE parameter can be set to SPFILE, MEMORY or BOTH:

- MEMORY: Set for the current instance only. This is the default behaviour if a PFILE was used at STARTUP.

- SPFILE: update the SPFILE, the parameter will take effect with next database startup

- BOTH: affect the current instance and persist to the SPFILE. This is the default behaviour if an SPFILE was used at STARTUP.
The COMMENT parameter (optional) specifies a user remark.

The SID parameter (optional; only used with RAC) indicates the instance for which the parameter applies (Default is *: all Instances).

Use the following syntax to set parameters that take multiple (a list of) values:

SQL> ALTER SYSTEM SET utl_file_dir='/tmp/','/oradata','/home/' SCOPE=SPFILE;

Use this syntax to set unsupported initialization parameters (obviously only when Oracle Support instructs you to set it):

SQL> ALTER SYSTEM SET "_allow_read_only_corruption"=TRUE SCOPE=SPFILE;

Execute one of the following command to remove a parameter from the SPFILE:
SQL> ALTER SYSTEM RESET timed_statistics SCOPE=SPFILE SID=‘*’;
SQL> ALTER SYSTEM SET timed_statistics = '' SCOPE=SPFILE;

Converting between PFILES and SPFILES:

One can easily migrate from a PFILE to SPFILE or vice versa. Execute the following commands from a user with SYSDBA or SYSOPER privileges:
SQL> CREATE PFILE FROM SPFILE; 
SQL> CREATE SPFILE FROM PFILE;

One can also specify a non-default location for either (or both) the PFILE and SPFILE parameters. Look at this example:

SQL> CREATE SPFILE='/oradata/spfileORCL.ora' from PFILE='/oradata/initORCL.ora';

Here is an alternative procedure for changing SPFILE parameter values using the above method:

  • Export the SPFILE with: CREATE PFILE=‘pfilename’ FROM SPFILE = ‘spfilename’;

  • Edit the resulting PFILE with a text editor

  • Shutdown and startup the database with the PFILE option: STARTUP PFILE=filename

  • Recreate the SPFILE with: CREATE SPFILE=‘spfilename’ FROM PFILE=‘pfilename’;

  • On the next startup, use STARTUP without the PFILE parameter and the new SPFILE will be used.


Parameter File Backups:

RMAN (Oracle's Recovery Manager) will backup the SPFILE with the database control file if setting "CONFIGURE CONTROLFILE AUTOBACKUP" is ON (the default is OFF). PFILEs cannot be backed-up with RMAN. Look at this example:

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

Use the following RMAN command to restore an SPFILE:

RMAN> RESTORE CONTROLFILE FROM AUTOBACKUP;

References:

  • Oracle9i Database Administrator's Guide Release 2 (9.2)
    Chapter 2: Creating an Oracle Database

  • Oracle9i Recovery Manager User's Guide Release 2 (9.2)
    Chapter 5: "RMAN Concepts I: Channels, Backups, and Copies"

  • Oracle9i SQL Reference Release 2 (9.2)


mardi 10 novembre 2009

Find all large files on a Linux machine

Finds all files over 20,000KB (roughly 20MB) in size and presents their names and size in a human readable format:
find / -type f -size +20000k -exec ls -lh {} \; 2>/dev/null|awk '{print $NF ": " $5}'|sort -nrk 2,2

find / -type f -size +20000k -exec ls -lh {} \; 2>/dev/null|awk '{print $NF ": " $5}'|sort -nk 2,2

dimanche 8 novembre 2009

Killing Oracle Sessions

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 spid


If after a few minutes the process hasn't stopped, terminate the session using:

% 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.

mercredi 4 novembre 2009

Top memory consuming processes

You can check for top memory consuming processes by issuing the following commands:

we use the following ps commands in order to check for performance probelms

1) Displaying top CPU_consuming processes:

ps aux | head -1; ps aux | sort -rn +2 | head -10

2) Displaying top 10 memory-consuming processes:

ps aux | head -1; ps aux | sort -rn +3 | head

3) Displaying process in order of being penalized:

ps -eakl | head -1; ps -eakl | sort -rn +5

4) Displaying process in order of priority:

ps -eakl | sort -n +6 | head

5) Displaying process in order of nice value

ps -eakl | sort -n +7

6) Displaying the process in order of time

ps vx | head -1;ps vx | grep -v PID | sort -rn +3 | head -10

7) Displaying the process in order of real memory use

ps vx | head -1; ps vx | grep -v PID | sort -rn +6 | head -10

8) Displaying the process in order of I/O

ps vx | head -1; ps vx | grep -v PID | sort -rn +4 | head -10

9) Displaying WLM classes

ps -a -o pid, user, class, pcpu, pmem, args

10) Determinimg process ID of wait processes:

ps vg | head -1; ps vg | grep -w wait

11) Wait process bound to CPU

ps -mo THREAD -p <PID>