`
edwards0307
  • 浏览: 27141 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

MANAGE TABLESPACE AND DATAFILES

 
阅读更多

1. tablespace,segment,extent,block

    tablespace: database logical is divided into more tablesapces.

    segment:   a special storage structure(table,index),span more datafiles

    extents:allocate unit

    block: use unit,write/read unit

              db_block_size, default block size. standand block size,system tablespace use.

              db_nk_block_size,not standand block size, other tablespace

              Any given tablespace will have a consistent block size

              any given segment(which is contained in a tablespace) will consist of blocks of exactly the        same size

              head,table directory,row directory,free,data

 2.Tablespace Mangement

     LocaL:  use bit map

     Dictionary: rescusive sql, result in update,insert sql to dictionary

   

 3. create tablespace myts1

     datafile '/u01/oradata/lsh/myts1.dbf' size  100m

     extent management local  uniform size 10k;

    

     create tablespace myts2

     datafile '/u01/oradata/lsh/myts2.dbf' size 100m

     extent management local  autoallocate;

   

     create tablespace myts3

     datafile '/u01/oradata/lsh/myts3.dbf' size 100m

     extent management dictionary

     default storage(

     initial 10k

     next 10k

     pctincrease 10%

     maxextent 100m

     )

     

     alter tablespace myts3 minimum extent 10k;

     alter tablespace myts3

     default storage(

     initial 10k

     next 10k

     );

 

 

     drop tablespace myts1 including contents and datafiles;

   

     resize tablespace

     alter database datafile '/u01/oradata/lsh/myts1.dbf' autoextend on next 10m maxsize 100m;

     alter database datafile '/u01/oradata/lsh/myts1.dbf' resize 100m;

     alter tablespace myts1 add datafile '/u01/oradata/lsh/myts1_1.dbf'  size 100m;

 

     rename datafile

     alter tablespace myts1 offline;

     !cp dest one to one dest

     alter tablespace myts1 rename datafile '/u01/oradata/lsh/myts1.dbf' to  '/u01/oradata/lsh/myts2.dbf ';

          

      shutdown immediate

      !cp one dest to one dest

      start mount;

      alter database rename file '' to '';

  

4 status of tablespace

     online/offline     control access data

     read only    drop objects   

 

5.System , undo ,temporary tablespace

   System tablespace: created by create database or dbca

                                   store data dictionary and system rollback segments

                                   can not be offline

                                   can not be delete

                                   in oracle 9i,using dbca create database ,system tablespace is local,other tablespace must be  local.

                                   if system is local ,defualt temporary tablespace must define.

                                  

    undo tablespace: store undo segment.

                                 local management

                                current use undo tablespace can not be delete

                                current use undo tablesapce can not be offline

    create undo tablespace myundo datafile '/u01/oradata/lsh/myundo.dbf' size 100m;

 

    temporary tablespace: store temporary segment

                                        default temporary tablespace can not be delete ,offline

    create temporary tablespace mytemp tempfile '/u01/ordata/lsh/mytemp.dbf' size 100m;

    alter database default temporary tablespace mytemp;

 

 

                                                        

分享到:
评论

相关推荐

    rlv方式增加oracle tablespace datafile

    rlv方式增加oracle tablespace datafile

    常用OracleSQL

    drop user oldoa cascade create tablespace tbsoa DATAFILE 'F:\app\Administrator\oradata\orcl\tbsoa.dbf' size 1024m autoextend on next 30m;...成为 drop tablespace mytbs01 including contents and datafiles;

    Oracle数据库创建和授权

    DROP TABLESPACE ELWY_TEMP INCLUDING CONTENTS AND DATAFILES; -- 创建临时表空间 CREATE TEMPORARY TABLESPACE ELWY_TEMP TEMPFILE 'E:\DataBase\Oracle\ELWY_TEMP.DBF' SIZE 100m AUTOEXTEND ON NEXT 50m ...

    CREATE TABLESPACE命令详解

    ### CREATE TABLESPACE 命令详解 在数据库管理中,`CREATE TABLESPACE` 命令是用于创建新的表空间的基础指令。表空间是数据库逻辑存储结构中的一个基本单位,用于存储数据文件、索引等数据库对象。通过合理地规划和...

    create delete tablespace user

    DROP TABLESPACE mytablespace INCLUDING CONTENTS AND DATAFILES; ``` 这将删除`mytablespace`及其所有数据文件和其中的对象。 关于【标签】中的"源码",在Oracle数据库中,虽然创建表空间和用户通常通过SQL语句...

    oracle数据库存储管理

    DROP TABLESPACE mytbs INCLUDING CONTENTS AND DATAFILES; 修改数据文件可以使用 ALTER DATABASE 语句,例如修改名为 mytbs 的数据文件的大小为 100MB: ALTER DATABASE RENAME FILE 'E:\oracledata\mydatafile....

    Orcal创建表空间

    --DROP TABLESPACE MEDEXECGTYY INCLUDING CONTENTS AND DATAFILES; CREATE TABLESPACE MEDEXECGTYY DATAFILE 'E:\Oracle\MEDEXECGTYY.dbf' SIZE 20480M AUTOEXTEND OFF LOGGING ONLINE PERMANENT EXTENT ...

    exp转换表空间

    SQL> DROP TABLESPACE TESTEXP INCLUDING CONTENTS AND DATAFILES; ``` 8. **重新配置用户**: 修改用户`TESTEXP`的默认表空间为`USERS`: ```sql SQL> CREATE USER TESTEXP IDENTIFIED BY TESTEXP DEFAULT ...

    oracle10g表空间操作命令

    DROP TABLESPACE tablespace_name INCLUDING CONTENTS AND DATAFILES; ``` 例如: ```sql DROP TABLESPACE sales INCLUDING CONTENTS AND DATAFILES; ``` ### 七、查看表空间使用情况 - 查看每个表空间的总...

    oracle创建表空间和用户授权及删除表空间和用户

    DROP TABLESPACE tablespace_name INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS; ``` - `tablespace_name`:要删除的表空间名称。 #### 3.2 删除表空间示例 删除名为`wbppcs`的表空间: ```sql DROP ...

    表空间和数据文件的管理

    DROP TABLESPACE '表空间' INCLUDING CONTENTS AND DATAFILES; ``` **扩展表空间**是数据库成长过程中常见的需求。当表空间空间不足时,可以通过增加数据文件或扩大现有数据文件的大小来扩展。例如: ```sql ALTER ...

    Oracle基本语法

    DROP TABLESPACE <tablespace_name> INCLUDING CONTENTS AND DATAFILES; ``` - **参数解释:** - `<tablespace_name>`: 要删除的表空间名称。 - `INCLUDING CONTENTS AND DATAFILES`: 同时删除表空间中的所有...

    管理表空间和数据文件.pdf

    9. **删除表空间**:需先删除其中的所有对象,然后使用`DROP TABLESPACE INCLUDING CONTENTS AND DATAFILES`,注意这会永久删除数据文件: ```sql DROP TABLESPACE demoindexts01 INCLUDING CONTENTS AND DATA...

    ORACLE表空间操作

    DROP TABLESPACE tablespace_name INCLUDING CONTENTS AND DATAFILES; ``` 例如: ```sql DROP TABLESPACE sales INCLUDING CONTENTS AND DATAFILES; ``` **说明:** - `INCLUDING CONTENTS AND DATAFILES`: 移除表...

Global site tag (gtag.js) - Google Analytics