有时需要跟踪达梦数据库里的sql语句,可通过开关输出到日志文件中。
-
#需要修改参数
-
sp_set_para_value(1,'svr_log',1);
-
-
#生效配置文件
-
sp_refresh_svr_log_config();
-
-
#检查svr_log参数
-
select * from v$dm_ini where para_name='svr_log';
效果如下:
-
日志位置:
-
[dmdba@db1 log]$ pwd
-
/dm8/dmdbms/log
-
-
内容:
-
[dmdba@db1 log]$ head dmsql_zhcx_20230417_112748.log
-
2023-04-17 11:27:44.294 (ep[0] sess:0x7f7270b647d8 thrd:1353902 user:sysdba trxid:530521 stmt:0x7f7270b636f8 appname:disql ip:::1) [ora]: select * from v$instance;
-
2023-04-17 11:27:44.307 (ep[0] sess:0x7f7270b647d8 thrd:1353902 user:sysdba trxid:530521 stmt:0x7f7270b636f8 appname:disql ip:::1) [sel] select * from v$instance; exectime: 0(ms).
-
2023-04-17 11:28:15.493 (ep[0] sess:0x7f7270b647d8 thrd:1353902 user:sysdba trxid:530521 stmt:0x7f7270b636f8 appname:disql ip:::1) [ora]: select * from v$dm_ini where para_name=‘svr_log’;
-
2023-04-17 11:28:15.494 (ep[0] sess:0x7f7270b647d8 thrd:1353902 user:sysdba trxid:530521 stmt:0x7f7270b636f8 appname:disql ip:::1) [err(-2111)]: select * from v$dm_ini where para_name=‘svr_log’;
-
2023-04-17 11:28:23.796 (ep[0] sess:0x7f7270b647d8 thrd:1353902 user:sysdba trxid:530521 stmt:0x7f7270b636f8 appname:disql ip:::1) [ora]: select * from v$dm_ini where para_name='svr_log';
-
2023-04-17 11:28:23.796 (ep[0] sess:0x7f7270b647d8 thrd:1353902 user:sysdba trxid:530521 stmt:0x7f7270b636f8 appname:disql ip:::1) [sel] select * from v$dm_ini where para_name='svr_log';
-
2023-04-17 11:28:23.811 (ep[0] sess:0x7f7270b647d8 thrd:1353902 user:sysdba trxid:530521 stmt:0x7f7270b636f8 appname:disql ip:::1) [sel] select * from v$dm_ini where para_name='svr_log'; exectime: 14(ms).
-
2023-04-17 11:28:36.824 (ep[0] sess:0x7f7264c3c138 thrd:1355154 user:zhcx5 trxid:558411 stmt:null appname:) trx: start
-
2023-04-17 11:28:36.825 (ep[0] sess:0x7f7264c3c138 thrd:1355154 user:zhcx5 trxid:558411 stmt:null appname:) trx: commit
-
2023-04-17 11:28:36.825 (ep[0] sess:0x7f7268100dc8 thrd:1355346 user:zhcx5 trxid:558412 stmt:null appname:) trx: start
阅读(419) | 评论(0) | 转发(0) |