Lab Notes RDS v1 02
Lab Notes RDS v1 02
Lab Notes RDS v1 02
lab title
Course title
BackSpace Academy
AWS Certified Associate
BackSpace Academy AWS Certified Associate
Table of Contents
Contents
Please note that not all AWS services are supported in all regions. Please use
the US-East-1 (North Virginia) region for this lab.
These lab notes are to support the hands on instructional videos of the AWS Relational Database Service (RDS)
section of the AWS Certified Associate Course.
Please note that AWS services change on a weekly basis and it is extremely important
you check the version number on this document to ensure you have the lastest version
with any updates or corrections.
In this section, we will use the Relational Database Service to create a database. We will
also connect in to the database.
From the AWS console select “RDS” from the Database services.
Select “instances”
Make sure “Only show options that are eligible for RDS Free Tier” is selected
When you instance status changes to “available” you can view your configuration details which should look similar
to below:
To connect to your MySQL Database you will need to download and install the MySQL Workbench from
https://dev.mysql.com/downloads/workbench/
When your instance status is “available”, copy the database server endpoint
The Hostname will be the RDS server endpoint with the “:3306” removed from the end.
The Username will be the master username we created in RDS (i.e. admin)
Click OK
Enter the password you created in RDS for your master username
Hover over the “test” database under “SCHEMAS” and click the information icon to get information about the
database that was created by us in RDS.
Hostname
The hostname will be the RDS Instance Connection Endpoint without :3306 on the end.
To connect to your MySQL Database using the command line you will need to download and install the MySQL
Shell from
https://dev.mysql.com/downloads/shell/
Connect your database using the following command (if the username is admin):
\connect admin@your-connection-hostname-goes-here
\sql
Enter the SQL command to list databases (don’t forget the ‘;’ on the end):
show databases;
Clean Up
Check “I acknowledge that upon instance deletion, automated backups, including system snapshots and point-in-
time recovery, will no longer be available.”
Click “Delete”
In this section, we will learn how to deploy and connect to a PostgreSQL RDS instance.
From the AWS console select “RDS” from the Database services.
Select “instances”
Make sure “Only show options that are eligible for RDS Free Tier” is selected
Fill in a master username administrator (username “admin” can’t be used with PostgreSQL) and password
https://www.pgadmin.org/download/
Open pgAdmin
Click “Save”
You will now be connected to your database and will be able to navigate to see the sampledb database
Clean Up
Check “I acknowledge that upon instance deletion, automated backups, including system snapshots and point-in-
time recovery, will no longer be available.”
Click “Delete”
In this section, we will learn how to deploy and connect to an Oracle RDS instance.
From the AWS console select “RDS” from the Database services.
Select “instances”
Licensed Oracle is not available on the free tier so uncheck “Free tier eligible only”
Select Dev/Test
Select “Connections”
Click OK
Click “Test”
Click “Connect”
You will now see the new connection to the ORCL database in the treeview
Clean Up
Check “I acknowledge that upon instance deletion, automated backups, including system snapshots and point-in-
time recovery, will no longer be available.”
Click “Delete”
In this section, we will learn how to deploy and connect to an Microsoft SQL Server RDS
instance.
From the AWS console select “RDS” from the Database services.
Select “instances”
Refresh and wait for the instance state to change from “creating” to “available”
Use sqlcmd from the Windows command line to connect to your database with the following command:
https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms
Click “Connect”
Clean up
Check “I acknowledge that upon instance deletion, automated backups, including system snapshots and point-in-
time recovery, will no longer be available.”
Click “Delete”
In this section, we will learn how to migrate an Oracle database to AWS Aurora using the
AWS Database Migration Service.
From the AWS console select “EC2” from the Compute services.
Add an inbound rule for MySQL access. You can use “anywhere” for source although in a production environment
you should select “My IP”
Click “Create”
Create an inbound rule for type “All traffic” and source the Security group ID (type “sg” for a list)
Click Save
Make sure “Only show options that are eligible for RDS Free Tier” is selected
Create another RDS instance with exactly the same settings as before but with a DB Instance Identifier “targetdb”
Use the same settings as before for security group, Database Name and Backup retention period:
\connect admin@your-connection-hostname-goes-here
\use testdb
\sql
Create a table called migrate (don’t forget the “;” at the end):
Check it is there:
show tables;
DO NOT change the target database as this table will be migrated across with the AWS Database Migration
Service
Select “Advanced”
Select “Create endpoint and do the same process for the target database:
Select “tasks” from the side menu and click “create task”
Now connect to the target database using the MySQL Shell to see if the table was migrated.
\connect admin@your-connection-hostname-goes-here
\use testdb
\sql
show tables;
Clean Up
Go back to the AWS Database Migration Service console delete the task, terminate the replication instance and
delete the endpoints.