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 

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.
 SQL;

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.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. 启动和JQuery绑定--AngularJS学习笔记(二)

    上一篇简单的分析了AngularJS的项目结构,后面就开始分析具体的源代码了. 从angularFiles.js中的定义可以看出有几个文件直接位于src根目录,并不是隶属于某个模块.这几 个分别是mi ...

  2. MySQL的show语句大全

    常用的MySQL show 语句列举如下: 1.show databases ; // 显示mysql中所有数据库的名称 2.show tables [from database_name]; // ...

  3. monkeyrunner自动登录脚本

    自己写了个平时测试的app的自动登录脚本,亲测可运行.读者参照时只需要改包名.activity名称.坐标值.账号和密码即可 查看坐标是多少的方法:使用手机的指针位置来实现:系统设置---开发者选项-- ...

  4. WPA/WAP2wifi 密码破解笔记

    前言: 相对于前一段时间脆弱的WEP路由器而言,当今的路由器加密方式也大都改变为WPA/WPA2,使得无线路由器的破解难度增加.虽然如此,但还是有很多漏洞层出不穷,如WPS.退一步来说,即使加密算法无 ...

  5. 2817 Tangent的愤怒 - Wikioi

    题目描述 Description 如果机房马上要关门了,或者你急着要和MM约会,请直接跳到第六个自然段. 第二段:本题改编自Usaco Training 4.4.2... 第三段:本题加大了数据强度. ...

  6. Android破解学习之路(六)——Android游戏 方块冒险 破解

    前言: 可能大家看到标题会有些懵逼,以为我发错了,这应该是五才对吧,其实,五我已经发了,不过被管理大大移出首页了,不知道这一篇是不是也会是同样的命运.. 今天所写的是关于支付宝内购的破解 原版 链接: ...

  7. 每日冲刺报告-Day4

    敏捷冲刺报告--Day4 情况简介 今天完成前端后端任务对接, GUI主体编写 任务进度 赵坤: 完成后端爬虫 李世钰: 前后端对接, GUI编写 黄亦薇:召集小组成员开会,帮助查找资料,寻找BUG ...

  8. php短信验证码接口接入流程及代码示例

    对于绝大部分企业来说,所使用的短信验证码接口都是第三方短信服务商所提供,目前市场上短信服务商有很多,在此向大家推荐一家动力思维乐信,运营13年,值得信赖! 就拿动力思维乐信短信验证码接口为例,详细介绍 ...

  9. Oracle参数Arraysize设置对于逻辑读的影响分析

    说明: 当执行一条SQL查询的时候,为了获得满足的数据,查询在这个过程中完成解析,绑定,执行和提取数据等一系列步骤,这些步骤都是单独执行的,满足条件的数据行必须由数据库返回给应用:对于任何大小的结果集 ...

  10. 2018.10.29 NOIP训练 数据结构(带修改莫队)

    传送门 带修莫队板题. 直接按照经典写法做就行了. 代码