AUDIT_SYS_OPERATIONS in 12c
12c里AUDIT_SYS_OPERATIONS参数的缺省值是TRUE, 以前的版本缺省值是FALSE导致的结果是audit_file_dest目录的aud文件变大,因为很多系统任务的sql写到了aud文件里,比如收集统计信息的自动任务db1_j000_16692_20170216234611354372143795.audThu Feb 16 23:46:11 2017 +08:00LENGTH : '758'ACTION :[515] 'sel...
unused column
由于对大表dorp column很耗时,可以先用 set unused逻辑删除,等找到时间窗口再做物理删除,所以usused的列是不可以恢复的。create table t ( x int not null, y int not null, z int not null); insert into t values (1,2,3); commit; alter table t set unused column z;查看有unused列的表se...
multi index on same column in 12c
12c可以在相同的列上建多个索引,但是只能有一个是"visible"的,应用这个功能,可以比较方便地把某个索引修改为分区索引来减少"热块"。create table t as select * from dba_objectswhere object_id is not null;create unique index t_ind1 on T ( object_id );alter table T add constraint T_PK primary key ( o...
vector i/o and BATCHED TABLE ACCESS
从11g开始, Nested Loop Joins 的i/o操作有了优化, 叫做vector i/oOracle Database 11g introduces a new implementation for nested loop joins to reduce overall latency for physical I/O. When an index or a table block is not in the buffer cache and is needed to process the join, a physical I/O is req...
abou AMM
在12cR2的文档中建议使用AMMAbout Memory Management (page 6-2)The memory structures that must be managed are the system global area(SGA) and the instance program global area (instance PGA). OracleDatabase supports various memory management methods, which arechosen by initialization parameter sett...
using sql prfile to ignore hints
有些开发工程师喜欢在sql里加hint, 希望走自认为高效的执行计划,但往往事与愿违,加了hint的sql反而走了不好的执行计划,碰到这种情况,在不能修改代码的情况下,可以用sql profile来忽略这些hint,创建sql profile的hint就是
sqlplus -L
用shell脚本执行sql,经常会需要写入账号,密码,例如:cat a.sqlselect * from dual;exitcat a.shsqlplus test/test @a.sqlsh a.shSQL*Plus: Release 10.2.0.4.0 - Production on Mon Mar 13 15:09:37 2017Copyright (c) 1982, 2007, Oracle. All Rights Reserved.Connected to:Oracle Database 10g Ent...
SQL Translator Profiles in 12c
SQL> select * from v$version;BANNER ...
adjust scn by poke kcsgscn_
11g以后手工修改scn的手段:adjust_scn,_minimum_giga_scn都失效了但是可以修改内存变量来修改scnSYS@bbb>select current_scn from v$database; CURRENT_SCN-------------------- 146028890382SYS@bbb>oradebug setmypidStatement processed.S...
where did the data of function:scn_to_timestamp come from?
scn_to_timestamp的scn和time的对应关系从何而来?是来自于系统表smon_scn_time吗?用10046去trace"select scn_to_timestamp(xxxxxxx) from dual"并没有发现访问smon_scn_time.但是对scn_to_timestamp来说,最小的有效的scn是"select min(scn_bas) from smon_scn_time"SYS@bbb>select min(scn_bas) SCN_BASE from smon...
根据hint手工创建sqlprofile
TEST@bbb>select * from v$version;BANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionPL/SQL Release 11.2.0.4.0 - ProductionCORE 11.2.0.4.0 Production...