ORA-1652 When Using CTAS With A View?

Aug 5, 2010

Environment is Oracle 11gR1 Enterprise Edition (non-RAC) on OEL 5.x.

The user has an assigned temporary tablespace SOME_TEMP which has autoextend on in increments of 1 MB with a maximum size of 5 GB.

User executes:

create table some_table as select * from some_view;

and error ORA-1652 is raised, "Unable to extend temporary tablespace SOME_TEMP".

This is the only user running any queries or statements in the database other than my monitoring session.

I alter the tablespace so it can increase unlimited removing the 5 GB max size. I then run

select count(*) from some_view;

The count is just under 249,000 rows and the query returns in only a few seconds.

I run the user's CTAS statement while periodically checking the size of SOME_TEMP. SOME_TEMP grows fairly quickly past 5 GB to 6, 7, 8, ..., 11 GB and still going after about 3 minutes.

I kill the CTAS statement after SOME_TEMP exceeds 11 GB ... using a view which returns less than 249,000 rows ... and no, the table is not wide enough to use this much temp space for the entire table many times over.

Previous versions of SOME_VIEW have been used to create SOME_TABLE and the CTAS typically completes in under 2 minutes without any errors.A new version of SOME_VIEW was used for the first time to recreate SOME_TABLE when ORA-1652 was raised.

The view returns a fixed number of rows fairly quickly so I think this rules out any logical, recursive errors or unwieldy Cartesian products in the view. what is causing the temporary space to quickly grow so large ?

I expect if I did not terminate the statement, the temporary space would grow until it consumed all available disk space on the system.

View 4 Replies


ADVERTISEMENT

SQL & PL/SQL :: CTAS - Select Query In Database

Apr 12, 2011

I have created a table using a CTAS

E.g. :

CREATE TABLE temp1 AS
SELECT * FROM table1;

Now after the table got created, is there any place in the data base where the select query is stored using which the table got created? In brief, I would like to get the select query through which the table got created.

View 2 Replies View Related

Application Express :: Does CTAS Evaluate Order By In APEX SQL Command Window

Oct 22, 2013

I need to recreate my table in order to change the column order. When I use the SQL Commands window and run the SQL, it runs successfully, creates the new table, but doesn't reorder the columns. Is this expected behavior?

View 2 Replies View Related

Server Administration :: Temp Tablespace Error ORA-1652

May 9, 2012

I am getting error "ORA-1652: unable to extend temp segment by 128 in tablespace" but i can see there is enough free space left in TEMP. I can see we have many active session. how can we drill down to solve this error. Below is the status for all the tablespaces.

Tablespace STA M A Init Total MB Free MB Used MB LrgstMB MaxExt %Fr A
------------ --- - - ---- ------------ ---------- ----------- -------- ------------ --- -
AMINDEX OLN L S 64K 5,120 5,120 0 3,968 2147483645 100
AMOWNER OLN L S 64K 5,120 5,120 0 3,968 2147483645 100
BOB_TS OLN L U 10M 17,240 16,130 1,110 9,740 2147483645 94
DDP_TAB OLN L U 1M 5,120 3,700 1,420 3,507 2147483645 72
[code]....

View 7 Replies View Related

ORA-1652 / Unable To Extend Temp Segment By 32 In Tablespace

Mar 20, 2013

I'm getting the error

ORA-1652: unable to extend temp segment by 32 in tablespace EDWSTGDATA00.

do i need to add more tempfiles or add more space in EDWSTGDATA00 tablespace.

View 1 Replies View Related

ORA-1652 - Unable To Extend Temp Segment By 128 In Tablespace TEMPORARY_DATA

May 3, 2011

When i retrive the data from database 11g, i am getting the error ORA-1652:unable to extend temp segment by 128 in tablespace TEMPORARY_DATA.

View 1 Replies View Related

Server Administration :: ORA-1652 - Big Temp Tablespace With 4 Tempfiles Each Of 32GB

Dec 1, 2011

I am having a very big Temp Tablespace with 4 tempfiles each of 32GB.Usually there is nightly run involving very big tables.

When i got the error ORA-1652:

unable to extend temp segment by 128 in tablespace TEMP

the temp usage was as follows

Tablespace name Total MB UsedMB FreeMB
TEMP 128818 100735 28083

Only 100GB was used and there was about 28GB free space in Temp.But still i was getting the error.Was it becos it was defragmented and was not able to find a contigous segment? Is it applicable for temp tablespace also..

View 6 Replies View Related

Server Administration :: How To Change Existing Materialized View To Normal View

Jan 17, 2013

can we change the existing materialized view to normal view? if yes how?

View 2 Replies View Related

Creating Materialized View On Remote Simple View

Dec 11, 2012

I'm trying to create a Materialized View on a remote database from a simple view. The reason is, the data owners don't want to grant explicit tables privileges to external subscribers.

A new schema is created to publish data in the form of a view. I've created mlogs on the master tables, and granted them to the subscriber, but it's still complaining about a missing primary key on the view. A primary key does exist in the master table.

Is there another work around for this situation without having to work inside the data sources' environment?

