SlideShare a Scribd company logo
SQL being executed by a OS Process ID

prompt "Please Enter The UNIX Process ID"
set pagesize 50000
set linesize 30000
set long 500000
set head off
select
s.username su,
substr(sa.sql_text,1,540) txt
from v$process p,
v$session s,
v$sqlarea sa
where p.addr=s.paddr
and s.username is not null
and s.sql_address=sa.address(+)
and s.sql_hash_value=sa.hash_value(+)
and spid=&SPID;
---------------------------------------------------------------------
Top 10 processes consuming CPU...
prstat -s cpu -n 10
----------------------------------------------------------------------
After you find the spid of the top cpu consuming process use the below script to
 find the sid ,user,username,status, module of that spid.
select sid, b.serial#, osuser, b.username, status, process, paddr, spid,a.progra
m, module
    from v$process a,v$session b
    where spid = '&spid'
    and a.addr = b.paddr
    and b.username != ' '
   order by 1;
-----------------------------------------------------------------------
How to kill all similar processes with single command (in this case opmn)

ps -ef   grep opmn grep -v grep      awk   {print $2}   xargs -i kill -9 {}
Locating Files under a particular directory
find . -print grep -i test.sql
 Using AWK in UNIX
To remove a specific column of output from a UNIX command   for example to determi
ne the UNIX process Ids for all Oracle processes on server (second column)
ps -ef grep -i oracle awk '{ print $2 }'
Changing the standard prompt for Oracle Users
Edit the .profile for the oracle user
PS1="`hostname`*$ORACLE_SID:$PWD>"
Display top 10 CPU consumers using the ps command
/usr/ucb/ps auxgw head -11
 Show number of active Oracle dedicated connection users for a particular ORACLE
_SID
ps -ef grep $ORACLE_SID grep -v grep grep -v ora_ wc -l
 Display the number of CPU s in Solaris
psrinfo -v grep "Status of processor" wc -l
Display the number of CPU s in AIX
lsdev -C grep Process wc -l
Display RAM Memory size on Solaris
prtconf grep -i mem
Display RAM memory size on AIX
First determine name of memory device
lsdev -C grep mem
then assuming the name of the memory device is   mem0
lsattr -El mem0
Swap space allocation and usage
Solaris : swap -s or swap -l
Aix : lsps -a
 Total number of semaphores held by all instances on server
ipcs -as awk '{sum += $9} END {print sum}'
View allocated RAM memory segments
ipcs -pmb
Manually deallocate shared memeory segments
ipcrm -m '<ID>'
 Show mount points for a disk in AIX
lspv -l hdisk13
 Display amount of occupied space (in KB) for a file or collection of files in a
 directory or sub-directory
du -ks * sort -n tail
Display total file space in a directory
du -ks .
 Cleanup any unwanted trace files more than seven days old
find . *.trc -mtime +7 -exec rm {} ;
 Locate Oracle files that contain certain strings
find . -print xargs grep rollback
 Locate recently created UNIX files (in the past one day)
find . -mtime -1 -print
 Finding large files on the server (more than 100MB in size)
find . -size +102400 -print
Crontab :
To submit a task every Tuesday (day 2) at 2:45PM
45 14 2 * * /opt/oracle/scripts/tr_listener.sh > /dev/null 2>&1
To submit a task to run every 15 minutes on weekdays (days 1-5)
15,30,45 * 1-5 * * /opt/oracle/scripts/tr_listener.sh > /dev/null 2>&1
To submit a task to run every hour at 15 minutes past the hour on weekends (days
 6 and 0)
15 * 0,6 * * opt/oracle/scripts/tr_listener.sh > /dev/null 2>&1
--------------------------------------------------------------------------------
------
Link:http://gavinsoorma.com/unix-for-the-dba/

More Related Content

What's hot

agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertor
Toshiaki Baba
 
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbСтажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
SmartTools
 
Ac cuda c_2
Ac cuda c_2Ac cuda c_2
Ac cuda c_2
Josh Wyatt
 
Perintah perintah dasar linux Operating Sistem
Perintah perintah dasar linux Operating SistemPerintah perintah dasar linux Operating Sistem
Perintah perintah dasar linux Operating Sistem
Roziq Bahtiar
 
Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)
Maarten Mulders
 
Redis as a message queue
Redis as a message queueRedis as a message queue
Redis as a message queue
Brandon Lamb
 
50 Perintah Dasar pada linux
50 Perintah Dasar pada linux50 Perintah Dasar pada linux
50 Perintah Dasar pada linux
ReskyRian
 
Openstack at NTT Feb 7, 2011
Openstack at NTT Feb 7, 2011Openstack at NTT Feb 7, 2011
Openstack at NTT Feb 7, 2011Open Stack
 
Clojure + MongoDB on Heroku
Clojure + MongoDB on HerokuClojure + MongoDB on Heroku
Clojure + MongoDB on Heroku
Naoyuki Kakuda
 
My First BCC
My First BCCMy First BCC
My First BCC
Naoto MATSUMOTO
 
LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control Groups
Marian Marinov
 
