在操作ORACLE数据库的时候,由于执行完,没有COMMIT,直接把PL/SQL关闭掉,后来导致那张表被锁住,当编辑时就会出现这个信息,record is locked by another user!
当出现这种情况的时候,只要操作下面几个步骤就可以解锁了。
1、查看锁
select t2.username,t2.sid,t2.serial#,t2.logon_time from v$locked_object t1,v$session t2 where t1.session_id=t2.sid ;
执行后如下:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdkAAABuCAIAAADknf4sAAAMzUlEQVR4nO2dPdKjuBZAtYy3Eq/HS3HmbXy5a6KJp/oLiRxO5nxCyhvwCwSy0O8VAgT2OUVN99ggpMvlcJGxW70AAKA16vbX3ywsLCwsbRf1AwAArVE9AAC0RrW+GAAAAHUxAMAOUK0/PAQAgBd1MQBAe3AxAEB7cDEAQHtwMQBAe3AxAEB7cDEAQHtwMQBAe3AxAEB7duTin5+f1+vVuhefAJFckG8O5gZjX3sXBzp8uPgDIZIL8s3BxMVbgos/ECK5IN8cTFy8Jbj4AyGSpXRd9xzonLe+OZi4eEsyLlYljJv8mdeVA0Vt5xDJImwR42IbXLwleRc7PyaUeLHve6X+6GVGVw4UtT3QedYwEEk5joi77uGs8M3BrB+7Uhd7WWMXaSTtK6V+f397Qekp32/RysMm2RadkVwul9iL4yZb1MWzY/QZdM+ue3TdI6zjbCQ7GdLOLNqawT+4ix/uruv+++8/W8SPR62LPykhF3Hx+zchy11celNe2r4Wl2nBrzINv7+/8sMay9t0C4d0sVLqd8rHZL8EI2K/iNNkI/l4PAZBPkNL12ktCfuzbGsGnWZOTjuv1DB0eNDxIOIaF+uTTf8O7WckZKWLlVKVdbFS6p9//qeU+vd+Dy7GofOGYDY3dbG+aLw8w9iKy47azlKdEq+XymrqeC6+XC6Xy0UPTKMjdbkEjvTn8RZxhYv7hEBnqXPZ1jR+KSEpLoTorj7fnRxE7NfvwpvcsaR6//cDdFzjYuHw611cUxc7G9oy8ZGMSKfB1IeDi3UJ3sfT+Hgu1vFyTtH60nj2rfSWSETciyMZEGiFOpd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oY1ScyfSARauTnAccDF0I60arEtfBO4GACgPbgYAKA9uBgAoD24GACgPbgYAKA9uBgAoD24GACgPbgYAKA9uBgAoD24GACgPbgYAKA9uBgAoD24GACgPbgYAKA9uBgAoD24GACgPbgYAKA9uBgAoD24GACgPbgYAKA9uBgAoD24GACgPbgYAKA9uBgAoD24GACgPbgYAKA9uBgAoD24GACgPbgYAKA9uBgAoD24GACgPbgYAKA9uBgAoD24GACgPbgYAKA9uBgAoD24GACgPbgYAKA9uBgAoD24GACgPbgYAKA9/wfbukPK7wEHhwAAAABJRU5ErkJggg==" alt="" />
2、Kill
--alter system kill session 'sid,serial#';
如:alter system kill session '790,19036';