Monday, 29 September 2008
Mid-Life Crisis Continues
My New Passion
Saturday, 20 September 2008
Windows Services
c:\windows\system32\services.msc
Wednesday, 17 September 2008
UNION [ALL], INTERSECT, MINUS Operators
Take for example two tables AUSTRALIA_CRICKET containing a few players from the Australian Cricket Team and KOLKATA_CRICKET containing a few players from the IPL Kolkata Cricket Team.
SQL> SELECT * FROM AUSTRALIA_CRICKET; FIRST_NAME LAST_NAME -------------------- -------------------- Ricky Ponting Michael Clarke Stuart Clark Brad Haddin Brett Lee 5 rows selected.SQL> SELECT * FROM KOLKATA_CRICKET; FIRST_NAME LAST_NAME -------------------- -------------------- Sourav Ganguly Shoaib Akhtar Ricky Ponting Brendon McCullum Chris Gayle 5 rows selected.
You can see from the results that Ricky Ponting is a player common to both tables.
To return data from both these tables, you could write:
SQL> SELECT * FROM AUSTRALIA_CRICKET 2 UNION 3 SELECT * FROM KOLKATA_CRICKET; FIRST_NAME LAST_NAME ------------------------------ ----------------------- Brad Haddin Brendon McCullum Brett Lee Chris Gayle Michael Clarke Ricky Ponting Shoaib Akhtar Sourav Ganguly Stuart Clark 9 rows selected.
You'll note Ricky Ponting was returned only once using the UNION syntax.
This is what happens if you change the UNION to UNION ALL:
This time Ricky Ponting appears twice. Once for each table.SQL> SELECT * FROM AUSTRALIA_CRICKET 2 UNION ALL 3 SELECT * FROM KOLKATA_CRICKET; FIRST_NAME LAST_NAME -------------------- -------------------- Ricky Ponting Michael Clarke Stuart Clark Brad Haddin Brett Lee Sourav Ganguly Shoaib Akhtar Ricky Ponting Brendon McCullum Chris Gayle 10 rows selected.
If you want only rows that appear in all tables, you would use the INTERSECT operation:
To round things off, if you wish to return data from the first table only, excluding data common between the two tables, you would use the MINUS operation:SQL> SELECT * FROM AUSTRALIA_CRICKET 2 INTERSECT 3 SELECT * FROM KOLKATA_CRICKET; FIRST_NAME LAST_NAME -------------------- -------------------- Ricky Ponting 1 row selected.
Or ... in Reverse:SQL> SELECT * FROM AUSTRALIA_CRICKET 2 MINUS 3 SELECT * FROM KOLKATA_CRICKET; FIRST_NAME LAST_NAME -------------------- -------------------- Brad Haddin Brett Lee Michael Clarke Stuart Clark 4 rows selected.
SQL> SELECT * FROM KOLKATA_CRICKET 2 MINUS 3 SELECT * FROM AUSTRALIA_CRICKET; FIRST_NAME LAST_NAME -------------------- -------------------- Brendon McCullum Chris Gayle Shoaib Akhtar Sourav Ganguly 4 rows selected.
Tuesday, 16 September 2008
PeopleSoft Scheduled Jobsets
select SCHEDULENAME
, JOBNAMESRC
, TO_CHAR(STARTDATETIME,'HH24:MI') TM
, A.RECURNAME
, RUNMONDAY
, RUNTUESDAY
, RUNWEDNESDAY
, RUNTHURSDAY
, RUNFRIDAY
, RUNSATURDAY
, RUNSUNDAY
from ps_schdldefn a
, psxlatitem b
, ps_prcsrecur c
where a.schedulestatus=b.fieldvalue
and a.recurname = c.recurname
and b.fieldname='SCHEDULESTATUS'
and b.xlatshortname='Active'
order by TM;
The numeric values in the RUN{DAY} columns indicates what days of the week the jobs are scheduled to run.
Tuesday, 9 September 2008
Oracle Process Details
select s.sid
, p.pid
, p.spid
, s.process
, s.status
, s.username
, s.osuser
, s.program
, a.name
, s.client_info
, s.module
, to_char(s.logon_time,'yyyy-mm-dd hh24:mi:ss')
, to_char(sysdate - (s.last_call_et /86400),'yyyy-mm-dd hh24:mi:ss')
from v$session s
, v$process p
, audit_actions a
where s.paddr = p.addr
and s.command = a.action
order by s.status;
Field Key
Monday, 8 September 2008
Accessing TSM through java client on UNIX
Invoke TSM Java client on AIX 5.2:


