有时需要跟踪达梦数据库里的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
阅读(567) | 评论(0) | 转发(0) |