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

Temporary Tablespace and Temporary Table

 
阅读更多

Temporary Tablespaces: (sort segments and temp table data segments)

          1.contains transient data that persists only for the duration of the session.         

          2.improve the concurrency of multiple sort operations, reduce their overhead, and avoid Oracle Database space management operations.

          3.A temporary tablespace can be assigned to users with the CREATE USER or ALTER USER statement and can be shared by multiple users.

          4.Within a temporary tablespace, all sort operations for a given instance and tablespace share a single sort segment.  An extent cannot be shared by multiple transactions.

          5.When you create a temporary table, its rows are stored in your default temporary tablespace.

          6. V$SORT_SEGMENT view,V$TEMPSEG_USAGE,v$tempfile,v$dba_temp_files

1.create temporary tablespace temp1 tempfile '/u01/oradata/lsh/tempfile.dbf' size 100m extent management local uniform size 10m;

 

2.alter tablespace temp1 tempfile offline/online ;alter database tempfile '/u01/oradata/lsh/tempfile.dbf' offline/online;

 

3.alter tablespace temp1 add  tempfile '/u01/oradata/lsh/tempfile01.dbf' size 100m; alter database tempfile '/u01/oradata/lsh/tempfile.dbf' resize 150m;

 

4.alter database tempfile '/u01/oradata/lsh/tempfile.dbf' drop including datafiles;               

 

 Temporary Table:    

            1.The definition of a temporary table is visible to all sessions  

            2. the data in a temporary table is visible only to the session that inserts the data into the table

            3.The ON COMMIT clause indicate if the data in the table is transaction-specific (the default) or session-specific, the implications of which are as follows:

ON COMMIT Setting Implications
DELETE ROWS This creates a temporary table that is transaction specific. A session becomes bound to the temporary table with a transactions first insert into the table. The binding goes away at the end of the transaction. The database truncates the table (delete all rows) after each commit.
PRESERVE ROWS This creates a temporary table that is session specific. A session gets bound to the temporary table with the first insert into the table in the session. This binding goes away at the end of the session or by issuing a TRUNCATE of the table in the session. The database truncates the table when you terminate the session.

CREATE GLOBAL TEMPORARY TABLE admin_work_area
        (startdate DATE,
         enddate DATE,
         class CHAR(20))
      ON COMMIT DELETE ROWS;

分享到:
评论

