Author Archives: alesk
SIOUG 2009
Next week I will attend 14 th SIOUG conference, again at my beloved place, Portorož . This year I managed to put up itinerary for all three days, after all — namely my first thought was that because of the lack of interesting morning sessions (apart from Steven Feuerstein on Wednesday) it’s only the last day of the conference that’s really worth attending. But that would be a pity, because I would miss sessions from Christian Antognini and Anjo Kolk.
So here it is, my three day itinerary for SIOUG 2009:
Monday, September 21
- Peter Kestner, “The Myth of hacking Oracle”
- Christian Antognini, “Interpreting Execution Plans” — (an opportunity to get an autograph for his book).
- Randolph Geist, “CBO fundamentals: Understanding the different modes of System Statistics”
- Lovro Vreš, “Zaščita podatkov v Oracle podatkovnih bazah” (Protection of data in Oracle database)
- Piet de Visser, “How to prevent double work”
- Christian Antognini, “Parallel processing”
Tuesday, September 22
- Jurij Jaklič, “Pot do zrele poslovne inteligence: Pripravljenost in dejavniki uspeha”
- Craig Stewart, “Oracle Data Integrator Enterprise Edition for Business Intelligence”
- Anjo Kolk, “7 Levels of Application Efficiency”
- Marko Borovnik, “Ali je mogoče že sam SQL dovolj za DW in BI”
- Piet de Visser, “Get your stats right: Guide CBO to go where you want it”
- Anjo Kolk, “Why the Middle Tier is Slowing Down the Database?”
- Zmago Žagar, “Obvladovanje meteoroloških procesov”
Wednesday, September 23
- Steven Feuerstein,”Coding Therapy for Software Developers”
- Steven Feuerstein,”Automated testing options for Oracle PL/SQL
- Jože Senegačnik,”Kako napisati dobro PL/SQL kodo?” (How to write good PL/SQL code?”)
- Jože Senegačnik,”RMAN v praksi”
- Boris Oblak, “RMAN: namigi in nasveti”
- Miha Peternel,”Izkušnje pri delu z XML datotekami v Oracle bazi”
- Aleš Okorn, “Vojna svetov ali kam s podatkovno logiko”
- Robert Korošec, “OLAP11g kot zamenjava za materializirane poglede”
I was pleasantly surprised that SIOUG introduced cheaper conference pass this year (thank you, Miss Recession!), that excludes social event and lunches; which, of course, I gladly took .
SQL*Plus -prelim option
Jonathan Lewis pointed to an old blog from Arup Nanda, where he describes how he used sqlplus undocumented option (-prelim) to connect to “hanged” Oracle instance. Since I was not aware of this command I decided to try this out with 10g on Windows.
I tried this on Windows 2003:
C:\ORACLE>sqlplus -prelim /nolog SQL*Plus: Release 10.2.0.2.0 - Production on Tor Avg 11 13:48:35 2009 Copyright (c) 1982, 2005, Oracle. All Rights Reserved. SQL> connect / as sysdba Prelim connection established SQL> oradebug setmypid Statement processed. SQL> oradebug hanganalyze 12 Hang Analysis in C:\oracle\admin\oraT\udump\oraT_ora_3336.trc SQL>
and sure enough it can also be done in another way, described by Virag Sharma:
C:\ORACLE>sqlplus /nolog SQL*Plus: Release 10.2.0.2.0 - Production on Tor Avg 11 13:40:35 2009 Copyright (c) 1982, 2005, Oracle. All Rights Reserved. SQL> set _prelim on SQL> connect / as sysdba Prelim connection established SQL> oradebug setmypid Statement processed. SQL> oradebug hanganalyze 12 Hang Analysis in c:\oracle\admin\oraT\udump\oraT_ora_3812.trc SQL>
Miladin Modrakovic also blogged about sqlplus -prelim option.
I can’t even remember when was the last time I have to troubleshoot (seemingly) hanged Oracle instance, but it’s good to know that Oracle gave us an option in 10g to knock on the back door and ask for a dump of SGA structures.
Running cmd.exe under System account
I was experimenting with sqlplus -prelim option, trying to “bypass” connect / as sysdba part from command sequence by launching sqlplus under System account (the same account Oracle service is running under). The problem was that I was working remotely within Remote Desktop session, so an old trick:
cmd> at 12:00 /interactive cmd.exe
didn’t work. You have to seat at console to see the command prompt interactively.
A quick search on net revealed a quick fix for the problem:
cmd> psexec -i -s cmd.exe
Resulting in command prompt that runs under System account:
PsExec v1.72 - Execute processes remotely
Copyright (C) 2001-2006 Mark Russinovich
Sysinternals - www.sysinternals.com
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
C:\WINDOWS\system32>
You can download the latest psexec version from:
http://live.sysinternals.com/
SlySoft Virtual CloneDrive
In the Late August 2009 issue of the newsletter Mark Minasi recommended free ISO mounting utility for Windows x86 and x64, freeware by SlySoft, Virtual CloneDrive. Until now I was using Microsoft Virtual CD-ROM. I can’t say I was disappointed by Virtual CD-ROM but on the other hand I didn’t use it on Windows x64 where (according to Mark Minasi) it doesn’t work reliably. Anyway, Slysoft freeware looks more polished and will likely replace Microsoft Virtual CD-ROM on my desktop.
Finding last Logon time with PowerShell
I needed to find out last AD log-on time for a particular Active Directory user account on all our domain controllers. I already knew that it should not be particular difficult to come up with some PowerShell one-liner.
With some help aside by the Google, I finally came up with the statement that I liked and that is worthy of this note for my future reference:
PS>
PS>
PS> $username='alesk'
PS> Get-QADComputer -ComputerRole DomainController | foreach {(Get-QADUser -Service $_.Name -SamAccountName $username) | select Name, DisplayName, LastLogon, Path} | sort LastLogon
PS>
…and with the output similar to this one:
Name DisplayName LastLogon Path
---- ----------- --------- ----
alesk ales-k 07.08.2009 23:30:00 LDAP://acme-dc2.corp.com...
alesk ales-k 10.08.2009 11:21:57 LDAP://acme-dc1.corp.com...
alesk ales-k 10.08.2009 11:40:01 LDAP://acme-dc3.corp.com...
alesk ales-k 10.08.2009 15:20:25 LDAP://acme-dc4.corp.com...
The logic behind the script is simple:
1) get the list of all the DC’s from ActiveDirectory (Get-QADComputer -ComputerRole DomainController).
2) then query each domain controller (-Service $_Name) for the account passed as variable ($username) and then select the attributes that are needed with ith the select statement (use select * to examine the vast amount of attributes available for querying).
3) finally, I wanted the result to be sorted by LastLogon field.