oracle deterministic关键字
http://inthirties.com:90/viewthread.jsp?tid=1395
这个deterministic是不是很眼熟呀,
我们在online redefinition里见到过这个关键字,这个关键在在自定义的函数索引里也出现了。
先看看文档
DETERMINISTIC Clause
Specify DETERMINISTIC to indicate that the function returns the same
result value whenever it is called with the same values for its
arguments.
You must specify this keyword if you intend to call the function in
the expression of a function-based index or from the query of a
materialized view that is marked REFRESH FAST or ENABLE QUERY REWRITE.
When Oracle Database encounters a deterministic function in one of these
contexts, it attempts to use previously calculated results when
possible rather than reexecuting the function. If you subsequently
change the semantics of the function, you must manually rebuild all
dependent function-based indexes and materialized views.
Do not specify this clause to define a function that uses package
variables or that accesses the database in any way that might affect the
return result of the function. The results of doing so will not be
captured if Oracle Database chooses not to reexecute the function.
The following semantic rules govern the use of the DETERMINISTIC
clause:
*You can declare a top-level subprogram DETERMINISTIC.
*You can declare a package-level subprogram DETERMINISTIC in the
package specification but not in the package body.
*You cannot declare DETERMINISTIC a private subprogram (declared
inside another subprogram or inside a package body).
*A DETERMINISTIC subprogram can call another subprogram whether the
called program is declared DETERMINISTIC or not.
要实现自己的函数,加入函数索引,必须加入这个deterministic关键字,保证你这行的返回是一个确定数。
否则出现
30553, 00000, “The function is not deterministic”
// *Cause: The function on which the index is defined is not
deterministic
// *Action: If the function is deterministic, mark it
DETERMINIS
相关文档:
oracle启动方式与命令参数汇总
本文主要是对oracle的启动方式和相关的命令参数进行一个汇总,用以加深印象。
Oracle的启动方式:
startup nomount
startup mount
startup open (startup的默认选项)
其他常用的参数:read only ,read write ,force,restrict
这些参数可以一起使用,比如 startup 与 startup open read ......
Oracle的分区技术在某些条件下可以极大的提高查询的性能,所以被广泛采用。从产品上说,分区技术是Oracle企业版中独立收费的一个组件。以下是对于分区及本地索引的一个示例。
Oracle的分区技术在某些条件下可以极大
Oracle的分区技术在某些条件下可以极大的提高查询的性能,所以被广泛采用。从产品上说,分区技术是 ......
Oracle 10g中的EM采用Web的形式来管理数据库及相关服务,但使用过程中会碰到一些跟EM有关的问题,根据同行的提示及笔者的实际经验,进行了一些归纳,希望对相关爱好者有所帮助:
(1)数据库控制台启动后,看到1)数据库实例无信息2)监听程序为状态为不可用3)到实例的代理连接状态为不可用。
问题分析:
此时服务刚启 ......
函数:
字符函数
转化成小写LOWER(<C>) 转化成大写UPPER(<C>) select lower('aAbBcC') from dual;
--------
日期函数
add_months(D,<I>)返回日期D加上i个月后的结果
select add_month(sysdate,3)from dual;
&nb ......
子查询
单行子查询(single-row subqueries)
使用的运算符号(=,>,<,>=,<=,<>)
多行子查询(multiple-row subqueries)
使用的运算符号(in,not in,exists,not exits,all,any)
相关子查询(correlated subqueries)
&nb ......