您的位置:首页 > 其它

修改SYSMAN的密码我忙活了一天(转)

2011-08-22 10:46 148 查看

修改SYSMAN的密码我忙活了一天(转)

2010/01/09 18:36 [Oracle ]






客户说修改修改了sysman的密码,EM不能用了,然后他重建EM又没成功。

大家知道sysman用户是dbconsole的owner.

如果单纯的修改sysman的密码,那么dbconsole就不能用了。

在数据库修改sysman的密码同时 必须用这个命令(emctl setpasswd dbconsole )去修改dbconsole的密码保持Enterprise Manager的密码和数据的密码一致。

客户修改了sysman的密码发现dbconsole不能用 于是就重建dbconsole,但是很不幸重建过程中出错了。

检查错误日志:

JVMDG304: Java core file written to /home/oracle/javacore1327168.1237815965.txt

JVMDG274: Dump Handler has Processed OutOfMemory.

JVMCI003

Exception in thread "main" java.lang.OutOfMemoryError

------------------------------------------修改java heap size---------------------------------------------------------------------------

这是一个java 内存溢出的错误。

首先检查java pool 有220M,这个应该足够了。

到网上找了把资料,发现很多给出的意见是修改java heap size .

修改启动文件的emca的 java heap size.

cd $ORACLE_HOME/bin

backup the file emca

cp emca $ORACLE_HOME/bin/emca.bak

vi emca

replace the line:

${JRE_JAVA} -DDISPLAY="${DISPLAY}" -DORACLE_HOME="${ORACLE_HOME}" -DTNS_ADMIN="${TNS_ADMIN}" oracle.sysman.emcp.EMConfigAssistant $*

with

${JRE_JAVA} -Xms128m -Xmx256m -DDISPLAY="${DISPLAY}" -DORACLE_HOME="${ORACLE_HOME}" -DTNS_ADMIN="${TNS_ADMIN}" oracle.sysman.emcp.EMConfigAssistant $*

---------------------------------------------------------彻底删除dbconsole---------------------------------------------------------------

如下的步骤是引用和参考metalink上一些重建em的docment.

Then rebuild EM as follow operations step by step.

首先要彻底删除以前的dbconsole,schema sysman 和mgmt_view,这个必须删除干净,不然重建会提示用户sysman已经建好,然后异常退出。

1. Drop and Recreate the DBControl:

+ To delete the dbconsole :

$ export ORACLE_SID=<SID of 10G db for which dbconsole has been configured>

$ cd $ORACLE_HOME/bin

$ emca -deconfig dbcontrol db -repos drop

At the end of this command, the following folders should be removed :

$ORACLE_HOME/<HOSTNAME_SID>

$ORACLE_HOME/oc4j/j2ee/<OC4J_DBConsole_HOSTNAME_SID>

If they are still present, please remove them manually before proceeding further.

+ Delete or move all the files under $ORACLE_HOME/cfgtoollogs/emca/<sid> directory.

+ Connect to the database as system(or a DBA user) user via sql*plus to drop

the repository schemas and objects :

- Drop the repository users -

SQL> drop user sysman cascade;

SQL> drop user mgmt_view cascade;

If the above emca command completed successfully, then these users would

have been dropped already.

- Drop the role mgmt_user :

SQL> drop role mgmt_user;

If the above emca command completed successfully, then this role would have

been dropped already.

- Drop all public synonyms on repository objects -

You can create a sql script to generate the drop statements and then

execute the script created -

SQL> set ver on

SQL> set echo off

SQL> set pages 999

SQL> set feed 0

SQL> set heading off

SQL> spool del_public_synonym_mgmt.sql

SQL> select 'Drop public synonym ' || synonym_name || ';' from dba_synonyms where synonym_name like 'MGMT%' OR synonym_

