Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[ORACLE] Löschen von TEMP Files

Empfohlene Antworten

Veröffentlicht

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ß

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.