Mastering the Unix Command Line
Mastering the Unix Command LineMastering the Unix Command Line
Mastering the Unix Command LineHoward Mao
 
Ansible for Beginners
Ansible for BeginnersAnsible for Beginners
Ansible for Beginners
Arie Bregman
 
(Practical) linux 104
(Practical) linux 104(Practical) linux 104
(Practical) linux 104
Arie Bregman
 
Building a DSL with GraalVM (CodeOne)
Building a DSL with GraalVM (CodeOne)Building a DSL with GraalVM (CodeOne)
Building a DSL with GraalVM (CodeOne)
Maarten Mulders
 
(Practical) linux 101
(Practical) linux 101(Practical) linux 101
(Practical) linux 101
Arie Bregman
 
NUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline TutorialNUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline Tutorial
Gagah Arifianto
 
Asphalt8.ifgiovanni
Asphalt8.ifgiovanniAsphalt8.ifgiovanni
Asphalt8.ifgiovanni
201419942010
 
Fast and cost effective geospatial analysis pipeline with AWS lambda
Fast and cost effective geospatial analysis pipeline with AWS lambdaFast and cost effective geospatial analysis pipeline with AWS lambda
Fast and cost effective geospatial analysis pipeline with AWS lambda
Mila Frerichs
 

What's hot (20)

agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertor
 
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbСтажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
 
Ac cuda c_2
Ac cuda c_2Ac cuda c_2
Ac cuda c_2
 
Perintah perintah dasar linux Operating Sistem
Perintah perintah dasar linux Operating SistemPerintah perintah dasar linux Operating Sistem
Perintah perintah dasar linux Operating Sistem
 
Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)
 
Redis as a message queue
Redis as a message queueRedis as a message queue
Redis as a message queue
 
50 Perintah Dasar pada linux
50 Perintah Dasar pada linux50 Perintah Dasar pada linux
50 Perintah Dasar pada linux
 
Openstack at NTT Feb 7, 2011
Openstack at NTT Feb 7, 2011Openstack at NTT Feb 7, 2011
Openstack at NTT Feb 7, 2011
 
Clojure + MongoDB on Heroku
Clojure + MongoDB on HerokuClojure + MongoDB on Heroku
Clojure + MongoDB on Heroku
 
My First BCC
My First BCCMy First BCC
My First BCC
 
LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control Groups
 
Mastering the Unix Command Line
Mastering the Unix Command LineMastering the Unix Command Line
Mastering the Unix Command Line
 
Ansible for Beginners
Ansible for BeginnersAnsible for Beginners
Ansible for Beginners
 
(Practical) linux 104
(Practical) linux 104(Practical) linux 104
(Practical) linux 104
 
Building a DSL with GraalVM (CodeOne)
Building a DSL with GraalVM (CodeOne)Building a DSL with GraalVM (CodeOne)
Building a DSL with GraalVM (CodeOne)
 
Note
NoteNote
Note
 
(Practical) linux 101
(Practical) linux 101(Practical) linux 101
(Practical) linux 101
 
NUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline TutorialNUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline Tutorial
 
Asphalt8.ifgiovanni
Asphalt8.ifgiovanniAsphalt8.ifgiovanni
Asphalt8.ifgiovanni
 
Fast and cost effective geospatial analysis pipeline with AWS lambda
Fast and cost effective geospatial analysis pipeline with AWS lambdaFast and cost effective geospatial analysis pipeline with AWS lambda
Fast and cost effective geospatial analysis pipeline with AWS lambda
 

Similar to 37562259 top-consuming-process

The New Systems Performance
The New Systems PerformanceThe New Systems Performance
The New Systems Performance
Brendan Gregg
 
Unix commands
Unix commandsUnix commands
Unix commands
Divya_Gupta19
 
Really useful linux commands
Really useful linux commandsReally useful linux commands
Really useful linux commands
Michael J Geiser
 
RedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative worksRedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative works
Md Shihab
 
exercises-log-management-rsyslog.pdf
exercises-log-management-rsyslog.pdfexercises-log-management-rsyslog.pdf
exercises-log-management-rsyslog.pdf
SngB2
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby Systems
Engine Yard
 
Perf stat windows
Perf stat windowsPerf stat windows
Perf stat windowsAccenture
 
Open Source Systems Performance
Open Source Systems PerformanceOpen Source Systems Performance
Open Source Systems Performance
Brendan Gregg
 
50 Most Frequently Used UNIX Linux Commands -hmftj
50 Most Frequently Used UNIX  Linux Commands -hmftj50 Most Frequently Used UNIX  Linux Commands -hmftj
50 Most Frequently Used UNIX Linux Commands -hmftj
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
Deathstar
DeathstarDeathstar
Deathstar
armstrtw
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging Ruby
Aman Gupta
 
Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Ontico
 
ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...
ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...
ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...ZFConf Conference
 
Basics of unix
Basics of unixBasics of unix
Basics of unix
Deepak Singhal
 
Exactly once with spark streaming
Exactly once with spark streamingExactly once with spark streaming
Exactly once with spark streaming
Quentin Ambard
 
Rhel3
Rhel3Rhel3
Vagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopVagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptop
Lorin Hochstein
 