name like 'SMP_EMD%' OR synonym_name like 'SMP_MGMT%' OR synonym_name in ('SETEMVIEWUSERCONTEXT','DBMS_SHARED_POOL','EMD_MNTR' ,'ECM_UTIL');

SQL> spool off

Then execute the script del_public_synonym_mgmt.sql

- Exit sqlplus.

--------------------------------------------------------重建dbconsole-----------------------------------------------------------------------------

这一步是正式的重建

+ To re-create the dbconsole:

$ export ORACLE_SID=<SID of 10G db for which dbconsole has to be configured>

$ cd $ORACLE_HOME/bin

$ emca -config dbcontrol db -repos create

Enter the required details to configure the dbconsole.

但是执行遇到错误:

INFO: Creating the EM repository (this may take a while) ...

Mar 27, 2009 10:05:36 AM oracle.sysman.emcp.EMReposConfig createRepository

CONFIG: ORA-28003: password verification for the specified password failed

ORA-20003: Password should contain at least one \

检查详细的日志发现创建用户MGMT_VIEW 时候发生的这个错误,

Create MGMT_VIEW user..

DECLARE

*

ERROR at line 1:

ORA-28003: password verification for the specified password failed

ORA-20003: Password should contain at least one digit, one character and one special char

~

密码不符合校验的要求,显然是调用了profile来限制密码的复杂性。

SELECT * FROM dba_profiles WHERE profile = 'DEFAULT' AND resource_type = 'PASSWORD';

--------------- ------------------------------ -------- --------------------

DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD 5

DEFAULT PASSWORD_LIFE_TIME PASSWORD 90

DEFAULT PASSWORD_REUSE_TIME PASSWORD 1800

DEFAULT PASSWORD_REUSE_MAX PASSWORD 12

DEFAULT PASSWORD_VERIFY_FUNCTION PASSWORD VERIFY_FUNCTION

DEFAULT PASSWORD_LOCK_TIME PASSWORD .0006

DEFAULT PASSWORD_GRACE_TIME PASSWORD 10

显然创建用户MGMT_VIEW 是创建dbconsole自动创建的,所以密码也是oracle来生成。(除非能找出建MGMT_VIEW的脚本然后修改它的创建密码)

------------------------------------------------------------禁用和启用passowrd verify function---------------------------------

所以只能暂时禁用下 PASSWORD_VERIFY_FUNCTION .

alter profile DEFAULT limit password_verify_function null;

然后重新创建em,等EM创建完再改回去。

alter profile default limit PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION;

这次创建成功。

Mar 27, 2009 12:35:53 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration

INFO: >>>>>>>>>>> The Database Control URL is http://hostname:5500/em <<<<<<<<<<<

Enterprise Manager configuration completed successfully

FINISHED EMCA at Mar 27, 2009 12:35:53 PM

然后告诉客户说EM创建完成了

--------------------------------------------------------------修改dbconsole的端口----------------------------------------------------

但是客户说他以前用的端口是1158,现在端口变成了5500。说他的防火墙做了限制的,不能用5500.要改成1158.

没办法又只用去修改端口:

emca -reconfig ports -dbcontrol_http_port 1158

Enter the following information:

Database SID:

这个比较简单输入sid回车就修改完成。

(如果修改agent 就用emca -reconfig ports -agent_port 3940 )

检查端口修改过来了

emctl status dbconsole

Oracle Enterprise Manager 10g Database Control Release 10.2.0.3.0

Copyright (c) 1996, 2006 Oracle Corporation. All rights reserved.
http://hostname:1158/em/console/aboutApplication
然后告诉客户端口也改好了,叫他测试下。客户测试说没问题了可以用了。

搞了一天总算大工告成。

总结:重建dbconsole不是很难的活,运气好一条命令输完不超过10分钟就大功告成。

不过我这次蛮背的碰到问题不断,所以做完,干脆写个文档记录下。免得下次碰到的时候有据可查。

不用再goole,metalink重新找资料,这样会节省很多时间。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: