AWR automatic or manual snapshot hangs – EXADATA

Reading Time: < 1 minute

Custer database manual or auto snapshot hangs and never returns:

Bug info:

https://support.oracle.com/CSP/ui/flash.html#tab=KBHome%28page=KBHome&id=%28%29%29,%28page=KBNavigator&id=%28bmDocType=BUG&bmDocTitle=AWR%20SNAPSHOTS%20HANGING&from=BOOKMARK&bmDocDsrc=BUG&bmDocID=13372759&viewingMode=1143%29%29

Solution:

sqlplus / as sysdba

SQL> exec dbms_stats.gather_table_stats('SYS','X$KCCFN',no_invalidate=>false);

SQL> exec dbms_stats.gather_table_stats('SYS','X$KCCFE',no_invalidate=>false);

SQL> execute dbms_workload_repository.modify_snapshot_settings (interval => 15, retention => 1576800);
SQL> EXEC DBMS_WORKLOAD_REPOSITORY.create_snapshot;

Step above should fix the issue..

Exadata bug related to HAIP

Reading Time: 2 minutes

Recently i have been engaged Peoplesoft financials and HR Exadata gig.  I ran into issue related to HAIP that is used on EXADATA system.  Oracle have confirmed that it is bug and solution is to set cluster_interconnects for each node.

following error encountered when starting cluster database:

PRCR-1013 : Failed to start resource ora.orcl.db
PRCR-1064 : Failed to start resource ora.orcl.db on node nd01db1
CRS-5017: The resource action “ora.orcl.db start” encountered the following error:
ORA-03113: end-of-file on communication channel
Process ID: 0
Session ID: 0 Serial number: 0
 

Trace file:

Group reconfiguration cleanup

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE]).

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE]).

*** 2012-02-07 15:05:09.686

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE]).

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE]).

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE]).

*** 2012-02-07 15:05:10.714

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE]).

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE]).

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE]).

*** 2012-02-07 15:05:11.743

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE]).

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE]).

*** 2012-02-07 15:05:12.565

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE]).

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE]).

*** 2012-02-07 15:05:16.275

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE])

I looked up on support and they are saying it is a bug:

https://support.oracle.com/CSP/ui/flash.html#tab=KBHome(page=KBHome&id=()),(page=KBNavigator&id=(bmDocTitle=Exadata%20Rac%20Node%20Instance%20Crash%20with%20kjzdattdlm:%20Can%20not%20attach%20to%20DLM&from=BOOKMARK&bmDocType=PROBLEM&bmDocDsrc=KB&bmDocID=1386843.1&viewingMode=1143))

solution is to shutdown and recreate spfile with hard coded value for bindib0

SQL> create pfile='inittempORCL.ora' from spfile ;
SQL> !echo "ORCL1.cluster_interconnects='192.168.5.1' " >>inittempORCL.ora
SQL> !echo "ORCL2.cluster_interconnects='192.168.5.2' " >>inittempORCL.ora

SQL> create spfile='+DATA/ORCL/spfileORCL.ora' from pfile='inittempORCL.ora';

# srvctl start database -d ORCL

Repeat each steps all cluster databases.

hopefully, steps above should fix the issue with bindib0.

Database monitoring scripts

Reading Time: < 1 minute
ACTIVE session report :

 set linesize 200
 col Username for a10
 col OSuser for a15
 col Machine for a31
 col Spid for a10
 col Program for a30
select
 S.Username,
 S.OSuser,
 S.Machine,
 S.STATUS,
 P.Spid,
 S.Program,
 S.SERIAL#,
 S.SID
 from V$PROCESS P, V$SESSION S
 where P.Addr = S.Paddr
 -- and s.Audsid > 8
 order by S.STATUS;
set linesize 200
 col Username for a10
 col OSuser for a15
 col Machine for a17
 col Spid for a10
 col Program for a30
spool sess.lst
 select
 S.Username,
 S.OSuser,
 S.Machine,
 S.STATUS,
 P.Spid,
 s.process client_PID,
 S.Program,
 S.SERIAL#,
 S.SID
 from V$PROCESS P, V$SESSION S
 where P.Addr = S.Paddr
 -- and s.Audsid > 8
 and s.process='&enter_process'
 order by S.Username;
 spool off
Active Session by SQL_ID:

 set linesize 150
 col Username for a10
 col OSuser for a8
 col Machine for a25
 col Spid for a10
 col Program for a30
select
 S.Username,
 S.OSuser,
 S.sql_hash_value,
 s.sql_id,
 P.Spid,
 S.Program,
 S.SERIAL#,
 s.status,
 S.SID
 ,s.logon_time
 ,s.client_info
 from V$PROCESS P, V$SESSION S
 where P.Addr = S.Paddr
 and s.Audsid > 8
Active Longops:
 set linesize 150
 col sql_text for a50
select  sid, to_char(START_TIME,'MM-DD-YY:HH:MM:SS') , to_char(TIME_REMAINING,'MM-DD-YY:HH:MM:SS') , LAST_UPDATE_TIME, SQL_HASH_VALUE, sql_text
 FROM v$session_longops a, v$sql b
 WHERE username='SYSADM'
 AND totalwork > 0
 and sofar <> totalwork
 and a.sql_hash_value=b.hash_value
 and sid=&enter_sid
 ;
 --    and s.Audsid > 8
