datafile autoextend 的信息记录在哪了呢
设置数据文件autoextend on,数据文件会自动扩展;
这个扩展时数据库的内部动作是怎样的呢?
信息记录在什么地方了呢?
1. Auto extend 与 resize数据文件类似,但是:
alter database datafile 'path/file' resize N m;
这个会记录在alert日志中。
2.看v$datafile的bytes/create_bytes的变化,不过数据库创建时的文件create_bytes为0
SQL> select name,bytes/1024/1024,create_bytes/1024/1024 from v$datafile;
NAME
BYTES/1024/1024CREATE_BYTES/1024/1024
---------------------------------------- --------------- ----------------------
E:\ORACLE\ORADATA\O9I\SYSTEM01.DBF410 0
E:\ORACLE\ORADATA\O9I\UNDOTBS01.DBF 200 0
E:\ORACLE\ORADATA\O9I\CWMLITE01.DBF 20 0
E:\ORACLE\ORADATA\O9I\DRSYS01.DBF 20 0
E:\ORACLE\ORADATA\O9I\EXAMPLE01.DBF 149.375 0
E:\ORACLE\ORADATA\O9I\INDX01.DBF25 0
E:\ORACLE\ORADATA\O9I\ODM01.DBF 20 0
E:\ORACLE\ORADATA\O9I\TOOLS01.DBF 10 0
E:\ORACLE\ORADATA\O9I\USERS01.DBF 30 0
E:\ORACLE\ORADATA\O9I\XDB01.DBF38.125 0
E:\ORACLE\ORADATA\O9I\TEST1.DBF9 1
E:\ORACLE\ORADATA\O9I\TEST2.DBF4 1
已选择12行。
也就没法比较了...
3.我做了两个测试,针对这两次测试都做了
alter session set events '10046 trace name context forever,level 12';
测试1:创建了一个1m的表空间,创建一个大表把这个表空间撑大。
测试2:手工指定表空间更大的size.
分析这两个trace文件,看不太懂,只是能看到几个等待事件:
db file single write等
obj$,file$,seg$,tab$,col$,x$什么的
附录1:
当设置表空间resize/read only/read write时;
当alter table allocate extent (size 10M)/或者表把表空间撑大(auto extend)时;
都会有一个等待事件:“db file single write”
(
Oracle9i
Database Reference
Part No. A96536-02
Oracle Wait Events A-25
db file single write
This event is used to wait for the writing of the file headers.
Wait Time: The wait time is the actual time it takes to do the I/O
Parameters:
file#See "file#" on page A-15
block# See "block#" on page A-15
blocks This is the number of blocks that the session is
trying to write in file# starting at block#
)
在10G下,还会有一个“Data file init write”(这个没查到)
但是也不能说看到v$system_event里有上述等待事件就说数据文件是auto extend 了
附录2:
where can I find resized datafiles metadata
http://www.dba-village.com/dba/v ... read?ThreadIdA=9291
附录3:oracledba建议用:
_enable_tablespace_alerts ,参数怎么用还没看,首先这是个10G的参数,9I的怎么弄?
http://www.orafaq.com/parms/parm433.htm
说的不是很清楚,归结到一句话:
数据文件设置为自动扩展,怎么看数据文件扩展过了?
|