Bo's Oracle Station

查看: 1398|回复: 0

第29次:2015-03-31星期二

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2015-4-1 09:58:47 | 显示全部楼层 |阅读模式
2015-03-31-a.sql:
  1. select  * from dba_tables t where t.owner='HR' and t.table_name='EMPLOYEES';

  2. select  * from dba_segments s where s.owner='HR' and s.segment_name='EMPLOYEES';

  3. select  * from dba_extents e where e.owner='HR' and e.segment_name='EMPLOYEES';

  4. -----

  5. select  * from dba_tablespaces t  where t.tablespace_name in ('EXAMPLE','TEMP','UNDOTBS1','SYSTEM');
  6. -----
  7. create tablespace tbs05207;

  8. select * from dba_data_files f where f.tablespace_name='TBS05207';

  9. select * from dba_tablespaces t  where t.tablespace_name='TBS05207';

  10. create tablespace tbs05207_b   segment space management manual;

  11. select * from dba_data_files f where f.tablespace_name='TBS05207_B';

  12. select * from dba_tablespaces t  where t.tablespace_name='TBS05207_B';

  13. ---------
  14. select  * from dba_tables t where t.owner='HR' and t.table_name like 'T05207%';

  15. select  * from dba_indexes i where i.owner='HR' and i.table_name like 'T05207%';
  16. ------

复制代码

2015-03-31-b.sql
  1. select  * from dba_tablespaces t where t.tablespace_name='SYSTEM';


  2. create bigfile  tablespace tbs05207_uniform
  3.   datafile '+DATA' size 50M autoextend on
  4.    next  1M  maxsize 16T
  5.    uniform size 1M;
  6.    
  7. alter tablespace  users  add datafile '+DATA' size 30M autoextend on ;

  8. select * from dba_extents e where e.owner='HR' and e.segment_name='T04209_UNAME';

  9. select  * from database_properties;

  10. alter database default tablespace  tbs05207_uniform ;

  11. ------
  12. select sum(f.bytes)/1024/1024
  13.   from dba_data_files f where f.tablespace_name='UNDOTBS1';
  14. -----
  15. select sum(s.bytes)/1024/1024
  16.   from dba_segments s where s.tablespace_name='EXAMPLE';
  17. -----
  18. select  
  19. (select sum(f.bytes)/1024/1024
  20.   from dba_data_files f where f.tablespace_name='UNDOTBS1')-

  21. (select  sum(fs.bytes)/1024/1024
  22.   from dba_free_space  fs where fs.tablespace_name='UNDOTBS1')
  23.   
  24.   from dual;
  25.   
  26.   
  27. ----

  28.   
  29.   
  30.   -----
  31.   
  32.   
  33.   select  sum( ue.bytes)/1024/1024
  34.     from dba_undo_extents ue
  35.      where ue.status <> 'EXPIRED';
  36.      
  37.      ----
  38.      
  39.      select sum(f.bytes)/1024/1024
  40.   from dba_temp_files f where f.tablespace_name='TEMP';
  41.      
  42.   
  43.   select  * from v$temp_extent_pool;
  44.   
  45.   ---
  46.   
  47.   drop tablespace tbs05207_uniform  including contents and datafiles cascade constraints ;
  48.   alter database default tablespace users;
  49.      
  50.   
  51.   select  * from dba_Tablespaces;
  52.   
  53.   alter tablespace users rename to users1;
  54.   
  55.   select  * from database_properties;
  56.      alter tablespace users1 rename to users;  
  57.   
  58.   



复制代码



回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-2 10:24 , Processed in 0.036301 second(s), 24 queries .

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