This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| ##################################################################### | |
| # Purpose: Following is an example on how to restore AlloyDB Cluster | |
| # cross project | |
| # For CLOUD SQL backup/restore cross project, please see: | |
| # https://gist.github.com/anorth848/724808332e4d3e699eb9a05411e59e5e | |
| # | |
| # Assumption: | |
| # Source and target Google Projects exist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: "2010-09-09" | |
| Description: Example AWS Backup resources including IAM and SNS | |
| Parameters: | |
| NotificationEmail: | |
| Type: String | |
| AllowedPattern: '(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)' | |
| Description: "Email address for notification on job completions" | |
| ResourceArns: | |
| Type: CommaDelimitedList | |
| Description: "Comma delimited string of resource ARNs to backup" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Python logger in AWS Lambda has a preset format. To change the format of the logging statement, | |
| # remove the logging handler & add a new handler with the required format | |
| import logging | |
| import sys | |
| def setup_logging(): | |
| logger = logging.getLogger() | |
| for h in logger.handlers: | |
| logger.removeHandler(h) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| sum(heap_blks_read) as heap_read, | |
| sum(heap_blks_hit) as heap_hit, | |
| sum(heap_blks_hit) / (sum(heap_blks_hit) + sum(heap_blks_read)) as ratio | |
| FROM | |
| pg_statio_user_tables; |