|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Today @ 3:05 PM
Points: 117,
Visits: 418
|
|
hi,
trying to understand whats going on and was hoping someone could help.
I have 10 scripts to run. Doing them 1 by 1 it takes less than a second for each to run. speeds though no problems.
If i put them into a osql batch its gets part way though and now just crawling along.. I have SP_WhoIsActive and running that its on the same query (A simple update single row)
And its just not moving.. the cpu total is just rising and rising, reads have gone into the millions! and status is suspended and its a wait on pageiolatch_ex (few mins ago it was pageiolatch_sh)
I know osql isn't a preferred choice but from the quick read around i saw its only because its limited in options compared to sqlcmd so didn't think that would factor..
the osql lines are -
osql -E -S server -d db -i "C:\temp\stage1.sql" -o "C:\temp\1.ans"
Just thought is it running all of the scripts at once? Ive just got ans files created for scripts that happen after this update!
Any ideas?
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 9:55 PM
Points: 6,720,
Visits: 11,759
|
|
Chances are the issue has nothing to do with osql but I am compelled to say it anyway, switch to using sqlcmd.exe, osql.exe has been a deprecated feature since SQL 2005 
pageiolatch_ex means a query in the script needs data from disk. You said the scripts ran in seconds when run 1 by 1. Was that is an SSMS query window? And was that against the same database with the same amount of data on a server with the same amount of activity?
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Today @ 8:08 AM
Points: 54,
Visits: 617
|
|
Might be worth checking sys.dm_os_waiting_tasks and sys.dm_tran_lock Regards
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Today @ 3:05 PM
Points: 117,
Visits: 418
|
|
hi!
yes i ran them i ssms.. it was against the same database / machine seemed to get stuck but did finish eventually.. nothing else was happening on the box.
Ill see what happens with sqlcmd tomorrow, Do you know if osql was running all the scripts at the same time or it does one then proceeds to the next.
thanks
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Today @ 3:05 PM
Points: 117,
Visits: 418
|
|
Sorry Paul missed your post!
ill take a look at them when i do it again.. hopefully help track it down some more...
guessing it has to be some sort of locking issue..
Thanks
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 9:55 PM
Points: 6,720,
Visits: 11,759
|
|
n00bDBA (10/10/2012) Do you know if osql was running all the scripts at the same time or it does one then proceeds to the next. Separate calls to the exe will constitute a separate session to the database. Inside each script the existence of a GO will separate batches within the same session.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|