Using strace one can trace the system calls being executed by a running process. To stop the strace press control-C To display the system calls being executed $ strace -p <pid> or To display a summary of system calls being executed $ strace -cfo <logfile> -p <pid> Example: In this example smon process was being traced $ strace -p 1234 Process 1234 attached – interrupt … Continue reading How to trace a running process?
Flash Tip: Running Profiler on a Busy SQL Server http://www.microsoft.com/technet/abouttn/flash/tips/tips_020205.mspx Continue reading Flash Tip: Running Profiler on a Busy SQL Server
Using the SQL below in which joining with V$session and V$sqlarea one can find the SQL currently running. In this example using a session id one can find the SQL running SQL> select a.sid, a.serial#, b.sql_text from v$session a, v$sqlarea b where a.sql_address=b.address and a.sid = 257; SID SERIAL# ———- ———- SQL_TEXT ——————————————————————————– 257 8885 ALTER TABLE SCOTT.TEST_TBL1 MOVE PARTITION PART1 TABLESPACE NEW_TBS COMPRESS PCTFREE … Continue reading How to find SQL running for a user/sid?
In 8i and 9i archiver process doesn’t automatically startup when database is archive log mode so using the SQL below one can verify if archiver is running on database that has archive log mode turned on. SQL> SELECT DECODE(d.log_mode, 'ARCHIVELOG', DECODE(i.archiver, 'STOPPED', 'Issue archiver not running on archivelog database', 'NoIssue archiver running on archivelog database'), 'NoIssue No archive log mode') archiver_status from v$database d, V$instance … Continue reading Check archiver is running on archivelog mode?
By calling msdb..sp_get_composite_job_info or msdb.dbo.sp_help_job one can find the current jobs running on SQLServer. Example: exec msdb..sp_get_composite_job_info @execution_status=1 Or exec msdb.dbo.sp_help_job @execution_status = 1 Sample output: job_id originating_server name ———————————— —————————— ——————— 7E043796-44F3-4ABF-A047-AA27691DF674 sqlserver01 job_name Continue reading How to monitor jobs that are running on SQLServer through SQLServer Agent?
Using Oracle SID and SERIAL# can turn trace on/off a Oracle session that has already started. The values of SID and serial# can be obtained from GV$SESSION. This will create trace file in directory set by the parameter user_dump_dest. To find the SID and SERIAL# you want to debug you can query GV$session to query by program, username, machine, terminal. To start trace: SQL> exec … Continue reading Enable trace in a running session from PL/SQL or SQL*Plus