同一个主机的同一个数据库,只能有一个监听器,我们所配置多个监听器时,它会监听另外一台主机上的数据库,但这样性能不好。
listener.ora配置文件讲解:
监听器部分:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS=(PROTOCOL = IPC) (KEY=EXTPRO1))
(ADDRESS=(PROTOCOL = TCP)(HOST = 192.168.2.29)(PORT = 1521))
)
)
数据库配置部分:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl.localdomain)
(ORACLE_HOME = /opt/oracle/product/11.2.0/dbhome_1)
(SID_NAME = orcl )
)
)
tnsname.ora配置文件
test =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.29)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = orcl.localdomain)
)
service_name 默认就是global_name.
查询global_name
select * from global_name;
修改global_name
alter database rename global_name to orcl;
update global_name set global_name = ‘orcl‘;
commit;
但是修改了、global_name并不会默认改掉server_name,也不会默认修改db_domain;
因此修改db_domain
alter system set db_domain=‘‘ scope=spfile;
本文出自 “常用文档” 博客,请务必保留此出处http://yujianglei.blog.51cto.com/7215578/1558698
原文地址:http://yujianglei.blog.51cto.com/7215578/1558698