今天在配置11G的dataguard时,执行rman target sys/oracle@dbp auxiliary sys/oracle@dbs连接数据库时刚开始报错ora-12514,lsnrctl stop/start重启监听还是没有解决问题,而且反复重启参数,重启备库实例时又报错ora-12528。百度查问题一直解决不了,主要还是对监听不了解。解决问题后做个总结:
报错ora-12514时,主要是前面在还没有更改db_unique_name的时候就已经配置好了监听和service且拷贝到了备库,之后再更改db_unique_name,就导致了tnsnames.ora中service_name不正确,tnsnames.ora中的service_name应该写数据库的db_unique_name。当然不写service_name写sid或者instance_name也可以。
报错ora-12528,由于备库还没有duplicate,所有不能使用动态注册监听,只能使用静态监听。监听文件listener.ora中静态监听注册设置错误,且更改了db_unique_name后也没有注意修改监听的GLOBAL_DBNAME参数,导致报错。
当时对listener.ora中的GLOBAL_DBNAME参数不是很理解,查了下资料:
GLOBAL_DBNAME
Purpose:
Use the parameter GLOBAL_DBNAME to identify the database service.
While processing a client connection request, the listener tries to match the value of this parameter with the value of the SERVICE_NAME parameter in the client connect descriptor. If the client connect descriptor uses the SID parameter, then the listener does not attempt to map the values. This parameter is primarily intended for configurations with Oracle8 release 8.0 or Oracle7 databases (where dynamic service registration is not supported for dedicated servers). This parameter may also be required for use with Oracle9i and Oracle8i database services by some configurations and management tools.
The value for this parameter is typically obtained from the combination of the DB_NAME and DB_DOMAIN parameters (DB_NAME.DB_DOMAIN) in the initialization parameter file, but the value can also contain any valid name used by clients to identify the service.
可以通过各种方法查看:
show parameter global_name;
select global_name from global_name;
这里GLOBAL_DBNAME参数可以直接写db_unique_name
监听和service都设置正确后重启监听,主备库都能正常访问。
对监听的理解可以参考这篇博客:http://blog.163.com/zangyunling@126/blog/static/1646245052010524101149835/
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29609901/viewspace-1205672/
,如需转载,请注明出处,否则将追究法律责任。