Monday, 20 August 2012

Reset/Change the ias_admin password

While upgrading the grid control host, I ran into a bug, when I say bug in this instance I mean a user problem, not the usual Oracle bug.

Apparently the ias_admin password had been changed and no one remembered to record the new password.

Oracle as usual makes life easy for us by not having any documented procedure for changing the password if forgotten.

There are two ways to change the password but no "official" way to change it if you forgot/lost the password.

After a huge amount of troubleshooting and research (15 minutes). I found this hack. The only problem is that it stores your password in clear text. Proceed at your peril:


Change ias_admin password directly in configuration file
–Backup $ORACLE_HOME/sysman/j2ee/config/jazn-data.xml
–Search for entry like below
  <user>
    <name>ias_admin</name>
      <credentials>{903}8QkQ/crno3lX0f3+67dj6WxW9KJMXaCu</credentials>
  </user>

change password like below 
  <user>
    <name>ias_admin</name>
      <credentials>Password</credentials>
  </user>



Tuesday, 7 August 2012

Temp tablespace recreation

For any number of reasons i.e. lack of space on ASM or disks, improperly sized segments, space will need to be reclaimed from the TEMP tablespace.

In my case it was due to a shortage of space, I looked around and there staring at me was over 30Gb of space, from whence I know not. Anyway in recent versions of Oracle (11G onwards), you have the ability to shrink the temp space, unfortunately I was running a version of 10g. So here we go:

Disclaimer: Try out all procedures on a test environment before "going production" with it.


Create temp2 tablespace


Create another temporary tablespace and make it the default tablespace using either sql prompt or grid control/enterprise manager

CREATE TEMPORARY TABLESPACE TEMP2 TEMPFILE  ‘+DATA/test/tempfile/TEMP2 ′ SIZE 2000M, ‘‘+DATA/prod/tempfile/TEMP2 ′ SIZE 2000M'; 

ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2;

Important: Kill inactive sessions on both nodes in RAC using the old temp tablespace:

Ensure there are no active sessions utilizing the previous temp tablespace:

SQL> SELECT USERNAME, SESSION_NUM, SESSION_ADDR FROM V$SORT_USAGE;

USERNAME                                                                                   SESSION_NUM SESSION_ADDR
------------------------------------------------------------------------------------------ ----------- ----------------
tommy                                                                                            147 070000020CE379D8
tommy                                                                                             33 070000020FE41DF0
tommy                                                                                          55165 070000020FE1B150

SQL> SELECT SID, SERIAL#, STATUS, LOGON_TIME FROM V$SESSION WHERE SERIAL#=147;

       SID    SERIAL# STATUS                   LOGON_TIME
---------- ---------- ------------------------ ---------------
      1600        147 INACTIVE                 18-JUL-12

SQL> SELECT SID, SERIAL#, STATUS, LOGON_TIME FROM V$SESSION WHERE SERIAL#=33;

       SID    SERIAL# STATUS                   LOGON_TIME
---------- ---------- ------------------------ ---------------
      1587         33 INACTIVE                 18-JUL-12

SQL> SELECT SID, SERIAL#, STATUS, LOGON_TIME FROM V$SESSION WHERE SERIAL#=55165;

       SID    SERIAL# STATUS                   LOGON_TIME
---------- ---------- ------------------------ ---------------
      1527      55165 INACTIVE                 25-JUL-12

Kill the inactive sessions 

ALTER SYSTEM KILL SESSION 'SID,SERIAL#' IMMEDIATE;

Drop temp tablespace

SQL> DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;

Recreate Tablespace Temp


SQL> CREATE TEMPORARY TABLESPACE TEMP TEMPFILE ‘+DATA/prod/tempfile TEMP.263.789587649′ SIZE 2000M’;


Make TEMP Tablespace default temporary tablespace

SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;


Drop temporary tablespace temp2

At this point if you run a very busy database you might need to kill inactive sessions and wait till the active sessions on temp2 are done before dropping it.

SQL> DROP TABLESPACE temp2 INCLUDING CONTENTS AND DATAFILES;