EM 重建 報錯 解決3則


---===emca 問題描述;

-=錯誤1;
$ emctl status dbconsole
OC4J Configuration issue. /u01/app/oracle/product/11.2.0/oc4j/j2ee/OC4J_DBConsole_HOSTNAME_SID not found.
    >>> 解決;由於hostname更改,重建EM解決。

-=錯誤2;
$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Apr 27, 2015 7:18:10 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: SID
Listener port number: 1521
Password for SYS user:  
Password for SYSMAN user:  

----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Apr 27, 2015 7:18:21 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/SID/emca_2015_04_27_19_18_10.log.
Apr 27, 2015 7:18:22 PM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl
WARNING: ORA-12541: TNS:no listener     >>>沒有監聽

Apr 27, 2015 7:18:22 PM oracle.sysman.emcp.EMConfig perform
SEVERE:

Database connection through listener failed. Fix the error and run EM Configuration Assistant again.

Some of the possible reasons may be:

1) Listener port 1521 provided is incorrect. Provide the correct port.
2) Listener is not up. Start the Listener.
3) Database service SID is not registered with listener. Register the database service.
4) Listener is up on physical host and ORACLE_HOSTNAME environment variable is set to virtual host. Unset ORACLE_HOSTNAME environment variable.
5) Listener is up on virtual host. Set environment variable ORACLE_HOSTNAME=<virtual host>.
6) /etc/hosts does not have correct entry for hostname.

Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/SID/emca_2015_04_27_19_18_10.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/SID/emca_2015_04_27_19_18_10.log for more details.

    >>> TNS:no listener ;
    >>> 解決;由於手工編寫的listener.ora原因導致此報錯。使用NETCA 重建監聽
    

NETCA

$ cat tnsnames.ora
LISTENER_MIDS =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))


MIDS =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = mids)
    )
  )



LISTENER_PSS =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))


PSS =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PSS)
    )
  )
 
$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Mon Apr 27 19:35:11 2015

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter listener

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
listener_networks                    string
local_listener                       string      LISTENER_PSS
remote_listener                      string



$
$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_MIDS =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))


MIDS =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = mids)
    )
  )



LISTENER_PSS =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))


PSS =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PSS)
    )
  )
$








-=錯誤3;
$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Apr 27, 2015 8:18:08 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: crds
Listener port number: 1521
Password for SYS user:  
Password for SYSMAN user:  

----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Apr 27, 2015 8:18:24 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/crds/emca_2015_04_27_20_18_07.log.
Apr 27, 2015 8:18:24 PM oracle.sysman.emcp.EMConfig perform
SEVERE:  Invalid Hostname ppaya_pst. Hostname should not contain underscore _ in it.
Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/crds/emca_2015_04_27_20_18_07.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/crds/emca_2015_04_27_20_18_07.log for more details.    
    
    >>> 原因;/etc/hosts 中 hostname的對應條目有問題
$ hostname
ppaya

問題/etc/hosts
10.22.18.177    ppaya_pst       ppaya
10.22.18.178    ppayb_pst       ppayb

修改成如下;
10.22.18.177    ppaya   ppaya_pst
10.22.18.178    ppayb   ppayb_pst

    >>> 分析; EM在讀取/etc/hosts時,讀取第一個名字。

-=錯誤3
$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Apr 27, 2015 9:28:40 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: cifs
Listener port number: 1521
Password for SYS user:  
Password for SYSMAN user:  

----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Apr 27, 2015 9:28:53 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/cifs/emca_2015_04_27_21_28_40.log.
Apr 27, 2015 9:28:53 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed. Some of the possible reasons may be:
 1) EM is configured with different hostname then physical host. Set environment variable ORACLE_HOSTNAME=<hostname> and re-run EMCA script
 2) ORACLE_HOSTNAME is set. Unset it and re-run EMCA script
Apr 27, 2015 9:28:53 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Apr 27, 2015 9:28:54 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /u01/app/oracle/product/11.2.0/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=pecifa)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=cifs))) -repos_user SYSMAN -action drop -verbose -output_file /u01/app/oracle/cfgtoollogs/emca/cifs/emca_repos_drop_2015_04_27_21_28_53.log
Apr 27, 2015 9:28:54 PM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error dropping the repository
Apr 27, 2015 9:28:54 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/cifs/emca_repos_drop_<date>.log for more details.
Apr 27, 2015 9:28:54 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Error dropping the repository
Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/cifs/emca_2015_04_27_21_28_40.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/cifs/emca_2015_04_27_21_28_40.log for more details.

# cat /u01/app/oracle/cfgtoollogs/emca/cifs/emca_repos_drop_2015_04_27_21_28_53.log
[27-04-2015 21:28:53] Enter SYS user's password :
[27-04-2015 21:28:53]
[27-04-2015 21:28:53] Getting temporary tablespace from database...
[27-04-2015 21:28:54] Could not connect to SYS/(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=pecifa)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=cifs))): ORA-01017: invalid username/password; logon denied (DBD ERROR: OCISessionBegin)

    >>>> 解決:重設sys密碼、remote_login_passwordfile=EXCLUSIVE 、檢查$ORACLE_HOME/dbs 下有無orapwcifs。
                最後發現 orapwcifs 沒有,重建解決。





--== 正確創建的過程
$ emca -config dbcontrol db -repos create

STARTED EMCA at Apr 27, 2015 7:04:00 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: pss
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0 ]:
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 ................ /u01/app/oracle/product/11.2.0

Local hostname ................ ppsdba
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0
Listener port number ................ 1521
Database SID ................ pss
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Apr 27, 2015 7:04:15 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/pss/emca_2015_04_27_19_04_00.log.
Apr 27, 2015 7:04:16 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Apr 27, 2015 7:07:23 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Apr 27, 2015 7:07:25 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Apr 27, 2015 7:08:30 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Apr 27, 2015 7:08:32 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Apr 27, 2015 7:08:39 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Apr 27, 2015 7:08:39 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Apr 27, 2015 7:08:54 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Apr 27, 2015 7:08:54 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://ppsdba:1158/em <<<<<<<<<<<
Apr 27, 2015 7:08:57 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0/ppsdba_pss/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Apr 27, 2015 7:08:57 PM
$



--==正確刪除過程
$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Apr 27, 2015 8:19:58 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: crds
Listener port number: 1521
Password for SYS user:  
Password for SYSMAN user:  

----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Apr 27, 2015 8:20:07 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/crds/emca_2015_04_27_20_19_58.log.
Apr 27, 2015 8:20:08 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed. Some of the possible reasons may be:
 1) EM is configured with different hostname then physical host. Set environment variable ORACLE_HOSTNAME=<hostname> and re-run EMCA script
 2) ORACLE_HOSTNAME is set. Unset it and re-run EMCA script
Apr 27, 2015 8:20:08 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Apr 27, 2015 8:21:03 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Apr 27, 2015 8:21:03 PM
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章