CREATE TABLE AS SELECT(CAST)(一)-ORA-1652
一、Symptoms
During CTAS (CREATE TABLE AS SELECT), be reported:
ORA-01652: unable to extend temp segment by 1024 in tablespace
二、Cause
The tablespace where the object is being created doesnt have sufficient space to extend for the CTAS command to succeed.
三、Solution
Modify the datafile associated for the tablespace to AUTOEXTEND ON till the CTAS command gets executed successfully.
During the CTAS , it creates a data segment in the target tablespace and marks this segment as temporary in dictionary.
Once the table created successfully , the dictionary type is changed from TEMPRORAY to TABLE. In addition, if the SELECT performs a SORT operation,temporary space may be used as for the same.
四、TEST CASE
1. 建立表空間
SQL> CREATE TABLESPACE TEST DATAFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL10G\TEST.DBF' SIZE 10M AUTOEXTEND OFF;
Tablespace created
2. 為客戶分配預設表空間
SQL> ALTER USER TESTER DEFAULT TABLESPACE TEST;
User altered.
3. 查詢物件實際大小
SQL>SELECT BYTES/1024/1024,TABLESPACE_NAME FROM DBA_SEGMENTS WHERE SEGMENT_NAME='DUMMY';
11 system --Size of the DUMMY object is 11 M
4. CTAS建立新物件
SQL> CONN TESTER/TESTER
Connected.
SQL> CREATE TABLE DUMMY_123 AS SELECT * FROM SCOTT.DUMMY;
CREATE TABLE DUMMY_123 AS SELECT * FROM SCOTT.DUMMY
*
ERROR at line 1:
ORA-01652: unable to extend temp segment by 128 in tablespace TEST
The above error message reported above is because the Tablespace TEST is of 10 M size and AUTOEXTEND OFF. The object about to be created "DUMMY_123 " , requires 11 M size and as it doesn't have enough space to extend , it has failed with the ORA-1652 error message in "TEST" tablespace.
參考文獻:
1. DURING CTAS (CREATE TABLE AS SELECT) ORA-1652 REPORTED ON THE DATA TABLESPACE [ID 577643.1]
2. http://space.itpub.net/?uid-9252210-action-viewspace-itemid-660173
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9252210/viewspace-660172/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CREATE TABLE AS SELECT(CAST)(二)-ConceptAST
- Oracle Create Table as SelectOracle
- sqlserver不能直接create table as select ......SQLServer
- insert into select 與 create table as的用法和區別(轉)
- 【SQL】14 UNION 操作符、SELECT INTO 語句、INSERT INTO SELECT 語句、CREATE DATABASE 語句、CREATE TABLE 語句SQLDatabase
- create table 使用select查詢語句建立表的方法分享
- create table進階學習(一)
- ERROR 1786 (HY000): Statement violates GTID consistency: CREATE TABLE ... SELECTError
- oracle 特殊SQL(TABLE( CAST( MULTISET()[zt]OracleSQLAST
- create table of mysql databaseMySqlDatabase
- Oracle table selectOracle
- create a partition table using a exsit table
- create table as select where 1=0會把null和not null屬性也帶上Null
- create table if not exists Waiting for table metadata lockAI
- MySQL5.6 create table原理分析MySql
- create table進階學習(三)
- create table進階學習(四)
- MySQL的create table as 與 like區別MySql
- VBA從Excel中生成Oracle create tableExcelOracle
- create table進階學習系列(八)
- create table進階學習系列(五)
- create table進階學習系列(七)
- create table進階學習系列(九)
- oracle 10046與select table查詢表系列(一)Oracle
- use azure data studio to create external table for oracleOracle
- create table之storage選項initial和其它
- T-SQL的CREATE TABLE語法(下)SQL
- T-SQL的CREATE TABLE語法(上)SQL
- create table進階學習(二)_全域性臨時表_global temporary table
- oracle 19c 無法create table解決Oracle
- How to Quickly Create a Copy of a Table using Transact-SQLUISQL
- dual表與create table語句的關係
- NOARCHIVE模式CREATE TABLE不記錄日誌呀Hive模式
- create table進階學習系列(十一)之cluster
- Bootstrap select2 ,table, 清空表單formbootORM
- 【MySQL】select for update 的Row Lock 與Table LockMySql
- 關於 mysql 中的 select * from table_a,table_b 的問題MySql
- C++之static_cast,dynamic_cast,const_castC++AST