View 5 Replies View Related

SQL & PL/SQL :: Create Primary Key On View And Use This View For Creating Foreign Key?

Oct 8, 2010

is it possible to create primary key on view and use this view for creating foreign key .

View 3 Replies View Related

SQL & PL/SQL :: Change View Definition When Select Is Running On That View

Apr 25, 2012

We wrote one data load process to load GZ files into Database.during process we will change client facing view definitions to backup table so that we can work on base tables.

This view definition changes are related to FROM and WHERE clause (not columns/type). during load process, client/user may connect to current server and accessing these views. My question is what will be the reflection of changing view definition while user is accessing view?

I created a scenario-
STEP1: Created a view-
create or replace view view_01 as
select object_name from dba_objects union all
select object_name from dba_objects union all
select object_name from dba_objects union all
[code]....

View definition is replaced by new definition while select is executing on that view. select returned number of records as per view definition one.

View 6 Replies View Related

SQL & PL/SQL :: Oracle View Have Dynamic View Function?

Jul 28, 2010

Are oracle view have Dynamic view function?

View 8 Replies View Related

SQL & PL/SQL :: Materialized View - Table Or View Does Not Exist

May 2, 2012

I have a materialized view "pro_mview",I am trying to refresh the MVIEW by using the following statement.

EXEC DBMS_MVIEW.REFRESH('pro_mview','C');

But I am getting the below error.

*
Error at line 1:
ORA-12008: error in materialized view refresh path
ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2256
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2462
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2431
ORA-06512: at line 1

I am able to fetch the data from that materialized view(pro_mview).

View 3 Replies View Related

SQL & PL/SQL :: Difference Between View And Materialized View

Apr 26, 2011

difference between view and materialized view?

View 1 Replies View Related

SQL & PL/SQL :: Difference Between View And Materialized View?

Aug 12, 2013

what would be the difference between a view and a materialized view? whether DML possible on a view? i think error occurs if DML tried on a view which is a combination of two or more tables, whether DML possible on a materialized view?

View 7 Replies View Related

SQL & PL/SQL :: Create View In Another View?

Dec 1, 2011

Can we create view in another view

View 10 Replies View Related

Select One Row From A View

Dec 7, 2006

I am using some UPS shipping software that imports shipping information based on an order number that the user enters and we are having performance problems. In the software's configuration you choose one database object (namely a table or view) to get the information from. I have created myView that selects from multiple tables, lookup tables, etc. I must use a view because the software only has the ability to add a " and <importKeyThatIHaveDefined> = <valueEnteredByUser>". For instance " and order_number = 123". It cannot join multiple tables, etc. The address_field1 info is the same for each record with the same order_number so I can just get the first row (or any row with order_number = <enteredOrderNumber> for that matter).

When I first looked at this it was created as something like this:

select order_number, line_number, order_number || '' || line_number as ol, address_field1 from order;Keep in mind that there are more than just this table and more fields selected. They are all joined correctly (for lookup values etc.).

The concatenation was determined to be the bottleneck in performance. ol was defined as the import key to be used and the users were just entering the order number plus a 1 to get ONLY the first line number. Each order (usually) has more than one line and even the line number is not necessarily unique for each order. For instance, order 123 may have line 1 twice and line 2 once.

select order_number, line_number, address_field1 from order where rownum = 1;

