oracle11g sql dever链接提示ora-12505,sql plus可以正常连接

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle11g sql dever链接提示ora-12505,sql plus可以正常连接相关的知识,希望对你有一定的参考价值。

这是我

listener.ora
# listener.ora Network Configuration File: F:\app\Yy\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = F:\app\Yy\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:F:\app\Yy\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = F:\app\Yy\product\11.2.0\dbhome_1)
(SID_NAME = orcl)

)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-6NHCI66)(PORT = 1521))
)
)

ADR_BASE_LISTENER = F:\app\Yy

tnsnames.ora
# tnsnames.ora Network Configuration File: F:\app\Yy\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-6NHCI66)(PORT = 1521))

ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-6NHCI66)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

参考技术A 而且回头会企鹅他为前提为前提为前提切图

MySQL创建自定义函数提示:This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its ......

报错场景:在MySQL中创建函数时,报错如下:

This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable)

错误原因

MySQL开启了bin-log, 我们就必须指定我们的函数是否是
1、DETERMINISTIC 不确定的
2、NO SQL 没有SQl语句,当然也不会修改数据
3、READS SQL DATA 只是读取数据,当然也不会修改数据
4、MODIFIES SQL DATA 要修改数据
5、CONTAINS SQL 包含了SQL语句

温馨提示:在自定义Function里面,只有 DETERMINISTIC, NO SQL 和 READS SQL DATA 被支持。如果我们开启了 bin-log, 我们就必须为我们的自定义Function指定一个参数。

解决方案

可以通过将变量 log_bin_trust_function_creators 的值设置为“开启”实现。

方式1临时方案,MySQL服务重启会失效)
可以通过SQL语句设置,SQL语句如下:


1)查询变量值

show variables like 'log_bin_trust_function_creators';

 

2)设置变量值

set global log_bin_trust_function_creators = 1;

show variables like 'log_bin_trust_function_creators';

 

方式2永久方案,需要重启MySQL服务,配置才能生效)
在 my.cnf 配置文件中添加如下一行配置,然后重启MySQL服务 

log_bin_trust_function_creators = 1

 

以上是关于oracle11g sql dever链接提示ora-12505,sql plus可以正常连接的主要内容,如果未能解决你的问题,请参考以下文章

oracle 11g错误ora-01033:oracle initialization or shutdown in progress解决办法

INSERT INTO table RETURNING 触发器生成的主键从 SQL Server 链接服务器到 Oracle (11g)

Java连接Oracle11g的时候提示ORA-12505

win8 64位+Oracle 11g 64位下使用PL/SQL Developer 的解决办法

Oracle 11g sys,system,scott密码没有设置解决办法

Oracle 11g R2 常见问题处理