惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Jina AI
Jina AI
Google DeepMind News
Google DeepMind News
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
T
The Exploit Database - CXSecurity.com
Latest news
Latest news
G
GRAHAM CLULEY
Project Zero
Project Zero
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cyber Attacks, Cyber Crime and Cyber Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Webroot Blog
Webroot Blog
Help Net Security
Help Net Security
TaoSecurity Blog
TaoSecurity Blog
Hacker News: Ask HN
Hacker News: Ask HN
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
N
News and Events Feed by Topic
Cisco Talos Blog
Cisco Talos Blog
T
Tor Project blog
The Hacker News
The Hacker News
The Last Watchdog
The Last Watchdog
C
CXSECURITY Database RSS Feed - CXSecurity.com
V2EX - 技术
V2EX - 技术
S
Secure Thoughts
AWS News Blog
AWS News Blog
W
WeLiveSecurity
云风的 BLOG
云风的 BLOG
V
V2EX
Last Week in AI
Last Week in AI
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
Google Developers Blog
P
Palo Alto Networks Blog
A
Arctic Wolf
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
M
MIT News - Artificial intelligence
V
Visual Studio Blog
C
CERT Recently Published Vulnerability Notes
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Threatpost
Simon Willison's Weblog
Simon Willison's Weblog
PCI Perspectives
PCI Perspectives
量子位
K
Kaspersky official blog
腾讯CDC
Schneier on Security
Schneier on Security
F
Full Disclosure
S
Schneier on Security

博客园 - kagar

挖掘经典:几乎被人遗忘的HTML七种用法 【转】P2P穿透NAT原理 关于delphi调用.net com的详细过程 3desj加密 C++ ,C#类型对照 DLL+ ActiveX控件+WEB页面调用例子 测试 Sql Server2005不同的表使用不同的表空间 Office文档在线编辑的实现之二 如何在Web页面上直接打开、编辑、创建Office文档 Foursquare引爆了什么 承博士:让云计算落地生根的中国云计算平台 PHP - Smarty 工作流系统功能列表系列 跨域情况下Iframe高度自适应解决方案 - kagar - 博客园 五种丑陋的项目管理 Chart 报表 jQuery 数据仓库与事务型数据库的区别 RUP与XP的平衡之道
表空间
kagar · 2010-05-24 · via 博客园 - kagar

创建临时表空间:

CREATE TEMPORARY TABLESPACE TEMP TEMPFILE'\data1\TEMP01.dbf' SIZE 500M autoextend on next 10M;

alter table AVG_ONLINE_USR move   tablespace  TBS_ubis_NEWEBA2;

alter user xm default tablespace tablespace_name

查看用户默认的表空间.sql:

select username,default_tablespace from dba_users;

查看各个表空间占用磁盘情况.sql:

select 
b.file_id 文件ID号, 
b.tablespace_name 表空间名, 
b.bytes/1024/1024||'M'字节数, 
(b.bytes-sum(nvl(a.bytes,0)))/1024/1024||'M' 已使用, 
sum(nvl(a.bytes,0))/1024/1024||'M' 剩余空间, 
100 - sum(nvl(a.bytes,0))/(b.bytes)*100 占用百分比 
from dba_free_space a,dba_data_files b 
where a.file_id=b.file_id 
group by b.tablespace_name,b.file_id,b.bytes 
order by b.file_id 

以上2者关联,就是查看用户默认表空间使用情况的sql语句:

Select *
FROM 
      (select username,default_tablespace from dba_users) ut,
      (select 
      --b.file_id 文件ID号, 
      b.tablespace_name 表空间名, 
      b.bytes/1024/1024||'M'字节数, 
      (b.bytes-sum(nvl(a.bytes,0)))/1024/1024||'M' 已使用, 
      sum(nvl(a.bytes,0))/1024/1024||'M' 剩余空间, 
      100 - sum(nvl(a.bytes,0))/(b.bytes)*100 占用百分比 
      from dba_free_space a,dba_data_files b 
      where a.file_id=b.file_id 
      group by b.tablespace_name,b.file_id,b.bytes 
      order by b.file_id ) tsu
Where ut.default_tablespace = tsu.表空间名
orDER BY ut.username

怎么查看某个表空间里的数据文件的名称和大小?
select * from dba_data_files;

增大表空间的两种方法:

1.增加额外的数据文件到表空间中

  例如:alter tablespace users add datafile '/u01/oradata/orcl/users02.dbf' size 25m;

2.修改表空间当前的数据文件

  例如:alter database datafile '/u01/oradata/orcl/users01.dbf' resize 50m;

例如:

 alter database datafile 'G:\ORACLE\PRODUCT\10.2.0\ORADATA\NXTMSG\USERS01.DBF' resize 300m;

create tablespace ** datafile ** size **

create user ** identified by ** default tablespace ** 
 

查看临时表空间的大小和使用情况:
Select round((f.bytes_free + f.bytes_used) / 1024 / 1024, 2) "total MB",
       round(((f.bytes_free + f.bytes_used) - nvl(p.bytes_used, 0)) / 1024 / 1024, 2)  "Free MB" ,
       d.file_name "Datafile name",
       round(nvl(p.bytes_used, 0)/ 1024 / 1024, 2) "Used MB",
       round((f.bytes_free + f.bytes_used) / 1024, 2) "total KB",
       round(((f.bytes_free + f.bytes_used) - nvl(p.bytes_used, 0)) / 1024, 2)  "Free KB",
       round(nvl(p.bytes_used, 0)/ 1024, 2) "Used KB",
       0 "Fragmentation Index"
from   SYS.V_$TEMP_SPACE_HEADER f, DBA_TEMP_FILES d, SYS.V_$TEMP_EXTENT_POOL p
where  f.tablespace_name(+) = d.tablespace_name
and    f.file_id(+) = d.file_id
and    p.file_id(+) = d.file_id