There’s a command called: ORADEBUG SETORAPNAME in 11g.
It allows you to attach to a named background process as shown below, so you don’t need to figure out what’s the PID or SPID of the target process.
SQL> oradebug setorapname dbw0 Oracle pid: 9, Unix process pid: 5506, image: oracle@linux03 (DBW0) SQL> SQL> oradebug setorapname pmon Oracle pid: 2, Unix process pid: 5490, image: oracle@linux03 (PMON) SQL>
Even though you probably don’t want to mess around with background processes in production DBs, in demos and just Oracle research it can help you save couple of seconds every now and then.




Thank You;-)
Nice improvement to oradebug.
In the past I have to wakeup SMON:
SQL> oradebug setorapname smon
Oracle pid: 19, Unix process pid: 12777, image: oracle@demo01 (SMON)
SQL> oradebug wakeup 19
Statement processed.
Save me time running this query:
SQL> select pid
from v$process p, v$bgprocess b
where b.paddr = p.addr
and name=’SMON’; 2 3 4
PID
———-
19
Tanel-
Nice find with oradebug. I enjoy your blog since we both have a passion for database internals.
Cheers,
Ben
Is there a way to name the shadow process from within a session? (In a dedicated connection environment, of course). That could really make life easier when doing demos, research, etc.
Hi Chen,
I have such a script which accepds SID as parameter as attaches to its corresponding process like this:
SQL> @odsid 170
Oracle pid: 2, Windows thread id: 2920, image: ORACLE.EXE (PMON)
The script contents are following:
—————————-
SET TERMOUT OFF
COL spid NEW_VALUE odsid_spid
SELECT spid FROM v$process WHERE addr = (SELECT /*+ NO_UNNEST */ paddr FROM v$session WHERE sid = &1);
COL spid CLEAR
SET TERMOUT ON
ORADEBUG SETOSPID &odsid_spid
—————————-
Also you could write an “init” script which intializes sqlplus variables like lgwr, dbw0 etc.
so you could just run “@odsid &lgwr” when doing the demo
informative for me, like that
injectable filler