The software appended the " and order_number = 123" as expected but because rownum = 1 had already been executed (before the and order_number = 123" the view only returned one row even WITHOUT the order_number = 123.

I need to return only ONE row for a given order number EVEN IF there are multiple records with the same order_number and line_number. Using "where order_number = <enteredOrderNumber> and line_number = 1" is not necessarily unique so that won't work.If I can't make it work this way and can't use the rownum = 1 what options do I have?

View 7 Replies View Related

Inserting In A View

Aug 13, 2010

I have a view ( from many tables) , an error view in wich i monitor errors that appear in my project. This view should be empt always but whenever a error occurs the view shows me this. I wanna put a trigger or something like that on that view to send me an e-mail whenever a line is inserted in that view. ( I don't wanna use a job for that to make a count because this will affect the entire database).

View 3 Replies View Related

View And Table With Same Name

Dec 5, 2012

If you have one table called CUST_ACCOUNTS and a view called CUST_ACCOUNTS -- and then you want to select from the view and not the table.Is there a prefix for views or something that I can have in front of the name to specify it's the view I want data from?

View 1 Replies View Related

How To Search For A Particular Value In The View

Dec 27, 2009

Which is better to use of Views and Materialized views so as to have good performance ? Also I need to search for a particular value in the view. Any function in sql to implement this ?

View 3 Replies View Related

SQL & PL/SQL :: Select From View

Mar 1, 2012

I am using Oracle Database 9i. I have created a view as follows:

CREATE OR REPLACE FORCE VIEW ipl.abc_test AS
SELECT '10' dsgn, TRIM (b.oc1) code, b.grp, b.POLICY, b.premcode,
b.receipt, b.recptdt, b.PLAN, b.term, b.paymode, b.sumass, b.datcom,b.duedt, b.instl, b.lprem, b.rprem, b.sprem, b.extprem, b.totprem,b.oc10, b.oc9, b.oc8, b.oc7, b.oc6, b.oc5, b.oc4, b.oc3, b.oc2,b.oc1, b.bill_oc1 billno, a.fprdate riskdt,
NVL (a.bmon, TO_CHAR (a.fprdate, 'YYYYMM')) bmon, a.entryopt,
a.extprem3 suplext

[Code]...

View created properly, But when i select from this view this giving message missing right parenthesis. For information the select statement of the view gives multiple rows. Where is the problem.

View 17 Replies View Related

SQL & PL/SQL :: Using Inline View?

Oct 6, 2012

I am working on this assignment question for class:

Write a SELECT statement that returns a single value that represents the sum of the largest unpaid invoices for each vendor (just one for each vendor). Use an inline view that returns MAX(invoice_total) grouped by vendor_id, filtering for invoices with a balance due

What I have coded so far is below
SELECT i.vendor_id,
To_char(SUM(invoice_total), '$9,999,999.99') AS sum_invoice_total
FROM invoices i
join (SELECT vendor_id,

[code]...

I am getting some results which I have attached. I'm not sure if I'm capturing the "largest unpaid invoices for each vendor" part of the question. Yielding to the knowledge the group and trying to use the proper posting etiquette. I have attached my output screen as well.

View 1 Replies View Related

SQL & PL/SQL :: Inline View?

Aug 19, 2013

the execution steps of inline view?importance&advantage of inline view?.Also reference link where i can get more information about inline view(i.e. basics to advanced),exercises and interview questions.

View 3 Replies View Related

SQL & PL/SQL :: Primary Key On A View

Dec 20, 2011

While making a view.

1. Is it advisable to have primary key in a view.

2. Why can't we have a primary key in a view, what are its advantages. I mean one cannot search a view by index.

3. Is it because of hibernate, but again i have used distinct keyword in a view declaration which means i cannot insert via view.

Here is my code for view to make a primary key in a view.

CREATE OR REPLACE FORCE VIEW VU_NAME
PRIMARY_KEY, NAME_ID, ADDRESS_ID
)

[Code]....

alter view VU_NAME add constraint vemp_pk primary key (PRIMARY_KEY) disable

View 3 Replies View Related

SQL & PL/SQL :: Query On View

May 25, 2010

I have created a table "temp" with one column "c_temp_1"

I have created a view "temp_vw" on table "temp".

When I queried the view, I got the table data i.e., column "c_temp_1".

Now, I added another column "c_temp_2" to table "temp"

When I querid the view, I did not got the column "c_temp_2".

But after recreated the view "temp_vw", I got the column "c_temp_2".

My knowledge is view will hold only select statement and will be executed when ever we call the view.

So, when I call the view after adding the second column, I should be able to see second column data as well but why I have to recreate the view?

-- Because of my PC issues, I was not able to paste SQL commands.

View 1 Replies View Related

Source For A View?

Jul 9, 2007

I am new to oracle... i have one view called c1.. I want to know table of this view..

View 4 Replies View Related

SQL & PL/SQL :: Variable In View

May 12, 2012

create view sample as

var varchar(100);
var:= select * from employee;

execute immediate var;

can we create like this ... my requirement is like this...

View 6 Replies View Related

SQL & PL/SQL :: How To Create View

Feb 25, 2011

I want to create view as follows.

Example:

Create or replace v_name
select job,sal, <funcation>
from emp;

Note:- Funcation returning 4 values.

Requirement:- I want to create view 6 columns.

how to create view.

View 3 Replies View Related

SQL & PL/SQL :: Materialized View

Jul 7, 2010

I have requirement to create materialized views. The design states to use Complete refresh. Now I am using WITH ROW_ID clause.

1. Question - what are the criteria to decide between WITH PRIMARY KEY & WITH ROW_ID clauses? I referred oracle doc, but couldn't exactly get this.

2. Background - The oracle doc mentions that - Primary key materialized views are the default type of materialized view. The master table must contain an enabled primary key constraint, and the defining query of the materialized view must specify all of the primary key columns directly.

Question - I saw some existing materialized views in my project using WITH PRIMARY KEY clause, but all of the primary key columns are not part of the Select query, but still these views are working fine, how is this possible?

3. Background - The oracle doc mentions that - Rowid materialized views must be based on a single table and cannot contain any of the following:

■Distinct or aggregate functions
■GROUP BY or CONNECT BY clauses
■Subqueries
■Joins
■Set operations

Question - But I have created a Rowid materialized view selecting data from more than one table & defining query involving outer joins. This materialized view got created & getting refreshed (complete refresh). But again this is contradicting with Oracle' statement.

View 1 Replies View Related

ListAgg Query Vs View?

Jan 29, 2013

I've generally operated under the assumption that if I have a query that executes properly, I should be able to create a view from that same logic. However, I've had more than one occasion where this seems to NOT be the case.

Today, I have a query using ListAgg that operates just fine when run interactively, but (in SQL Developer v 3.0.04) it gives ORA-24344 when I try to create a view using the exact same statement.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved