Lock de tabela
Situação:
SANTIBR-71445 ERRO MOCR102
Olá, pessoal, bom dia. Estou tendo problema com o programa MOCR102, toda vez que tento usá-lo o seguinte aviso persiste;
Possíveis Soluções:
Rodar o scrip abaixo, para ver as tabelas que estão com lock no momento e procurar, de acordo com o print acima, o processo e o usuário que está travando para a Claudia ou o Vinicius derrubarem.
W:\ESP2\qgp\ver-lock-transf.p
OUTPUT TO c:\temp\lista-lock-MOD.txt.
/* OUTPUT TO c:\temp\lista-lock-SEU.txt. */
MESSAGE "Lock de tabelas - banco:MGCAD".
FOR EACH MGCAD._Lock NO-LOCK:
IF _Lock._Lock-Usr = ? THEN
LEAVE.
ELSE DO:
FIND FIRST MGCAD._file NO-LOCK
WHERE _file._file-number = _lock._lock-table NO-ERROR.
IF AVAIL _file THEN DO:
FIND FIRST MGCAD._Connect NO-LOCK
WHERE _Connect._Connect-usr = _lock._lock-usr NO-ERROR.
IF AVAIL _Connect THEN DO:
disp _Lock._lock-table
_Lock-Type
_lock._lock-recid
_file._file-name
_connect._Connect-usr
_connect._connect-name
_connect._connect-batch
_connect._connect-device
_connect._connect-PID
_connect._connect-ipAddress
WITH WIDTH 500.
END.
END.
END.
END.
MESSAGE "Lock de tabelas - banco:MGMOV".
FOR EACH mgmov._Lock NO-LOCK:
IF _Lock._Lock-Usr = ? THEN
LEAVE.
ELSE DO:
FIND FIRST mgmov._file NO-LOCK
WHERE _file._file-number = _lock._lock-table NO-ERROR.
IF AVAIL _file THEN DO:
FIND FIRST mgmov._Connect NO-LOCK
WHERE _Connect._Connect-usr = _lock._lock-usr NO-ERROR.
IF AVAIL _Connect THEN DO:
disp _Lock._lock-table
_Lock-Type
_lock._lock-recid
_file._file-name
_connect._Connect-usr
_connect._connect-name
_connect._connect-batch
_connect._connect-device
_connect._connect-PID
_connect._connect-ipAddress
WITH WIDTH 500.
END.
END.
END.
END.
MESSAGE "Lock de tabelas - banco:MGMOD".
FOR EACH MGMOD._Lock NO-LOCK:
IF _Lock._Lock-Usr = ? THEN
LEAVE.
ELSE DO:
FIND FIRST MGMOD._file NO-LOCK
WHERE _file._file-number = _lock._lock-table NO-ERROR.
IF AVAIL _file THEN DO:
FIND FIRST MGMOD._Connect NO-LOCK
WHERE _Connect._Connect-usr = _lock._lock-usr NO-ERROR.
IF AVAIL _Connect THEN DO:
disp _Lock._lock-table
_Lock-Type
_lock._lock-recid
_file._file-name
_connect._Connect-usr
_connect._connect-name
_connect._connect-batch
_connect._connect-device
_connect._connect-PID
_connect._connect-ipAddress
WITH WIDTH 500.
END.
END.
END.
END.
MESSAGE "Lock de tabelas - banco:EMSCAD".
FOR EACH EMSCAD._Lock NO-LOCK:
IF _Lock._Lock-Usr = ? THEN
LEAVE.
ELSE DO:
FIND FIRST EMSCAD._file NO-LOCK
WHERE _file._file-number = _lock._lock-table NO-ERROR.
IF AVAIL _file THEN DO:
FIND FIRST EMSCAD._Connect NO-LOCK
WHERE _Connect._Connect-usr = _lock._lock-usr NO-ERROR.
IF AVAIL _Connect THEN DO:
disp _Lock._lock-table
_Lock-Type
_lock._lock-recid
_file._file-name
_connect._Connect-usr
_connect._connect-name
_connect._connect-batch
_connect._connect-device
_connect._connect-PID
_connect._connect-ipAddress
WITH WIDTH 500.
END.
END.
END.
END.
MESSAGE "Lock de tabelas - banco:EMSMOV".
FOR EACH EMSMOV._Lock NO-LOCK:
IF _Lock._Lock-Usr = ? THEN
LEAVE.
ELSE DO:
FIND FIRST EMSMOV._file NO-LOCK
WHERE _file._file-number = _lock._lock-table NO-ERROR.
IF AVAIL _file THEN DO:
FIND FIRST EMSMOV._Connect NO-LOCK
WHERE _Connect._Connect-usr = _lock._lock-usr NO-ERROR.
IF AVAIL _Connect THEN DO:
disp _Lock._lock-table
_Lock-Type
_lock._lock-recid
_file._file-name
_connect._Connect-usr
_connect._connect-name
_connect._connect-batch
_connect._connect-device
_connect._connect-PID
_connect._connect-ipAddress
WITH WIDTH 500.
END.
END.
END.
END.
OUTPUT CLOSE.
OS-COMMAND NO-WAIT "c:\temp\lista-lock-MOD.txt" .
/* OS-COMMAND NO-WAIT "c:\temp\lista-lock-SEU.txt" . */