Similar to 37562259 top-consuming-process (20)

The New Systems Performance
The New Systems PerformanceThe New Systems Performance
The New Systems Performance
 
Unix commands
Unix commandsUnix commands
Unix commands
 
Really useful linux commands
Really useful linux commandsReally useful linux commands
Really useful linux commands
 
RedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative worksRedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative works
 
exercises-log-management-rsyslog.pdf
exercises-log-management-rsyslog.pdfexercises-log-management-rsyslog.pdf
exercises-log-management-rsyslog.pdf
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby Systems
 
Perf stat windows
Perf stat windowsPerf stat windows
Perf stat windows
 
Linux.pdf
Linux.pdfLinux.pdf
Linux.pdf
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
Open Source Systems Performance
Open Source Systems PerformanceOpen Source Systems Performance
Open Source Systems Performance
 
50 Most Frequently Used UNIX Linux Commands -hmftj
50 Most Frequently Used UNIX  Linux Commands -hmftj50 Most Frequently Used UNIX  Linux Commands -hmftj
50 Most Frequently Used UNIX Linux Commands -hmftj
 
Deathstar
DeathstarDeathstar
Deathstar
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging Ruby
 
Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)
 
ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...
ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...
ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...
 
Basics of unix
Basics of unixBasics of unix
Basics of unix
 
Exactly once with spark streaming
Exactly once with spark streamingExactly once with spark streaming
Exactly once with spark streaming
 
Rhel3
Rhel3Rhel3
Rhel3
 
Vagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopVagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptop
 

Recently uploaded

Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 

Recently uploaded (20)

Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 

37562259 top-consuming-process

  • 1. SQL being executed by a OS Process ID prompt "Please Enter The UNIX Process ID" set pagesize 50000 set linesize 30000 set long 500000 set head off select s.username su, substr(sa.sql_text,1,540) txt from v$process p, v$session s, v$sqlarea sa where p.addr=s.paddr and s.username is not null and s.sql_address=sa.address(+) and s.sql_hash_value=sa.hash_value(+) and spid=&SPID; --------------------------------------------------------------------- Top 10 processes consuming CPU... prstat -s cpu -n 10 ---------------------------------------------------------------------- After you find the spid of the top cpu consuming process use the below script to find the sid ,user,username,status, module of that spid. select sid, b.serial#, osuser, b.username, status, process, paddr, spid,a.progra m, module from v$process a,v$session b where spid = '&spid' and a.addr = b.paddr and b.username != ' ' order by 1; ----------------------------------------------------------------------- How to kill all similar processes with single command (in this case opmn) ps -ef grep opmn grep -v grep awk {print $2} xargs -i kill -9 {} Locating Files under a particular directory find . -print grep -i test.sql Using AWK in UNIX To remove a specific column of output from a UNIX command for example to determi ne the UNIX process Ids for all Oracle processes on server (second column) ps -ef grep -i oracle awk '{ print $2 }' Changing the standard prompt for Oracle Users Edit the .profile for the oracle user PS1="`hostname`*$ORACLE_SID:$PWD>"
  • 2. Display top 10 CPU consumers using the ps command /usr/ucb/ps auxgw head -11 Show number of active Oracle dedicated connection users for a particular ORACLE _SID ps -ef grep $ORACLE_SID grep -v grep grep -v ora_ wc -l Display the number of CPU s in Solaris psrinfo -v grep "Status of processor" wc -l Display the number of CPU s in AIX lsdev -C grep Process wc -l Display RAM Memory size on Solaris prtconf grep -i mem Display RAM memory size on AIX First determine name of memory device lsdev -C grep mem then assuming the name of the memory device is mem0 lsattr -El mem0 Swap space allocation and usage Solaris : swap -s or swap -l Aix : lsps -a Total number of semaphores held by all instances on server ipcs -as awk '{sum += $9} END {print sum}' View allocated RAM memory segments ipcs -pmb Manually deallocate shared memeory segments ipcrm -m '<ID>' Show mount points for a disk in AIX lspv -l hdisk13 Display amount of occupied space (in KB) for a file or collection of files in a directory or sub-directory du -ks * sort -n tail Display total file space in a directory du -ks . Cleanup any unwanted trace files more than seven days old find . *.trc -mtime +7 -exec rm {} ; Locate Oracle files that contain certain strings find . -print xargs grep rollback Locate recently created UNIX files (in the past one day) find . -mtime -1 -print Finding large files on the server (more than 100MB in size) find . -size +102400 -print Crontab :
  • 3. To submit a task every Tuesday (day 2) at 2:45PM 45 14 2 * * /opt/oracle/scripts/tr_listener.sh > /dev/null 2>&1 To submit a task to run every 15 minutes on weekdays (days 1-5) 15,30,45 * 1-5 * * /opt/oracle/scripts/tr_listener.sh > /dev/null 2>&1 To submit a task to run every hour at 15 minutes past the hour on weekends (days 6 and 0) 15 * 0,6 * * opt/oracle/scripts/tr_listener.sh > /dev/null 2>&1 -------------------------------------------------------------------------------- ------ Link:http://gavinsoorma.com/unix-for-the-dba/