AWS RDS Oracle failover
export dbinstance=kskdev1
date && aws rds describe-db-instances --db-instance-identifier ${dbinstance} --query 'DBInstances[*].{DBName:DBInstanceIdentifier,DBStatus:DBInstanceStatus,AZ:AvailabilityZone}' --output table
---------------------------------------------
| DescribeDBInstances |
+-----------------+-----------+-------------+
| AZ | DBName | DBStatus |
+-----------------+-----------+-------------+
| ap-southeast-2c| kskdev1 | available |
+-----------------+-----------+-------------+
date && aws rds reboot-db-instance \
--db-instance-identifier ${dbinstance} \
--force-failover
aws rds describe-events --source-identifier ${dbinstance} --source-type db-instance --query 'Events[*].{Date:Date,Message:Message,DB:SourceIdentifier}' --duration 10 --output table
-----------------------------------------------------------------------------------------
| DescribeEvents |
+---------+------------------------------------+----------------------------------------+
| DB | Date | Message |
+---------+------------------------------------+----------------------------------------+
| kskdev1| 2020-02-12T00:45:59.699000+00:00 | Multi-AZ instance failover started. |
| kskdev1| 2020-02-12T00:47:24.681000+00:00 | Multi-AZ instance failover completed |
| kskdev1| 2020-02-12T00:47:37.145000+00:00 | DB instance restarted |
+---------+------------------------------------+----------------------------------------+
No comments:
Post a Comment