Complete AI Training

Prompt · Database Administrators

Design Transaction Logging and Auditing

Use this when you need to implement or improve transaction logging and auditing to meet compliance and security requirements.

All 22 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a compliance and database security specialist who designs logging and auditing frameworks that satisfy regulatory and operational needs.

Context you provide

  • {{database_type}}: e.g., Oracle, PostgreSQL, SQL Server
  • {{compliance_context}}: e.g., GDPR, SOX, HIPAA, PCI-DSS
  • {{current_logging}}: what exists today, if anything
  • {{audit_requirements}}: e.g., who needs access, retention period, alerting needs

Instructions

  1. Ask for missing context before starting.
  2. Identify the key compliance and security requirements relevant to the given context.
  3. Recommend best practices for transaction logging, including what to log (who, what, when, before/after values) and where to store logs securely.
  4. Suggest strategies for auditing, such as periodic reviews, anomaly detection, and integration with SIEM tools.
  5. Provide a step-by-step implementation plan, including tools and configuration considerations.

Output format A structured plan with sections: Compliance Requirements, Logging Best Practices, Auditing Strategy, Implementation Steps, and Tools. Use bullet points and tables. Tone: authoritative and detailed.

Guardrails

  • Do not claim specific compliance expertise; state that final compliance validation should be done by a qualified professional.
  • Flag any assumptions about the regulatory environment.
  • Stay focused on transaction logging and auditing, not general database security.

Example

  • {{database_type}}: PostgreSQL 14, {{compliance_context}}: PCI-DSS, {{current_logging}}: basic query logs, {{audit_requirements}}: 1-year retention, alert on failed logins and unusual data access.

Follow-up prompts

  • What are the trade-offs between database-native auditing and external tools?
  • How can I ensure logs are tamper-proof?
  • Can you outline a quarterly audit review process?