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

a)   DB_CREATE_FILE_DEST

b)   DB_CREATE_ONLINE_LOG_DEST_N

c)   DB_RECOVERY_FILE_DEST

 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 01653

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> alter database datafile 4 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.
SQL> recovery datafile 4;

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> alter database move datafile 4 to ‘u02/user01.dbf’ keep; #to keep a copy of the original file.
SQL> alter database move datafile 4 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.2.0.1.0升级到11.2.0.3.0

    Oracle Study之--Oracle 单实例11.2.0.1.0升级到11.2.0.3.0 系统环境: 操作系统: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 11.2.0.4.0 Production on Fri Sep 11 0 ...

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

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

  7. 17.1.1.6 Creating a Data Snapshot Using Raw Data Files 创建一个数据快照使用 Raw Data Files

    17.1.1.6 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. 使用Spring的Property文件存储测试数据 - 添加测试数据

    测试数据直接写在Property文件中,如下图: application.properties是系统自动生成,我添加了两个Property文件:HomeTestData.properties和moto ...

  2. JavaScript 变量克隆和判断变量类型

    一.变量克隆 在js中经常会遇到将一个变量赋值给一个新的变量这种情况,这对于基本类型很容易去实现,直接通过等号赋值就可以了,对于引用类型就不能这样了.(注:像函数,正则也可以直接通过等号赋值) 这里我 ...

  3. 【教程】【FLEX】#002 请求服务端数据(UrlLoader)

    为什么Flex需要请求服务端读取数据,而不是自己读取? Flex 是一门界面语言,主要是做界面展示的,它能实现很多绚丽的效果,这个是传统Web项目部能比的. 但是它对数据库和文件的读写 没有良好的支持 ...

  4. opencv学习——兴趣区选取

    在OpenCV中,普遍支持ROI和widthStep,函数的操作被限制于感兴趣的区域,要设置或者取消ROI,就要使用cvSetImageROI()和cvResetImage()函数.如过想设置ROI, ...

  5. word2010忽然无法撤销

    转:http://tieba.baidu.com/p/1115124288     第三楼 关闭正在运行的所有程序. 按Win-R,在运行框中键入regedit,然后单击“确定”. 在注册表编辑器中, ...

  6. 默菲定律 [Murphy's Law]

    一.关于默菲定律(Murphy's Law)   “墨菲定律”.“帕金森定律”和“彼德原理”并称为二十世纪西方文化三大发现. “墨菲定律”的原话是这样说的:If there are two or mo ...

  7. css各兼容应该注意的问题

    1.div布局在ie浏览器和chrome浏览器,firefox浏览器不同,不如在div里面嵌套3个div,分别左中右,左边div的pading和margin在ie8以上都是几乎相同,ie8以下做内边距 ...

  8. VC与JavaScript交互(三) --- CWebPage类调用javascript函数(给js函数传参,并取得返回值)

    ①需要一个别人写好的类CWebPage,将其对于的两个文件WebPage.h和WebPage.cpp添加到工程中. ②添加WebBrowser控件,在视图/对话框类的头文件中#include &quo ...

  9. jquery+javascript编写国籍控件

    主要功能和界面介绍 国籍控件主要支持中文.英文过滤以及键盘上下事件. 源码介绍 国籍控件核心是两个文件,navtionality.js 和 mian.css.navtionality.js主要功能是国 ...

  10. spring+hibernate--直接修改数据库,再通过hibernate查询数据不变

    这个问题已经很多天了,一直没有时间解决,不过还好是自己的项目,没什么影响. 刚好今天没事,想好好解决一下这个问题. hibernate主要配置如下: <property name="h ...