Quelques infos ici :
http://home.planet.nl/~heuve345/databases/oraclea.html
Q: Ive powered off my PC while a SQL statement was running. Although my PC is powered off, the table on which the SQL statement was running is still locked. What should I do?
A: To prevent this:
Some OSs automatically detect when an client has died. In this case, you dont have to do anything to automatically kill an Oracle process.
However, there are OSs (like Windows NT) which dont have this feature; in that case try the following.
1. Open the file \ORANT\NETWORK\ADMIN\SQLNET.ORA on the server with a text editor (e.g. notepad).
2. Change or add:
sqlnet.expire_time = n
in which n is a positive integer unequal to zero.
3. Save the file and close the editor.
4. Reboot the server.
Every n minutes, the server will send a small packet to the client,. If the server doesnt get an answer, it assumes the client is dead, and it will ROLLBACK its transactions and then kill the session).
To kill a process:
1. Make sure all the users are logged out.
2. Start any SQL tool you like.
3. Connect to the database as user sys or system.
4. Execute the following query.
SELECT * FROM v$session;
5. Note down the SID and SERIAL# of the remaining sessions.
6. For every session you want to kill, execute the following statement.
ALTER SYSTEM KILL SESSION '<SID>,<SERIAL#>';
Dont forget the qoutes!
7. Query v$session again. The sessions should either have been disappeared or have the STATUS 'KILLED'.
Message édité par Beegee le 26-10-2005 à 15:26:27