Installing OEM for second instance

本文详细记录了在Oracle 11.2.0.3环境下手动创建第二个数据库实例SOE60G的过程,并解决了配置Oracle Enterprise Manager (OEM)过程中遇到的问题,包括处理权限不足、缺少必要的表结构、配置监听器及设置密码文件等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

        一台机器运行着从Oracle11.2.0.3的安装程序里的默认的数据库。这个实例名字叫做o1123。


        然后我手动创建了第二个实例(通过swingbenchcrdb.shslob的测试)而不是通过数据库配置助手(或许这是个错误),然后我想访问OEM。第二个实例名字是SOE60G(一个60GB的swingbench数据集数据库)。


        首先试着启动dbconsole:


$ emctl start dbconsole
OC4J Configuration issue.
 /home/oracle/oracle1123/product/oc4j/j2ee/OC4J_DBConsole_perf234-target1.delphix.com_SOE60G 
#ff0000;">not found.
OK, missing file. EM wasn’t configured for this database, make sense. Let’s configure it

$ emca -config dbcontrol db -repos create
...
#ff0000;">SEVERE: Dbcontrol Repository already exists.  
Fix the error(s) and run EM Configuration Assistant again in standalone mode.
Looks like there is already a repository, so lets configure EM with out making the repository

# emca -config dbcontrol db
#ff0000;">WARNING: ORA-00942: table or view does not exist
SEVERE: The existing database you have specified has Grid Control repository. 
This operation is not supported.
Hmm, what table is missing? Put db in sql trace mode to see what SQL statement ran into the 942 error

sqlplus / as sysdba
alter database set sql_trace=true
exit
rerun and grep for 942 in trace files in user_dump_dest

cd /home/oracle/oracle1123/diag/rdbms/soe60g/SOE60G/trace
grep 942 *
this show a dozen or so files.
Open each one up and searched for 942 and found two distinct SQL queries:

SELECT ATTRIBUTE,SCOPE,NUMERIC_VALUE,CHAR_VALUE,DATE_VALUE FROM #ff0000;">SYSTEM.PRODUCT_PRIVS
WHERE (UPPER('SQL*Plus') LIKE UPPER(PRODUCT)) AND (USER LIKE USERID)

select count(*) from #ff0000;">sysman.mgmt_versions where status > 0 and component_mode
like 'SYSAUX' and component_name in ('DB','CORE')
The first table is from not having run $ORACLE_HOME/sqlplus/admin/pupbld.sql
Second is the problem emca was running into. Let’s look at sysman’s objects and see what’s there.

sqlplus sysman/sys
select object_name from user_objects;
-> no rows returned
OK, sysman looks empty , let’s drop it and recreated it

sqlplus / as sysdba
drop user sysman cascade;
drop user MGMT_VIEW cascade;
someone’s blog had suggested dropping the following but I didn’t

# drop role MGMT_USER;
# drop public synonym MGMT_TARGET_BLACKOUTS;
# drop public synonym SETEMVIEWUSERCONTEXT;
#                                                        host      port  SID
# $ORACLE_HOME/sysman/admin/emdrep/bin/RepManager antarctic 2483 sprod -action drop
# ./emca -repos create
rerun emca

$ emca -config dbcontrol db -repos create
....
Do you wish to continue? [yes(Y)/no(N)]: y
Apr 20, 2013 7:27:51 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at 
/home/oracle/oracle1123/cfgtoollogs/emca/SOE60G/emca_2013_04_20_07_27_38.log.
Apr 20, 2013 7:27:51 AM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl
#ff0000;">WARNING: ORA-01031: insufficient privileges
Apr 20, 2013 7:27:51 AM 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 SOE60G 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=.
6) /etc/hosts does not have correct entry for hostname.
Notice the ORA-01031. Hmm, I can connect as sqlplus / as sysdba but connecting as sysdba through the listener requires a password file.  Let’s see if password files are set up

sqlplus / as sysdba
show parameters remote_login_passwordfile
remote_login_passwordfile            string      EXCLUSIVE
that’s set correct, but is there a password file?

cd $ORACLE_HOME/dbs
ls orapw$ORACLE_SID
ls: cannot access orapwdSOE60G: No such file or directory
not there, let’s create it

orapwd FILE=orapw$ORACLE_SID ENTRIES=30
now emca works !

Now what URL to I use to access OEM for the second database?
It’s the same URL as the first database but with different port. We can find the ports for each database in the following file

