Centos7下Oracle11g数据库 遇到em无法开启

问题BUG:

   在Centos7下安装Oracle11g数据库时候,会遇到em的bug,导致数据库安装完成后,em无法启动。
image.png

1、根据官方解释,在Centos7下安装Oracle11g的时候,em开启会遇到bug,必须打补丁后才能正常开启em服务。

在oracle官网下载补丁包文件:p19692824_112040_Linux-x86-64.zip

1.1、上传补丁包,并解压:
[oracle@oracle-test ~]$ll
total 44
drwxr-xr-x 5 oracle dba         81 Dec  1  2014 19692824
drwxr-xr-x 7 oracle oinstall   136 Aug 27  2013 database
-rw-r--r-- 1 oracle dba      44600 Jan 11 15:54 p19692824_112040_Linux-x86-64.zip
[oracle@oracle-test ~]$unzip p19692824_112040_Linux-x86-64.zip
1.2、进入解压的p开头的补丁目录中,并用opatch命令执行补丁升级操作:
[oracle@oracle-test ~]$cd 19692824/
[oracle@oracle-test ~/19692824]$
[oracle@oracle-test ~/19692824]$ /oracle/product/11.2.0/db_1/OPatch/opatch   apply
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation.  All rights reserved.


Oracle Home       : /oracle/product/11.2.0/db_1
Central Inventory : /oracle/oraInventory
  from           : /oracle/product/11.2.0/db_1/oraInst.loc
OPatch version    : 11.2.0.3.4
OUI version       : 11.2.0.4.0
Log file location : /oracle/product/11.2.0/db_1/cfgtoollogs/opatch/19692824_Jan_12_2021_10_29_43/apply2021-01-12_10-29-43AM_1.log

Applying interim patch '19692824' to OH '/oracle/product/11.2.0/db_1'
Verifying environment and performing prerequisite checks...

The following patch(es) are already installed in the Oracle Home.
[19692824]
Please roll back the existing identical patch(es) first.

OPatch system modification phase did not start:
Log file location: /oracle/product/11.2.0/db_1/cfgtoollogs/opatch/19692824_Jan_12_2021_10_29_43/apply2021-01-12_10-29-43AM_1.log

OPatch stopped on request.

2、删除之前安装过程中的无效em:

2.1 删除数据库中无效的em数据:
[oracle@oracle-test ~]$sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 11 16:15:55 2021

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 4092055552 bytes
Fixed Size                  2259640 bytes
Variable Size            1291846984 bytes
Database Buffers         2785017856 bytes
Redo Buffers               12931072 bytes
Database mounted.
Database opened.
SQL> DROP public synonym SETEMVIEWUSERCONTEXT;

Synonym dropped.

SQL> DROP PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;

Synonym dropped.

SQL> drop role MGMT_USER;

Role dropped.

SQL> DROP USER MGMT_VIEW CASCADE;

User dropped.

SQL> DROP USER SYSMAN CASCADE;

User dropped.

SQL>exit
2.2 删除em(末尾显示successfully dropped代表删除成功,里面的WARNING不用管):
[oracle@oracle-test ~]$emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Jan 11, 2021 4:23:34 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: orcl
Listener port number: 1521
Password for SYS user:
Password for SYSMAN 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
Jan 11, 2021 4:23:56 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/cfgtoollogs/emca/orcl/emca_2021_01_11_16_23_33.log.
Jan 11, 2021 4:23:57 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly
WARNING: ORA-01017: invalid username/password; logon denied

Jan 11, 2021 4:23:57 PM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl
WARNING: Error initializing SQL connection. SQL operations cannot be performed
Jan 11, 2021 4:23:57 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
Jan 11, 2021 4:23:57 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Jan 11, 2021 4:24:06 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jan 11, 2021 4:24:07 PM

备注:上面出现WARNING: ORA-01017: invalid username/password; logon denied错误,这是因为目前没有em库导致,先不用去管,新建em即可。

2.3 重新创建em:
[oracle@oracle-test ~]$emca -config dbcontrol db -repos create

STARTED EMCA at Jan 11, 2021 4:24:56 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: orcl
Listener port number: 1521
Listener ORACLE_HOME [ /oracle/product/11.2.0/db_1 ]:
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 ................ /oracle/product/11.2.0/db_1

Local hostname ................ oracle-test
Listener ORACLE_HOME ................ /oracle/product/11.2.0/db_1
Listener port number ................ 1521
Database SID ................ orcl
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Jan 11, 2021 4:25:32 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/cfgtoollogs/emca/orcl/emca_2021_01_11_16_24_56.log.
Jan 11, 2021 4:25:34 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jan 11, 2021 4:31:00 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Jan 11, 2021 4:31:05 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Jan 11, 2021 4:32:13 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Jan 11, 2021 4:32:19 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Jan 11, 2021 4:32:30 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Jan 11, 2021 4:32:30 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jan 11, 2021 4:32:57 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jan 11, 2021 4:32:57 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://oracle-test:1158/em <<<<<<<<<<<
Jan 11, 2021 4:33:00 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: /oracle/product/11.2.0/db_1/oracle-test_orcl/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 Jan 11, 2021 4:33:00 PM

注意:在新建em的时候不能报错,报错会导致em无法启动。
2.4 em新建完成后,开启em服务:
[oracle@oracle-test ~]$emctl start dbconsole
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "AMERICAN_AMERICA.ZHS16GBK"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
https://oracle-test:1158/em/console/aboutApplication
 - An instance of Oracle Enterprise Manager 11g Database Control is already running.

[oracle@oracle-test ~]$emctl status dbconsole
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "AMERICAN_AMERICA.ZHS16GBK"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
https://oracle-test:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running.
------------------------------------------------------------------
Logs are generated in directory /oracle/product/11.2.0/db_1/oracle-test_orcl/sysman/log

备注:里面的语言报警先不用管,只要em显示启动就可以进行访问。
2.5 访问em服务:

URL:https://192.168.99.238:1158/em/

image.png

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 212,686评论 6 492
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,668评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 158,160评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,736评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,847评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,043评论 1 291
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,129评论 3 410
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,872评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,318评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,645评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,777评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,470评论 4 333
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,126评论 3 317
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,861评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,095评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,589评论 2 362
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,687评论 2 351

推荐阅读更多精彩内容