I was inserting a bulk data from one table to a partitioned table. I am using a terminal emulator which automatically ends connection with the host every 10-15 minutes.
Thus my session was closed. I donot know if the inserts will still be continuing or not. When queried on those tables, there will be a lock, so I am unable to get even the record count.
What should I do?
Query from v$session for INACTIVE sessions and kill them. The transaction will be rolled back.
But this is a ever occuring problem, so is there any way I can submit this 'sql ' to a background process, so that even if the terminal is off, still the inserts keep going on;
I am not sure if I can help, but if it is unix, then:
You can send it on command line and end it with an & (to say run in the background).
eg if an sql script:
sqlplus system/manager @test.sql &
& wont work since the process would be killed after your session ends, may you could try nohup, check unix manual for this command
Why don't you wrap your INSERT into PL/SQL procedure and invoke that with DBMS_JOB? As yoon as you submit a job with dbms_job you can log off, since the yob is carried out entirely on server.
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
u can use the "AT" function of UNIX in running the script.
$ at now
at> sqlplus system/manager @test.sql
Combining the nohup and & solutions from previous posts is the way I tend to do it. If you do this, you may want to redirect any output to a log file (default is nohup.out)
nohup sqlplus system/manager @test.sql &
Click Here to Expand Forum to Full Width