Droping TEMP tablespace
hi folks,
i have a production database in a high traffic environment base on oracle 8.1.7.0.0
i lost TEMP tablespace's datafile because of that i just offlined the tablespace ( just one datafile per tablespace TEMP ) but i can not drop or add a datafile to this tablespace.
i just added a TEMPX tablespace and changed TEMPORARY TABLESPACE of users to use this new temporary tablespace.
really how can i renew TEMP tablespace?
thanks in advanced
Well, the tablespace's offline. ok. Is it a TEMPORARY TABLESPACE or a PERMANENT with TEMPORARY option?
Can you issue the queries:select tablespace_name,file_name from dba_temp_files where tablespace_name='TEMP';
select tablespace_name,file_name from dba_data_files where tablespace_name='TEMP';to check this?
OEM show the used space because it checks in some data dictionary views which still contains info about the TEMP tablespace.
You should really try dropping the datafile/tempfile first via "ALTER DATABASE DATAFILE 'filename' OFFLINE DROP" before dropping the tablespace.
You should also check the status of the session in which you drop the tablespace before cancelling. It may take some time to complete.
Similar Messages
-
Error while Droping Undo Tablespace.
Hi,
I come across following error while droping UNDO tablesapce-
ORA-01548: active rollback segment '_SYSSMU1$' found, terminate dropping tablespace
Before droping above tablespace I created a new tablespace and set UNDO_TABLESPACE=<new Tablespace>.
I even tried to drop the UNDO tablespace after restarting instance, but no vail.
Any workaround?
Thanks,the problem's details :
SVRMGR> select segment_name,status,tablespace_name from dba_rollback_segs where
status='NEEDS RECOVERY';
SEGMENT_NAME STATUS TABLESPACE_NAME
OKRBS NEEDS RECOVERY TS_OKRBS
1 row selected.
SVRMGR> drop rollback segment OKRBS;
drop rollback segment OKRBS
ORA-01545: rollback segment 'OKRBS' specified not available
SVRMGR> select segment_name,status,tablespace_name from dba_rollback_segs;
SEGMENT_NAME STATUS TABLESPACE_NAME
SYSTEM ONLINE SYSTEM
RBS0 ONLINE RBS
RBS1 ONLINE RBS
RBS2 ONLINE RBS
RBS3 ONLINE RBS
RBS4 ONLINE RBS
RBS5 ONLINE RBS
RBS6 ONLINE RBS
ASTEK_RBS1 ONLINE TS_ROLLBKS
ASTEK_RBS2 ONLINE TS_ROLLBKS
ASTEK_RBS3 ONLINE TS_ROLLBKS
OKRBS NEEDS RECOVERY TS_OKRBS
12 rows selected.
SVRMGR> select file_name,TABLESPACE_NAME,status from dba_data_files;
FILE_NAME
TABLESPACE_NAME STATUS
/home/oracle/oradata/wil7/drsys01.dbf
DRSYS AVAILABLE
/home/oracle/oradata/wil7/indx01.dbf
INDX AVAILABLE
/home/oracle/oradata/wil7/users01.dbf
USERS AVAILABLE
/home/oracle/oradata/wil7/temp01.dbf
TEMP AVAILABLE
/home/oracle/oradata/wil7/rbs01.dbf
RBS AVAILABLE
/home/oracle/oradata/wil7/tools01.dbf
TOOLS AVAILABLE
/home/oracle/oradata/wil7/system01.dbf
SYSTEM AVAILABLE
/data1/oradata/907/INDEKS01.ORA
TS_INDEKS AVAILABLE
/data1/oradata/907/INDEKS02.ORA
TS_INDEKS AVAILABLE
/data2/oradata/907/IURAN01.ORA
TS_IURAN AVAILABLE
/data2/oradata/907/IURAN02.ORA
TS_IURAN AVAILABLE
/data2/oradata/907/JURNAL01.ORA
TS_JURNAL AVAILABLE
/data2/oradata/907/DATAPDK01.ORA
TS_PDK AVAILABLE
/data2/oradata/907/ROLLBKS01.ORA
TS_ROLLBKS AVAILABLE
/data1/oradata/907/SIMKJ01.ORA
TS_SIMKJ AVAILABLE
/data1/oradata/907/SIMKJ02.ORA
TS_SIMKJ AVAILABLE
/data2/oradata/907/TMPSIMKJ01.ORA
TS_TMPSIMKJ AVAILABLE
/data2/oradata/907/TMPSIMKJ02.ORA
TS_TMPSIMKJ AVAILABLE
/data2/oradata/907/UPAH01.ORA
TS_UPAH AVAILABLE
/data1/oradata/907/GLDATA01.ORA
TSGL_DATA AVAILABLE
/data1/oradata/907/GLBACKUP01.ORA
TSGL_BACKUP AVAILABLE
/data1/oradata/907/GLINDEX01.ORA
TSGL_INDEX AVAILABLE
/data2/oradata/907/SDM01.ORA
TS_PERSONALIA AVAILABLE
/data2/oradata/907/SDMIND01.ORA
TS_PERSOIND AVAILABLE
/data2/oradata/907/SDMPDK01.ORA
TS_PERSOPDK AVAILABLE
/data2/oradata/907/SDMROLL01.ORA
TS_PERSOROLL AVAILABLE
/data2/oradata/907/SDMTEMP01.ORA
TS_PERSOTEMP AVAILABLE
/data6/analisa/ANALISA.ORA
TS_ANALISA AVAILABLE
/data4/TS_OKTMP.ORA
TS_OKTMP AVAILABLE
/home/oracle/oradata/wil7/system02.dbf
SYSTEM AVAILABLE
/data4/TS_OKRBS.ORA
TS_OKRBS AVAILABLE
/data4/TS_OKIDX.ORA
TS_OKIDX AVAILABLE
/data5/TS_OKDTA1.ORA
TS_OKDTA AVAILABLE
/data5/TS_ODSSNP1.ORA
TS_ODSSNP AVAILABLE
/data6/TS_ODSSNP2.ORA
TS_ODSSNP AVAILABLE
/data6/TS_OKDTA2.ORA
TS_OKDTA AVAILABLE
/data2/oradata/907/ROLLBK02.ORA
TS_ROLLBKS AVAILABLE
/data1/oradata/907/SIMKJ03.ORA
TS_SIMKJ AVAILABLE
/data1/oradata/907/INVEN01.ORA
TS_INVEN AVAILABLE
/data2/oradata/907/INVENIND01.ORA
TS_INVENIND AVAILABLE
/data1/oradata/907/INVENTEMP01.ORA
TS_INVENTEMP AVAILABLE
/data1/oradata/907/GLBACKUP02.ORA
TSGL_BACKUP AVAILABLE
/data2/oradata/907/DATAPDK02.ORA
TS_PDK AVAILABLE
/data2/tssipa_data01.ora
TSSIPA_DATA AVAILABLE
/data2/tssipa_index01.ora
TSSIPA_INDEX AVAILABLE
/data2/tssipa_tmp01.ora
TSSIPA_TMP AVAILABLE
/data2/tssipa_backup01.ora
TSSIPA_BACKUP AVAILABLE
/data1/oradata/907/GLDATA02.ORA
TSGL_DATA AVAILABLE
/data1/oradata/907/GLINDEX02.ORA
TSGL_INDEX AVAILABLE
/data2/tsdpkp_data01.ora
TSDPKP_DATA AVAILABLE
/data2/tsdpkp_index01.ora
TSDPKP_INDEX AVAILABLE
/data2/TSKBL_DATA.ora
TSKBL_DATA AVAILABLE
/data2/TSKBL_INDEX.ora
TSKBL_INDEX AVAILABLE
/data2/TSKBL_BACKUP.ora
TSKBL_BACKUP AVAILABLE
/data2/SILHKDATA01.ORA
TS_SILHK_DATA AVAILABLE
/data2/SILHKINDEX01.ORA
TS_SILHK_INDEX AVAILABLE
/data2/SILHKPDK01.ORA
TS_SILHK_PDK AVAILABLE
/data2/tsdpkp_backup01.ora
TSDPKP_BACKUP AVAILABLE
58 rows selected.
SVRMGR> -
Creating a Global Temporary Table on non-default TEMP tablespace.
Hello ,
I am using Oracle 11g.
I have a procedure which create global temporary tables for its functionality. As the data which is going in the global temporary table , mean the data which is going in the default TEMP tablesapce is too huge ..... billions of rows..
So what i want to do is , I want to create the global temporary table in another TEMP2 tablespace ( which is not the default one) so the load of billions of rows of data will be shifted to TEMP2. The default TEMP tablespace will not be affected and it can be used for other transactions.
Is this possible. Can i shift the global temporary table from TEMP( Default temp tablespace) to TEMP2 ( the non-default temp tablespace) ????
Please guide me with proper solutions and examples ....
Thanks in advance ..DBA4 wrote:
Hello ,
I am using Oracle 11g.
I have a procedure which create global temporary tables for its functionality. As the data which is going in the global temporary table , mean the data which is going in the default TEMP tablesapce is too huge ..... billions of rows..
So what i want to do is , I want to create the global temporary table in another TEMP2 tablespace ( which is not the default one) so the load of billions of rows of data will be shifted to TEMP2. The default TEMP tablespace will not be affected and it can be used for other transactions.
Is this possible. Can i shift the global temporary table from TEMP( Default temp tablespace) to TEMP2 ( the non-default temp tablespace) ????
Global temporary tables are instantiated in the temporary tablespace of the schema that inserts the data - not into "the default" temporary tablespace.
Assume Schema1 creates a GTT and grants all on that table to schema2
Assume schema1 also creates a procedure (authid owner, the default) to insert data into the GTT and grants execute on the procedure to schema2
If schema2 executes: insert into schema1.gtt, the data will appear in the temporary tablespace of schema2
If schema2 executes: execute schema1.procedure, the data will appear in the temporary tablespace of schema1
So if you want to protect the "normal" temporary tablespace, you could just create a special temporary tablespace for the owner of the procedure.
Regards
Jonathan Lewis -
TEMP tablespace getting full while inserting a CLOB in Trigger
We have a Oracle 10g (10.2.0.4.0) DB on a Solaris 9 box which also runs our J2EE web-service application on Weblogic 8sp6 server.
We get around 220K web-service requests from upstream callers daily to insert data in the main table, say TABLE1, which has daily partitions on a date column. This table has around 21 columns out of which 1 is a CLOB column.
Now this table has an AFTER INSERT trigger which calls a package procedure to insert the same record into another table, say TABLE2.
From Java application insert statement in executed in below format using a weblogic jdbc connection pool :
INSERT INTO TABLE1(COLUMN1, COLUMN2, ........., CLOB_COLUMN,........, COLUMN21) VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20);
Clob object is prepared in application using ojdbc14.jar.
We are observing a strange issue here. The TEMP tablespace utilization keeps on growing as more and more inserts are executed by application and after ~125K inserts the TEMP tablespace gets full and we start getting ORA-01652 error.
On further analysis we could see that there are only 7-10 session being maintained but as more and more inserts happen TEMP tablespace utilization goes on increasing for each of these sessions.
When we tried with inserting just few records and then watching the session details in v$session_wait then we could see that it is in INACTIVE state and waiting for the event ‘SQL*Net message from client’. This does not seem correct as the session has successfully inserted the data and committed the transaction and we can see the data in the tables as well.
The confusing thing here is when we modify the trigger to pass blank string('' ) instead of the CLOB column to TABLE2 then this issue does not occur. All 200K records are inserted properly and TEMP tablespace utilization also keep always below 1%.
Can you please help us in solving this issue. Is this related to any oracle issue?
Inside the package we have tried using DBMS_COPY statement to copy the CLOB column after insert but still same result.
Code for reference:
Trigger:
=====================================
CREATE OR REPLACE TRIGGER trg
AFTER INSERT OR UPDATE
ON TABLE1
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
IF (:NEW.date_col > SYSDATE - 2)
THEN
IF (:NEW.cat IN (1001, 1002))
THEN
pkg.process_change
(:NEW.COLUMN1,
:NEW.COLUMN2,
:NEW.CLOB_COLUMN,
FLAG
END IF;
END IF;
END;
=====================================
Package:
=====================================
procedure PKG.Process_change(
p_COLUMN1 number,
p_COLUMN2 varchar2,
p_CLOB_COLUMN clob,
flag boolean
) is
v_watermark pls_integer;
v_type varchar2(1);
begin
if (flag) then
v_type := 'U';
else
v_type := 'I';
end if;
select t_seq.nextval into v_watermark from dual;
insert into TABLE2(
COLUMN1 number,
COLUMN2 varchar2,
CLOB_COLUMN clob,
watermark,
dml_type
)values (
p_COLUMN1 number,
p_COLUMN2 varchar2,
p_CLOB_COLUMN clob,
v_watermark,
v_dml_type
end;
=====================================My first thought on reading your post is that not only are you using a database version that is now so old it is in extended support and even then not even the most recent patchset for it.
The first thing I would do is move to 11gR2 and if you can't do that at least get to 10.2.0.5 and apply CLOB relevant patches as well.
Same goes for your operating system. Solaris 9 is ancient: So move to 10 which has vastly improved memory management.
To help you further it would be really valuable to know the table layout. For example is this a heap table or an IOT? Is it partitioned? Is this RAC? What size are the CLOBs? Are they stored in-line? Chunk size? etc.
This page should start you down the right road:
http://docs.oracle.com/cd/B19306_01/appdev.102/b14249/adlob_tables.htm#sthref204
But I am also wondering why you would use a trigger to, as you say, "insert the same record into another table." This description is a poster child for "bad design." -
How to create temp files in temp tablespace
Dear all,
Due to outage of our SAN, we our out of production for the
last 3 days. By the grace of Almighty we have restored production by
database recovery from our standby backup. Since temp tablespace and
temp data files do not taken as backup for standby, now after recovery
we are getting abap dumps asking for temp_1 and temp_2 datafiles.
Please guide us how to create temp files. v$tablespace is showing tablespace PSAPTEMP but datafile are not there
Abap dumps are giving these errors as mentioned below
====================================================
The exception must either be prevented, caught within the procedure
"DATA_SELECTION"
"(FORM)", or declared in the procedure's RAISING clause.
To prevent the exception, note the following:
Database error text........: "ORA-01157: cannot identify/lock data file 256 -
see DBWR trace file#ORA-01110: data file 256:
'/oracle/SD1/sapdata4/temp_2/temp.data2'"
Internal call code.........: "[RSQL/FTCH/MARA ]"
===================================================
another one asking for
'/oracle/SD1/sapdata3/temp_1/temp.data1'"
Best Regards
Waqasif you want to add a new tempfile to your TEMP Tablespace,you can do like that.
<i>ALTER TABLESPACE</i> <<b><u>name of TEMP Tablespace</u></b>> ADD TEMPFILE <<b><u><b><u>pfad to the file_and_file name</u></b></u></b>> <b>SIZE</b> <size>;
You can use also the options <i>REUS</i>E <i>autoextend off</i> or <i>on</i> .
e.g:
<i>alter tablespace</i> <u><b>PSAPTEMP</b></u> add <i>tempfile</i> <b><u>'/oracle/SD1/sapdata4/temp_2/temp.data2'</u></b> <i>SIZE 1000K</i> <i>REUSE</i>;
The directory <b><u>temp_2</u></b> should exist.
Or you can use the BR*Tools to create a new datafile. Enter brtools and follow the instructions or menu.
More to TEMP Tablespaces see please following SAP notes:
<u><b>659946</b></u> - FAQ: Temporary tablespaces
<u><b>600513</b></u> - ORA-25153 after recovery due to missing tempfiles
and the Oracle Note:
<u><b>160426.1</b></u>: TEMPORARY Tablespaces : Tempfiles or Datafiles ?
I hope it helps. -
Should I increase TEMP tablespace size here ?
Version: 10.2.0.4
Platform : RHEL 5.8
Currently we are running a batch job in a schema. The default temporary tablespace for that schema is TEMP.
But I see that the tablespace is full.
SQL> select file_name, bytes/1024/1024/1024 gb from dba_temp_files where tablespace_name = 'TEMP';
FILE_NAME GB
/prd/fdms/oradata_db18/fdmsc1sdb/oradata/ts_temp/temp01.dbf 10
SQL> SELECT TABLESPACE_NAME, FILE_ID,
BYTES_USED/1024/1024,
bytes_free/1024/1024
FROM V$TEMP_SPACE_HEADER where tablespace_name = 'TEMP' 2 3 4 ;
TABLESPACE_NAME FILE_ID BYTES_USED/1024/1024 BYTES_FREE/1024/1024
TEMP 1 10240
So, far the application users have not complained and I didn't see any 'unable to extend' error in the alert log yet, but the above scenario is dangerous. Right? I mean SQL statements with sorting can error out. Right ? Unlike UNDO, with temp tablespace, temp segments cannot be reused. Right ?Hello,
As said previously, the Sort Segments can be reused, the Views V$SORT_SEGMENT and V$TEMPSEG_USAGE are relevant to monitore the usage of the Temporary Tablespace.
You'll find in the Note below a way to control over time the Temporary Tablespace:
How Can Temporary Segment Usage Be Monitored Over Time? [ID 364417.1]
More over, you may also check for any ORA-01652 in the Alert Log.
But don't worry to much to get a Full Temporary Tablespace, here "Full" doesn't mean "unreusable".
Hope this help.
Best Regards,
Jean-Valentin Lubiez -
Restored coldbackup and having trouble with TEMP tablespace
Hi, i succesfully restored from a coldbackup on solaris.(oracle 9.2)
i can log on to database using toad, query the database, but when i try to take an export or something i got the error
EXP-00056: ORACLE error 1157 encountered
ORA-01157: cannot identify/lock data file 203 - see DBWR trace file
ORA-01110: data file 203: '/sun2int1/oracle92/app/oracle/product/9.2.1/oradata/TPRS/temp03.dbf'
ORA-06512: at "SYS.DBMS_LOB", line 424
ORA-06512: at "SYS.DBMS_METADATA", line 1140
ORA-06512: at line 1
EXP-00000: Export terminated unsuccessfully
when i did the restore, i simply renamed the datafiles and redo logs.
But i didnt rename the TEMP datafile, as you can not rename it with a "alter database rename file ..." command
so thats the problem!
i planned to create a new default temp. tablespace, and simply make it default and drop the other one. but it does not work!
i tried to execute:
CREATE TEMPORARY TABLESPACE temp4 TEMPFILE '/oracleAS/TPRS/oradata/TPRS/temp4.dbf' SIZE 5M REUSE AUTOEXTEND ON NEXT 1M MAXSIZE unlimited
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;
create temporary tablespace temp01 tempfile '/oracleAS/TPRS/oradata/TPRS/temp01.dbf' size 100M;
but they all hang! i wait, but nothing happens! (and alert log does not log anything too)
and finally i tried to drop the default tablespace, and i couldnt drop it as i thought. (ORA-12906: cannot drop default temporary tablespace
So, im stuck and i beleive i have to RENAME the datafile for temporary tablespace. how can i do this?
Edited by: merope on Jun 9, 2009 11:32 AMSQL> col file_name for a50
col status for a15
col tablespace_name for a15
col PROPERTY_VALUE for a20
select file_name,tablespace_name,bytes/1024/1024 as "SIZE_IN_MB",status,autoextensible from dba_temp_files;
SELECT PROPERTY_NAME,PROPERTY_VALUE FROM DATABASE_PROPERTIES where PROPERTY_NAME='DEFAULT_TEMP_TABLESPACE';
SQL> SQL> SQL> SQL> SQL> SQL> ERROR:
ORA-01157: cannot identify/lock data file 202 - see DBWR trace file
ORA-01110: data file 202: '/izmir1/oradbTPRS/temp1.db'
no rows selected
SQL>
PROPERTY_NAME PROPERTY_VALUE
DEFAULT_TEMP_TABLESPACE TEMP3
This is not the actual directory: /izmir1/oradbTPRS/temp1.db
it is the old location, but in the restored db, the temp1.db file is in some other directory
how can i rename this?
Edited by: merope on Jun 9, 2009 11:50 AM -
9i on Linux. Problems with Temp tablespace cleanup
I am currently running Oracle 9i Enterprise on SUSE Linux 7.2.
I am executing queries against the new XMLType datatype and every query adds to the Temp tablespace, which doesn't get cleaned up. Eventually, the tablespace will run out of space and Oracle will issue and error:
ORA-01652: unable to extend temp segment by 128 in tablespace <name>
The only way to clean up the Temp tablespace seems to be by restarting the server.
Is that happening on other platforms as well? I would appreciate any help.Hi
You can connect to the database as DBA (Sys or System) and make a bigger temporal tablespace. Or create a new bigger temporary tablespace and assign it to the user.
A10!
PS: Temporary tablespace is used when no memory available for the session, for example when a big ORDER BY is done. Try to increase the memory assigned, just look at initXXX.ora (sort_size) -
hi all,
i faced a problem regarding full temp tablespace, i added a tempfile as an immediate measure ,but the problem was with a query
i identified it
the query is
SELECT DISTINCT rt.po_unit_price item_price,
pl.unit_meas_lookup_code uom_code,
TO_NUMBER (porh.segment1) req_number,
msi.segment1 item_code, pl.item_description,
ph.po_header_id, TO_NUMBER (ph.segment1) po_number,
TRUNC (ph.creation_date) po_date, pv.vendor_name supplier,
pll.need_by_date, pl.quantity qty_ordered,
rt.quantity quantity_received,
(rt.quantity * rt.po_unit_price) pl_amount,
ph.currency_code, isd.ige_number ge_no,
isd.ige_date ge_date, rsh.receipt_num,
TRUNC (rt.transaction_date) receipt_date,
isd.lr_number gr_no, isd.transporter_name transporter,
(SELECT SUM (j.tax_amount)
FROM ja_in_receipt_tax_lines j
WHERE j.shipment_header_id =
rsl.shipment_header_id
AND j.shipment_line_id = rsl.shipment_line_id
AND j.tax_name LIKE 'PO%Freight%') freight,
pvs.vat_reg_no, pvs.cst_reg_no,
pvs.service_tax_regno st_reg_no,
pvs.excise_duty_reg_no excise_reg_no,
pvs.st_reg_no lst_reg_no, ai.invoice_num, ai.invoice_date,
ai.invoice_amount invoice_amount, ai.invoice_currency_code,
TRUNC (ai.terms_date + atl.due_days) date_of_payment,
TRUNC (aca.check_date) payment_date, aca.check_number,
aca.bank_account_name mode_of_payment,
TRUNC (aip.accounting_date) gl_date
FROM po_headers_all ph,
po_lines_all pl,
po_line_locations_all pll,
po_distributions_all pod,
po_req_distributions_all pord,
po_requisition_lines_all porl,
po_requisition_headers_all porh,
mtl_system_items msi,
po_vendors pv,
ja_in_po_vendor_sites pvs,
rcv_transactions rt,
rcv_shipment_headers rsh,
rcv_shipment_lines rsl,
ja_in_receipt_tax_lines jirtl,
ja_in_tax_codes jitc,
ap_invoice_distributions_all aid,
ap_invoices_all ai,
ap_terms_tl att,
ap_terms_lines atl,
ap_invoice_payments_all aip,
ap_checks_all aca,
kpm_ige_security_details isd,
kpm_ige_purchase_orders ipo
WHERE ph.po_header_id = pl.po_header_id
AND ph.po_header_id = pod.po_header_id
AND pl.po_line_id = pod.po_line_id
AND pl.po_line_id = pll.po_line_id
AND pl.item_id = msi.inventory_item_id
AND pod.req_distribution_id = pord.distribution_id(+)
AND pord.requisition_line_id = porl.requisition_line_id(+)
AND porl.requisition_header_id = porh.requisition_header_id(+)
AND msi.organization_id = 136
AND
pv.vendor_id = pvs.vendor_id
AND ph.vendor_id = pv.vendor_id
AND ph.vendor_site_id = pvs.vendor_site_id
AND rt.po_header_id = pl.po_header_id
AND rt.po_line_id = pl.po_line_id
AND rt.transaction_type = 'RECEIVE'
AND isd.ige_header_id = ipo.ige_header_id
AND ipo.po_header_id = ph.po_header_id
AND rsh.shipment_header_id = rsl.shipment_header_id
AND rt.shipment_header_id = rsl.shipment_header_id
AND rt.shipment_line_id = rsl.shipment_line_id
AND rsl.shipment_header_id = jirtl.shipment_header_id
AND rsl.shipment_line_id = jirtl.shipment_line_id
AND jirtl.tax_id = jitc.tax_id
AND aid.po_distribution_id = pod.po_distribution_id
AND aid.rcv_transaction_id = rt.transaction_id
AND aid.invoice_id = ai.invoice_id
AND ai.invoice_type_lookup_code = 'STANDARD'
AND ai.terms_id = att.term_id
AND att.term_id = atl.term_id
AND aip.invoice_id(+) = ai.invoice_id
AND aip.check_id = aca.check_id(+);
i am unable to identify the main cause, i know some tables are large , but how do i optimize it
I CAN SEND THE EXPLAIN PLAN ON EMAIL AS IT WONT GET DISPALYED HERE PROPERLY
database is 10g and OS is HP UX 11.11
the query runs perfectly on 9i
Edited by: user7864753 on Dec 4, 2009 2:55 PM>
database is 10g and OS is HP UX 11.11
the query runs perfectly on 9iDid you compare 9i and 10g plan ?
What changed ?
Was the DB migrated ? How ?
Were statistics recalculated ?
>
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
| 0 | SELECT STATEMENT | | 1 | 547 | 1224 (4)|
| 1 | SORT AGGREGATE | | 1 | 31 | |
|* 2 | TABLE ACCESS BY INDEX ROWID | JA_IN_RECEIPT_TAX_LINES | 1 | 31 | 4 (0)|
|* 3 | INDEX RANGE SCAN | JA_IN_RECEIPT_TAX_LINES_N2 | 4 | | 3 (0)|
| 4 | HASH UNIQUE | | 1 | 547 | 1224 (4)|
| 5 | NESTED LOOPS | | 1 | 547 | 1223 (4)|
| 6 | NESTED LOOPS | | 1 | 543 | 1223 (4)|
| 7 | NESTED LOOPS | | 1 | 527 | 1220 (4)|
| 8 | NESTED LOOPS | | 1 | 491 | 1219 (4)|
| 9 | NESTED LOOPS | | 1 | 473 | 1216 (4)|
| 10 | NESTED LOOPS | | 1 | 465 | 1214 (4)|
| 11 | NESTED LOOPS | | 1 | 460 | 1213 (4)|
| 12 | NESTED LOOPS | | 1 | 400 | 1211 (4)|
| 13 | NESTED LOOPS | | 1 | 388 | 1204 (4)|
| 14 | NESTED LOOPS | | 1 | 376 | 1203 (4)|
| 15 | NESTED LOOPS | | 1 | 364 | 1202 (4)|
| 16 | NESTED LOOPS | | 1 | 351 | 1200 (4)|
| 17 | NESTED LOOPS | | 1 | 297 | 1192 (4)|
| 18 | NESTED LOOPS | | 1 | 274 | 1190 (4)|
| 19 | NESTED LOOPS | | 5 | 1050 | 1185 (4)|
| 20 | NESTED LOOPS | | 5 | 985 | 1180 (4)|
| 21 | NESTED LOOPS | | 5 | 935 | 1175 (4)|
| 22 | NESTED LOOPS | | 5 | 885 | 1170 (4)|
|* 23 | HASH JOIN | | 6 | 954 | 1158 (4)|
|* 24 | HASH JOIN | | 6 | 684 | 1029 (4)|
|* 25 | HASH JOIN | | 29 | 3045 | 898 (4)|
|* 26 | HASH JOIN | | 7077 | 483K| 90 (6)|
| 27 | VIEW | index$_join$_010 | 4217 | 123K| 57 (4)|
|* 28 | HASH JOIN | | | | |
| 29 | INDEX FAST FULL SCAN | PO_VENDORS_U1 | 4217 | 123K| 19 (0)|
| 30 | INDEX FAST FULL SCAN | PO_VENDORS_U2 | 4217 | 123K| 37 (3)|
| 31 | TABLE ACCESS FULL | JA_IN_PO_VENDOR_SITES | 7077 | 276K| 32 (7)|
| 32 | TABLE ACCESS FULL | PO_HEADERS_ALL | 52500 | 1794K| 805 (4)|
PLAN_TABLE_OUTPUT
|* 33 | TABLE ACCESS FULL | KPM_IGE_PURCHASE_ORDERS | 10824 | 97416 | 130 (3)|
| 34 | TABLE ACCESS FULL | KPM_IGE_SECURITY_DETAILS | 14910 | 655K| 128 (4)|
|* 35 | TABLE ACCESS BY INDEX ROWID| PO_DISTRIBUTIONS_ALL | 1 | 18 | 3 (0)|
|* 36 | INDEX RANGE SCAN | PO_DISTRIBUTIONS_N3 | 4 | | 1 (0)|
| 37 | TABLE ACCESS BY INDEX ROWID | PO_REQ_DISTRIBUTIONS_ALL | 1 | 10 | 1 (0)|
|* 38 | INDEX UNIQUE SCAN | PO_REQ_DISTRIBUTIONS_U1 | 1 | | 0 (0)|
| 39 | TABLE ACCESS BY INDEX ROWID | PO_REQUISITION_LINES_ALL | 1 | 10 | 1 (0)|
|* 40 | INDEX UNIQUE SCAN | PO_REQUISITION_LINES_U1 | 1 | | 0 (0)|
| 41 | TABLE ACCESS BY INDEX ROWID | PO_REQUISITION_HEADERS_ALL | 1 | 13 | 1 (0)|
|* 42 | INDEX UNIQUE SCAN | PO_REQUISITION_HEADERS_U1 | 1 | | 0 (0)|
|* 43 | TABLE ACCESS BY INDEX ROWID | PO_LINES_ALL | 1 | 64 | 1 (0)|
|* 44 | INDEX UNIQUE SCAN | PO_LINES_U1 | 1 | | 0 (0)|
| 45 | TABLE ACCESS BY INDEX ROWID | MTL_SYSTEM_ITEMS_B | 1 | 23 | 2 (0)|
|* 46 | INDEX UNIQUE SCAN | MTL_SYSTEM_ITEMS_B_U1 | 1 | | 1 (0)|
|* 47 | TABLE ACCESS BY INDEX ROWID | RCV_TRANSACTIONS | 1 | 54 | 8 (0)|
|* 48 | INDEX RANGE SCAN | RCV_TRANSACTIONS_N5 | 7 | | 2 (0)|
| 49 | TABLE ACCESS BY INDEX ROWID | PO_LINE_LOCATIONS_ALL | 1 | 13 | 2 (0)|
|* 50 | INDEX RANGE SCAN | PO_LINE_LOCATIONS_N1 | 2 | | 1 (0)|
|* 51 | TABLE ACCESS BY INDEX ROWID | RCV_SHIPMENT_LINES | 1 | 12 | 1 (0)|
|* 52 | INDEX UNIQUE SCAN | RCV_SHIPMENT_LINES_U1 | 1 | | 0 (0)|
| 53 | TABLE ACCESS BY INDEX ROWID | RCV_SHIPMENT_HEADERS | 1 | 12 | 1 (0)|
|* 54 | INDEX UNIQUE SCAN | RCV_SHIPMENT_HEADERS_U1 | 1 | | 0 (0)|
|* 55 | TABLE ACCESS BY INDEX ROWID | AP_INVOICE_DISTRIBUTIONS_ALL | 1 | 12 | 7 (0)|
|* 56 | INDEX RANGE SCAN | AP_INVOICE_DISTRIBUTIONS_N17 | 7 | | 2 (0)|
|* 57 | TABLE ACCESS BY INDEX ROWID | AP_INVOICES_ALL | 1 | 60 | 2 (0)|
|* 58 | INDEX UNIQUE SCAN | AP_INVOICES_U1 | 1 | | 1 (0)|
|* 59 | INDEX RANGE SCAN | AP_TERMS_TL_U1 | 1 | 5 | 1 (0)|
| 60 | TABLE ACCESS BY INDEX ROWID | AP_TERMS_LINES | 2 | 16 | 2 (0)|
|* 61 | INDEX RANGE SCAN | AP_TERMS_LINES_U1 | 2 | | 1 (0)|
| 62 | TABLE ACCESS BY INDEX ROWID | AP_INVOICE_PAYMENTS_ALL | 1 | 18 | 3 (0)|
|* 63 | INDEX RANGE SCAN | AP_INVOICE_PAYMENTS_N1 | 1 | | 2 (0)|
| 64 | TABLE ACCESS BY INDEX ROWID | AP_CHECKS_ALL | 1 | 36 | 1 (0)|
|* 65 | INDEX UNIQUE SCAN | AP_CHECKS_U1 | 1 | | 0 (0)|
| 66 | TABLE ACCESS BY INDEX ROWID | JA_IN_RECEIPT_TAX_LINES | 1 | 16 | 3 (0)|
|* 67 | INDEX RANGE SCAN | JA_IN_RECEIPT_TAX_LINES_N2 | 4 | | 2 (0)|
|* 68 | INDEX UNIQUE SCAN | JA_IN_TAX_CODES_U1 | 1 | 4 | 0 (0)|
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
2 - filter("J"."TAX_NAME" LIKE 'PO%Freight%')
3 - access("J"."SHIPMENT_HEADER_ID"=:B1 AND "J"."SHIPMENT_LINE_ID"=:B2)
23 - access("ISD"."IGE_HEADER_ID"="IPO"."IGE_HEADER_ID")
24 - access("IPO"."PO_HEADER_ID"="PH"."PO_HEADER_ID")
25 - access("PH"."VENDOR_ID"="PV"."VENDOR_ID" AND "PH"."VENDOR_SITE_ID"="PVS"."VENDOR_SITE_ID")
26 - access("PV"."VENDOR_ID"="PVS"."VENDOR_ID")
28 - access(ROWID=ROWID)
33 - filter("IPO"."PO_HEADER_ID" IS NOT NULL)
35 - filter("POD"."REQ_DISTRIBUTION_ID" IS NOT NULL)
36 - access("PH"."PO_HEADER_ID"="POD"."PO_HEADER_ID")
38 - access("POD"."REQ_DISTRIBUTION_ID"="PORD"."DISTRIBUTION_ID")
40 - access("PORD"."REQUISITION_LINE_ID"="PORL"."REQUISITION_LINE_ID")
42 - access("PORL"."REQUISITION_HEADER_ID"="PORH"."REQUISITION_HEADER_ID")
43 - filter("PH"."PO_HEADER_ID"="PL"."PO_HEADER_ID")
44 - access("PL"."PO_LINE_ID"="POD"."PO_LINE_ID")
46 - access("PL"."ITEM_ID"="MSI"."INVENTORY_ITEM_ID" AND "MSI"."ORGANIZATION_ID"=136)
47 - filter("RT"."TRANSACTION_TYPE"='RECEIVE' AND "RT"."PO_HEADER_ID"="PL"."PO_HEADER_ID")
48 - access("RT"."PO_LINE_ID"="PL"."PO_LINE_ID")
50 - access("PL"."PO_LINE_ID"="PLL"."PO_LINE_ID")
51 - filter("RT"."SHIPMENT_HEADER_ID"="RSL"."SHIPMENT_HEADER_ID")
52 - access("RT"."SHIPMENT_LINE_ID"="RSL"."SHIPMENT_LINE_ID")
54 - access("RSH"."SHIPMENT_HEADER_ID"="RSL"."SHIPMENT_HEADER_ID")
55 - filter("AID"."PO_DISTRIBUTION_ID" IS NOT NULL AND
"AID"."PO_DISTRIBUTION_ID"="POD"."PO_DISTRIBUTION_ID")
56 - access("AID"."RCV_TRANSACTION_ID"="RT"."TRANSACTION_ID")
filter("AID"."RCV_TRANSACTION_ID" IS NOT NULL)
57 - filter("AI"."INVOICE_TYPE_LOOKUP_CODE"='STANDARD')
58 - access("AID"."INVOICE_ID"="AI"."INVOICE_ID")
59 - access("AI"."TERMS_ID"="ATT"."TERM_ID")
61 - access("ATT"."TERM_ID"="ATL"."TERM_ID")
63 - access("AIP"."INVOICE_ID"="AI"."INVOICE_ID")
65 - access("AIP"."CHECK_ID"="ACA"."CHECK_ID")
67 - access("RSL"."SHIPMENT_HEADER_ID"="JIRTL"."SHIPMENT_HEADER_ID" AND
PLAN_TABLE_OUTPUT
"RSL"."SHIPMENT_LINE_ID"="JIRTL"."SHIPMENT_LINE_ID")
68 - access("JIRTL"."TAX_ID"="JITC"."TAX_ID")
Note
- 'PLAN_TABLE' is old version
117 rows selected. -
Oracle 9i TEMP tablespace backup problem using RMAN!
Oracle8/8i whole backup is ok for our backup software(using RMAN without RC database), but for Oracle 9i, I get following error messages when backing up temp tablespace.
1. RMAN-20202: tablespace not found in the recovery catalog
2. RMAN-06019: could not translate tablespace name "TEMP"
I check some views of Oracle9i, and know some changes happen for temp tablespace in 9i, but how to deal with this problem. Any idea, please!In 9i RMAN does not restore temporary datafiles. Instead, you should create them after your restore. I believe that Oracle is going to make a change to this in the next release of 9i and have RMAN create the temporary files. You can view the temporary datafiles @ v$tempfile.
I believe RMAN doesn't restore temporary files because they are locally managed and not in the control files. RMAN reads the controlfile of the target database to obtain info about backups, datafiles, etc.
Hope this helps. -
To shrink the size of TEMP tablespace
Dear all,
There is a databse with RAC, now in OEM the size of TEMP tablespace has been reached at 99.9%. now we want to shrink the size of TEMP tablespace.
how to we do that???????
plz help me...........Temporary tablespaces usually show they are full, however this space is not actually in use. It is rather allocated. Oracle has evaluated the best way to obtain the most of performance, and he said it is better to allocate once than allocate-deallocate-reallocate extents, so temporary space is not 'released'.
If you want to feel psychologically more confortable with lower allocated space, you can drop your tablespace (create an interim default temporary tablespace first) and recreate it.
You can also rebuild temporary datafiles:
alter tablespace temp add tempfile 'C:\ORACLE\ORACLEXE\ORADATA\XE\TEMP01.dbf' size 32m;
SQL> select name from v$tempfile;
NAME
C:\ORACLE\ORACLEXE\ORADATA\XE\TEMP.DBF
C:\ORACLE\ORACLEXE\ORADATA\XE\TEMP01.DBF
SQL> alter database tempfile 'C:\ORACLE\ORACLEXE\ORADATA\XE\TEMP01.DBF' drop including datafiles;
Database altered. -
Check and identify cause of previous temp tablespace usage
Hi
Our production ERP database is on solaris and on version 9.2.0.8.0. The application tier and database tier are on two separate nodes.
Recently we observed that the temporary tablespace is being consumed more on a particular day. While monitoring the database,we observed the free temp tablespace was less and hence added 10gb space to it. However within 5-6 hours this space was utilised and certain requests/jobs failed due to no space in temp. This happened on 04th December 2012. Though the situation returned to normal post that,we need to find the cause of consumption of temporary tablespace in such large volumes. We are on 9i database and hence tried identifying the queries through statspack report as no views in particular exist for 9i.
We came across many queries which would help us identfy the current temp usage,but in 9i,we didnot find anything which would guide us on the historic temp tablespace usage. Can it be found via statspack? If yes,what exactly to check for in it? Request you to all please advice. Thanks.
Regards
Rdxdba-- To get historic information for a spesific sid,serial
column temp_mb format 99999999
column sample_time format a25
prompt
prompt DBA_HIST_ACTIVE_SESS_HISTORY
prompt
select sample_time,session_id,session_serial#,sql_id,temp_space_allocated/1024/1024 temp_mb,
temp_space_allocated/1024/1024-lag(temp_space_allocated/1024/1024,1,0) over (order by sample_time) as temp_diff
from dba_hist_active_sess_history
--from v$active_session_history
where
session_id=&1
and session_serial#=&2
order by sample_time asc
prompt
prompt ACTIVE_SESS_HIST
prompt
select sample_time,session_id,session_serial#,sql_id,temp_space_allocated/1024/1024 temp_mb,
temp_space_allocated/1024/1024-lag(temp_space_allocated/1024/1024,1,0) over (order by sample_time) as temp_diff
--from dba_hist_active_sess_history
from v$active_session_history
where
session_id=&1
and session_serial#=&2
order by sample_time asc
=========================================================================
---- For global temp usage info
col sid_serial format a10
col username format a17
col osuser format a15
col spid format 99999
col module format a15
col program format a30
col mb_used format 999999.999
col mb_total format 999999.999
col tablespace format a15
col statements format 999
col hash_value format 99999999999
col sql_text format a50
col service_name format a15
prompt
prompt #####################################################################
prompt #######################LOCAL TEMP USAGE#############################
prompt #####################################################################
prompt
SELECT A.tablespace_name tablespace, D.mb_total,
SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_used,
D.mb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_free
FROM v$sort_segment A,
SELECT B.name, C.block_size, SUM (C.bytes) / 1024 / 1024 mb_total
FROM v$tablespace B, v$tempfile C
WHERE B.ts#= C.ts#
GROUP BY B.name, C.block_size
) D
WHERE A.tablespace_name = D.name
GROUP by A.tablespace_name, D.mb_total;
prompt
prompt #####################################################################
prompt #######################LOCAL TEMP USERS#############################
prompt #####################################################################
prompt
SELECT S.sid || ',' || S.serial# sid_serial, S.username, S.osuser, P.spid,
--S.module,
--P.program,
s.service_name,
SUM (T.blocks) * TBS.block_size / 1024 / 1024 mb_used, T.tablespace,
COUNT(*) statements
FROM v$tempseg_usage T, v$session S, dba_tablespaces TBS, v$process P
WHERE T.session_addr = S.saddr
AND S.paddr = P.addr
AND T.tablespace = TBS.tablespace_name
GROUP BY S.sid, S.serial#, S.username, S.osuser, P.spid,
S.module,
P.program,
s.service_name,TBS.block_size, T.tablespace
ORDER BY mb_used;
--prompt
--prompt #####################################################################
--prompt #######################LOCAL ACTIVE SQLS ############################
--prompt #####################################################################
--prompt
-- SELECT sysdate "TIME_STAMP", vsu.username, vs.sid, vp.spid, vs.sql_id, vst.sql_text,vsu.segtype, vsu.tablespace,vs.service_name,
-- sum_blocks*dt.block_size/1024/1024 usage_mb
-- FROM
-- SELECT username, sqladdr, sqlhash, sql_id, tablespace, segtype,session_addr,
-- sum(blocks) sum_blocks
-- FROM v$tempseg_usage
-- group by username, sqladdr, sqlhash, sql_id, tablespace, segtype,session_addr
-- ) "VSU",
-- v$sqltext vst,
-- v$session vs,
-- v$process vp,
-- dba_tablespaces dt
-- WHERE vs.sql_id = vst.sql_id
-- AND vsu.session_addr = vs.saddr
-- AND vs.paddr = vp.addr
-- AND vst.piece = 0
-- AND vs.status='ACTIVE'
-- AND dt.tablespace_name = vsu.tablespace
-- order by usage_mb;
--prompt
--prompt #####################################################################
--prompt #######################LOCAL TEMP SQLS##############################
--prompt #####################################################################
--prompt
--SELECT S.sid || ',' || S.serial# sid_serial, S.username, Q.sql_id, Q.sql_text,
--T.blocks * TBS.block_size / 1024 / 1024 mb_used, T.tablespace
--FROM v$tempseg_usage T, v$session S, v$sqlarea Q, dba_tablespaces TBS
--WHERE T.session_addr = S.saddr
--AND T.sqladdr = Q.address
--AND T.tablespace = TBS.tablespace_name
--ORDER BY mb_used;
-- -
Hello All,
I am using Oracle 11g R2 i want to increase the temp tablespace size. can i use the below command? can i increase while the database is open and some queries are running and use the temp table space?
ALTER DATABASE TEMPFILE '....../datafile/name_datafile.tmp' RESIZE 100M
Regards,Hello,
I am using Oracle 11g R2 i want to increase the temp tablespace size. can i use the below command? can i increase while the database is open and some queries are running and use the temp table space?Why do you intend to extend the Temporary Tablespace ? Do you have any ORA-01652 error ?
If not, may be it's not necessary to extend it. Even if it seems to be full Free Extents are reused.
ALTER DATABASE TEMPFILE '....../datafile/name_datafile.tmp' RESIZE 100MYes you can use this statement, but be aware that the Size specified (here 100 Mo) is the target size not the supplemental size.
Hope this help.
Best regards,
Jean-Valentin -
Temp tablespace full at startup
Hi,
my temp tablespace appears full at database startup. I know it is full because the collecting statistics process can not be executed since temp tablespace can not grow (autoextend off). I had to add another temp datafile to get the statistics but first one continues full after each restart.
Is this any signal of malfunction?
Thanks for all.
Greetings.ok. I think all is understood.
DBMS_STATS.GATHER_SCHEMA_STATS probably needed more disk than 1.5 GB (my old temp tablespace), so the result was
ERROR en línea 1:
ORA-01652: no se ha podido ampliar el segmento temporal con 128 en el
tablespace TEMP
ORA-06512: en "SYS.DBMS_STATS", línea 9136
ORA-06512: en "SYS.DBMS_STATS", línea 9616
ORA-06512: en "SYS.DBMS_STATS", línea 9800
ORA-06512: en "SYS.DBMS_STATS", línea 9854
ORA-06512: en "SYS.DBMS_STATS", línea 9831
ORA-06512: en línea 1
Then adding new datafile (1.5 GB more) process could finish. Database continues growing, process always had finished not yesterday: the day of needing full temp tablespace came.
Tell me if I am wrong.
Thanks a lot. -
Hi
I am having problem in executing the SQL query with certain parameters in the WHERE clause.
ORA-01114: IO error writing block to file 4 (block # 524242)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
OSD-04026: Invalid parameter passed. (OS 524247)
ORA-01114: IO error writing block to file 4 (block # 524242)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
OSD-04026: Invalid parameter passed. (OS 524247)
I get the above listed error. And i assumed there may be some issue due to Temp tablespace. I also verified the space occupied by the TEMP tablespace and it was 99% occupied.
Kindly let me know is there a way to extend the space without affecting the existing DB content
Regards
Srinivasan BDidn't you got a answer in your Getting error while executing the SQL ( ver 8.1.7.0.0), did you ?
Furthermore, don't worry about the TEMP tablespace utilization, Oracle doesn't freed space until you need it. By the way, how your TEMP tbs is defined (AUTOEXTEND, DATAFILE/TEMPFILE...) ?
Anyway, you have to be sure about the free space on your device. And check on metalink website to get some notes advices.
Nicolas.
Maybe you are looking for
-
How do I open with an animated gif and then go to home page?
I apologize for the newbie question, but I would like to have an animated gif intro to a web page. Is it possible to have the gif play and then go to the index file? Or do I need to insert the gif into an index file and save the home page as somethin
-
Question on unplanned delivery costs need to go to GL account ????
Hello I have a question regarding unplanned deliver costs. I am a FI analyst Can you please explain my how I can solve my problem . My user wants unplanned delivery costs to go in to the GL account . In MM account determination GL account is set up
-
Internet Explorer 11 installation WMI Timeout KB2729094
Hey, I have a lot of Win7 SP1 PCs here on which I receive an WMI timeout error during Internet Explorer 11 installation. Error is the following (always with the same hotfix): WMI query for Hotfixes timed out. Query string: 'Select HotFixID from Win32
-
Opening a .tif or .tiff file in Internet Explorer using Quicktime in Window
How do you open a .tif or .tiff file within Internet Explorer using Quicktime in Windows 7? Thank you for looking.
-
Deployment Descriptor defaults for clustering
If stateless session EJB is deployed in a cluster, and cluster properties are not explicitly set, what are their defaults? Darko Bohinc Synergy International Limited www.synergy.co.nz