设为首页 加入收藏

TOP

Oracle数据文件管理
2015-07-24 10:07:11 来源: 作者: 【 】 浏览:0
Tags:Oracle 数据 文件 管理

1、手工改变数据文件的大小

SQL>conn / as sysdba

SQL>Createtablespace exampletb Datafile 'E:\ examp01.dbf' size 10M ;

SQL>alter database datafile 'E:\examp01.dbf' resize 20m;

SQL>alter database datafile 'E:\examp01.dbf' resize 9m;

2、添加数据文件到表空间

SQL> alter tablespace exampletb add datafile 'E:\ examp02.dbf' size 10M;

3、从表空间中删除数据文件

SQL> alter tablespace exampletb drop datafile 'E:\ examp02.dbf';

4、将表空间设置为只读模式和读写模式

SQL>CREATETABLE scott.student (id NUMBER(5), name VARCHAR2(10)) TABLESPACE exampletb;

SQL>insertinto scott.student(id,name) values(1, 'lucy');

SQL> alter tablespace exampletb read only;

SQL>insertinto scott.student(id,name) values(2, 'lily');

SQL>select* from scott.student;

SQL> alter tablespace exampletb read write;

SQL>insertinto scott.student(id,name) values(2, 'lily');

5、 将表空间设置为在线和离线

SQL> alter tablespace exampletb offline;

SQL>select* from scott.student;

SQL> alter tablespace exampletb online;

SQL>select* from scott.student;

6、查询表空间和数据文件

SQL>select * from v$tablespace;

SQL>select * from dba_tablespaces;

SQL>select * from v$datafile;

SQL> select * from dba_data_files;

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇检查ORACLE的警告文件的脚本 下一篇测试oracle11gcluster中OLR的重要..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·MySQL 基础入门视频 (2025-12-26 23:20:22)
·小白入门:MySQL超详 (2025-12-26 23:20:19)
·关于 MySQL 数据库学 (2025-12-26 23:20:16)
·SOLVED: Ubuntu 24.0 (2025-12-26 22:51:53)
·Linux 常用命令最全 (2025-12-26 22:51:50)