1.how to create a tablespace that employs the most common features

 create tablespace tb_name  #create bigfile tablespace tb_name
         datafile ‘/u01/dbfile/orcl/tb_name.dbf’
         size 100m
         autoextend on maxsize 1000m  #don’t recommend use the AUTOEXTEND feature. if use this feature,suggest always specify a corresponding MAXSIZE.
 extent management local  #A locally managed tablespace uses a bitmap in the data file to efficiently determine whether an extent is in use
         uniform size 128k  #instruct Oracle to allocate size for each extent via the UNIFORM SIZE [size] clause.the default uniform extent size is 1MB
         segment space management auto;  #the SEGMENT SPACE MANAGEMENT AUTO clause instructs Oracle to manage the space within the block.
         nologging;  #you can turn off the generation of redo for direct path loading.
         default row store compress advanced;

2.renameing a tablespace. When you rename a tablespace,Oracle updates the name of the tablespace in the data dictionary,control files,and data file headers. Keep in mind that renaming a tablespace doesn’t rename any associated data files.

 SQL> alter tablespace old_name rename to new_name

3.alter a tablespace logging mode

 SQL> alter tablespace tb_name nologging;

4.confirm the tablespace logging mode by querying the DBA_TABLESPACES view

 SQL> select tablespace_name,logging from dba_tablespaces;

5.changing a tablespace’s write mode

 SQL> alter tablespace tb_name read only; #you can’t make a tablespace that contains active rollback segment read-only.
 SQL> alter tablespace tb_name read write;
 SQL> alter table table_name read only; #modify individual tables

6.dropping a tablespace

 SQL> alter tablespace tb_name offline; #before droping a tablespace,it’s a good practices to first it offline.
 SQL> drop tablespace tb_name including contents and datafiles cascade constraints;

7.using Oracle Managed Files




 SQL> alter system set db_create_file_dest=’/u01’;

8.enabling default table compression within a tablespace

 SQL> alter tablespace tb_name default row store compress advanced;
 SQL> alter tablespace tb_name defaule compress [basic | nocompres]

9.displaying oracle error messages and action

 $ oerr ora 

10.altering tablespace size

 SQL> alter database datafile ‘/u01/user01.dbf’ resize 1g;
 SQL> alter tablespace users add datafile ‘/u02/users02.dbf’ size 100m;
 SQL> alter tablespace big_data resize 1T;  #with bigfile tablespace,you have the option of using the ALTER TABLESPACE statement to resize the data file. this works because only one data file can be associated with a bigfile tablespace.

11.to add space to a temporary tablespace

 SQL> select name,bytes from v$tempfile;  #first query the V$TEMPFILE view to verify the current size and location of temporary data files.
 SQL> alter database tempfile ‘u01/temp01.dbf’ resize 500m;
 SQL> alter tablespace temp add tempfile ‘u01/temp02.bdf’ size 5000m;

12.toggling data files offline and online

 SQL> alter tablespace tb_name offline;
 SQL offline for drop  #if your database isn’t in archivelog mode,you must specify ALTER DATAFILE ... OFFLINE FOR DROP when taking a data file offline.When you use the OFFLINE FOR DROP clause, no checkpiont is taken on the data file, this means you need to perform media recovery on the data file before bringing it online.

13.renaming or relocating a data file.new in Oracle 12c is the ALTER DATABASE MOVE DATAFILE commend.this commend allows you to rename or move datafiles without any downtime.

 SQL> alter database move datafile ‘u01/user01.dbf’ to ‘/u01/user02.dbf’;
 SQL to ‘u02/user01.dbf’ keep;  #to keep a copy of the original file.
 SQL to ‘/u01/user02.dbf’ reuse;  #specify the REUSE clause to overwrite an existing file.

Oracle Study Note : Tablespace and Data Files的更多相关文章

  1. Oracle Study Note : Users and Basic Security

    1. view the default user account SQL> select username from dba_users; 2. lock all users and set t ...

  2. Oracle客户端工具出现“Cannot access NLS data files or invalid environment specified”错误的解决办法

    Oracle客户端工具出现"Cannot access NLS data files or invalid environment specified"错误的解决办法 方法一:参考 ...

  3. Oracle Study之--Oracle 单实例11.升级到11.

    Oracle Study之--Oracle 单实例11.升级到11. 系统环境: 操作系统:RedHat EL6(64位) Oracle:    Oracle 11gR2 ...

  4. do export method of oracle all database tables with dmp files.

    usually we need to export the database tables to backup and others use. So we must know what to do e ...

  5. ORA-12705: Cannot access NLS data files or invalid environment specified

    ASM实例无法启动 [grid@data ~]$ sqlplus / as sysasm SQL*Plus: Release Production on Fri Sep 11 0 ...

  6. Oracle 11gR2 Database和Active Data Guard迁移案例

    客户一套核心系统由一台Oracle Database单机和一台Active Data Guard组成,分别运行在两台PC服务器上,Oracle Linux 5.8 x86_64b ...

  7. Creating a Data Snapshot Using Raw Data Files 创建一个数据快照使用 Raw Data Files Creating a Data Snapshot Using Raw Data Files 创建一个数据快照使用 Raw Data Files 如果数据库是大的, 复制raw 数据文 ...

  8. Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(3)

    Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(3) 一.配置共享存储 [oracle@aix203 ~]$lsdev -c disk hdisk0 Available ...

  9. Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(4)

    Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(4) 一.安装CRS补丁 在安装CRS之前,须要安装补丁p6718715_10203_AIX64-5L,否则在安装时会出现 ...


  1. 【bzoj1913】 Apio2010—signaling 信号覆盖

    http://www.lydsy.com/JudgeOnline/problem.php?id=1913 (题目链接) 题意 给出一个平面上n个点,求任选3个点画一个圆所包含的点的期望值. Solut ...

  2. 写了placement new就要写placement delete

    "placement new"通常是专指指定了位置的new(std::size_t size, void *mem),用于vector申请capacity剩余的可用内存. 但广义的 ...

  3. iPhone系列设备媒体查询:

    这就引出一个问题,我们在对iPhone设备适配时候,又多出几种情况.iPhone系列设备媒体查询: @media only screen and (min-device-width: 320px){ ...

  4. cni 添加网络 流程分析

    cnitool: Add or remove network interfaces from a network namespace cnitool add <net> <netns ...

  5. 嵌入式 使用mp4v2将H264+AAC合成mp4文件

    录制程序要添加新功能:录制CMMB电视节目,我们的板卡发送出来的是RTP流(H264视频和AAC音频),录制程序要做的工作是: (1)接收并解析RTP包,分离出H264和AAC数据流: (2)将H26 ...

  6. Codeforces GYM 100114 D. Selection 线段树维护DP

    D. Selection Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100114 Descriptio ...

  7. HDU-2548 两军交锋

    两军交锋 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submi ...

  8. Dynamics CRM 2011编程系列(60):JS编程之CRUD辅助类(JQuery版)

    今天给大家分享一个JQuery版的REST辅助类,在一年前我分享过一个只能在IE环境下运行的REST辅助类:<JS编程之实体CRUD辅助类 >.为什么要推出JQuery版的CRUD辅助类呢 ...

  9. STL List容器

    转载http://www.cnblogs.com/fangyukuan/archive/2010/09/21/1832364.html 各个容器有很多的相似性.先学好一个,其它的就好办了.先从基础开始 ...

  10. 京东消息中间件JMQ

    http://blog.csdn.net/javahongxi/article/details/54411464 [京东技术]京东的MQ经历了JQ->AMQ->JMQ的发展,其中JQ的基于 ...