Here is a situation on our production server, Hope you guys may be able
to throw some light.
We need to alter a table,add some columns.
So i tried to monitor users threads accessing this table, using
who-access.sh script in IIUG site.
It doesn't show any userthreads.
So i tried executing "alter table " statement on dbaccess , but failed
saying "can't get exclusive access" on table.
Even i tried manually by getting hex(partnum) from systabnames and
greping against onstat -g opn output, still doesn't show any threads
accessing the table.
It's true some of the applications access this table from different
databases using synonyms.
I tried scheduling cron job to alter table on odd hours, still can't get
exclusive lock and failed.
Wondering what kind of lock is remaining on the table.
I tried this several times.
Now situation is, we need to bounce box to do this, so that we can
acquire exclusive access.
I would appreciate if anyone could help on this.
Regards
Anas
Sent via Deja.com http://www.deja.com/
Before you buy.
↪ replying to mohdanas@my-deja.com
Have you tried logic like this?
begin work;
set lock mode to wait;lock table <table> in exclusive mode;
alter table <table> add (
whatever ....
);
commit work;
Caution : Test this by running in the foreground, in DBAccess.
Rudy
mohdanas@my-deja.com wrote:
> Here is a situation on our production server, Hope you guys may be able
> to throw some light.
>
> We need to alter a table,add some columns.
>
> ...Wondering what kind of lock is remaining on the table.
>
>