1.删除档案库

  1. $
  2. [oracle@centos6 admin]$ emca -repos drop
  3. STARTED EMCA at Mar 17, 2021 11:20:59 AM
  4. EM Configuration Assistant, Version 11.2.0.3.0 Production
  5. Copyright (c) 2003, 2011, Oracle. All rights reserved.
  6. Enter the following information:
  7. Database SID: orcl
  8. Listener port number: 1521
  9. Password for SYS user:
  10. Password for SYSMAN user:
  11. ----------------------------------------------------------------------
  12. WARNING : While repository is dropped the database will be put in quiesce mode.
  13. ----------------------------------------------------------------------
  14. Do you wish to continue? [yes(Y)/no(N)]: y
  15. Mar 17, 2021 11:21:15 AM oracle.sysman.emcp.EMConfig perform
  16. INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2021_03_17_11_20_59.log.
  17. Mar 17, 2021 11:21:16 AM oracle.sysman.emcp.EMReposConfig invoke
  18. INFO: Dropping the EM repository (this may take a while) ...

2.删除em

  1. [oracle@centos6 admin]$ emca -deconfig dbcontrol db -repos drop
  2. STARTED EMCA at Mar 17, 2021 11:24:49 AM
  3. EM Configuration Assistant, Version 11.2.0.3.0 Production
  4. Copyright (c) 2003, 2011, Oracle. All rights reserved.
  5. Enter the following information:
  6. Database SID: orcl
  7. Listener port number: 1521
  8. Password for SYS user:
  9. Password for SYSMAN user:
  10. ----------------------------------------------------------------------
  11. WARNING : While repository is dropped the database will be put in quiesce mode.
  12. ----------------------------------------------------------------------
  13. Do you wish to continue? [yes(Y)/no(N)]: y
  14. Mar 17, 2021 11:25:05 AM oracle.sysman.emcp.EMConfig perform
  15. INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2021_03_17_11_24_48.log.
  16. Mar 17, 2021 11:25:05 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly
  17. WARNING: ORA-01017: invalid username/password; logon denied
  18. Mar 17, 2021 11:25:05 AM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl
  19. WARNING: Error initializing SQL connection. SQL operations cannot be performed
  20. Mar 17, 2021 11:25:05 AM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
  21. WARNING: EM is not configured for this database. No EM-specific actions can be performed. Some of the possible reasons may be:
  22. 1) EM is configured with different hostname then physical host. Set environment variable ORACLE_HOSTNAME=<hostname> and re-run EMCA script
  23. 2) ORACLE_HOSTNAME is set. Unset it and re-run EMCA script
  24. Mar 17, 2021 11:25:05 AM oracle.sysman.emcp.EMReposConfig invoke
  25. INFO: Dropping the EM repository (this may take a while) ...
  26. Mar 17, 2021 11:25:06 AM oracle.sysman.emcp.EMReposConfig invoke
  27. INFO: Repository successfully dropped
  28. Enterprise Manager configuration completed successfully
  29. FINISHED EMCA at Mar 17, 2021 11:25:06 AM

3.创建em

或者直接执行 emca -config dbcontrol db -repos recreate

  1. [oracle@centos6 admin]$ emca -config dbcontrol db -repos create
  2. STARTED EMCA at Mar 17, 2021 11:25:49 AM
  3. EM Configuration Assistant, Version 11.2.0.3.0 Production
  4. Copyright (c) 2003, 2011, Oracle. All rights reserved.
  5. Enter the following information:
  6. Database SID: orcl
  7. Listener port number: 1521
  8. Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/dbhome_1 ]:
  9. Password for SYS user:
  10. Password for DBSNMP user:
  11. Password for SYSMAN user:
  12. Email address for notifications (optional):
  13. Outgoing Mail (SMTP) server for notifications (optional):
  14. -----------------------------------------------------------------
  15. You have specified the following settings
  16. Database ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/dbhome_1
  17. Local hostname ................ centos6
  18. Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/dbhome_1
  19. Listener port number ................ 1521
  20. Database SID ................ orcl
  21. Email address for notifications ...............
  22. Outgoing Mail (SMTP) server for notifications ...............
  23. -----------------------------------------------------------------
  24. Do you wish to continue? [yes(Y)/no(N)]: y
  25. Mar 17, 2021 11:26:13 AM oracle.sysman.emcp.EMConfig perform
  26. INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2021_03_17_11_25_49.log.
  27. Mar 17, 2021 11:26:14 AM oracle.sysman.emcp.EMReposConfig createRepository
  28. INFO: Creating the EM repository (this may take a while) ...