function-index error exeplan!(函数索引需要重建)

The index can only be enabled if the signature of the function is same as before (i.e when it was created). If the signature of the functions changes then the index needs to be revalidated by using the rebuild option:
ALTER INDEX REBUILD;

oracle function specify deterministic

Specify DETERMINISTIC to indicate that the function returns the same result value whenever it is called with the same values for its arguments.

ORA-02070: 数据库 不支持此上下文中的

SQL> insert into test@rhel243(sid)
2 select instance_number from v$instance;
select instance_number from v$instance
*
第 2 行出现错误:
ORA-02070: 数据库 不支持此上下文中的

oracle grant update a column on table(给一列授权update)

oracle 10 允许 基于表中某一列单独授权 update 权限

anbob@ORCL> conn system
Enter password:

sqlplus environment $SQLPATH login.sql

常用sqlplus 每次可能都要set pagesize \set linesize \set serveroutput很麻烦,sqlplus 允许每次启动都是会查找一个login.sql的文件自动格式化这些变量,从当前目录查找,也可以指定SQLPATH变量批定login.sql存放路径,这样从哪个目录进sqlplus都可以找到。

oracle profile 登录失败次数

SQL> create profile log5 limit FAILED_LOGIN_ATTEMPTS 5;

Profile created.

ORACLE 对象类型 ODCIAggregate

CREATE OR REPLACE TYPE “STRCAT_TYPE” as object(
cat_string varchar2(4000),
static function ODCIAggregateInitialize(cs_ctx in out strcat_type) return number,
member function ODCIAggregateIterate(self in out strcat_type,value in varchar2) return number,
……….

ODCIConst.Success是什么?

今天有个网友问oracle 的对象类型有段代码是return ODCIConst.Success;我查了一下,得出一下结论

那是在一篇oracle关于合并列值的文章,其实有很多方法,ODCIConst.Success=0
……

ASH buffers的大小疑问

网上有一种说法ASH buffers的大小按照以下算法分配:Min(shared_pool_size*5%,2M*cpu_count)
我验证了一下,使用asmm或msmm,找了三台机器,结果有点不同

java excel生成sql

D:\test>java exceltooracle aa.xls
ExcelToOracle java 0.1.0.1
————————-
Copyright www.anbob.com
qq:397464815
info:
This file:aa.xls have 3 sheets,now reloading the first sheet only!
Sheet1 reloading…
This sheet have 10 columns,and have 8 rows
Create Table sql:
————–

linux du 显示路径下各子目录大小

use command du display estimate file space usage size of subdirectories

[oracle@ahjcyl-db backup]$ pwd
/backup
[oracle@ahjcyl-db backup]$ du -sh

alter table rename talblename、columnname、indexname、constraintsname

重命名表名、字段名、索引名、约束名

SQL> CREATE TABLE test1 (
2 col1 NUMBER(10) NOT NULL,
3 col2 VARCHAR2(50) NOT NULL);
…….

exp query 导出加where条件

exp 导出单表时可以加where条件,但转义有时很头疼,下面请看我的实验

SQL> create table test_exp(id number,in_date date);

Table created.

JOBRUNNINGLOG的创建-计算程序运行时间-自建JOB监控日志

ORACLE自身提供的JOB监控视图 dba_jobs,dba_jobs_running 里只提供JOB一共运行耗时多久(无论运行多少次),或者JOB是否正在运行查看。那么我想知道每次JOB的运行时间,怎么办?此为我的实现方式。代码的主要部分。思路:记录程序开始的时间点,记录程序结束的时间点,二者之差写入一张JOBRUNNINGLOG表中。就是自己监控自己的JOB。此思路已经实现。以下为实现的核心代码。

让程序DO-NOTHING

很多时候需要这样的情况。此为举例说明一下。备忘!

ORA-04089: cannot create triggers on objects owned by SYS

今天做实验,忘记切换用户,在sys下建立触发器时发现了ORA-04089,不能建立trigger在sys的对象上

SQL> conn / as sysdba
Connected.

sql 编程命名规范

create or replace procedure pro_test_create_table
— 1 命名:建议PRO开头来区分是存储过程还是其他什么对象,例如: TRI_ FUN_ PAC_等等。尽量表达清楚,他的用意。是做什么的…..

orcle of column trigger test

CREATE OR REPLACE TRIGGER TRI_TEST
BEFORE INSERT OR UPDATE
of ID_A
ON test_trigger_ofcol
….

linux登录提示”[: =: unary operator expected”

以前在linux上安装的一台oracle的机器,每次本机登录都会提示”[: =: unary operator expected”,显然是profile出了问题

因为配置oracle时,会对用户oracle做系统资源限制加下profile中

#new add
if [ $USER = “oracle” ]; then

oracle 修改列的前后顺序

Whether you are create table or alter table plus a filling, the column is asequence of before and after,In oracle you can modify the sequence.

for example: