Oracle leading vs. ordered hints
http://www.dba-oracle.com/t_leading_hint.htmThe "ordered" hint is extremely useful for cutting-down query parse time and ensuring proper table join order for static tables and queries. Good article on using the ordered hint Ault on the ordered hint[@more@]/* LEA
ITL(Interested Transaction List)
一、ITL描述: ITL(Interested Transaction List)是Oracle数据块内部的一个组成部分, 位于数据块头(block header),itl由xid(Transaction XID),uba(Undo block address),flag,lck和scn/fsc组成, 用来记录该块所有发生的事务,一个itl可以看作是一条事务记录。 当然,如果这个事务已经提交,那么这个itl的位置就可以被反复使用了,因为itl类似记录,所以,有的时候也叫itl槽位。如果一个事务一直没有提交, 那么,这个事务将一直占用一个itl槽位,itl里面记录了事务信息,回滚段的入口, 事务类型等等。如果这个事务已经提交
Oracle Profile and PASSWORD_VERIFY_FUNCTION
ALTER PROFILE default LIMIT PASSWORD_LIFE_TIME 90 PASSWORD_GRACE_TIME 5 PASSWORD_REUSE_TIME 100 PASSWORD_REUSE_MAX 360 FAILED_LOGIN_ATTEMPTS 3 PASSWORD_VERIFY_FUNCTION MY_PASSWORD_VERIFY_FUNC;[@more@]RemRem $Header: utlpwdmg.sql 31-aug-2000.11:00:47 nireland Exp $RemRem utlpwdmg.sqlRemRem Copyright (c) Oracle Corporation 1996, 2000. All Rights Reserved.RemRem NAMERem utlpwdmg.sql - script for Default Password Resource LimitsRemRem DESCRIPTIONRem This is a script fo
Oracle中的SCN详解
pre. Oracle中的SCN(system change number)和我们的北京时间的意义是相同的,SCN是Oracle中的时间号。 为什么Oracle不用时间来界定呢? 我在北京时间8:00的时候执行一条DML语句,然后修改机器上的时间为 7:00,再执行一条DML语句。如果用机器上的时间区分的话,那Oracle根本区分不出来这两条DML语句的执行顺序——而这一点对于Oracle是 很重要的。所以它采用自己产生的SCN来区分所有操作的先后顺序。 SCN设计的值很大,所以不用担心达到最大值后怎么办。[@more@] 可以查看系统当前的SCN号: SQL> se
Histograms
Histograms 就是柱状图 在你不收集Histograms信息的时候 如果存在一个表 表中的记录从1到9,一共900条记录 由于没有收集Histograms信息 oracle会假设记录是平均分配的 就是说1有100条,2有100条…… 而实际上1有800条,其他的100条 这样就会存在问题 在索引的选择上 对1的查询用全表扫描会更好 而对于其他的值用索引可能效果会更好 这时候就需要收集Histograms信息 告诉oracle数据是倾斜 不是平均分布的 v:* {behavior:url(#default#VML);} o:* {behavior:url(#default#VML);} w:* {behavior:url(#default#VML);
PLSQL questions
here are some general questionsPL/SQL Questions: 1. Describe the difference between a procedure, function and anonymous pl/sql block.A function must return a value while a procedure doesn’t have to. Functions can be called from SQL.anonymous pl/sql block begins with a DECLARE statement. [@more@] 2. Describe the use of %ROWTYPE and %TYPE in PL/SQL %TYPE associates a variable with a single column type. %ROWTYPE associates a variable with an entire table row. % TYPE is used to declare a field wi
recover database until cancel using backup controlfile
recover database until cancel using backup controlfile的一些知识点。[@more@]QAPROD_arch15342.dbf 已经在归档地址,但用rman里的recover提示:RMAN-06054: media recovery requesting unknown log: thread 1 scn 7418781225888。 用“recover database until cancel using backup controlfile;” 就可以。难道是因为控制文件是用“alter database backup control file to '/u16/me/control_bkup';” 这种方法备份来的,就需要用“recover database until cancel using backup controlfile;” RMAN> run {allocate channel c1 type
oracle 监听
The listener supports no serviceshttp://tc.itkee.com/database/detail-cba.html[@more@]lsnrctl start提示:The listener supports no servicesThe command completed successfully這樣啓動後遠程連接會造成oracle ORA-12514:TNS:listener does not currently know of service requested in connect descriptor---方案一---------原因:數據庫實例註冊到listener-------------------------------------登錄數據庫$sqlplus / as sysdba--顯示服務名SQL>show parameter service_names--強制註冊服務SQL>alter system register;--查看
shell 的判断
#!/bin/shfile=/u03if [ "${file}" = "/u03" ]thenecho the filename is /u03#!/bin/shfile=/u03if [ "${file}" = "/u03" ]thenecho the filename is /u03fifile2=/u04if [ "${file2}" != "/u03" ]thenecho the filename is not /u03fi[@more@]
Database Audit and Audit trail purging
http://www.oradba.ch/2011/05/database-audit-and-audit-trail-purging/Database Audit and Audit trail purging There are several reason to enable database audit and at least as much reason to not enable database audit. For today I will focus on what can be done after the audit has enabled and how to get rid of the audit data quite easily. It is nothing new nor is it rocket engineering. Ok, removing data is mostly a quite easy task, sometimes to easy… Rather than delet
oracle 8i的restore
oracle8i的restore有些需要特别注意的地方[@more@]oracle 8i 恢复时不支持restore controlfile from ... and restore controlfile from autobackup; 也不支持set DBID= , 在备份时也不支持CONFIGURE CONTROLFILE AUTOBACKUP ON; 在恢复控制文件时,建议在源数据库用 alter database backup controlfile to '$ORACLE_BASE/admin/orcl/bdump/orcl.ctl';(binary file), 然后拷贝到target的控制文件路径。或用alter database backup controlfile to trace;(flat text file)。trace file is very usefu, u can re-create control fil