Bo's Oracle Station

查看: 2110|回复: 0

第42次:2015-08-17星期一

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2015-8-18 10:14:01 | 显示全部楼层 |阅读模式
上完1Z0-052第7章        (52-36)

2015-08-17a.sql
  1. select  * from dba_tablespaces  t where t.tablespace_name like 'TBS05207%';

  2. create tablespace  tbs05207_M datafile size 10M segment space management  manual;

  3. create tablespace  tbs05207_A datafile size 10M;

  4. select  * from dba_tables t where t.table_name  like 'T05207%';

  5. select  i.index_name, i.pct_free  from dba_indexes i where i.index_name  like 'I05207%';

  6. select * from dba_segments s where s.owner='HR' and s.segment_name='T04209_UNAME';

  7. select * from dba_extents s where s.owner='HR' and s.segment_name='T04209_UNAME';

  8. CREATE SMALLFILE TABLESPACE tbs05207_d
  9.     DATAFILE SIZE 10M AUTOEXTEND ON NEXT 4K MAXSIZE UNLIMITED   
  10.      DEFAULT STORAGE ( INITIAL 1024K NEXT 1024K  PCTINCREASE 0);
  11.      
  12.   
  13. create tablespace tbs05207_u
  14.   DATAFILE SIZE 10M AUTOEXTEND ON NEXT 4K MAXSIZE UNLIMITED  
  15.   uniform size 1024K;


  16. CREATE SMALLFILE TABLESPACE tbs05207_d2
  17.     DATAFILE SIZE 10M AUTOEXTEND ON NEXT 4K MAXSIZE UNLIMITED   
  18.      DEFAULT STORAGE ( INITIAL 128K NEXT 128K  PCTINCREASE 50);
  19.      
  20.    select * from dba_extents s where s.owner='HR' and s.segment_name='T05207_D3';  
  21.      
复制代码

2015-08-17b.sql

  1. select  * from dba_tables t where t.owner='HR'
  2.   and t.table_name='T04209_UNAME';
  3.   
  4.   select  * from database_properties ;
  5.   
  6.   alter database default tablespace users;
  7.   
  8.   select sum(bytes)/1024/1024 from dba_segments s where s.tablespace_name='EXAMPLE';
  9.   
  10.   select  ( (select sum(bytes) from dba_data_files d where d.tablespace_name='TEMP')-
  11.   (select  sum(bytes)  from dba_free_space f where f.tablespace_name='TEMP'))/  
  12.   (select sum(bytes) from dba_data_files d where d.tablespace_name='TEMP')
  13.     from dual;
  14.    
  15.     select  
  16.    ((select  sum(bytes) from dba_temp_files t where t.tablespace_name='TEMP')-
  17.   ( select  sum( t.BYTES_CACHED +t.BYTES_USED)   from v_$temp_extent_pool  t))/   
  18.     (select  sum(bytes) from dba_temp_files t where t.tablespace_name='TEMP')
  19.     from dual
  20.     ;
  21.    
  22.    
  23.     select  sum(e.bytes)/1024/1024  from dba_undo_extents e
  24.      where e.tablespace_name='UNDOTBS1' and e.status  <> 'EXPIRED'
  25.      (select sum(bytes)/1024/1024 from dba_data_files d where d.tablespace_name='UNDOTBS1')
  26.      
  27.      
  28.      
  29.      create bigfile tablespace tbsbig datafile size 5M autoextend on maxsize 4T uniform size 512K;
  30.      
  31.      select  * from dba_data_files where tablespace_name='TBSBIG';
  32.      
  33.      alter tablespace tbsbig add datafile size 5M ;
  34.      
  35.      alter database datafile '+DATA/orcl/datafile/tbsbig.272.888010091' resize 20M;
  36.      
  37.    
  38.    
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-3-29 15:27 , Processed in 0.030664 second(s), 24 queries .

快速回复 返回顶部 返回列表