cat $ORACLE_HOME/install/portlist.ini
Enterprise Manager Console HTTP Port (o1123) = 1158
Enterprise Manager Agent Port #ff0000;">(o1123) = 3938
Enterprise Manager Console HTTP Port (SOE60G) = 5500
Enterprise Manager Agent Port #ff0000;">(SOE60G) = 1830
Post script

        通过上述的步骤,当我能够在Chrome里访问OEM数据库页面时,一件奇怪的事情发生了,但是事还没完。进入OEM,首先要求我登录。我以system用户登录,我看见了数据库主页面,然后如果我点击性能标签,然后我得到提示要求我重新登录。我再次登录,回到数据库主页面。不管我点击哪个标签,我最终都在登录后回到数据库主页面。


        Firefox里,虽然我曾经登录,我可以进入任何一个标签,更神奇的是,它居然正常工作了!


        PS 当我运行emca时,我得到很多变量提示。不试这个,但是好像所有的参数都可以在命令行得到。


        参考

        http://dbataj.blogspot.com/2011/09/severe-dbcontrol-repository-already.html

 

        http://sheltong-appsdba.blogspot.com/2010/07/configuring-em-on-oracle-11g.html

 

        https://forums.oracle.com/forums/thread.jspa?threadID=1773883




	Had a machine running the default database from the Oracle 11.2.0.3 installer. This instance was called o1123.
I then created a second database by hand (with crdb.sh for swingbench and slob tests) instead of dbca (maybe that was a mistake) and then I wanted to acccess OEM. The second instance was called SOE60G ( a 60GB swingbench dataset database)

First tried to start up dbconsole:

$ emctl start dbconsole
OC4J Configuration issue.
 /home/oracle/oracle1123/product/oc4j/j2ee/OC4J_DBConsole_perf234-target1.delphix.com_SOE60G 
#ff0000;">not found.
OK, missing file. EM wasn’t configured for this database, make sense. Let’s configure it

$ emca -config dbcontrol db -repos create
...
#ff0000;">SEVERE: Dbcontrol Repository already exists.  
Fix the error(s) and run EM Configuration Assistant again in standalone mode.
Looks like there is already a repository, so lets configure EM with out making the repository

# emca -config dbcontrol db
#ff0000;">WARNING: ORA-00942: table or view does not exist
SEVERE: The existing database you have specified has Grid Control repository. 
This operation is not supported.
Hmm, what table is missing? Put db in sql trace mode to see what SQL statement ran into the 942 error

sqlplus / as sysdba
alter database set sql_trace=true
exit
rerun and grep for 942 in trace files in user_dump_dest

cd /home/oracle/oracle1123/diag/rdbms/soe60g/SOE60G/trace
grep 942 *
this show a dozen or so files.
Open each one up and searched for 942 and found two distinct SQL queries:

SELECT ATTRIBUTE,SCOPE,NUMERIC_VALUE,CHAR_VALUE,DATE_VALUE FROM #ff0000;">SYSTEM.PRODUCT_PRIVS
WHERE (UPPER('SQL*Plus') LIKE UPPER(PRODUCT)) AND (USER LIKE USERID)

select count(*) from #ff0000;">sysman.mgmt_versions where status > 0 and component_mode
like 'SYSAUX' and component_name in ('DB','CORE')
The first table is from not having run $ORACLE_HOME/sqlplus/admin/pupbld.sql
Second is the problem emca was running into. Let’s look at sysman’s objects and see what’s there.

sqlplus sysman/sys
select object_name from user_objects;
-> no rows returned
OK, sysman looks empty , let’s drop it and recreated it

sqlplus / as sysdba
drop user sysman cascade;
drop user MGMT_VIEW cascade;
someone’s blog had suggested dropping the following but I didn’t

# drop role MGMT_USER;
# drop public synonym MGMT_TARGET_BLACKOUTS;
# drop public synonym SETEMVIEWUSERCONTEXT;
#                                                        host      port  SID
# $ORACLE_HOME/sysman/admin/emdrep/bin/RepManager antarctic 2483 sprod -action drop
# ./emca -repos create
rerun emca

$ emca -config dbcontrol db -repos create
....
Do you wish to continue? [yes(Y)/no(N)]: y
Apr 20, 2013 7:27:51 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at 
/home/oracle/oracle1123/cfgtoollogs/emca/SOE60G/emca_2013_04_20_07_27_38.log.
Apr 20, 2013 7:27:51 AM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl
#ff0000;">WARNING: ORA-01031: insufficient privileges
Apr 20, 2013 7:27:51 AM 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 SOE60G 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=.
6) /etc/hosts does not have correct entry for hostname.
Notice the ORA-01031. Hmm, I can connect as sqlplus / as sysdba but connecting as sysdba through the listener requires a password file.  Let’s see if password files are set up

