将字典管理的表空间转换为本地管理表空间 SQL> alter table emp move tablespace tbsp_new; SQL> alter index emp_pk_idx rebuild tablespace tbsp_idx_new; 或 SQL> exec dbms_space_admin.tablespace_migrate_to_loca('user'); 注意: 不过使用dbms_space_admin包时转换后不会设置为ASSM,另外空间碎片也不会消失。 创建表空间 SQL> create tablespace test01 datafile '+DATA' size 1024M autoextend on next 10M maxsize 4096M extent management local autoallocate segment space management auto; 查看表空间管理方式: SQL> select tablespace_name,initial_extent,next_extent,min_extents,max_extents,extent_management,segment_space_management,allocation_type from dba_tablespaces order by 6,7,8; 语法: create [ undo | temporary ] tablespace tablesapce_name datafile '+DATA' size 100M [ reuse ] 当指定数据文件已存在时,需要使用该参数覆盖 [autoextend [off | on]] 禁止或允许自动扩展数据文件,默认为off [next 100M] 指定自动扩展数据时的磁盘空间 [maxsize [unlimited | 100 M]] 扩展的最大磁盘空间 [minimum extent 10M] 指定分配extent的大小 [blocksize 16k] 设置块的大小 ,注意默认8K,如果改成16K时,必须设置db_16K_cache_size参数 [default storage xx] 配置默认参数 [online | offline] [logging | nologging] 表示该表空间上对象是否需要进行日志处理,默认logging [force logging] 强制记录该表空间上所有的改变,除了临时段 [extent management [dictionary | local ]] extent管理方式,建议本地管理 [autoallocate | uniform [size 20 M]] 自动分配extent大小或者固定extent大小 [segment space management [ auto | manual ]] 配置段的管理方式,建议自动管理 增加表空间大小 SQL> alter tablespace test01 add datafile '+DATA' size 1000M autoextent on next 10M maxsize 1000M; 重新定义数据文件大小 SQL> alter database datafile 'xxxxx' resize 250M; 删除表空间 SQL> drop tablespace test01 including contents and datafiles; SQL> drop tablespace test01 cascade constraints; 包含其他表与该表的外键约束 sysaux表空间移除用户 SQL> select occupant_name,schema_name,space_usage_kbytes,move_procedure from v$sysaux_occupants; SQL> execute wksys.move_wk('TEST01'); 管理表空间可用性 SQL> alter tablespace test01 online normal; SQL> alter tablespace test01 online temporary; SQL> alter tablespace test01 online immediate; 执行该操作前执行checkpoint,另外onine前执行recover datafile操作 SQL> alter tablespace tets01 offline; 重新命名表空间 SQL> alter tablespace test01 rename to test02; 重新命名数据文件 SQL> alter tablespace test01 offline normal; $ cp /u01/app/oracle/test01.dbf /u02/app/oracle/test01.dbf SQL> alter tablespace test01 rename datafile '/u01/app/oracle/test01.dbf' to '/u02/app/oracle/test01.dbf'; SQL> alter tablespace test01 online; 只读表空间 SQL> alter tablespace test01 read only; SQL> alter tablespace test01 read write; 配置默认表空间 SQL> alter database default tablespace test01; 大文件表空间 数据库中最多64000个datafile 创建BFT SQL> alter tablespace set default bigfile tablespace; SQL> create bigfile tablespace bigtbs_01 datafile '+DATA' size 100G; SQL> select property_value from database_properties where property_name='DEFAULT_TBS_TYPE'; 更改BFT空间 SQL> alter tablespace bigtbs resize 120G; SQL> alter tablespace bigtbs autoextend on next 20G;
Oracle表空间管理命令
来源:这里教程网
时间:2026-03-03 11:57:57
作者:
编辑推荐:
- Word2010中 自动更正 使用基础教程03-03
- 如何在Office2010中如何使用其它国家语言03-03
- Oracle表空间管理命令03-03
- Oracle使用备份文件集恢复归档日志03-03
- Word2010的数学自动更正使用基础教程03-03
- Word2010中使用“即点即输”功能使用基础教程03-03
- rman 差异增量 和累计增量03-03
- oracle之 安装oracle指定jdk 或者如何解决提示框显示不全03-03
下一篇:
相关推荐
-
雷神推出 MIX PRO II 迷你主机:基于 Ultra 200H,玻璃上盖 + ARGB 灯效
2 月 9 日消息,雷神 (THUNDEROBOT) 现已宣布推出基于英
-
制造商 Musnap 推出彩色墨水屏电纸书 Ocean C:支持手写笔、第三方安卓应用
2 月 10 日消息,制造商 Musnap 现已在海外推出一款 Oce
热文推荐
- rman 差异增量 和累计增量
rman 差异增量 和累计增量
26-03-03 - oracle之 安装oracle指定jdk 或者如何解决提示框显示不全
oracle之 安装oracle指定jdk 或者如何解决提示框显示不全
26-03-03 - 沃趣微讲堂 | Oracle集群技术(一)
沃趣微讲堂 | Oracle集群技术(一)
26-03-03 - Word2010中视图模式的使用介绍
Word2010中视图模式的使用介绍
26-03-03 - 为什么归档日志的大小比在线日志的大小小很多
为什么归档日志的大小比在线日志的大小小很多
26-03-03 - 实现在Word2010文档中快速删除段落标记等特殊字符
实现在Word2010文档中快速删除段落标记等特殊字符
26-03-03 - Oracle如何确定终端用户在数据库中只有一个会话?
Oracle如何确定终端用户在数据库中只有一个会话?
26-03-03 - Oracle 12C Data Gurad RAC TO RAC
Oracle 12C Data Gurad RAC TO RAC
26-03-03 - 从 Oracle 转型 MySQL 分布式事务数据库的实战旅途
从 Oracle 转型 MySQL 分布式事务数据库的实战旅途
26-03-03 - Oracle 18c安装初体验
Oracle 18c安装初体验
26-03-03