相关推荐

    CREATE TABLESPACE命令详解

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

    Oracle释放临时表空间脚本

    在Oracle数据库管理中,临时表空间(Temporary Tablespace)的管理是一项非常重要的任务。合理的管理和优化临时表空间不仅可以提高系统的性能,还可以帮助解决空间不足等问题。本文将详细介绍如何通过SQL脚本进行...

    oracle新建用户详细步骤

    cmd输入 sqlplus;... GRANT CREATE SESSION,CREATE TABLE,CREATE VIEW,CREATE SEQUENCE,UNLIMITED TABLESPACE TO 用户名; GRANT CONNECT TO 用户名; GRANT RESOURCE TO 用户名; GRANT DBA TO 用户名;

    linux下创建oracle用户表空间

    创建用户的步骤是:create user jack identified by jack default tablespace test_data temporary tablespace test_temp;。 为用户赋予权限的步骤是:GRANT create any table TO jack;GRANT resource,dba TO jack;...

    创建和管理数据表.ppt

    TEMPORARY TABLESPACE temporary_tablespace_name; ``` 其中,username 是要创建的用户名,password 是用户的密码,tablespace_name 是用户的默认表空间,temporary_tablespace_name 是用户的临时表空间。 例如,...

    IBM db2 常用命令大全

    `CREATE TEMPORARY TABLESPACE exoasystmp IN DATABASE PARTITION GROUP Ibmtempgroup PAGESIZE 8K MANAGED BY SYSTEM USING('/home/exoa2/exoasystmp') EXTENTSIZE 32 PREFETCHSIZE 16 BUFFERPOOL ibmdefault8k ...

    Oracle常用的和表(Table)相关的命令

    sql> create global temporary table xay_temp as select * from xay on commit preserve rows / on commit delete rows; ``` **解析**: - `create global temporary table`: 创建全局临时表。 - `on commit ...

    oracle_create

    temporary tablespace temp 位置:D:\wwOracle\wwspace.dbf 用户名: wwuser 密码: wwuser 临时表:temp 3、创建角色 sql>create role wwrole; 4、给角色赋予相应权限 sql>grant create session,...

    数据库实验四报告.docx

    create user user_one identified by 123456 default tablespace users temporary tablespace temp quota unlimited on users; create user user_two identified by 123456 default tablespace users temporary ...

    学习oracle创建一个表空间创建临时表空间创建用户表空间资源的权限

    在Oracle数据库系统中,表空间(Tablespace)是存储数据对象(如表、索引、视图等)的逻辑单位,而临时表空间(Temporary Tablespace)则用于存储临时数据,比如排序或联接操作产生的中间结果。创建和管理表空间及...

    创建用户语句.txt

    - **`TEMPORARY TABLESPACE temp_tablespace`**:指定用户的临时表空间,默认情况下,所有用户都共享一个名为TEMP的临时表空间。 - **`PROFILE profile_name`**:指定用户配置文件,用于控制用户的资源限制等。 ###...

    oracle创建表空间

    1. `CREATE TEMPORARY TABLESPACE test_temp`:指定创建的表空间类型为临时表空间,并命名为 `test_temp`。 2. `TEMPFILE 'D:\Oracle\oradata\orcl\test_temp01.dbf'`:指定临时表空间的数据文件路径。 3. `SIZE 50M...

    Oracle创建表空间、创建用户、授权、授权对象的访问以及查看权限

    #### 1.1 临时表空间 (Temporary Tablespace) 临时表空间用于存储临时数据,例如排序操作或临时表的数据。当事务完成时,临时数据会被自动删除。创建临时表空间的基本语法如下: ```sql CREATE TEMPORARY ...

    SQL语句的使用

    TEMPORARY TABLESPACE<临时表空间> 删除用户: DROP USER 用户名; 设置用户大小: QUATA <空间大小> ON <空间名称> 用户授权方法: GRANT 角色/权限名称 TO 用户名; 常用权限: GRANT CONNECT,RESOURCE TO ...

    Oracle创建用户、表空间、导入导出、...命令

    CREATE TEMPORARY TABLESPACE test_temp TEMPFILE 'E:\oracle\product\10.2.0\oradata\testserver\test_temp01.dbf' SIZE 32M AUTOEXTEND ON NEXT 32M MAXSIZE 2048M EXTENT MANAGEMENT LOCAL; ``` 这条命令解释...

    DB2常用命令

    - 创建16KB系统表空间:`CREATE TEMPORARY TABLESPACE exoasystmp16k ... BUFFERPOOL IBMDEFAULT16K ...` - 创建32KB系统表空间:`CREATE TEMPORARY TABLESPACE exoasystmp32k ... BUFFERPOOL IBMDEFAULT32K ...` ...

    超全DB2SQL命令大全

    CREATE TEMPORARY TABLESPACE exoasystmp IN DATABASE PARTITION GROUP IBMTEMPGROUP PAGESIZE 8K MANAGED BY SYSTEM USING('/home/exoa2/exoasystmp') EXTENTSIZE 32 PREFETCHSIZE 16 BUFFERPOOL IBMDEFAULT8K ...

    Oracle.pdf

    DROP TABLESPACE 表空间名 INCLUDING CONTENTS AND DATAFILES; ``` 4. Temporary Tablespace(临时表空间):用于存储临时数据,例如排序和连接操作的中间结果。创建临时表空间: ```sql CREATE TEMPORARY ...

    oracle常用操作(创建数据库等操作)

    创建临时表空间类似,但需使用`TEMPORARY TABLESPACE`关键字,用于存储临时工作数据。 2. 用PL/SQL创建用户 创建用户通常涉及到指定用户名、密码、默认表空间和临时表空间。例如: ```sql CREATE USER 用户名 ...

Global site tag (gtag.js) - Google Analytics