Pull SQL info :
select sql_text,sql_id,hash_value from v$sqltext
 where sql_text like '%&1%'
 order by piece
 /

Rename Snapshot Standby database name

Reading Time: 2 minutes

Recently we had requirement to change database name to look like instance name once we convert Physical Standby to Snapshot Standby.   So, basically when user query v$database view it shows instance name rather unique database name:

cattach is custom

Here are steps I used to accomplish the goal..

SQL> select name , database_role from v$database;

NAME      DATABASE_ROLE

——— —————-

XONPROD   PHYSICAL STANDBY

SQL>

Converted Database to Snapshot Standby:

SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter database convert to snapshot standby;

Database altered.

SQL> alter database open;

Database altered.

SQL> select name , database_role from v$database;

NAME      DATABASE_ROLE

——— —————-

XONPROD   SNAPSHOT STANDBY

SQL> @custom_view.sql

View created.

Grant succeeded.

Synonym dropped.

Synonym created.

SQL> show user

USER is “SYS”

SQL> select name , database_role from v$database;

NAME      DATABASE_ROLE

——— —————-

XONPROD   SNAPSHOT STANDBY

SQL> conn system

Enter password:

Connected.

SQL> select name , database_role from v$database;

NAME             DATABASE_ROLE

—————- —————-

xonprod2         SNAPSHOT STANDBY

SQL> select instance_name from v$instance;

INSTANCE_NAME

—————-

xonprod2

SQL>

attach is custom view script:

CREATE OR REPLACE FORCE VIEW V_CUST_VDATABASE

(

DBID,

NAME,

CREATED,

RESETLOGS_CHANGE#,

RESETLOGS_TIME,

PRIOR_RESETLOGS_CHANGE#,

PRIOR_RESETLOGS_TIME,

LOG_MODE,

CHECKPOINT_CHANGE#,

ARCHIVE_CHANGE#,

CONTROLFILE_TYPE,

CONTROLFILE_CREATED,

CONTROLFILE_SEQUENCE#,

CONTROLFILE_CHANGE#,

CONTROLFILE_TIME,

OPEN_RESETLOGS,

VERSION_TIME,

OPEN_MODE,

PROTECTION_MODE,

PROTECTION_LEVEL,

REMOTE_ARCHIVE,

ACTIVATION#,

SWITCHOVER#,

DATABASE_ROLE,

ARCHIVELOG_CHANGE#,

ARCHIVELOG_COMPRESSION,

SWITCHOVER_STATUS,

DATAGUARD_BROKER,

GUARD_STATUS,

SUPPLEMENTAL_LOG_DATA_MIN,

SUPPLEMENTAL_LOG_DATA_PK,

SUPPLEMENTAL_LOG_DATA_UI,

FORCE_LOGGING,

PLATFORM_ID,

PLATFORM_NAME,

RECOVERY_TARGET_INCARNATION#,

LAST_OPEN_INCARNATION#,

CURRENT_SCN,

FLASHBACK_ON,

SUPPLEMENTAL_LOG_DATA_FK,

SUPPLEMENTAL_LOG_DATA_ALL,

DB_UNIQUE_NAME,

STANDBY_BECAME_PRIMARY_SCN,

FS_FAILOVER_STATUS,

FS_FAILOVER_CURRENT_TARGET,

FS_FAILOVER_THRESHOLD,

FS_FAILOVER_OBSERVER_PRESENT,

FS_FAILOVER_OBSERVER_HOST,

CONTROLFILE_CONVERTED,

PRIMARY_DB_UNIQUE_NAME,

SUPPLEMENTAL_LOG_DATA_PL,

MIN_REQUIRED_CAPTURE_CHANGE#

)

AS

SELECT a.DBID,

(select INSTANCE_NAME from v$instance) as NAME,

a.CREATED,

a.RESETLOGS_CHANGE#,

a.RESETLOGS_TIME,

a.PRIOR_RESETLOGS_CHANGE#,

a.PRIOR_RESETLOGS_TIME,

a.LOG_MODE,

a.CHECKPOINT_CHANGE#,

a.ARCHIVE_CHANGE#,

a.CONTROLFILE_TYPE,

a.CONTROLFILE_CREATED,

a.CONTROLFILE_SEQUENCE#,

a.CONTROLFILE_CHANGE#,

a.CONTROLFILE_TIME,

a.OPEN_RESETLOGS,

a.VERSION_TIME,

a.OPEN_MODE,

a.PROTECTION_MODE,

a.PROTECTION_LEVEL,

a.REMOTE_ARCHIVE,

a.ACTIVATION#,

a.SWITCHOVER#,

a.DATABASE_ROLE,

a.ARCHIVELOG_CHANGE#,

a.ARCHIVELOG_COMPRESSION,

a.SWITCHOVER_STATUS,

a.DATAGUARD_BROKER,

a.GUARD_STATUS,

a.SUPPLEMENTAL_LOG_DATA_MIN,

a.SUPPLEMENTAL_LOG_DATA_PK,

a.SUPPLEMENTAL_LOG_DATA_UI,

