Maintaining MMTE SQL Script Catalog
Users of MMTE Client can create SQL scripts in the Meta Query tab and save them on MMTE Server.
When it happens, MMTE Server saves those SQL scripts in the JSON
format (one SQL script = one JSON file) in the directory <METAMINER PROGRAM FOLDER>\server\scripts
.
These JSON
files must have a mmdbScript
key on top, for example:
{
"hostname": "Company",
"hostuser": "JohnSmith",
"mmdbScript": {
"id": 0,
"uuid": "a4e53596-b25a-40e7-8d3b-6d6f743b7dff",
"name": "Tableau Extracts refresh time with backgrounder utilized information",
"description": "",
"dbType": "General",
"content": "SELECT bgj.started_at\n , bgj.completed_at\n , bgj.completed_at - bgj.started_at elapsed_time\n , bgj.subtitle object_type\n , bgj.title object_name\n , e.env_name\n , s.name site_name\n , bgj.backgrounder_id\n , CASE WHEN bgj.finish_code \u003d 1 AND bgj.completed_at IS NULL THEN \u0027Running\u0027 WHEN bgj.finish_code \u003d 1 THEN \u0027Error\u0027 ELSE \u0027Success\u0027 END status\nFROM tableau.background_jobs bgj\nINNER JOIN tableau.environments e ON e.env_id \u003d bgj.env_id\nLEFT JOIN tableau.sites s ON s.env_id \u003dbgj.env_id AND s.tableau_id \u003d bgj.site_id\nWHERE bgj.job_name IN (\u0027Refresh Extracts\u0027,\u0027Increment Extracts\u0027)\n AND bgj.started_at \u003e\u003d CURRENT_TIMESTAMP AT TIME ZONE \u0027UTC\u0027 - INTERVAL \u00271 month\u0027\nORDER BY elapsed_time DESC, bgj.started_at DESC\n;",
"createByUser": "JohnSmith",
"updatedTime": 0,
"updatedUtcMillis": 1587492562028,
"scriptType": "SQL",
"isPublic": true,
"tags": [
"extracts",
"refresh",
"backgrounder"
]
}
}
Additional key-value pairs contain script metadata to help manage your scripts. For example, mmdbScript:tags
help find the desired one; mmdbScript:description
text is displayed in the SQL Script Catalog dialog window to help understand what this script does.
If you upgrade, uninstall, or reinstall MMTE Server, we recommend to back up all files found in this folder, for future reuse.