博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle表空间管理
阅读量:4296 次
发布时间:2019-05-27

本文共 1415 字,大约阅读时间需要 4 分钟。

1.创建表空间

create tablespace yyydatafile '/u01/oracle/oradata/orcl/yyy01.dbf'size 50mautoextend onnext 50m maxsize unlimitedextent management local

2.创建用户

create user yyy identified by yyydefault tablespace yyytemporary tablespace tempprofile DEFAULT

3.授权权限

-- Grant/Revoke object privileges grant select on SYS.V_$SESSION to yyy;grant select on SYS.V_$SESSTAT to yyy;grant select on SYS.V_$STATNAME to yyy;-- Grant/Revoke role privileges grant connect to yyy;grant resource to yyy;-- Grant/Revoke system privileges grant create view to yyy;grant debug connect session to yyy;grant unlimited tablespace to yyy;

4.查询表空间的大小

SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_sizeFROM dba_tablespaces t, dba_data_files dWHERE t.tablespace_name = d.tablespace_nameGROUP BY t.tablespace_name;

5.查看表空间对应的数据文件id和数据文件名称

SELECT tablespace_name,file_id,file_name,round(bytes / (1024 * 1024), 0) total_spaceFROM dba_data_filesORDER BY tablespace_name;

6.查看表空间的使用情况

SELECT a.tablespace_name,a.bytes/1024/1024 "total/m",b.bytes/1024/1024 "used/m",c.bytes/1024/1024 "free/m",Round((c.bytes * 100)/a.bytes,2) " FREE %"FROM sys.sm$ts_avail a, sys.sm$ts_used b, sys.sm$ts_free cWHERE a.tablespace_name = b.tablespace_nameAND a.tablespace_name = c.tablespace_name;

7.更改表空间大小(dbf)

alter database datafile '数据文件路径' resize 大小;

8.删除表空间及关联关系

DROP TABLESPACE tablesapce_name including contents and datafiles cascade constraint;

转载地址:http://vudws.baihongyu.com/

你可能感兴趣的文章
网格马丁格尔交易法
查看>>
一行代码让 Python 的运行速度提高100倍
查看>>
一行 Python 实现并行化 -- 日常多线程操作的新思路
查看>>
期货市场的运作机制
查看>>
一文精通 crontab从入门到出坑
查看>>
股票连续跌停后开板表现
查看>>
东航期货行情接口和交易接口(20190509)
查看>>
ubnutu系统完美克隆至新硬盘,系统备份迁移至新硬盘
查看>>
ubnutu系统完美克隆至新硬盘,系统备份迁移至新硬盘
查看>>
东航期货模拟交易brockerid(期货公司的客户号)
查看>>
史上最全量化资源整理
查看>>
vnpy2.0安装后报错ModuleNotFoundError: No module named 'vnpy.api.ctp.vnctpmd'
查看>>
VNPY2.0火币期货交易接口配置使用
查看>>
win10和ubuntu18双系统时间同步(20190604亲测可行)
查看>>
重启小狼毫输入法,rime输入法重启
查看>>
命令行或终端ImportError:No module named(pycharm运行没问题)
查看>>
量化策略回测01双均线
查看>>
量化策略回测ATRRSI
查看>>
量化干货:量化交易系统设计的六大细节
查看>>
量化策略回测tdma
查看>>