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

推荐订阅源

Project Zero
Project Zero
F
Fortinet All Blogs
Recent Announcements
Recent Announcements
云风的 BLOG
云风的 BLOG
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
T
Tailwind CSS Blog
WordPress大学
WordPress大学
Engineering at Meta
Engineering at Meta
S
Schneier on Security
N
News and Events Feed by Topic
N
News | PayPal Newsroom
H
Help Net Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
The Exploit Database - CXSecurity.com
Attack and Defense Labs
Attack and Defense Labs
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
A
About on SuperTechFans
AWS News Blog
AWS News Blog
S
Secure Thoughts
The Cloudflare Blog
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
C
Cybersecurity and Infrastructure Security Agency CISA
V2EX - 技术
V2EX - 技术
Recorded Future
Recorded Future
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
MyScale Blog
MyScale Blog
Martin Fowler
Martin Fowler
Help Net Security
Help Net Security
人人都是产品经理
人人都是产品经理
Latest news
Latest news
C
Cyber Attacks, Cyber Crime and Cyber Security
大猫的无限游戏
大猫的无限游戏
The Last Watchdog
The Last Watchdog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
月光博客
月光博客
H
Hacker News: Front Page
P
Proofpoint News Feed
N
News and Events Feed by Topic
H
Heimdal Security Blog
L
Lohrmann on Cybersecurity
有赞技术团队
有赞技术团队
L
LangChain Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog

博客园 - 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