ablog

不器用で落着きのない技術者のメモ

Error securing Database Control...

dbca でデータベース作成時に[Configure the Database with Enterprise Manager]を選択すると、以下のメッセージが表示される。

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 orcl 
 2) /opt/app/oracle/product/10.2.0.1/db/bin/emctl stop dbconsole 
 3) /opt/app/oracle/product/10.2.0.1/db/bin/emctl config emkey -repos 
    -sysman_pwd < Password for SYSMAN user >  
 4) /opt/app/oracle/product/10.2.0.1/db/bin/emctl secure dbconsole 
    -sysman_pwd < Password for SYSMAN user >  
 5) /opt/app/oracle/product/10.2.0.1/db/bin/emctl start dbconsole 
 
 To secure Em Key, run /opt/app/oracle/product/10.2.0.1/db/bin/emctl config emkey 
 -remove_from_repos -sysman_pwd < Password for SYSMAN user >

ログを見てみると。。。

$ less /export/home/oracle/product/10.2.0/db_1/cfgtoollogs/emca/orcl/emca_2008-12-24_06-22-58-PM.log
CONFIG: Starting execution: /export/home/oracle/product/10.2.0/db_1/bin/emctl config emkey -repos
Dec 24, 2008 6:23:15 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: Exit value of 1
Dec 24, 2008 6:23:15 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
Please enter repository password:

Invalid Password
caught Exception java.sql.SQLException: Io exception: The Network Adapter could not establ
ish the connection

Dec 24, 2008 6:23:15 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: stty: : ???????????f?o?C?X???A?h???X?????????????B
stty: : ???????????f?o?C?X???A?h???X?????????????B

Dec 24, 2008 6:23:15 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /export/home/oracle/product/10.2.0/db_1/bin/emctl config emkey -repos

リスナーが起動していないから失敗している気がする。。。

$ lsnrctl stop
$ emctl config emkey -repos
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
Please enter repository password:

Invalid Password
caught Exception java.sql.SQLException: Io exception: The Network Adapter could not
 establish the connection
$ lsnrctl start
$ emctl config emkey -repos
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
Please enter repository password:

The Em Key has been configured successfully.

やっぱりそうだった。