Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Creating a File Audit Task

Updated on 2025-02-22 GMT+08:00

Scenarios

You want to check whether SQL statements in a file comply with specifications and affect performance.

Constraints

  • Only four types of syntax for nested statements can be audited. For details, see Table 1.
  • The table name and table alias must be different. The aliases of different tables must be different.
  • Tables in a view cannot be audited.
  • Database system tables and system views cannot be audited.
  • MySQL statements containing number signs (#) cannot be audited.
  • You cannot click Retry when the file is being or has been audited.
  • If a system template is used, the audit results before and after a version upgrade will be inconsistent. You are advised to use a custom template.
  • Up to 110 SQL audit tasks can be created, and up to 10 can be executed concurrently.

Procedure

  1. Log in to the UGO console.
  2. In the navigation pane, choose SQL Audit > Statement Audit. Click the SQL from Files tab.
  3. Click Upload File.

    Figure 1 Upload a file
    Table 1 Parameter description

    Parameter

    Example Value

    Description

    Database Type

    GaussDB

    Select a database type. Currently, only GaussDB, MySQL, and PostgreSQL are supported.

    Data Source

    app_db_01

    Select a data source. Currently, only GaussDB, MySQL, and PostgreSQL are supported.

    This parameter is optional. If no data source is provided, the audit rules that depend on the data source are skipped by default.

    Schema

    demo_schema_01

    Select a schema. This parameter is optional and only available for GaussDB and PostgreSQL databases.

    • If the SQL statement contains a schema name, use the schema in the SQL statement.
    • If the SQL statement does not contain a schema name, the selected schema is used.
    • If the SQL statement does not contain a schema name and no schema is selected, use the public schema.

    Rule Template

    baseline_template_01

    Select a template based on the selected database type.

    You can set the template information by referring to Adding a Rule Template.

    Upload Data File

    sql_code.zip

    Upload a SQL file that meets the following requirements:

    • The SQL object name can contain only lowercase letters. If you enter an uppercase SQL object name, the system automatically converts it to lowercase letters.
    • The file can contain only simple SQL statements, such as INSERT, ALTER, DELETE, SELECT operations, and cannot contain stored procedures, functions, triggers, packages, or anonymous blocks, which is regarded as one SQL statement for audit.
    • Only .zip, .xml, .sql, .java, and .json files can be uploaded.
      • The file name can contain only digits, letters, underscores (_), and hyphens (-).
      • Maximum file name length: 240 characters
    • Max. file size: 5 MB.
    • Only XML, SQL, Java, and JSON files in the .zip package can be audited. Any other file types will be skipped automatically.
      • Max.size per file: 10 MB
      • Max. files: 10,000
      • The file name can contain only digits, letters, underscores (_), and hyphens (-).
      • Maximum file name length: 240 characters
      • Files to be uploaded cannot contain sensitive data such as binary files, passwords, and keys.
    NOTE:

    Only JSON files generated during workload replay on DRS can be parsed.

    Recommend Index

    Enable

    Disabled by default. Currently, only GaussDB is supported.

    Description

    Audit SQL statement for a service query

    (Optional) Enter a description, which contains up to 100 characters.

  4. Click OK to view the created task in the list.

    Figure 2 Audit task list

    The status can be one of the following:

    • Pending: The SQL audit task is to be scheduled.
    • Collecting objects: SQL statements scanned in the file.
    • Auditing SQL statements: The file is being audited.
    • Audit completed: The audit is complete only after all SQL statements in the file are audited.
    • Audit failed: An exception occurred during the audit.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback