Posts

PostgreSQL DBA Troubleshooting Scripts

Essential PostgreSQL Database Administration Commands: A Comprehensive Guide Database administrators need a reliable set of commands for managing and maintaining PostgreSQL databases. This guide provides essential commands for common administrative tasks, from checking database versions to managing users and performing maintenance operations. Basic Database Information Version Information To check your PostgreSQL version: sql Copy show server_version ; -- or SELECT version ( ) ; User Management Check current user: sql Copy SELECT CURRENT_USER ; Switch between users: sql Copy SET session authorization your_username ; -- Reset to default user SET session authorization DEFAULT ; Database Size Information View sizes of all databases: sql Copy SELECT pg_database . datname AS "database_name" , pg_size_pretty ( pg_database_size ( pg_database . datname ) ) AS size_in_mb FROM pg_database ORDER BY size_in_mb DESC ; Time Zone Management Check timezone setti...

How to run SSRS or Power BI Reports on SQL Server with NO SQL Databases Data

Image
Goal:  Loading Couchbase data to the SQL Server Data Warehouse database as per scheduled frequency.    Process and Key Components: 1) PowerShell: PowerShell invokes the RESTAPI GET method and queries the Couchbase through API and writes each result JSON record into the landing zone table as a valid JSON record. Example: {     "address_1":  "123 hotel way",     "end_time":  "05:00:00",     "latitude":  36.127028,     "location_name":  "Embassy Suites",     "longitude":  -79.8856824,     "meeting_date":  "2018-05-30",     "meeting_id":  "21645",     "phone":  "8594623291",     "postal_code":  "27519",     "start_time":  "09:00:00" } 2)      SQL JSON Function (SQL 2016 upper):  Query the raw json records from the landing zone table and load into the...