查看表空间大小和使用率,增加表空间大小的四种方法
**
查看表空間大小和使用率**
select a.tablespace_name as tablespace_name,total,free,total-free as used,(total-free) as usepercent
from (select tablespace_name,sum(bytes)/1024/1024 total from dba_data_files group by tablespace_name) a,
(select tablespace_name,sum(bytes)/1024/1024 free from dba_data_files group by tablespace_name) b where
a.tablespace_name = b.tablespace_name;
select tablespace_name,file_id,file_name,round(bytes/(1024*1024),0) total_space from dba_data_files order by tablespace_name;
5.有些查詢表空間的語句需要執(zhí)行用戶需要高的權(quán)限,如何查看當前用戶的角色呢?使用命令select * from user_role_privs即可。
**
增加表空間大小的四種方法
**
Meathod1:給表空間增加數(shù)據(jù)文件
ALTER TABLESPACE app_data ADD DATAFILE
‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF’ SIZE 50M;
Meathod2:新增數(shù)據(jù)文件,并且允許數(shù)據(jù)文件自動增長
ALTER TABLESPACE app_data ADD DATAFILE
‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP04.DBF’ SIZE 50M
AUTOEXTEND ON NEXT 5M MAXSIZE 100M;
Meathod3:允許已存在的數(shù)據(jù)文件自動增長
ALTER DATABASE DATAFILE ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF’
AUTOEXTEND ON NEXT 5M MAXSIZE 100M;
Meathod4:手工改變已存在數(shù)據(jù)文件的大小
ALTER DATABASE DATAFILE ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP02.DBF’
RESIZE 100M;
英文版
**
View table space size and usage
**
select a.tablespace_ name as tablespace_ name,total,free,total-free as used,(total-free) as usepercent
from (select tablespace_ name,sum(bytes)/1024/1024 total from dba_ data_ files group by tablespace_ name) a,
(select tablespace_ name,sum(bytes)/1024/1024 free from dba_ data_ files group by tablespace_ name) b where
a.tablespace_ name = b.tablespace_ name;
select tablespace_ name,file_ id,file_ name,round(bytes/(1024*1024),0) total_ space from dba_ data_ files order by tablespace_ name;
**
Four ways to increase the size of table space
**
Meathod1: add data file to table space
ALTER TABLESPACE app_ data ADD DATAFILE
‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF’ SIZE 50M;
Meathod2: add new data files and allow them to grow automatically
ALTER TABLESPACE app_ data ADD DATAFILE
‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP04.DBF’ SIZE 50M
AUTOEXTEND ON NEXT 5M MAXSIZE 100M;
Meathod3: allow existing data files to grow automatically
ALTER DATABASE DATAFILE ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF’
AUTOEXTEND ON NEXT 5M MAXSIZE 100M;
Meathod4: manually changing the size of existing data files
ALTER DATABASE DATAFILE ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP02.DBF’
RESIZE 100M;
總結(jié)
以上是生活随笔為你收集整理的查看表空间大小和使用率,增加表空间大小的四种方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: plsql 批量调存储过程_数控双端开榫
- 下一篇: mui aniShow 动画属性