﻿.. _sysaudit_record_sao(KES):

sysaudit_record_sao
##########################

数据库审计员 sao 可以在 security 数据库下查询视图 ``sysaudit_record_sao``，查看超级用户（包括数据库管理员 system）和数据库安全员
sso 的审计记录信息。更多审计功能信息参见 :ref:`数据库审计` 。


.. table:: sysaudit_record_sao列
      :class: longtable
      :widths: 2 2 2

      +-------------------+------------------------------+-------------------------------------------+
      | 名称              | 类型                         | 描述                                      |
      +===================+==============================+===========================================+
      | ``session_id``    | ``text``                     | 会话 id                                   |
      +-------------------+------------------------------+-------------------------------------------+
      | ``proc_id``       | ``integer``                  | 进程号                                    |
      +-------------------+------------------------------+-------------------------------------------+
      | ``vxid``          | ``text``                     | 虚事务 id                                 |
      +-------------------+------------------------------+-------------------------------------------+
      | ``xid``           | ``integer``                  | 事务 id                                   |
      +-------------------+------------------------------+-------------------------------------------+
      | ``user_id``       | ``oid``                      | 用户 id                                   |
      +-------------------+------------------------------+-------------------------------------------+
      | ``username``      | ``text``                     | 用户名                                    |
      +-------------------+------------------------------+-------------------------------------------+
      | ``remote_addr``   | ``text``                     | ip 地址/端口                              |
      +-------------------+------------------------------+-------------------------------------------+
      | ``db_id``         | ``oid``                      | 数据库 id                                 |
      +-------------------+------------------------------+-------------------------------------------+
      | ``db_name``       | ``text``                     | 数据库名                                  |
      +-------------------+------------------------------+-------------------------------------------+
      | ``rule_id``       | ``bigint``                   | 审计策略编号                              |
      +-------------------+------------------------------+-------------------------------------------+
      | ``rule_type``     | ``text``                     | 审计类型                                  |
      +-------------------+------------------------------+-------------------------------------------+
      | ``opr_type``      | ``text``                     | 操作类型                                  |
      +-------------------+------------------------------+-------------------------------------------+
      | ``obj_type``      | ``text``                     | 对象类型                                  |
      +-------------------+------------------------------+-------------------------------------------+
      | ``schm_id``       | ``oid``                      | 模式 id                                   |
      +-------------------+------------------------------+-------------------------------------------+
      | ``schm_name``     | ``text``                     | 模式名                                    |
      +-------------------+------------------------------+-------------------------------------------+
      | ``obj_id``        | ``oid``                      | 对象 id                                   |
      +-------------------+------------------------------+-------------------------------------------+
      | ``obj_name``      | ``text``                     | 对象名                                    |
      +-------------------+------------------------------+-------------------------------------------+
      | ``sqltext``       | ``text``                     | SQL 文本                                  |
      +-------------------+------------------------------+-------------------------------------------+
      | ``params``        | ``text``                     | 参数                                      |
      +-------------------+------------------------------+-------------------------------------------+
      | ``errcode``       | ``text``                     | SQLSTATE 错误码                           |
      +-------------------+------------------------------+-------------------------------------------+
      | ``errmsg``        | ``text``                     | 错误消息内容                              |
      +-------------------+------------------------------+-------------------------------------------+
      | ``audit_ts``      | ``timestamp with time zone`` | 操作时间                                  |
      +-------------------+------------------------------+-------------------------------------------+
      | ``result``        | ``text``                     | 操作成功是 success，失败是 failure        |
      +-------------------+------------------------------+-------------------------------------------+
      | ``record_type``   | ``smallint``                 | 审计记录类型                              |
      +-------------------+------------------------------+-------------------------------------------+
      | ``aud_client``    | ``text``                     | 客户端名字                                |
      +-------------------+------------------------------+-------------------------------------------+
      | ``server_type``   | ``text``                     | 集群时服务器类型， M 是主机， S 是备机    |
      +-------------------+------------------------------+-------------------------------------------+
      | ``authen_method`` | ``text``                     | 认证方式。非用户登录进程此字段显示unknown |
      +-------------------+------------------------------+-------------------------------------------+
