Friday 26 February 2010

OEM java.lang.Exception: No such metric

I tried the fix specified on the link below, but that did not sort out my problem.

http://forums.oracle.com/forums/message.jspa?messageID=1131271

Turns out though that the xml file ->>> $ORACLE_HOME/hostname_SID/sysman/emd/targets.xml had a wrong entry for my machine name.

Just confirm that you have the correct entries in the file.

If the problem persists, just recreate the EM repository

emca -config dbcontrol db -repos recreate

Thursday 25 February 2010

Oracle Database 10g - Shutdown Hanging

Phweeee!!! I must say, today was a rather interesting day... like always, I learnt something new. Okay, so one of the applications administrator tells me there is an audit on the way and he needs me to check for him if the DB is being backed up.

same old story... I am tired of hearing it too; DB is production.... running in NOARCHIVELOG mode and guess what, they have never performed a backup on the poor thing. So like a good dog (as always), I start narrating to him what repacations all this might have on the DB......

Fact File

OS ->>> MS Windows Server 2003 R2 Enterprise Edition; Service Pack 2
RAM ->>> 3.25GM
CPU ->>> Intel Xeron; 2.00GHz
DB ->>> Oracle Database 10g R2 Enterprise Edition
DB Role ->>> Production
Application: OMNIX (A Telecommunication Asset Management System)


Problem: DB needs to be mounted in older for DB to be configured in ARCHIVELOG mod. Unfortunately, Shutdown Hangs (see alertlog entries below).


Thu Feb 25 11:02:18 2010
Starting background process EMN0
EMN0 started with pid=27, OS id=7552
Thu Feb 25 11:02:18 2010
Shutting down instance: further logons disabled
Thu Feb 25 11:02:19 2010
Stopping background process QMNC
Thu Feb 25 11:02:20 2010
Stopping background process CJQ0
Thu Feb 25 11:02:21 2010
Stopping background process MMNL
Thu Feb 25 11:02:22 2010
Stopping background process MMON
Thu Feb 25 11:02:23 2010
Shutting down instance (immediate)
License high water mark = 30
Thu Feb 25 11:02:23 2010
Stopping Job queue slave processes
Thu Feb 25 11:02:23 2010
Job queue slave processes stopped
Thu Feb 25 11:07:22 2010
Active call for process 7360 user 'SYSTEM' program 'ORACLE.EXE (SHAD)'
SHUTDOWN: waiting for active calls to complete.
Thu Feb 25 11:21:48 2010
MMNL absent for 1204 secs; Foregrounds taking over



Solution:

Step 1 ->>> Log in as SYSDBA and issue shutdown abort

D:\>sqlplus /nolog

SQL*Plus: Release 10.2.0.3.0 - Production on Thu Feb 25 11:45:53 2010

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

SQL> connect sys as sysdba
Enter password:
Connected to an idle instance.
SQL> shutdown abort
ORA-03113: end-of-file on communication channel
SQL>


Step 2 ->>> Startup DB in restricted mode



C:\>sqlplus /nolog

SQL*Plus: Release 10.2.0.3.0 - Production on Thu Feb 25 11:56:39 2010

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

SQL> connect sys as sysdba
Enter password:
ERROR:
ORA-12560: TNS:protocol adapter error


SQL>


Oh boy; Vindows :( Turns out the windows Oracle service is not started.... net start command should sort this out

C:\>net start OracleServiceOMXZAMPRD
The OracleServiceOMXZAMPRD service is starting.......
The OracleServiceOMXZAMPRD service was started successfully.


C:\>sqlplus /nolog

SQL*Plus: Release 10.2.0.3.0 - Production on Thu Feb 25 12:01:12 2010

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

SQL> connect sys as sysdba
Enter password:
Connected.
SQL> startup restrict;
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup restrict;
ORACLE instance started.

Total System Global Area 1098907648 bytes
Fixed Size 1291700 bytes
Variable Size 654314060 bytes
Database Buffers 436207616 bytes
Redo Buffers 7094272 bytes
Database mounted.
Database opened.
SQL>
SQL>


Step 3: Now shutdown Normally

SQL>
SQL> shutdown normal;
Database closed.
Database dismounted.
ORACLE instance shut down.



Step 4: Startup Mount


SQL> startup mount;
ORACLE instance started.

Total System Global Area 1098907648 bytes
Fixed Size 1291700 bytes
Variable Size 654314060 bytes
Database Buffers 436207616 bytes
Redo Buffers 7094272 bytes
Database mounted.
SQL>



Step 5: Change to Archivelog mode

SQL> alter database archivelog;

Database altered.

SQL>



Step 6: Open the Database

SQL> alter database open;

Database altered.

SQL> SELECT dbid, name, created, log_mode FROM v$database;

DBID NAME CREATED LOG_MODE
---------- --------- --------- ------------
4175576194 OMXZAMPR 01-JUN-07 ARCHIVELOG

SQL>



References:

http://asktom.oracle.com/
http://dbataj.blogspot.com/