sqlplus / as sysdba
show parameters remote_login_passwordfile
remote_login_passwordfile            string      EXCLUSIVE
that’s set correct, but is there a password file?

cd $ORACLE_HOME/dbs
ls orapw$ORACLE_SID
ls: cannot access orapwdSOE60G: No such file or directory
not there, let’s create it

orapwd FILE=orapw$ORACLE_SID ENTRIES=30
now emca works !

Now what URL to I use to access OEM for the second database?
It’s the same URL as the first database but with different port. We can find the ports for each database in the following file

cat $ORACLE_HOME/install/portlist.ini
Enterprise Manager Console HTTP Port (o1123) = 1158
Enterprise Manager Agent Port #ff0000;">(o1123) = 3938
Enterprise Manager Console HTTP Port (SOE60G) = 5500
Enterprise Manager Agent Port #ff0000;">(SOE60G) = 1830
Post script

After the above steps, one of the bizarre things I ran into was being able to  access OEM database page in Chrome but nothing else. Coming into OEM, I’m first asked for a login. I login as system, I see the database home page, then if I click on the performance tab, then I get prompted for the login again. I then  login again, and I’m back at the database home page. No matter what tab I click, I end up back at the database home page after giving login credentials.
In Firefox, though once I login, I can go to any of the other tabs and it works!

 

PS when running emca above I was prompted for a number of variables.  didn’t try this, but looks like all the arguments can be given in the command line

emca -repos create -silent -ORACLE_HOSTNAME perf234-target1 -SID SOE60G 
-SERVICE_NAME SOE60G -ORACLE_HOME /home/oracle/oracle1123/product
 -SYS_PWD sys -DBSNMP_PWD sys -SYSMAN_PWD sys 
-HOST_USER oracle -HOST_USER_PWD  -PORT 1521
 

references

http://dbataj.blogspot.com/2011/09/severe-dbcontrol-repository-already.html

http://sheltong-appsdba.blogspot.com/2010/07/configuring-em-on-oracle-11g.html

https://forums.oracle.com/forums/thread.jspa?threadID=1773883


        http://www.oaktable.net/content/installing-oem-second-instance



katoonSina 优快云
@Wentasy 博文仅供参考,欢迎大家来访。如有错误之处,希望批评指正。原创博文如需转载请注明出处,谢谢 :) [优快云博客]
<think>好的,用户现在遇到了在安装Pillow以支持matplotlib时的问题。首先,我需要回想一下常见的安装问题和解决方法。用户之前已经问过如何正确安装matplotlib,所以可能他们在安装后发现缺少Pillow,或者运行时提示需要Pillow。 首先,用户可能已经尝试过安装Pillow但遇到了错误。常见的错误可能包括依赖项缺失、权限问题或者Python环境配置不当。我需要分步骤给出解决方案,确保覆盖常见问题点。 接下来,我应该考虑Ubuntu系统下的安装步骤。通常,除了使用pip安装Pillow,可能还需要安装一些系统依赖库,比如libjpeg-dev、zlib1g-dev等。用户可能没有安装这些库,导致Pillow编译失败。 然后,我需要检查用户是否正确使用了pip3和虚拟环境。有时候,用户可能在全局环境中安装,但项目使用的是虚拟环境,导致找不到包。或者权限问题导致安装失败,需要sudo权限。 另外,测试安装是否成功的方法也很重要。用户可能不知道如何验证Pillow是否正确安装,或者是否被matplotlib正确识别。提供一个简单的Python脚本测试导入和功能可以帮他们确认问题是否解决。 还要考虑用户可能遇到的错误信息,比如“JPEG support not available”,这时候需要安装对应的开发包。或者权限错误,需要使用--user选项或sudo。 最后,相关问题需要覆盖常见的后续疑问,比如验证安装、依赖问题、与其他库的冲突等。确保用户能一步步排查问题,并找到解决方法。 </think>安装Pillow时出现依赖问题时,可按以下步骤处理: ```bash # 安装系统依赖(Ubuntu) sudo apt-get install libjpeg-dev zlib1g-dev libpng-dev # 使用pip安装Pillow(推荐在虚拟环境中操作) pip install pillow # 或指定国内镜像加速安装 pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple ``` 验证安装: ```python from PIL import Image im = Image.new('RGB', (100, 100), color='red') im.show() # 应显示红色图片窗口 ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值