Thursday, August 17, 2006

Database Control Shows - Java.Lang.Exception: No Such Metric after login

Applies to:

Enterprise Manager for RDBMS - Version: 10.2.0.1.0
This problem can occur on any platform.

Symptoms

ERROR
java.lang.Exception: no such metric

is displayed when logging into database control

emoms.log file shows the error -

ORA-28000: the account is locked (DBD ERROR: OCISessionBegin)

Also HOST CPU shows no data

Cause

This is due to the dbsnmp account being locked.

Solution

To implement the solution, please execute the following steps:

1. Unlock dbsnmp account.
2. Restart dbconsole


Taken directly from metalink Note:333490.1

Tuesday, August 15, 2006

Configure Oracle 10g Database Control

Database Control is basically a web based Monitoring tools for Oracle 10g Architecture. It is provided to ease DBA's job.
The different between Database Control and Grid Control is you can only use Database Control to manage single instance. So, if you have 10 instance you will need 10 database control. In contrast, with Grid Control everything is centralised.

Grid Control is supported with Enterprise Edition & Personal Edition, if you are using Standard Edition then you can use Database Control.

You can configure Database Control during database creation with DBCA, or you can configure it after the database creation using command line.

Use 'emca' binary to configure database control.

Configure DB Control
$ cd $ORACLE_HOME/bin
$ ./emca -config dbcontrol db

STARTED EMCA at 16/08/2006 18:04:35
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database SID: SNZDB
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /app/oracle/product/10.2.0

Database hostname ................ OLSSWIFTCS0001
Listener port number ................ 1521
Database SID ................ SNZDB
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
16/08/2006 18:08:34 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /app/oracle/product/10.2.0/cfgtoollogs/emca/SNZDB/emca_2006-08-16_06-04-35-PM.log.
16/08/2006 18:08:42 oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
16/08/2006 18:10:24 oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
16/08/2006 18:10:24 oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://OLSSWIFTCS0001:1158/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 16, 2006 6:10:24 PM





RMAN : Restore SPFILE from autobackup

SPFILE is included in the controlfile autobackup. Therefore, If you loose it you can use RMAN to restore it from the autobackup.

Use below command :

RMAN> restore SPFILE from autobackup db_recovery_file_dest='/app/oracle/flash_recovery_area' db_name = 'orcl';

if you don't specify db_recovery_file_dest, by default RMAN will try to look the autobackup in $ORACLE_HOME/dbs (UNIX).

Before you can execute above command, you need to start the instance.
Use STARTUP FORCE NOMOUNT to start the instance without initialization parameter file.

Monday, August 07, 2006

RMAN : Improving Incremental Backup Performance: Change Tracking

RMAN's change tracking feature for incremental backups improves incremental backup performance by recording changed blocks in each datafile in a change tracking file. If change tracking is enabled, RMAN uses the change tracking file to identify changed blocks for incremental backup, thus avoiding the need to scan every block in the datafile.

After enabling change tracking, the first level 0 incremental backup still has to scan the entire datafile, as the change tracking file does not yet reflect the status of the blocks. Subsequent incremental backup that use this level 0 as parent will take advantage of the change tracking file.

Using change tracking in no way changes the commands used to perform incremental backups, and the change tracking files themselves generally require little maintenance after initial configuration.

Change tracking is disabled by default, because it does introduce some minimal performance overhead on your database during normal operations. However, the benefits of avoiding full datafile scans during backup are considerable, especially if only a small percentage of data blocks are changed between backups. If your backup strategy involves incremental backups, then you should enable change tracking.

One block change tracking file is created for the whole database. By default, the block change tracking file is created as an Oracle managed file in DB_CREATE_FILE_DEST. You can also specify the name of the block change tracking file, placing it in any location you choose.

How to enable Change Tracking:

SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING
USING FILE '/mydir/rman_change_track.f' REUSE;

You can view the status,filename,filesize
of Change Tracking in V$BLOCK_CHANGE_TRACKING view





Friday, August 04, 2006

How to Change the DBID and the DBNAME by using NID

The NID (New Database ID) is a new utility introduced with Oracle 9.2. The NID utility allows you to change only the DBNAME, or only the DBID or both DBNAME and DBID in the same command.

Notes:
  1. If you change the DBID you must open the database with the RESETLOGS option, which re-creates the online redo logs and resets their sequence to 1.
  2. If you change the DBNAME without changing the DBID then this does not require you to open with the RESETLOGS option, so database backups and archived logs are not invalidated. You must change the DB_NAME initialization parameter after a database name change to reflect the new name. Also, you may have to re-create the Oracle password file. If you restore an old backup of the control file (before the name change, then you should use the initialization parameter file and password file from before the database name change.
Steps to use NID :
=============
  1. Backup the database
  2. SHUTDOWN IMMEDIATE of the database
  3. STARTUP MOUNT
  4. Open one session and run NID with sysdba privileges
  5. Shutdown IMMEDIATE of the database
  6. Set the DB_NAME initialization parameter in the initialization parameter file to the new database name
  7. Create a new password file
  8. Startup of the database with open resetlogs/no resetlogs
NID Usage:
========
TARGET --> Username/Password
DBNAME --> New database name
LOGFILE --> Output Log
REVERT --> Revert failed change (NO)
SETNAME --> Set a new database name only (NO)
APPEND --> Append to output log (NO)
HELP --> Displays these messages (NO)