ITPub博客

首页 > Linux操作系统 > Linux操作系统 > object checkpoint对象检查点小记

object checkpoint对象检查点小记

原创 Linux操作系统 作者:wisdomone1 时间:2013-04-18 21:40:46 0 删除 编辑

/************对象检查点的概念****************/
即仅把与对象所属的dirty block自buffer cache 的checkpoint queue写入到数据文件中

 

/*************查看与对象相关的检查点*********/
SQL> select * from v$statname where name like '%object%' and STATISTIC#=108;                    
                                                                                                
STATISTIC# NAME                                                                  CLASS    STAT_ID
---------- ---------------------------------------------------------------- ---------- ----------
       108 DBWR object drop buffers written                                          8  658143835

/*********查看对象检查点的参数值*************/                                                                                                
SQL> select value from v$sysstat where STATISTIC#=108;                                          
                                                                                                
     VALUE                                                                                      
----------                                                                                      
         0                                                                                      

/********创建测试表*********/                                                                                                
SQL> create table t_object_checkpoint(a int);                                                   
                                                                                                
Table created                                                                                   

/*******创建表不产生对象检查点********/                                                                                                
SQL> select value from v$sysstat where STATISTIC#=108;                                          
                                                                                                
     VALUE                                                                                      
----------                                                                                      
         0                                                                                      
/*******插入数据**********/                                                                                                
SQL> insert into t_object_checkpoint values(1);                                                 
                                                                                                
1 row inserted                                                                                  

/************插入数据不产生对象检查点************/                                                                                                
SQL> select value from v$sysstat where STATISTIC#=108;                                          
                                                                                                
     VALUE                                                                                      
----------                                                                                      
         0                                                                                      
                                                                                                
SQL> commit;                                                                                    
                                                                                                
Commit complete                                                                                 

/***同上commit********/                                                                                                
SQL> select value from v$sysstat where STATISTIC#=108;                                          
                                                                                                
     VALUE                                                                                      
----------                                                                                      
         0                                                                                      
                                                                                              
SQL> delete from t_object_checkpoint;                                                           
                                                                                                
1 row deleted                                                                                   

/******delete也不产生对象检查点********/                                                                                                 
SQL> select value from v$sysstat where STATISTIC#=108;                                          
                                                                                                
     VALUE                                                                                      
----------                                                                                      
         0                                                                                      
                                                                                                
                                                                                                
SQL> truncate table t_object_checkpoint;                                                        
                                                                                                
Table truncated                                                                                 

/***truncate产生对象检查点********/                                                                                                
SQL> select value from v$sysstat where STATISTIC#=108;                                          
                                                                                                
     VALUE                                                                                      
----------                                                                                      
         2                                                                                      
                                                                                                
                                                                                                
SQL> drop table t_object_checkpoint;                                                            
                                                                                                
Table dropped                                                                                   

/****drop table 产生对象检查点*********/                                                                                                
SQL> select value from v$sysstat where STATISTIC#=108;                                          
                                                                                                
     VALUE                                                                                      
----------                                                                                      
         4           
        
        
        
/*********创建另一个测试表**********/                                                     
SQL> create table t_ckpt(a int);                     
                                                     
Table created                                        

/****查看对象检查点信息*****/                                                     
SQL> select value from v$sysstat where STATISTIC#=108;
                                                     
     VALUE                                           
----------                                           
         4                                           
                                                     
SQL> alter table t_ckpt add b int;                   
                                                     
Table altered                                        
                                                     
SQL> select value from v$sysstat where STATISTIC#=108;
                                                     
     VALUE                                           
----------                                           
         4                                           
                                                     
SQL>                                                 
SQL> ---未添加表记录前的ddl不产生对象检查点          
SQL>                                                 
SQL>                                                 
SQL>                                                 
SQL> ---插入表记录                                   
SQL> insert into t_ckpt values(1);                   
                                                     
insert into t_ckpt values(1)                         
                                                     
ORA-00947: not enough values                         
                                                     
SQL> insert into t_ckpt values(1,2);                 
                                                     
1 row inserted                                       
                                                     
SQL> commit;                                         
                                                     
Commit complete                                      
                                                     
SQL> alter table t_ckpt add c int;                   
                                                     
Table altered                                        
                                                     
SQL> select value from v$sysstat where STATISTIC#=108;
                                                     
     VALUE                                           
----------                                           
         4                                           
                                                     
SQL> --插入表记录后的ddl也不产生对象检查点           
SQL>                                                 
SQL>                                                 
SQL> update t_ckpt set c=10;                         
                                                     
1 row updated                                        
                                                     
SQL> commit;                                         
                                                     
Commit complete                                      
                                                     
SQL> select value from v$sysstat where STATISTIC#=108;
                                                     
     VALUE                                           
----------                                           
         4                                           
                                                     
/****alter table rename column不产生对象检查点*********/
SQL> alter table t_ckpt rename column c to c_new;    
                                                     
Table altered                                        
                                                     
SQL> select value from v$sysstat where STATISTIC#=108;
                                                     
     VALUE                                           
----------                                           
         4                                           
                                                     
SQL> create index idx_ckpt on t_ckpt(a);             
                                                     
Index created                                        
                                                     
SQL> select value from v$sysstat where STATISTIC#=108;
                                                     
     VALUE                                           
----------                                           
         4                                           
                                                  
SQL> drop index idx_ckpt;                            
                                                     
Index dropped                                        
                                                     
SQL> select value from v$sysstat where STATISTIC#=108;
                                                     
     VALUE                                           
----------                                           
         6                                           
                                                     
SQL> ---drop index会产生对象检查点

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-758818/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
提供针对oracle初学者及进阶的数据库培训,欢迎大家咨询: 微信: wisdomone 微信公众号: lovedb 工作经历: 中国普天 北京科蓝 北京云和恩墨 北京神州新桥

注册时间:2008-04-04

  • 博文量
    2189
  • 访问量
    12685655