a.FORCE_LOGGING,

a.PLATFORM_ID,

a.PLATFORM_NAME,

a.RECOVERY_TARGET_INCARNATION#,

a.LAST_OPEN_INCARNATION#,

a.CURRENT_SCN,

a.FLASHBACK_ON,

a.SUPPLEMENTAL_LOG_DATA_FK,

a.SUPPLEMENTAL_LOG_DATA_ALL,

a.DB_UNIQUE_NAME,

a.STANDBY_BECAME_PRIMARY_SCN,

a.FS_FAILOVER_STATUS,

a.FS_FAILOVER_CURRENT_TARGET,

a.FS_FAILOVER_THRESHOLD,

a.FS_FAILOVER_OBSERVER_PRESENT,

a.FS_FAILOVER_OBSERVER_HOST,

a.CONTROLFILE_CONVERTED,

a.PRIMARY_DB_UNIQUE_NAME,

a.SUPPLEMENTAL_LOG_DATA_PL,

a.MIN_REQUIRED_CAPTURE_CHANGE#

FROM v$database a

;

GRANT SELECT ON V_CUST_VDATABASE TO SELECT_CATALOG_ROLE;

DROP PUBLIC SYNONYM V$DATABASE;

CREATE OR REPLACE PUBLIC SYNONYM V$DATABASE FOR SYS.V_CUST_VDATABASE;

Let me know if this helps or if we have better workaround..

RMAN duplicate using until time/backup set:

Reading Time: 6 minutes

RMAN duplicate using until time/backup set:

 

RMAN> show all;

using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name DLFA01 are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘%F’; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM ‘AES128’; # default
CONFIGURE COMPRESSION ALGORITHM ‘BASIC’ AS OF RELEASE ‘DEFAULT’ OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_DLFA01.f’; # default

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP on
2> ;

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

RMAN> backup as compressed backupset incremental level 0 database include current controlfile plus archivelog TAG=”2011_08_17_AK”;

Starting backup at 17-AUG-11
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=47 device type=DISK
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=4 STAMP=759355393
input archived log thread=1 sequence=6 RECID=5 STAMP=759355404
input archived log thread=1 sequence=7 RECID=6 STAMP=759355632
input archived log thread=1 sequence=8 RECID=7 STAMP=759355696
input archived log thread=1 sequence=9 RECID=8 STAMP=759396723
channel ORA_DISK_1: starting piece 1 at 17-AUG-11
channel ORA_DISK_1: finished piece 1 at 17-AUG-11
piece handle=+FRA_QA/dlfa01/backupset/2011_08_17/annnf0_2011_08_17_ak_0.366.759396725 tag=2011_08_17_AK comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 17-AUG-11

Starting backup at 17-AUG-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/dlfa01/datafile/system.256.758748765
input datafile file number=00002 name=+DATA/dlfa01/datafile/sysaux.257.758748767
input datafile file number=00003 name=+DATA/dlfa01/datafile/undotbs1.258.758748767
input datafile file number=00004 name=+DATA/dlfa01/datafile/users.259.758748767
channel ORA_DISK_1: starting piece 1 at 17-AUG-11
channel ORA_DISK_1: finished piece 1 at 17-AUG-11
piece handle=+FRA_QA/dlfa01/backupset/2011_08_17/nnndn0_tag20110817t073208_0.365.759396729 tag=TAG20110817T073208 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:06
channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 17-AUG-11
channel ORA_DISK_1: finished piece 1 at 17-AUG-11
piece handle=+FRA_QA/dlfa01/backupset/2011_08_17/ncnnn0_tag20110817t073208_0.364.759396797 tag=TAG20110817T073208 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 17-AUG-11

Starting backup at 17-AUG-11
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=10 RECID=9 STAMP=759396799
channel ORA_DISK_1: starting piece 1 at 17-AUG-11
channel ORA_DISK_1: finished piece 1 at 17-AUG-11
piece handle=+FRA_QA/dlfa01/backupset/2011_08_17/annnf0_2011_08_17_ak_0.1135.759396801 tag=2011_08_17_AK comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 17-AUG-11

Starting Control File and SPFILE Autobackup at 17-AUG-11
piece handle=+FRA_QA/dlfa01/autobackup/2011_08_17/s_759396801.1136.759396803 comment=NONE
Finished Control File and SPFILE Autobackup at 17-AUG-11

RMAN> quit

$ env
_=*25457*/bin/env
CVS_RSH=ssh
G_BROKEN_FILENAMES=1
HISTSIZE=1000
HOME=/home/oracle
HOSTNAME=asm05
INPUTRC=/etc/inputrc
LANG=en_US.UTF-8
LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/dbhome_1/lib
LESSOPEN=|/usr/bin/lesspipe.sh %s
LOGNAME=oracle
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
MAIL=/var/spool/mail/oracle
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_SID=CLONE01
PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/u01/app/oracle/product/11.2.0/dbhome_1/bin
PWD=/u01/app/oracle/product/11.2.0/dbhome_1/dbs
SHELL=/bin/ksh
SHLVL=1
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SSH_CLIENT=192.168.1.202 44746 22
SSH_CONNECTION=192.168.1.202 44746 192.168.1.241 22
SSH_TTY=/dev/pts/1
TERM=vt100
USER=oracle
_AST_FEATURES=UNIVERSE – ucb
A__z=”*SHLVL
$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 17 07:33:36 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> shutdown abort;
ORACLE instance shut down.
SQL> !pwd
/u01/app/oracle/product/11.2.0/dbhome_1/dbs

