和外键相关的一点性能问题总结!
当存在主外键关系的时候,如果外键上没有索引,而且从表(有外键的表)又比较大时,一些操作主表的动作,如delete可能会消耗很大的资源,因为在操作主表的同时oracle内部需要访问从表。[@more@]SQL> create table t tablespace users as select * from dba_objects;表已创建。SQL> alter table t add constraint pk_t primary key (object_id);alter table t add constraint pk_t primary key (object_id) *第 1 行出现错误:ORA-01449: 列包含 NULL 值; 无法将其变更为 NOT NULLSQL>
Oracle性能调整指导纲要
讲优化时大致写的一个提纲,内容分db的物理设计和逻辑设计,主要以物理设计为主,逻辑设计介绍的内容不多,提纲里把物理结构设计和实例优化有机的结合在一起,把逻辑结构设计和应用调整结合在一起......[@more@]Oracle性能调整指导纲要数据库物理结构设计和实例级别的调整一、Oracle性能优化方法论1.为什么(what)要优化(系统慢了?慢是表象)2.怎样(how)优化?(需要找到慢的原因)a.是系统的问题?b.是数据库的问题?3.谁(who)来优化?a.系统架构师(系统架构设计的有问题,麻烦大了)b.系统管理员(os、storage问题)c.数
OCP考证须知
很多人即使考了ocp可能也不知道这些东西,想考的兄弟们可能就更加困惑了,一天问我有关ocp考试相关问题的人很多,不回答吧觉得不够礼貌,回答的话烦的要命,几乎都是相同或者相似的问题,今天一口气写了这么多,以后会逐渐的完善和补充,打算考ocp的兄弟如果对ocp的考试流程不是很清楚的话不妨读一下.欢迎对号入座,如果触犯了谁的利益,多有得罪.[@more@]很多人即使考了ocp可能也不知道考证的流程,想考的兄弟们可能就更加困惑了,一天向我询问我有关ocp考试相关问题的人很多,不回答吧觉得不够礼貌和友好,回答的话烦的要命,几乎都是相
一次通过stream复制解决数据单向复制的案例
primary db:asmnl29 aix6.1双机oracle11.1 racStandby db:asmnl19 windows2008 oracle11.1单机其中29和19是2台db server的ip尾数:环境简要介绍,我们需要把asmnl29上用户asmnlirc下的40多张表适时同步复制到asmnl19下的asmnlirc用户下,权衡各种因素最终选择了oracle的stream复制技术,其实实现了上面的同步技术之后另外一个客户还需要把这40张表通过mv的方式刷新到他们的系统中最终使用,这次不再涉及mv的过程,因为这个过程我不负责实施,下面是stream详细配置步骤:[@more@]1.修改主、从db的相关参数:alter system set aq_tm_proc
oracle ocp考试程序的登录问题
oracle ocp 考试程序Start Your Test.exe每次考试的时候都不能正常打开,似乎和机器有关,有的机器可以打开,有的不行,最后诊断为是浏览器设置问题:解决办法:打开浏览器---->工具---->internet选项---->高级--->在安全和非安全模式之间切换时发出警告(取消这一选项)同时要求windows系统是xp,否则(如果是2003)即使可以登录,登录进去之后也会有问题,特此纪录[@more@]test
rman中nocatalog下被删除的datafile在以前的备份中无法显示出来
看到一位puber提出来的疑问,简单的测试了一下,发现确实存在这个问题,原帖:http://www.itpub.net/viewthread.php?tid=1340189&pid=16296004&page=1&extra=page%3D2[@more@]--nocatalog的情况RMAN> backup as compressed backupset full database ;启动 backup 于 23-8月 -10使用通道 ORA_DISK_1通道 ORA_DISK_1: 启动压缩的全部数据文件备份集通道 ORA_DISK_1: 正在指定备份集中的数据文件输入数据文件 fno=00001 name=E:ORACLETESTSYSTEM01.DBF输入数据文件 fno=00002 name=E:ORACLETESTUNDOTBS01.DBF输入数据文件 fno=
Oracle CPU Costing
原文连接:http://www.remote-dba.net/oracle_10g_tuning/t_oracle_cpu_costing.htmhttp://itspace.javaeye.com/blog/644780http://www.eggheadcafe.com/software/aspnet/35989389/what-does-the-costcpu-in-explain-plan-mean.aspxhttp://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/[@more@]Oracle CPU CostingOracle Tips by Burleson ConsultingTurning on CPU CostingThe default setting for the optimizer cost model is CHOOSE, meaning that the presence of CBO statistics will influence whether or not CPU costs
oracle里的连接(connection)究竟是指什么
因为有图,所以没发把内容直接贴过来,直接看连接吧[@more@]http://www.itpub.net/thread-1338428-1-1.html
非常荣幸的为最近出版的一本oracle优化力作写书评
非常荣幸的受到作者谭怀远(网名:alantany)先生的邀请为他的著作写一个书评,我的书评与其他几位重量级人物的书评相比显的有些片面和单薄,我为该书的书评如下:据我所知作者是中国独立撰写Oracle性能优化书籍的第一人,该书几乎涵概了Oracle性能优化的所有主题,在国内数据库性能优化领域的书籍中实属罕见。 ——谢永生(warehouse) 资深Oracle培训讲师 我对该书的评价其实不够准确,该书还没有完全涵盖oracle性能优化所涉及的所有主题,作者主要介绍的其实是sql优化的主题较多,实例和系统一级的优化似乎提及的不多,不管咋说,这确实是
搜集一篇介绍logical rowid的好文章
Like indexes, IOTs are subject to inserts, deletes, block splits and coalsces, all of which affect the rowid. This means a standard rowid cannot always be used to retrieve an IOT record from a secondary index. For this reason secondary indexes on IOTs use a logical rowid which is made up of the original rowid and the primary key of the row. When a secondary index is referenced the rowid is used to find the block. If the block is not present at that disk address the primary key is used to find th
rman里exclude tablespace之后obsolete的archivelog不被删除
测试的缘由是基于下面一个问题:http://www.itpub.net/thread-1333706-1-1.html[@more@]RMAN> configure exclude for tablespace users;今后的全部数据库备份将排除表空间 USERS已成功存储新的 RMAN 配置参数RMAN> show all;RMAN 配置参数为:CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # defaultCONFIGURE BACKUP OPTIMIZATION OFF; # defaultCONFIGURE DEFAULT DEVICE TYPE TO DISK; # defaultCONFIGURE CONTROLFILE AUTOBACKUP OFF; # defaultCONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # defaul
block corruption type
Type of block corruption in the datafile: ALL ZERO - Block header on disk contained only zeros. The block may be valid if it was never filled and if it is in an Oracle7 file. The buffer will be reformatted to the Oracle8 standard for an empty block.FRACTURED - Block header looks reasonable, but the front and back of the block are different versions.CHECKSUM - optional check value shows that the block is not self-consistent. It is impossible to determine exactly why the check value fails, but it
Flashback Database logs里的内容是什么?
按照oracle的说法是before images of data blocks[@more@]Flashback Database is implemented using a type of log file called Flashback Database logs. TheOracle database periodically logs before images of data blocks in the Flashback Database logs.Block images can be reused to quickly back out the data file changes to any time at whichflashback logs were captured just before the desired target time. Then, changes from the redo logfiles are applied to fill in the gap. The Flashback Database logs are au
给redo增加mirror之后别忘了switch几次
讲课时随手的一些总结[@more@]SQL> col member format a40SQL> select group#,member from v$logfile; GROUP# MEMBER---------- ---------------------------------------- 2 D:ORADATATESTREDO02.LOG 3 D:ORADATATESTREDO03.LOG 1 D:ORADATATESTREDO01.LOGSQL> select group#,members,status from v$log; GROUP# MEMBERS STATUS---------- ---------- ---------------- 1 1 CURRENT 2 1 INACTIVE 3 1 INACTIVESQL> alter database add
flashback database的一点总结
讲课时随手的一些总结[@more@]要想启动flashback database的功能需要满足3个条件:1.要求db在archivelog2.startup mount3.使用flash recovery area,因为flashback log必须要求放在flash recovery area里--======================SQL> select flashback_on from v$database;FLASHBACK_ON------------------NOSQL> archive log list;数据库日志模式 存档模式自动存档 启用存档终点 USE_DB_RECOVERY_FILE_DEST最早的联机日志序列 4下一个存档日志序列 7当前日志序列 7SQL> shutdown immediate数据库已经关闭。已经卸载数据库。ORACL
large_pool_size不能超过shared_pool_size
The large pool must be explicitly configured. The memory of the large pool does not come out ofthe shared pool, but directly out of the SGA, thus adding to the amount of shared memory theOracle server needs for an instance at startup[@more@]--===========================SQL> show parameter largeNAME TYPE VALUE------------------------------------ ----------- ------------------------------large_pool_size big integer 0SQL> show parameter sgaNAME TYPE VALUE------------------------------------ -
使用using backup controlfile恢复db之后为啥需要resetlogs?
这个问题我想可能不仅仅困挠我一个人,不过很多时候我们却又解释不清,觉得oracle似乎使用using backup controlfile恢复db之后没必要resetlogs,但是我觉得resetlogs似乎又有些道理...[@more@]SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.--冷备份SQL> startupORACLE instance started.Total System Global Area 167772160 bytesFixed Size 1247876 bytesVariable Size 83887484 bytesDatabase Buffers 75497472 bytesRedo Buffers 7139328 bytes数据库装载完毕。数据库已经打开。SQL&g
验证commit之后是否把其他session没有提交的事务所产生的reodo也写入了logfile
这个试验的目的是想验证一下一个session提交之后lgwr是否把其他session里的事务还没有提交所产生的redo也一起写入logfile了.在验证之前结论已经很清楚,commit的时候不管log buffer里的内容是否已经提交,lgwr会一起写入logfile,这样做的目的当然是保证写的速度,同时恢复的时候也会使用logfile“连续"恢复.通过dump logfile的内容发现session 76 commit之后把session 164没有提交的reod也一起写入logfile了,不过依据是什么似乎没有观察清楚,莫非是dump内容里的version 185599488?commit一次写入logfile之后oracle是用什么来标识
Automatic Undo Retention测试!
Automatic Undo RetentionOracle Database 10g automatically tunes a parameter called the undo retention period. The undo retention period indicates the amount of time that must pass before old undo information—that is, undo information for committed transactions—can be overwritten. The database collects usage statistics and tunes the undo retention period based on these statistics and on undo tablespace size. Provided that automatic undo management is enabled, the database automatically tunes th
profile中password limit的一点总结
在Implement standard password security features时我们需要执行脚本:E:oracleproduct10.2.0db_1RDBMSADMINutlpwdmg.sql ,执行之后不仅创建了口令验证函数verify_function,同时修改了profile default的一些password limit特性,本文对这些limit做一点说明:[@more@]ALTER PROFILE default LIMITPASSWORD_LIFE_TIME 60 --口令的生命周期,超过这段时间口令可能会自动过期,是否过期要看是否设定了PASSWORD_GRACE_TIMEPASSWORD_GRACE_TIME 10 --接着PASSWORD_LIFE_TIME特性,如果PASSWORD_LIFE_TIME的期限已到,那么PASSWORD_GRACE_TIME