字段avg_row_len of dba_tables是如何被计算的!
困扰了很久的一个问题![@more@]SQL> create table tt(id int , name varchar2(20)) tablespace users;表已创建。SQL> insert into tt values(1,'a');已创建 1 行。SQL> insert into tt values(2,'aa');已创建 1 行。SQL> insert into tt values(2,'aaa');已创建 1 行。SQL> insert into tt values(2,'aaaa');已创建 1 行。SQL> insert into tt values(2,'aaaaa');已创建 1 行。SQL> insert into tt values(2,'aaaaaa');已创建 1 行。SQL> insert into tt values(2,'aaaaaaa');已创建 1 行。SQL> insert into
利用trcsess合并以共享模式连接的session所产生的tracefile!
我们知道mts下存在多个process为一个session服务的情况,这样如果想开启该session的trace功能,那么产生的trace文件势必就有多个文件,如何把这个多个文件中的session信息提取出来就显的尤为重要,oracle提供的trcsess工具可以帮助我们,通过trcsess处理之后的tracefile就可以通过tkprof继续处理了。[@more@]SQL> select distinct sid from v$mystat;SID----------138SQL> select saddr,paddr,server,sid,serial# from v$session where sid=138;SADDR PADDR SERVER SID SERIAL#-------- -------- --------- ---------- ----------69
10g采用共享模式连接db产生的tracel文件放在了bdump中!
之前的版本貌似都放在了udump中...[@more@]SQL> select distinct sid from v$mystat; SID---------- 159SQL> select paddr,server from v$session where sid=159;PADDR SERVER-------- ---------6964C00C SHAREDSQL> alter session set sql_trace=true;会话已更改。SQL> select name,paddr from v$shared_server where paddr='6964C00C';NAME PADDR---- --------S000 6964C00CSQL> select pid,spid from v$process where addr='6964C00C'; PID SPID---------- ------------ 14 544SQL> sel
行连接的一点内部存储测试!
主要是验证一下block内部的一个"fb"标志The ‘fb’ value gives us flags about the row. ‘H’ means that we have the head of the row. ‘F’ means that we have the first piece of the row. ‘L’ means we also have the last piece of the row. Since this is the first and last piece of the row, the row is not chained. Since this is also the head of the row, the row has not been migrated.[@more@]SQL> create table tt(a char(2000),b char(2000),c char(2000) , d char(2000) ,e char(2000)) tablespac
获得tracefile name的脚步!
可以利用下面的脚本获得tracefile name,在11g可以非常方便的获得,其他版本相对比较麻烦。在oradebug中也很容易获得。[@more@]select pa.value ||decode(d.PLATFORM_NAME,'Microsoft Windows IA (32-bit)','','Microsoft Windows IA (64-bit)','','/') || i.instance_name || '_ora_' || pr.spid || '.trc' as trace_filefrom v$session s, v$process pr, v$parameter pa, v$instance i , v$database dwhere s.username = user and s.paddr = pr.addrand pa.name='user_dump_dest';
10g依然可以启动手动归档!
不细看doc还真不行。http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/archredo.htm#i1006731[@more@]SQL> shutdown immediate数据库已经关闭。已经卸载数据库。ORACLE 例程已经关闭。SQL> startup mountORACLE 例程已经启动。Total System Global Area 104857600 bytesFixed Size 1247540 bytesVariable Size 96470732 bytesDatabase Buffers 4194304 bytesRedo Buffers 2945024 bytes数据库装载完毕。--启用手动归档SQL> alter database archivelog
standby中RFS process的作用!
doc的原话,记录一下,加深印象。[@more@]Specifying the Mode of Log TransmissionThe two modes of transmitting archived logs to their destination are normal archiving transmission and standby transmission mode. Normal transmission involves transmitting files to a local disk. Standby transmission involves transmitting files through a network to either a local or remote standby database.Normal Transmission ModeIn normal transmission mode, the archiving destination is another disk drive of the databas
oracle 讲师
需要oracle讲师联系我![@more@]mobile:13840879243msn:xys_666888@hotmail.commail:yongsheng.xie@gmail.comqq:9020630个人简介:http://warehouse.itpub.net/post/777/403336整体过的一些文章:http://www.itpub.net/thread-911241-1-1.html
控制listener安全性的2篇不错的文章!
http://hi.baidu.com/edeed/blog/item/b8ad3901365c0f087bec2cca.htmlhttp://www.dbform.com/html/2009/771.html[@more@]http://hi.baidu.com/edeed/blog/item/b8ad3901365c0f087bec2cca.htmlhttp://www.dbform.com/html/2009/771.htmlhttp://www.itpub.net/viewthread.php?tid=1176759&highlight=%2Bwarehouse
如何看懂执行计划!
The execution order in EXPLAIN PLAN output begins with the line that is the furthest indented to the right. The next step is the parent of that line. If two lines are indented equally, then the top line is normally executed first. 在doc上看到了,记录一下[@more@]SQL> select count(*) from dba_objects;COUNT(*)----------11345Execution Plan----------------------------------------------------------Plan hash value: 2598313856---------------------------------------------------------------------------
通过bbed模拟和修复corrupted block!
使用bbed需要注意:1、win下oracle不提供2、随oracle软件一起发布3、在unix/linux下使用时需要事先relink4、oracle最初使用bbed用来修复坏block,从9i开始可以通过rman的blockrecover来恢复,不过前提是事先做过备份[@more@][oracle@xys oracle]$ bbedPassword:BBED: Release 2.0.0.0.0 - Limited Production on Tue Jun 9 13:13:04 2009Copyright (c) 1982, 2005, Oracle. All rights reserved.************* !!! For Oracle Internal Use only !!! ***************BBED> help all;SET DBA [ dba | file#, block# ]SET FILENAME 'file
asm中template特性测试!
都是doc的内容:Templates are used to set redundancy (mirroring) and striping attributes of files created in an ASM disk group. When a file is created, redundancy and striping attributes are set for that file based on an explicitly named template or the system template that is the default template for the file type.When a disk group is created, ASM creates a set of default templates for that disk group. The set consists of one template for each file type (data file, control file, redo log file, a
如何为asm db中system表空间的数据文件使用别名!
问题虽小,却困扰了一段时间![@more@]SQL> create tablespace TEST datafile '+DG/asmdb/datafile/TEST.DBF' SIZE 3M;表空间已创建。SQL> SELECT FILE_NAME FROM DBA_DATA_FILES;FILE_NAME--------------------------------------------------------------------------------+DG/asmdb/datafile/users.266.688401581+DG/asmdb/datafile/sysaux.264.688401529+DG/asmdb/datafile/undotbs1.263.688401515+DG/asmdb/datafile/system01.dbf+DG/asmdb/datafile/test.dbf--=====================================ASMCMD> pwd+dg/asmdb
expdp时不能导出sys用户下的对象!
sys用户下的对象不支持导出[@more@]SQL> select owner,segment_name,tablespace_name from dba_segments where tablespace_name='USERS';OWNER SEGMENT_NAME TABLESPACE_NAME---------- -------------------- ------------------------------SYS REPAIR_TABLE USERSSYS TT USERSTEST1 TT USERSSYS T1 USERSTEST T USERSTEST TT USERS已选择6行。SQL>C:>expdp 'sys/system@test as sysdba' DIRECTORY=temp_dir dumpfile=users.dmp tablespaces=usersExport: Release 10.2.0.1.0 - Production on 星期一, 01 6月, 2009 9:47:44Copy
网络配置相关内容总结
网络问题是困扰初学者的大问题,简单的总结了一下,希望对一些人有所帮助。[@more@]1、listener首先对初学者要明确一下listener是在db server上配置,凡是在client端要连接db都需要通过listener,就像非本单位员工要想进入该单位所在的办公大楼必须去保安那里登记一下自己的信息(亮名自己的身份同时说出来要找谁、办什么事儿),之后保安打电话和你要找的人进行确认和求证。这里不打算介绍lsnrctl中的内容,这个doc上有,而且也比较简单,重点介绍一下pub上经常人们问到的一些和net相关的或者说可能是困扰初学者的一些不太容易掌握的问题,
影响flashback table的操作!
rt[@more@]14:32:24 SQL> create table tt(id int) rowdependencies tablespace users;表已创建。14:32:57 SQL> insert into tt values(1);已创建 1 行。14:33:12 SQL> insert into tt values(2);已创建 1 行。14:33:14 SQL> insert into tt values(3);已创建 1 行。14:33:16 SQL> commit;提交完成。14:33:18 SQL> select id ,ora_rowscn from tt; ID ORA_ROWSCN---------- ---------- 1 1739405 2 1739405 3 173940514:33:32 SQL> update tt set id=100;已更新3行。14:33:
sys用户不支持flashback table特性!
讲课时随手记录的flashback table大致过程[@more@]SQL> connect / as sysdbaConnected.SQL> desc tt Name Null? Type ----------------------------------------- -------- ---------------------------- ID NUMBER(38)SQL> select * from tt;no rows selectedSQL> set time on14:14:36 SQL> insert into tt values(1);1 row created.14:14:42 SQL> insert into tt values(2);1 row created.14:14:44 SQL> insert into tt
备份恢复的一个有趣现象!
讲课时发现的所以随手记录一下。[@more@]SQL> alter tablespace users offline;表空间已更改。SQL> select * from t2;select * from t2 *第 1 行出现错误:ORA-00376: 此时无法读取文件 4ORA-01110: 数据文件 4: 'C:ORADATATESTUSERS01.DBF'--备份表空间users对应的数据文件SQL> alter tablespace users online;表空间已更改。SQL> select group#,sequence#,archived,status,first_change# from v$log; GROUP# SEQUENCE# ARC STATUS FIRST_CHANGE#---------- ---------- --- ---------------- ----
remote_os_authent参数测试!
client端普通用户os验证过程[@more@]client端普通用户os验证过程:1、保证参数remote_os_authent=trueSQL> show parameter remote_os_authentNAME TYPE VALUE------------------------------------ ----------- ------------------------------remote_os_authent boolean TRUESQL>2、在server端保证sqlnet.ora中SQLNET.AUTHENTICATION_SERVICES= (none)必须是none,我测试client端SQLNET.AUTHENTICATION_SERVICES的设置无关紧要3、注意参数os_authent_prefix的值,如果os_authent_prefix有值,不为null,则创建用户时也要加上os_aut
和参数相关的一些视图!
oracle有好几个和参数相关的视图,它们之间到底有啥区别,下面通过试验以及结合doc来理解一下。[@more@] 1.v$spparameter 这里的sp就是server parameterdoc对它的解释是:This view displays the current contents of the server parameter file. The view returns FALSE values in the ISSPECIFIED column if a server parameter file is not being used by the instance.验证一下:SQL> connect / as sysdba已连接。SQL> show parameter spfileNAME TYPE VALUE--------------------------