SQLPLus waits... why?
I am new to SQL Plus. I am trying to update a record using SQL Plus in a batch file. Can this be done?
When I try this, it just waits and waits and waits... I do not know why.
This is my test.sql file:
CONNECT scott/tiger@server
SPOOL ./ResetTable.status
SET LINESIZE 100
SET PAGESIZE 50
UPDATE MY_DBO.ControlTable SET TriggerFlag = 1;
COMMIT;
SPOOL OFF
EXIT;
This is my test.bat file
sqlplus /nolog @"C:\test.sql"
exit
However, this works...
This is my tes开发者_C百科t.sql file:
CONNECT scott/tiger@server
SPOOL ./ResetTable.status
SET LINESIZE 100
SET PAGESIZE 50
select * from MY_DBO.ControlTable ;
SPOOL OFF
EXIT;
This is my test.bat file
sqlplus /nolog @"C:\test.sql"
exit
I would wager that some other session has locked one or more of the rows in MY_DBO.ControlTable
where the TriggerFlag
is 1.
From a different session, can you query DBA_BLOCKERS
and DBA_WAITERS
? If you're seeing rows in those tables, can you post the results?
精彩评论