I have load_cdr as main scriptwhich loads all the file records into vertica database through unix script. But there are two files which try to update same table..n thats y my script is getting failed...
Can any1 give me some logic how to over come this error..i need to lock the table if one file is getting loaded( i guess this is be default as when ever we apply update automatically it locks the table) and then if any other file try to update that same table..instead of fail attempt that second file should waut until first file gets loaded completely...
i need to inherit these changes in my load_cdr main script...can any1 provide input on this..
Load you files sequentially when concerning a same object.
Try to see whether you can avoid splitting object across different files during the generation step.
People won't be able to help much if you don't give more clue about the code you use.
well the script i am using is too big to post here....i am clear about my requirement the only thing i am not able to put that in unix code..
i want to add sm code in exisitng script where, if my script is running and reading all the files .. and if one file is getting loaded into table and say suppose sm other file also try to update the same table thn it shud go in sleep mode till that first file get loaded completely
Concurent access issues are tricky things... I know since I had to write a module (cobol...) to get visual basic pro v3 work in concurrent mode using access DB in a Novell environment 20 years ago... Trust me, what ctsgnb has posted is by far the simplest or be prepared to spend a month of wrting and testing just for that...
Each database use to have its own tools and/or method to load data.
I don't know those used by Vertica but it should be some, with their own requirements and constraints.
I would suggest to use the approach recommended by the editor of the product before trying to implement an home made solution.
Check Vertica's docs, pdf and red book about loading data and then, if you still encounter specific performance issue while loading, you could get help from specialised forum about this database. (At least that is how i would proceed)
well i figured something like..i can use lock file property of unix on the first file and if second files tries to load and lock file exists i will make my script to go in sleep mode...
Now prob is how can i give sleep command if i dont know how much time it wud require to finsh first file loading..is there any option with sleep command where i can give some condition instead of giveing some definite time..
Or how about i run one loop and check the lock file in every five seconds...jus a wild guess...any input on this