由于LINUX上的ORACLE软件和数据已经安装好了,现在要更改机器名,即将原机器名
LINUX10 更改为
LINUX15,特地将相关的步骤记录下来。
查看服务器版本信息
上面监听文件中是配置的IP地址,所以不需要调整,直接启动监听即可
由于我没有配置本地服务名,所以没有
tnsnames.ora 文件,如果有该文件,也需要进行调整(
将原主机名更改成新的主机名,如果是配置的IP地址,就不需要调整
)
提示文件找不到,此时要更改两个文件夹的名称
将文件夹 LINUX10_orcl(机器名+数据库名) 重命名为 LINUX15_orcl
重命名文件夹
OC4J_DBConsole_LINUX10_orcl 为
OC4J_DBConsole_LINUX15_orcl
查看
/u01/app/oracle/product/11
.
2
.
3/oracle/LINUX15_orcl/sysman/log 下面的跟踪日志文件
看到em还是默认是以前的机器名,看来要重新配置em了
首先,删除EM资料库
资料库删除成功。
其次,创建EM资料库
查
看EM是否启动
现在EM也已经配置好了,可以通过页面访问了。
查看服务器版本信息
- [oracle@LINUX15 ~]$ lsb_release -a
- LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
- Distributor ID: OracleServer
- Description: Oracle Linux Server release 6.5
- Release: 6.5
- Codename: n/a
修改hosts文件
- -- 将hosts 文件中本地IP 对应的 LINUX10 更改成 LINUX15
- [oracle@LINUX10 ~]$ vi /etc/hosts
-
- [oracle@LINUX15 ~]$ more /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.15 LINUX15
修改network
-
- -- 将network 文件中本地IP 对应的 LINUX10 更改成 LINUX15
- [root@LINUX10 ~]# vi /etc/sysconfig/network
-
- [oracle@LINUX15 ~]$ more /etc/sysconfig/network
- NETWORKING=yes
- HOSTNAME=LINUX15
查看监听配置文件及本地服务名文件
如果监听配置文件中是用的主机名,就需要将原主机名更改成新的主机名,如果是配置的IP地址,就不需要调整
- [oracle@LINUX15 j2ee]$ cd /u01/app/oracle/product/11.2.3/oracle/network/admin
- [oracle@LINUX15 admin]$ ls
- listener.ora samples shrept.lst
- [oracle@LINUX15 admin]$ more listener.ora
- # listener.ora Network Configuration File: /u01/app/oracle/product/11.2.3/oracle/network/admin/listener.ora
- # Generated by Oracle configuration tools.
-
- SID_LIST_LISTENER =
- (SID_LIST =
- (SID_DESC =
- (GLOBAL_DBNAME = orcl)
- (ORACLE_HOME = /u01/app/oracle/product/11.2.3/oracle)
- (SID_NAME = orcl)
- )
- )
-
- LISTENER =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.×××.×××)(PORT = 1521))
- )
-
- ADR_BASE_LISTENER = /u01/app/oracle
- [oracle@LINUX15 ~]$ lsnrctl start
-
- LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 07-MAR-2015 22:32:48
-
- Copyright (c) 1991, 2011, Oracle. All rights reserved.
-
- Starting /u01/app/oracle/product/11.2.3/oracle/bin/tnslsnr: please wait...
-
- TNSLSNR for Linux: Version 11.2.0.3.0 - Production
- System parameter file is /u01/app/oracle/product/11.2.3/oracle/network/admin/listener.ora
- Log messages written to /u01/app/oracle/diag/tnslsnr/LINUX15/listener/alert/log.xml
- Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.15)(PORT=1521)))
-
- Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.15)(PORT=1521)))
- STATUS of the LISTENER
- ------------------------
- Alias LISTENER
- Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
- Start Date 07-MAR-2015 22:32:49
- Uptime 0 days 0 hr. 0 min. 0 sec
- Trace Level off
- Security ON: Local OS Authentication
- SNMP OFF
- Listener Parameter File /u01/app/oracle/product/11.2.3/oracle/network/admin/listener.ora
- Listener Log File /u01/app/oracle/diag/tnslsnr/LINUX15/listener/alert/log.xml
- Listening Endpoints Summary...
- (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.15)(PORT=1521)))
- Services Summary...
- Service "orcl" has 1 instance(s).
- Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
- The command completed successfully
启动数据库
- [oracle@LINUX15 ~]$ sqlplus / as sysdba
-
- SQL*Plus: Release 11.2.0.3.0 Production on Sat Mar 7 22:32:59 2015
-
- Copyright (c) 1982, 2011, Oracle. All rights reserved.
-
- Connected to an idle instance.
-
- SQL> startup
- ORACLE instance started.
-
- Total System Global Area 939495424 bytes
- Fixed Size 2233960 bytes
- Variable Size 629148056 bytes
- Database Buffers 301989888 bytes
- Redo Buffers 6123520 bytes
- Database mounted.
- Database opened.
数据库可以正常启动
启动EM报错处理
- [oracle@LINUX15 ~]$ emctl status dbconsole
- OC4J Configuration issue. /u01/app/oracle/product/11.2.3/oracle/oc4j/j2ee/OC4J_DBConsole_LINUX15_orcl not found.
- [oracle@LINUX15 ~]$ cd $ORACLE_HOME
- [oracle@LINUX15 oracle]$ ll
- total 312
- ......
- ......
- drwxr-xr-x. 4 oracle oinstall 12288 Feb 15 22:57 lib
- drwxr-----. 3 oracle oinstall 4096 Mar 7 17:04 LINUX10_orcl
- drwxr-xr-x. 5 oracle oinstall 4096 Mar 7 22:32 log
- ......
- ......
- [oracle@LINUX15 oracle]$ mv LINUX10_orcl LINUX15_orcl
- [oracle@LINUX15 j2ee]$ pwd
- /u01/app/oracle/product/11.2.3/oracle/oc4j/j2ee
- [oracle@LINUX15 j2ee]$ ll
- total 32
- -rw-r--r--. 1 oracle oinstall 1000 Feb 15 22:55 deploy_db_wf.ini
- drwxr-xr-x. 14 oracle oinstall 4096 Feb 15 22:53 home
- drwxr-xr-x. 3 oracle oinstall 4096 Feb 15 22:52 oc4j_applications
- drwxr-x---. 6 oracle oinstall 4096 Feb 15 22:52 OC4J_DBConsole
- drwxr-x---. 10 oracle oinstall 4096 Feb 16 00:01 OC4J_DBConsole_LINUX10_orcl
- drwxr-xr-x. 5 oracle oinstall 4096 Feb 15 22:52 OC4J_Workflow_Component_Container
- drwxr-xr-x. 5 oracle oinstall 4096 Feb 15 22:52 OC4J_Workflow_Management_Container
- drwxr-xr-x. 2 oracle oinstall 4096 Feb 15 22:53 utilities
- [oracle@LINUX15 j2ee]$
- [oracle@LINUX15 j2ee]$ mv OC4J_DBConsole_LINUX10_orcl OC4J_DBConsole_LINUX15_orcl
再次启动EM还是报错处理
- [oracle@LINUX15 j2ee]$ emctl start dbconsole
- Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
- Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
- https://LINUX10:1158/em/console/aboutApplication
- Starting Oracle Enterprise Manager 11g Database Control ....................................... failed.
- ------------------------------------------------------------------
- Logs are generated in directory /u01/app/oracle/product/11.2.3/oracle/LINUX15_orcl/sysman/log
- [oracle@LINUX15 j2ee]$ cd /u01/app/oracle/product/11.2.3/oracle/LINUX15_orcl/sysman/log
-
- [oracle@LINUX15 log]$ tail -10 emdctl.trc
- 2015-03-07 23:26:43,128 Thread-3461998336 ERROR http: nmehl_connect_internal: failed to get host info. Could not resolve name
2015-03-07 23:26:55,169 Thread-686225152 ERROR http: nmehl_connect_internal: failed to get host info. Could not resolve name
2015-03-07 23:27:01,293 Thread-2620741376 ERROR http: nmehl_connect_internal: failed to get host info. Could not resolve name
2015-03-07 23:27:01,398 Thread-2324297472 ERROR http: nmehl_connect_internal: failed to get host info. Could not resolve name
2015-03-07 23:27:01,398 Thread-2324297472 ERROR main: nmectla_agentctl: Error connecting to https://LINUX10:3938/emd/main. Returning status code 1
2015-03-07 23:27:07,423 Thread-1574823680 ERROR http: nmehl_connect_internal: failed to get host info. Could not resolve name
2015-03-07 23:27:19,460 Thread-316806912 ERROR http: nmehl_connect_internal: failed to get host info. Could not resolve name
2015-03-07 23:27:31,495 Thread-1615763200 ERROR http: nmehl_connect_internal: failed to get host info. Could not resolve name
2015-03-07 23:27:31,559 Thread-3334194944 ERROR http: nmehl_connect_internal: failed to get host info. Could not resolve name
2015-03-07 23:27:31,559 Thread-3334194944 ERROR main: nmectla_agentctl: Error connecting to https://LINUX10:3938/emd/main. Returning status code 1
重新配置EM
重新配置EM可以参考网址 http://blog.itpub.net/30150152/viewspace-1452052/
重新配置EM可以参考网址 http://blog.itpub.net/30150152/viewspace-1452052/
首先,删除EM资料库
- [oracle@LINUX15 log]$ emca -repos drop
-
- STARTED EMCA at Mar 7, 2015 11:40:53 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:
-
- ----------------------------------------------------------------------
- WARNING : While repository is dropped the database will be put in quiesce mode.
- ----------------------------------------------------------------------
- Do you wish to continue? [yes(Y)/no(N)]: Y
- Mar 7, 2015 11:41:32 PM oracle.sysman.emcp.EMConfig perform
- INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2015_03_07_23_40_52.log.
- Mar 7, 2015 11:41:34 PM oracle.sysman.emcp.EMReposConfig invoke
- INFO: Dropping the EM repository (this may take a while) ...
- Mar 7, 2015 11:46:50 PM oracle.sysman.emcp.EMReposConfig invoke
- INFO: Repository successfully dropped
- Enterprise Manager configuration completed successfully
- FINISHED EMCA at Mar 7, 2015 11:46:50 PM
其次,创建EM资料库
[oracle@LINUX15 log]$ emca -repos create
STARTED EMCA at Mar 8, 2015 12:24:13 AM
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:
Do you wish to continue? [yes(Y)/no(N)]: Y
Mar 8, 2015 12:24:40 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2015_03_08_00_24_11.log.
Mar 8, 2015 12:24:41 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Mar 8, 2015 12:41:29 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Enterprise Manager configuration completed successfully FINISHED EMCA at Mar 8, 2015 12:41:29 AM
最后配置database control
STARTED EMCA at Mar 8, 2015 12:24:13 AM
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:
Do you wish to continue? [yes(Y)/no(N)]: Y
Mar 8, 2015 12:24:40 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2015_03_08_00_24_11.log.
Mar 8, 2015 12:24:41 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Mar 8, 2015 12:41:29 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Enterprise Manager configuration completed successfully FINISHED EMCA at Mar 8, 2015 12:41:29 AM
- [oracle@LINUX15 ~]$ emca -config dbcontrol db
- STARTED EMCA at Mar 8, 2015 8:30:50 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
- Database Control is already configured for the database orcl
- You have chosen to configure Database Control for managing the database orcl
- This will remove the existing configuration and the default settings and perform a fresh configuration
- Do you wish to continue? [yes(Y)/no(N)]: Y
- Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.3/oracle ]:
- Password for SYS user: le
- Password for DBSNMP user: l
- Password for SYSMAN user: a
- 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.3/oracle
- Local hostname ................ LINUX15
- Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.3/oracle
- 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
- Mar 8, 2015 8:32:09 PM oracle.sysman.emcp.EMConfig perform
- INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2015_03_08_20_30_49.log.
- Mar 8, 2015 8:32:10 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
- INFO: Stopping Database Control (this may take a while) ...
- Mar 8, 2015 8:32:24 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
- INFO: Uploading configuration data to EM repository (this may take a while) ...
- Mar 8, 2015 8:33:51 PM oracle.sysman.emcp.EMReposConfig invoke
- INFO: Uploaded configuration data successfully
- Mar 8, 2015 8:33:56 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
- INFO: Securing Database Control (this may take a while) ...
- Mar 8, 2015 8:35:04 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
- INFO: Database Control secured successfully.
- Mar 8, 2015 8:35:04 PM oracle.sysman.emcp.util.DBControlUtil startOMS
- INFO: Starting Database Control (this may take a while) ...
- Mar 8, 2015 8:36:17 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
- INFO: Database Control started successfully
- Mar 8, 2015 8:36:17 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
- INFO: >>>>>>>>>>> The Database Control URL is https://LINUX15:1158/em <<<<<<<<<<<
- Mar 8, 2015 8:36:20 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.3/oracle/LINUX15_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 Mar 8, 2015 8:36:20 PM
- [oracle@LINUX15 ~]$ emctl status dbconsole
- Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
- Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
- https://LINUX15:1158/em/console/aboutApplication
- Oracle Enterprise Manager 11g is running.
- ------------------------------------------------------------------
- Logs are generated in directory /u01/app/oracle/product/11.2.3/oracle/LINUX15_orcl/sysman/log
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30150152/viewspace-1452077/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30150152/viewspace-1452077/