SQL> !ls -lrt
total 28792
-rw-r–r– 1 oracle dba    2851 May 15  2009 init.ora
-rw-r—– 1 oracle dba      24 Aug  9 19:32 lkDLFA01
-rw-r—– 1 oracle dba    1536 Aug  9 19:34 orapwDLFA01
-rw-r—– 1 oracle dba      39 Aug  9 19:35 initDLFA01.ora
-rw-r—– 1 oracle dba      24 Aug  9 19:46 lkDLQA01
-rw-r—– 1 oracle dba    1536 Aug  9 19:47 orapwDLQA01
-rw-rw—- 1 oracle dba    1544 Aug  9 20:11 hc_DBUA0.dat
-rw-r—– 1 oracle dba      24 Aug  9 20:13 lkVALQA02
-rw-r—– 1 oracle dba      41 Aug  9 20:16 initVALQA02.ora
-rw-r—– 1 oracle dba 9748480 Aug 11 17:19 snapcf_DLQA01.f
-rw-r—– 1 oracle dba    1536 Aug 12 18:07 orapwCLONE01
-rw-r—– 1 oracle dba      24 Aug 13 14:59 lkCLONE01
-rw-r–r– 1 oracle dba      62 Aug 15 09:59 initDLQA01.ora
-rw-rw—- 1 oracle dba    1544 Aug 15 17:49 hc_DLQA01.dat
-rw-r—– 1 oracle dba    1536 Aug 16 15:15 orapwVALQA02
-rw-rw—- 1 oracle dba    1544 Aug 16 16:26 hc_VALQA02.dat
-rw-r—– 1 oracle dba 9846784 Aug 16 16:26 snapcf_VALQA02.f
-rw-rw—- 1 oracle dba    1544 Aug 16 20:03 hc_DLFA01.dat
-rw-r—– 1 oracle dba     931 Aug 17 07:09 initCLONE01.ora
-rw-r—– 1 oracle dba   12800 Aug 17 07:18 spfileCLONE01.ora
-rw-r—– 1 oracle dba 9748480 Aug 17 07:33 snapcf_DLFA01.f
-rw-rw—- 1 oracle dba    1544 Aug 17 07:33 hc_CLONE01.dat

SQL> startup nomount pfile=’initCLONE01.ora’
ORACLE instance started.

Total System Global Area  521936896 bytes
Fixed Size                  2214936 bytes
Variable Size             159384552 bytes
Database Buffers          356515840 bytes
Redo Buffers                3821568 bytes
SQL> create spfile from  pfile=’initCLONE01.ora’;

File created.

B COMPLETION_TIME
– ——————-
L 08/16/2011 20:07:15
D 08/16/2011 20:08:12
D 08/16/2011 20:08:14
L 08/16/2011 20:08:17
L 08/17/2011 07:32:08
D 08/17/2011 07:33:04
D 08/17/2011 07:33:17
L 08/17/2011 07:33:20
D 08/17/2011 07:33:23

9 rows selected.

SQL> l
  1* select BACKUP_TYPE, COMPLETION_TIME from V$BACKUP_SET

> rman target sys/oracle@DLFA01

Recovery Manager: Release 11.2.0.1.0 – Production on Thu Aug 25 10:53:54 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DLFA01 (DBID=3134528100)

 

RMAN> connect auxiliary /

RMAN> duplicate target database to CLONE01 nofilenamecheck UNTIL TIME “to_date(’08/17/2011 07:33′,’MM/DD/YYYY HH24:MI’)”;

Starting Duplicate Db at 17-AUG-11

using target database control file instead of recovery catalog

allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=23 device type=DISK

contents of Memory Script:
{
   sql clone “create spfile from memory”;
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2214936 bytes

Variable Size                163578856 bytes
Database Buffers             352321536 bytes
Redo Buffers                   3821568 bytes

contents of Memory Script:
{
   set until scn  1044124;
   sql clone “alter system set  db_name =
 ”DLFA01” comment=
 ”Modified by RMAN duplicate” scope=spfile”;
   sql clone “alter system set  db_unique_name =
 ”CLONE01” comment=
 ”Modified by RMAN duplicate” scope=spfile”;
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile;
   alter clone database mount;
}
executing Memory Script

executing command: SET until clause

sql statement: alter system set  db_name =  ”DLFA01” comment= ”Modified by RMAN duplicate” scope=spfile

sql statement: alter system set  db_unique_name =  ”CLONE01” comment= ”Modified by RMAN duplicate” scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2214936 bytes

Variable Size                163578856 bytes
Database Buffers             352321536 bytes
Redo Buffers                   3821568 bytes

Starting restore at 17-AUG-11
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=20 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece +FRA_QA/dlfa01/backupset/2011_08_16/ncsnn0_tag20110816t200717_0.1009.759355695
channel ORA_AUX_DISK_1: piece handle=+FRA_QA/dlfa01/backupset/2011_08_16/ncsnn0_tag20110816t200717_0.1009.759355695 tag=TAG20110816T200717
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
output file name=+DATA/clone01/controlfile/control01.ctl
output file name=+FRA_QA/clone01/controlfile/control02.ctl
Finished restore at 17-AUG-11

database mounted

contents of Memory Script:
{
   set until scn  1044124;
   set newname for clone datafile  1 to new;
   set newname for clone datafile  2 to new;
   set newname for clone datafile  3 to new;
   set newname for clone datafile  4 to new;
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 17-AUG-11
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to +DATA
channel ORA_AUX_DISK_1: restoring datafile 00002 to +DATA
channel ORA_AUX_DISK_1: restoring datafile 00003 to +DATA
channel ORA_AUX_DISK_1: restoring datafile 00004 to +DATA
channel ORA_AUX_DISK_1: reading from backup piece +FRA_QA/dlfa01/backupset/2011_08_17/nnndn0_tag20110817t073208_0.365.759396729
channel ORA_AUX_DISK_1: piece handle=+FRA_QA/dlfa01/backupset/2011_08_17/nnndn0_tag20110817t073208_0.365.759396729 tag=TAG20110817T073208
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:05
Finished restore at 17-AUG-11

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=5 STAMP=759397024 file name=+DATA/clone01/datafile/system.288.759396959
datafile 2 switched to datafile copy
input datafile copy RECID=6 STAMP=759397024 file name=+DATA/clone01/datafile/sysaux.287.759396959
datafile 3 switched to datafile copy
input datafile copy RECID=7 STAMP=759397024 file name=+DATA/clone01/datafile/undotbs1.295.759396959
datafile 4 switched to datafile copy
input datafile copy RECID=8 STAMP=759397025 file name=+DATA/clone01/datafile/users.296.759396959

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
   sql clone “alter system set  db_name =
 ”CLONE01” comment=
 ”Reset to original value by RMAN” scope=spfile”;
   sql clone “alter system reset  db_unique_name scope=spfile”;
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

database dismounted
Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2214936 bytes

Variable Size                163578856 bytes
Database Buffers             352321536 bytes
Redo Buffers                   3821568 bytes

sql statement: alter system set  db_name =  ”CLONE01” comment= ”Reset to original value by RMAN” scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     521936896 bytes

Fixed Size                     2214936 bytes

Variable Size                163578856 bytes
Database Buffers             352321536 bytes
Redo Buffers                   3821568 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE “CLONE01” RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP  1  SIZE 50 M ,
  GROUP  2  SIZE 50 M ,
  GROUP  3  SIZE 50 M
 DATAFILE
  ‘+DATA/clone01/datafile/system.288.759396959’
 CHARACTER SET WE8MSWIN1252

contents of Memory Script:
{
   set newname for clone tempfile  1 to new;
   switch clone tempfile all;
   catalog clone datafilecopy  “+DATA/clone01/datafile/sysaux.287.759396959”,
 “+DATA/clone01/datafile/undotbs1.295.759396959”,
 “+DATA/clone01/datafile/users.296.759396959”;
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to +DATA in control file

cataloged datafile copy
datafile copy file name=+DATA/clone01/datafile/sysaux.287.759396959 RECID=1 STAMP=759397045
cataloged datafile copy
datafile copy file name=+DATA/clone01/datafile/undotbs1.295.759396959 RECID=2 STAMP=759397045
cataloged datafile copy
datafile copy file name=+DATA/clone01/datafile/users.296.759396959 RECID=3 STAMP=759397045

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=759397045 file name=+DATA/clone01/datafile/sysaux.287.759396959
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=759397045 file name=+DATA/clone01/datafile/undotbs1.295.759396959
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=759397045 file name=+DATA/clone01/datafile/users.296.759396959

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 17-AUG-11

Disk group rename 11G: Step by Step

Reading Time: 3 minutes

Warning: This procedure tested in test environment:

 

Disk group rename 11G:

Check the status of Diskgroup:

[oracle@asm05] /home/oracle $

$ crs_stat -t    

Name           Type           Target    State     Host       

————————————————————

ora.DATA.dg    ora….up.type ONLINE    ONLINE    asm05      

ora.DATA2.dg   ora….up.type ONLINE    ONLINE    asm05      

ora.FRA.dg     ora….up.type ONLINE    ONLINE    asm05      

ora….ER.lsnr ora….er.type ONLINE    OFFLINE              

ora.asm        ora.asm.type   ONLINE    ONLINE    asm05      

ora.cssd       ora.cssd.type  ONLINE    ONLINE    asm05      

ora.diskmon    ora….on.type ONLINE    ONLINE    asm05      

ora.dlfa01.db  ora….se.type ONLINE    ONLINE    asm05      

ora.dlqa01.db  ora….se.type ONLINE    ONLINE    asm05      

ora.valqa02.db ora….se.type ONLINE    ONLINE    asm05      

[oracle@asm05] /home/oracle $

$

$ crsctl status resource ora.FRA.dg

NAME=ora.FRA.dg

TYPE=ora.diskgroup.type

TARGET=ONLINE

STATE=ONLINE on asm05

[oracle@asm05] /home/oracle $

[oracle@asm05] /home/oracle $

$ asmcmd umount FRA

ORA-15032: not all alterations performed

ORA-15027: active use of diskgroup “FRA” precludes its dismount (DBD ERROR: OCIStmtExecute)

[oracle@asm05] /home/oracle $

$ crsctl status resource ora.FRA.dg

NAME=ora.FRA.dg

TYPE=ora.diskgroup.type

TARGET=ONLINE

STATE=ONLINE on asm05

$ ps -ef |grep pmon

oracle    3447     1  0 09:56 ?        00:00:00 asm_pmon_+ASM

oracle    3568     1  0 09:59 ?        00:00:00 ora_pmon_DLQA01

oracle    3891     1  0 10:00 ?        00:00:00 ora_pmon_DLFA01

oracle    4060     1  0 10:01 ?        00:00:00 ora_pmon_VALQA02

Shutdown all instances using DG to be renamed.

$ ps -ef |grep pmon

oracle    3447     1  0 09:56 ?        00:00:00 asm_pmon_+ASM

oracle    3568     1  0 09:59 ?        00:00:00 ora_pmon_DLQA01

oracle    3891     1  0 10:00 ?        00:00:00 ora_pmon_DLFA01

oracle    4060     1  0 10:01 ?        00:00:00 ora_pmon_VALQA02

$ asmcmd umount FRA

[oracle@asm05] /home/oracle $

$ crsctl status resource ora.FRA.dg

NAME=ora.FRA.dg

TYPE=ora.diskgroup.type

TARGET=OFFLINE

STATE=OFFLINE

[oracle@asm05] /home/oracle $

$

$ asmcmd lsdg

State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name

MOUNTED  EXTERN  N         512   4096  1048576     15342    11112                0           11112              0             N  DATA/

MOUNTED  EXTERN  N         512   4096  1048576     10228    10174                0           10174              0             N  DATA2/

[oracle@asm05] /home/oracle $

$ renamedg phase=both dgname=FRA newdgname=FRA_QA verbose=true

Parsing parameters..

Parameters in effect:

         Old DG name       : FRA

         New DG name          : FRA_QA

         Phases               :

                 Phase 1

                 Phase 2

         Discovery str        : (null)

         Clean              : TRUE

         Raw only           : TRUE

renamedg operation: phase=both dgname=FRA newdgname=FRA_QA verbose=true

Executing phase 1

Discovering the group

Performing discovery with string:

Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:DISK4 with disk number:0 and timestamp (32956723 2083846144)

Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:DISK5 with disk number:1 and timestamp (32956723 2083846144)

Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:DISK6 with disk number:2 and timestamp (32956723 2083846144)

Checking for hearbeat…

Re-discovering the group

Performing discovery with string:

Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:DISK4 with disk number:0 and timestamp (32956723 2083846144)

Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:DISK5 with disk number:1 and timestamp (32956723 2083846144)

Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:DISK6 with disk number:2 and timestamp (32956723 2083846144)

Checking if the diskgroup is mounted

Checking disk number:0

Checking disk number:1

Checking disk number:2

Checking if diskgroup is used by CSS

Generating configuration file..

Completed phase 1

Executing phase 2

Looking for ORCL:DISK4

Modifying the header

Looking for ORCL:DISK5

Modifying the header

Looking for ORCL:DISK6

Modifying the header

Completed phase 2

Terminating kgfd context 0x2aba026740a0

[oracle@asm05] /home/oracle $

Mount new DG:

$ asmcmd mount FRA_QA

$ crs_stat -t                                                

Name           Type           Target    State     Host       

————————————————————

ora.DATA.dg    ora….up.type ONLINE    ONLINE    asm05      

ora.DATA2.dg   ora….up.type ONLINE    ONLINE    asm05      

ora.FRA.dg     ora….up.type OFFLINE   OFFLINE              

ora.FRA_QA.dg  ora….up.type ONLINE    ONLINE    asm05      

ora….ER.lsnr ora….er.type ONLINE    OFFLINE               

ora.asm        ora.asm.type   ONLINE    ONLINE    asm05      

ora.cssd       ora.cssd.type  ONLINE    ONLINE    asm05      

ora.diskmon    ora….on.type ONLINE    ONLINE    asm05      

ora.dlfa01.db  ora….se.type OFFLINE   OFFLINE               

ora.dlqa01.db  ora….se.type OFFLINE   OFFLINE              

ora.valqa02.db ora….se.type OFFLINE   OFFLINE              

[oracle@asm05] /home/oracle $

$

$ asmcmd lsdg

State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name

MOUNTED  EXTERN  N         512   4096  1048576     15342    11112                0           11112              0             N  DATA/

MOUNTED  EXTERN  N         512   4096  1048576     10228    10174                0           10174              0             N  DATA2/

MOUNTED  EXTERN  N         512   4096  1048576     15342    12322                0           12322              0             N  FRA_QA/

[oracle@asm05] /home/oracle $

$

Remove of DG:

$ srvctl modify database -d DLQA01 -a “DATA,FRA_QA”

[oracle@asm05] /home/oracle $

$ srvctl disable diskgroup -g FRA

[oracle@asm05] /home/oracle $

$ srvctl remove diskgroup -g FRA -f

[oracle@asm05] /home/oracle $

$ srvctl modify database -d DLQA01 -z

[oracle@asm05] /home/oracle $

$

Auto start new DG:

crsctl status resource ora.FRA_QA.dg -p |grep AUTO_START

AUTO_START=never

[oracle@asm05] /home/oracle $

$ crsctl modify resource ora.FRA_QA.dg -attr AUTO_START=always

[oracle@asm05] /home/oracle $

$ crsctl status resource ora.FRA_QA.dg -p |grep AUTO_START   

AUTO_START=always

Set new location for control file:

SQL> alter system set control_files=’+DATA/dlfa01/controlfile/current.260.758748837′,’+FRA_QA/dlfa01/controlfile/current.256.758748837′ scope=spfile;

alter system set db_recovery_file_dest=’+FRA_QA’;

SQL> show parameter control

NAME                                 TYPE        VALUE

———————————— ———– ——————————

control_file_record_keep_time        integer     7

control_files                        string      +DATA/dlfa01/controlfile/curre

                                                 nt.260.758748837, +FRA_QA/dlfa

                                                 01/controlfile/current.256.758

                                                 748837

control_management_pack_access       string      DIAGNOSTIC+TUNING

srvctl modify database -d DLFA01 -a “DATA,FRA_QA”

[oracle@asm05] /home/oracle $

sqlplus system/xxxx@DLFA01                                        

SQL*Plus: Release 11.2.0.1.0 Production on Mon Aug 15 13:31:04 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

SQL> quit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[oracle@asm05] /home/oracle $

$

Rebuild Online Redo logs:

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC

———- ———- ———- ———- ———- ———- —

STATUS           FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME

—————- ————- ——— ———— ———

         1          1          4   52428800        512          2 YES

INACTIVE                976201 11-AUG-11      1007552 13-AUG-11

         2          1          5   52428800        512          2 NO

CURRENT                1007552 13-AUG-11   2.8147E+14

         3          1          3   52428800        512          2 YES

INACTIVE                962934 09-AUG-11       976201 11-AUG-11

Re-create online redo logs:

SQL> alter database drop logfile group 1;

Database altered.

SQL> ALTER DATABASE ADD LOGFILE THREAD 1

  2  group 1

  3  (‘+DATA’,’+FRA_QA’) size 50M;

Database altered.

SQL>  select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME

———- ———- ———- ———- ———- ———- — —————- ————- ——— ———— ———

         1          1          0   52428800        512          2 YES UNUSED                       0                      0

         2          1          5   52428800        512          2 NO  CURRENT                1007552 13-AUG-11   2.8147E+14

         3          1          3   52428800        512          2 YES INACTIVE                962934 09-AUG-11       976201 11-AUG-11

SQL> select * from  v$logfile;

    GROUP# STATUS  TYPE

———- ——- ——-

MEMBER

——————————————————————————————————————————————————

IS_

         3         ONLINE

+DATA/dlfa01/onlinelog/group_3.263.758748847

NO

         3         ONLINE

+FRA/dlfa01/onlinelog/group_3.259.758748847

YES

    GROUP# STATUS  TYPE

———- ——- ——-

MEMBER

——————————————————————————————————————————————————

IS_

         2         ONLINE

+DATA/dlfa01/onlinelog/group_2.262.758748843

NO

         2         ONLINE

+FRA/dlfa01/onlinelog/group_2.258.758748845

    GROUP# STATUS  TYPE

———- ——- ——-

MEMBER

——————————————————————————————————————————————————

IS_

YES

         1         ONLINE

+DATA/dlfa01/onlinelog/group_1.261.759245639

NO

         1         ONLINE

    GROUP# STATUS  TYPE

———- ——- ——-

MEMBER

——————————————————————————————————————————————————

IS_

+FRA_QA/dlfa01/onlinelog/group_1.293.759245641

NO

6 rows selected.

SQL>

SQL> alter system switch logfile;

System altered.

SQL>  select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC

———- ———- ———- ———- ———- ———- —

STATUS           FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME

—————- ————- ——— ———— ———

         1          1          6   52428800        512          2 NO

CURRENT                1009892 15-AUG-11   2.8147E+14

         2          1          5   52428800        512          2 NO

ACTIVE                 1007552 13-AUG-11      1009892 15-AUG-11

         3          1          3   52428800        512          2 YES

INACTIVE                962934 09-AUG-11       976201 11-AUG-11

PL/SQL Procedure to compare dates

Reading Time: < 1 minute

Hello All,

I haven’t updated my blog in a while, so here is what i have been working on:

I was asked to put together pl/sql procedure which can compare the date and use the output to do something:

This Procedure takes two date input from user and compare if date is less then 1 day old(value can be adjusted according to business requirement).

CREATE OR REPLACE PROCEDURE TEMP1(sdate in varchar2, edate in varchar2)
IS

v_sdate DATE;
v_edate DATE;
–r_exception     EXCEPTION;

BEGIN
DBMS_OUTPUT.put_line ( ‘Process Start Time: ‘
||TO_CHAR (SYSDATE, ‘MM/DD/YYYY HH24:MI:SS’)
);
BEGIN
select to_date(sdate, ‘YYYY-MM-DD:HH24:MI’)
into v_sdate
from dual;

select to_date(edate, ‘YYYY-MM-DD:HH24:MI’)
into v_edate
from dual;
if (v_edate – v_sdate >2 )
–IF (SYSDATE – v_sdate > 60)
THEN
—  RAISE r_exception;
raise_application_error(-20001,’An error was encountered – Provide correct date’);
–dbms_output.put_line(‘BAD DATE PROVIDED’);
–RASIE_APPLICATION_ERROR(-2100, ‘DATE issue’);
End IF;

DBMS_OUTPUT.put_line (‘START DATE: ‘|| v_sdate);
DBMS_OUTPUT.put_line (v_edate);
end;
END;
/

Dropping and rebuilding dbconsole

Reading Time: 2 minutes
Steps to drop DB Console:

  • emca -deconfig dbcontrol db

    STARTED EMCA at May 12, 2009 1:44:07 AM
    EM Configuration Assistant, Version 10.2.0.1.0 Production
    Copyright (c) 2003, 2005, Oracle. All rights reserved.

    Enter the following information:
    Database SID: ora02

    Do you wish to continue? [yes(Y)/no(N)]: Y
    May 12, 2009 1:44:11 AM oracle.sysman.emcp.EMConfig perform
    INFO: This operation is being logged at /opt/local/oracle/product/10.2.0.4/cfgtoollogs/emca/ora02/emca_2009-05-12_01-44-07-AM.log.
    May 12, 2009 1:44:12 AM oracle.sysman.emcp.util.DBControlUtil stopOMS
    INFO: Stopping Database Control (this may take a while) …
    Enterprise Manager configuration completed successfully
    FINISHED EMCA at May 12, 2009 1:44:28 AM
    [oracle@dbrv2 bdump]$ /opt/local/oracle/product/admin/ora02/bdump->:dbrv2::[ora02]

 

Steps to create database dbconsole:

  • emca -config dbcontrol db

 
STARTED EMCA at May 12, 2009 1:46:05 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database SID: Database SID: ora02
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 ……………. /opt/local/oracle/product/10.2.0.4

Database hostname ……………. dbrv2
Listener port number ……………. 1521
Database SID ……………. ora02
Email address for notifications ……………
Outgoing Mail (SMTP) server for notifications ……………

—————————————————————–
Do you wish to continue? [yes(Y)/no(N)]: Y
May 12, 2009 1:46:26 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /opt/local/oracle/product/10.2.0.4/cfgtoollogs/emca/ora02/emca_2009-05-12_01-46-05-AM.log.
May 12, 2009 1:46:28 AM oracle.sysman.emcp.EMReposConfig updateReposVars
SEVERE: File/directory /opt/local/oracle/product/10.2.0.4/sysman/emdrep/config/repository.variables does not exist
May 12, 2009 1:46:36 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) …
May 12, 2009 1:46:43 AM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /opt/local/oracle/product/10.2.0.4/bin/emctl config emkey -repos
May 12, 2009 1:46:43 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
WARNING: Configuring EM-Key failed.
May 12, 2009 1:46:43 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
WARNING: Error securing Database control.
May 12, 2009 1:46:43 AM oracle.sysman.emcp.EMDBPostConfig setWarnMsg
INFO: Error securing Database Control, Database Control has been brought up in non-secure mode. To secure the Database Control execute the following command(s):

1) Set the environment variable ORACLE_SID to ora02
2) /opt/local/oracle/product/10.2.0.4/bin/emctl stop dbconsole
3) /opt/local/oracle/product/10.2.0.4/bin/emctl config emkey -repos -sysman_pwd <>
4) /opt/local/oracle/product/10.2.0.4/bin/emctl secure dbconsole -sysman_pwd <>
5) /opt/local/oracle/product/10.2.0.4/bin/emctl start dbconsole

