Veröffentlicht 9. Februar 200718 j Hallo Kollegen, Oracle erlaubt es ja TEMP-Files im laufenden Betrieb zu löschen. Dabei stelle ich mir eigentlich folgende frage: Wie handelt Oracle die benötigten "aktiven" Temp-Segmente (von laufenden Sorts,Joins,etc..) die gerade in dem Tempfile liegen? Ich stelle mir gerade folgendes vor: Ich habe einen TEMP Tablespace als Default für die Datenbank und die User gesetzt. Dieser beinhaltet 2 Tempfiles. Ein User macht gerade einen Join und einen ORDER BY von 2 großen Tabellen, so das Speicher im TEMP Tablespace allokiert werden muss. Es werden 2 Segmente aus dem Tempfile1 und 3 Segmente aus dem Tempfile2 allokiert. Nun droppe ich im laufenden Betrieb das Tempfile2 ... Was passiert mit den 3 allokierten Segmenten? Die Query läuft während des ganzen DROP Vorgangs noch.... Bekomme ich dann einen ORA Error oder wie wird das gehandelt? Vielen Dank! Gruß
9. Februar 200718 j Hallo, ich zitiere mal If users are currently accessing the tempfile you are attempting to drop, you may receive the following error: SQL> ALTER DATABASE TEMPFILE '/u02/oradata/TESTDB/temp01.dbf' DROP INCLUDING DATAFILES; ALTER DATABASE TEMPFILE '/u02/oradata/TESTDB/temp01.dbf' DROP INCLUDING DATAFILES * ERROR at line 1: ORA-25152: TEMPFILE cannot be dropped at this time As for the poor users who were using the tempfile, their transaction will end and will be greeted with the following error message: SQL> @testTemp.sql join dba_extents c on (b.segment_name = c.segment_name) * ERROR at line 4: ORA-00372: file 601 cannot be modified at this time ORA-01110: data file 601: '/u02/oradata/TESTDB/temp01.dbf' ORA-00372: file 601 cannot be modified at this time ORA-01110: data file 601: '/u02/oradata/TESTDB/temp01.dbf' If this happens, you should attempt to drop the tempfile again so the operation is successful: SQL> ALTER DATABASE TEMPFILE '/u02/oradata/TESTDB/temp01.dbf' DROP INCLUDING DATAFILES; Database altered. Gruß sayso
Archiv
Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.