To secure Em Key, run /opt/local/oracle/product/10.2.0.4/bin/emctl config emkey -remove_from_repos -sysman_pwd <>
May 12, 2009 1:46:43 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) …
May 12, 2009 1:48:28 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
May 12, 2009 1:48:28 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://dbrv2:1158/em <<<<<<<<<<<>
4) /opt/local/oracle/product/10.2.0.4/bin/emctl secure dbconsole -sysman_pwd <>
5) /opt/local/oracle/product/10.2.0.4/bin/emctl start dbconsole

To secure Em Key, run /opt/local/oracle/product/10.2.0.4/bin/emctl config emkey -remove_from_repos -sysman_pwd <>
[oracle@dbrv2 bdump]$ /opt/local/oracle/product/admin/ora02/bdump->:dbrv2::[ora02]
> emctl status dbconsole
TZ set to US/Central
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
http://dbrv2:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
——————————————————————
Logs are generated in directory /opt/local/oracle/product/10.2.0.1/dbrv2_ora02/sysman/log
[oracle@dbrv2 bdump]$ /opt/local/oracle/product/admin/ora02/bdump->:dbrv2::[ora02]

On another note, for Linux servers make sure that Listener is not listening on loop back address.

If you have listener is using loop back (lo0) address, then its possible that dbconsole show status of listener as down.