• 沒有找到結果。

Amazon Relational Database Service User Guide

N/A
N/A
Protected

Academic year: 2022

Share "Amazon Relational Database Service User Guide"

Copied!
2328
0
0

加載中.... (立即查看全文)

全文

(1)

Amazon Relational Database Service

User Guide

Amazon Relational Database Service: User Guide

Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved.

(2)

Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon.

(3)

Table of Contents

What is Amazon RDS? ... 1

Overview ... 1

Amazon EC2 and on-premises databases ... 1

Amazon RDS and Amazon EC2 ... 2

Amazon RDS Custom for Oracle and Microsoft SQL Server ... 3

DB instances ... 3

DB engines ... 3

DB instance classes ... 4

DB instance storage ... 4

Amazon Virtual Private Cloud (Amazon VPC) ... 4

AWS Regions and Availability Zones ... 5

Security ... 5

Monitoring an Amazon RDS DB instance ... 5

How to work with Amazon RDS ... 5

AWS Management Console ... 5

Command line interface ... 5

Programming with Amazon RDS ... 6

How you are charged for Amazon RDS ... 6

What's next? ... 6

Getting started ... 6

Topics specific to database engines ... 6

DB instances ... 7

DB instance classes ... 9

DB instance class types ... 9

Supported DB engines ... 11

Determining DB instance class support in AWS Regions ... 28

Changing your DB instance class ... 31

Configuring the processor ... 31

Hardware specifications ... 44

DB instance storage ... 52

Storage types ... 52

General Purpose SSD storage ... 52

Provisioned IOPS storage ... 54

Magnetic storage ... 55

Monitoring storage performance ... 56

Factors that affect storage performance ... 56

Regions, Availability Zones, and Local Zones ... 59

AWS Regions ... 59

Availability Zones ... 62

Local Zones ... 62

Multi-AZ deployments ... 64

Multi-AZ DB instance deployments ... 65

Multi-AZ DB cluster deployments ... 70

DB instance billing for Amazon RDS ... 81

On-Demand DB instances ... 82

Reserved DB instances ... 83

Setting up ... 92

Sign up for AWS ... 92

Create an IAM user ... 92

Determine requirements ... 94

Provide access to your DB instance ... 95

Getting started ... 98

Creating a MariaDB DB instance and connecting to a database ... 98

Creating a MariaDB DB instance ... 98

(4)

Connecting to a database on a DB instance running MariaDB ... 102

Deleting a DB instance ... 105

Creating a SQL Server DB instance and connecting to it ... 106

Creating a sample SQL Server DB instance ... 106

Connecting to your sample DB instance ... 110

Exploring your sample DB instance ... 113

Deleting your sample DB instance ... 114

Creating a MySQL DB instance and connecting to a database ... 115

Creating a MySQL DB instance ... 115

Connecting to a database on a DB instance running MySQL ... 119

Deleting a DB instance ... 122

Creating an Oracle DB instance and connecting to a database ... 123

Creating a sample Oracle DB instance ... 123

Connecting to your sample DB instance ... 127

Deleting your sample DB instance ... 129

Creating a PostgreSQL DB instance and connecting to a database ... 129

Creating a PostgreSQL DB instance ... 130

Connecting to a PostgreSQL DB instance ... 133

Deleting a DB instance ... 139

Tutorial: Create a web server and an Amazon RDS DB instance ... 140

Create a DB instance ... 141

Create a web server ... 146

Tutorials and sample code ... 158

Tutorials in this guide ... 158

Tutorials in other AWS guides ... 158

Tutorials and sample code in GitHub ... 159

Best practices for Amazon RDS ... 160

Amazon RDS basic operational guidelines ... 160

DB instance RAM recommendations ... 161

Using Enhanced Monitoring to identify operating system issues ... 161

Using metrics to identify performance issues ... 161

Viewing performance metrics ... 161

Evaluating performance metrics ... 164

Tuning queries ... 165

Best practices for working with MySQL ... 166

Table size ... 166

Number of tables ... 166

Storage engine ... 167

Best practices for working with MariaDB ... 167

Table size ... 167

Number of tables ... 168

Storage engine ... 168

Best practices for working with Oracle ... 168

Best practices for working with PostgreSQL ... 168

Loading data into a PostgreSQL DB instance ... 169

Working with the PostgreSQL autovacuum feature ... 169

Amazon RDS for PostgreSQL best practices video ... 170

Best practices for working with SQL Server ... 170

Amazon RDS for SQL Server best practices video ... 171

Working with DB parameter groups ... 171

Best practices for automating DB instance creation ... 171

Amazon RDS new features and best practices presentation video ... 172

Configuring a DB instance ... 173

Creating a DB instance ... 174

Available settings ... 177

Original console example ... 189

Creating a Multi-AZ DB cluster ... 194

(5)

Prerequisites ... 194

Creating a DB cluster ... 195

Available settings ... 198

Nonapplicable settings ... 204

Creating resources with AWS CloudFormation ... 205

RDS and AWS CloudFormation templates ... 205

Learn more about AWS CloudFormation ... 205

Connecting to a DB instance ... 206

Finding the connection information ... 206

Database authentication options ... 209

Encrypted connections ... 210

Scenarios for accessing a DB instance ... 210

Connecting to a DB instance running a specific DB engine ... 210

Managing connections with RDS Proxy ... 211

Using RDS Proxy ... 212

Supported engines and Region availability ... 212

Quotas and limitations ... 213

Planning where to use RDS Proxy ... 214

RDS Proxy concepts and terminology ... 215

Getting started with RDS Proxy ... 219

Managing an RDS Proxy ... 230

Working with RDS Proxy endpoints ... 239

Monitoring RDS Proxy with CloudWatch ... 246

Working with RDS Proxy events ... 251

RDS Proxy examples ... 252

Troubleshooting RDS Proxy ... 254

Using RDS Proxy with AWS CloudFormation ... 259

Working with option groups ... 261

Option groups overview ... 261

Creating an option group ... 263

Copying an option group ... 264

Adding an option to an option group ... 265

Listing the options and option settings for an option group ... 269

Modifying an option setting ... 270

Removing an option from an option group ... 273

Deleting an option group ... 274

Working with parameter groups ... 277

Working with DB parameter groups ... 279

Working with DB cluster parameter groups ... 289

Comparing DB parameter groups ... 297

Specifying DB parameters ... 297

Managing a DB instance ... 303

Stopping a DB instance ... 304

Benefits ... 305

Limitations ... 305

Option and parameter group considerations ... 305

Public IP address ... 305

Stopping a DB instance ... 305

Starting a DB instance ... 307

Modifying a DB instance ... 308

Apply Immediately setting ... 309

Available settings ... 309

Modifying a Multi-AZ DB cluster ... 323

Apply Immediately setting ... 324

Available settings ... 324

Nonapplicable settings ... 330

Maintaining a DB instance ... 332

(6)

Viewing pending maintenance ... 332

Applying updates ... 334

Maintenance for Multi-AZ deployments ... 335

The maintenance window ... 336

Adjusting the maintenance window for a DB instance ... 337

Working with mandatory operating system updates ... 338

Upgrading the engine version ... 343

Manually upgrading the engine version ... 343

Automatically upgrading the minor engine version ... 345

Renaming a DB instance ... 347

Renaming to replace an existing DB instance ... 347

Rebooting a DB instance ... 349

Rebooting Multi-AZ DB clusters ... 351

Working with read replicas ... 353

Overview ... 355

Creating a read replica ... 358

Promoting a read replica ... 360

Monitoring read replication ... 363

Creating a read replica in a different AWS Region ... 365

Tagging RDS resources ... 374

Overview ... 374

Using tags for access control with IAM ... 375

Using tags to produce detailed billing reports ... 375

Adding, listing, and removing tags ... 376

Using the AWS Tag Editor ... 378

Copying tags to DB instance snapshots ... 378

Tutorial: Use tags to specify which DB instances to stop ... 379

Enabling backups ... 381

Working with ARNs ... 384

Constructing an ARN ... 384

Getting an existing ARN ... 388

Working with storage ... 392

Increasing DB instance storage capacity ... 392

Managing capacity automatically with storage autoscaling ... 393

Modifying Provisioned IOPS ... 398

Deleting a DB instance ... 400

Deletion protection ... 400

Final snapshots and retained backups ... 400

Deleting a DB instance ... 401

Deleting a Multi-AZ DB cluster ... 403

Backing up and restoring a DB instance ... 405

Working with backups ... 406

Backup storage ... 406

Backup window ... 407

Backup retention period ... 408

Enabling automated backups ... 408

Retaining automated backups ... 410

Deleting retained automated backups ... 411

Disabling automated backups ... 412

Using AWS Backup ... 414

Unsupported MySQL storage engines ... 414

Unsupported MariaDB storage engines ... 415

Replicating automated backups to another Region ... 416

AWS Region support ... 416

Enabling cross-Region automated backups ... 418

Finding information about replicated backups ... 420

Point-in-time recovery from a replicated backup ... 423

(7)

Stopping backup replication ... 424

Deleting replicated backups ... 425

Creating a DB snapshot ... 427

Creating a Multi-AZ DB cluster snapshot ... 429

Restoring from a DB snapshot ... 431

Parameter groups ... 431

Security groups ... 431

Option groups ... 432

Tagging ... 432

Microsoft SQL Server ... 432

Oracle Database ... 433

Restoring from a snapshot ... 433

Restoring from a snapshot to a Multi-AZ DB cluster ... 435

Copying a snapshot ... 437

Limitations ... 437

Snapshot retention ... 437

Copying shared snapshots ... 437

Handling encryption ... 438

Incremental snapshot copying ... 438

Cross-Region copying ... 439

Option groups ... 442

Parameter groups ... 442

Copying a DB snapshot ... 443

Sharing a snapshot ... 451

Sharing public snapshots ... 452

Sharing encrypted snapshots ... 453

Sharing a snapshot ... 455

Exporting snapshot data to Amazon S3 ... 460

Limitations ... 461

Overview of exporting snapshot data ... 461

Setting up access to an S3 bucket ... 462

Using a cross-account KMS key ... 464

Exporting a snapshot to an S3 bucket ... 465

Monitoring snapshot exports ... 468

Canceling a snapshot export ... 469

Failure messages ... 470

Troubleshooting PostgreSQL permissions errors ... 471

File naming convention ... 471

Data conversion ... 472

Point-in-time recovery ... 479

Restoring a Multi-AZ DB cluster to a specified time ... 482

Deleting a snapshot ... 485

Deleting a DB snapshot ... 485

Tutorial: Restore a DB instance from a DB snapshot ... 487

Restoring a DB instance from a DB snapshot ... 487

Monitoring metrics in a DB instance ... 490

Overview of monitoring ... 491

Monitoring plan ... 491

Performance baseline ... 491

Performance guidelines ... 491

Monitoring tools ... 492

Viewing instance status and recommendations ... 495

Viewing Amazon RDS DB instance status ... 496

Viewing Amazon RDS recommendations ... 499

Viewing metrics in the Amazon RDS console ... 504

Monitoring RDS with CloudWatch ... 507

Viewing CloudWatch metrics ... 509

(8)

Creating CloudWatch alarms ... 512

Tutorial: Creating a CloudWatch alarm for DB cluster replica lag ... 513

Monitoring DB load with Performance Insights ... 520

Overview of Performance Insights ... 520

Turning Performance Insights on and off ... 525

Enabling the Performance Schema for MariaDB or MySQL ... 528

Performance Insights policies ... 531

Analyzing metrics with the Performance Insights dashboard ... 534

Retrieving metrics with the Performance Insights API ... 565

Logging Performance Insights calls using AWS CloudTrail ... 579

Monitoring the OS with Enhanced Monitoring ... 581

Overview of Enhanced Monitoring ... 581

Setting up and enabling Enhanced Monitoring ... 582

Viewing OS metrics in the RDS console ... 586

Viewing OS metrics using CloudWatch Logs ... 589

RDS metrics reference ... 590

CloudWatch metrics for RDS ... 590

CloudWatch dimensions for RDS ... 594

CloudWatch metrics for Performance Insights ... 594

Counter metrics for Performance Insights ... 596

OS metrics in Enhanced Monitoring ... 605

Monitoring events, logs, and database activity streams ... 614

Viewing logs, events, and streams in the Amazon RDS console ... 614

Monitoring RDS events ... 618

Overview of events for Amazon RDS ... 618

Viewing Amazon RDS events ... 621

Using Amazon RDS event notification ... 622

Creating a rule that triggers on an Amazon RDS event ... 641

Monitoring RDS logs ... 645

Viewing and listing database log files ... 645

Downloading a database log file ... 646

Watching a database log file ... 647

Publishing to CloudWatch Logs ... 647

Reading log file contents using REST ... 648

MariaDB database log files ... 650

Microsoft SQL Server database log files ... 659

MySQL database log files ... 663

Oracle database log files ... 672

PostgreSQL database log files ... 679

Monitoring RDS API calls in CloudTrail ... 685

CloudTrail integration with Amazon RDS ... 685

Amazon RDS log file entries ... 685

Monitoring Oracle with Database Activity Streams ... 689

Overview ... 689

Configuring Oracle unified auditing ... 692

Starting a database activity stream ... 693

Getting activity stream status ... 694

Stopping a database activity stream ... 695

Monitoring activity streams ... 696

Managing access to activity streams ... 710

Working with Amazon RDS Custom ... 713

Database customization challenge ... 713

RDS Custom management model and benefits ... 714

Shared responsibility model ... 715

Key benefits of RDS Custom ... 716

RDS Custom architecture ... 716

RDS Custom for Oracle components ... 717

(9)

RDS Custom for Oracle workflow ... 718

RDS Custom for SQL Server components ... 719

RDS Custom for SQL Server workflow ... 720

RDS Custom automation and monitoring ... 720

RDS Custom requirements and limitations ... 721

General requirements for RDS Custom for Oracle ... 721

General requirements for RDS Custom for SQL Server ... 722

DB instance class support ... 722

AWS Region support ... 722

Limitations for RDS Custom for Oracle ... 723

Limitations for RDS Custom for SQL Server ... 723

Setting up your RDS Custom for Oracle environment ... 725

Prerequisites for creating an RDS Custom for Oracle instance ... 725

Make sure that you have a symmetric AWS KMS key ... 725

Download and install the AWS CLI ... 726

Configuring IAM and your VPC ... 726

Grant required permissions to your IAM user ... 734

Setting up your RDS Custom for SQL Server environment ... 737

Prerequisites for setting up RDS Custom for SQL Server ... 737

Make sure that you have a symmetric AWS KMS key ... 737

Download and install the AWS CLI ... 738

Configuring IAM and your VPC ... 738

Grant required permissions to your IAM user ... 746

Working with CEVs for RDS Custom for Oracle ... 747

Preparing to create a CEV ... 747

Creating a CEV ... 755

Modifying CEV status ... 758

Deleting a CEV ... 759

Creating and connecting to an RDS Custom for Oracle DB instance ... 761

Creating an RDS Custom for Oracle DB instance ... 761

RDS Custom service-linked role ... 764

Connecting to your RDS Custom DB instance using SSH ... 765

Connecting to your RDS Custom DB instance using AWS Systems Manager ... 767

Creating and connecting to an RDS Custom for SQL Server DB instance ... 769

Creating an RDS Custom for SQL Server DB instance ... 769

RDS Custom service-linked role ... 772

Connecting to your RDS Custom DB instance using AWS Systems Manager ... 772

Connecting to your RDS Custom DB instance using RDP ... 774

Managing an RDS Custom DB instance ... 777

Working with high availability features for RDS Custom for Oracle ... 777

Working with high availability features for RDS Custom for SQL Server ... 777

Pausing and resuming RDS Custom automation ... 778

Modifying an RDS Custom for SQL Server DB instance ... 781

Modifying the storage for an RDS Custom for Oracle DB instance ... 782

Changing the time zone of an RDS Custom for Oracle DB instance ... 784

Support for Transparent Data Encryption ... 785

Tagging RDS Custom resources ... 785

Deleting an RDS Custom DB instance ... 785

Working with read replicas for RDS Custom for Oracle ... 787

Network considerations ... 787

Considerations for the tnsnames.ora file ... 787

Limitations ... 788

Backing up and restoring an RDS Custom DB instance ... 790

Creating an RDS Custom snapshot ... 790

Restoring from an RDS Custom DB snapshot ... 791

Point-in-time recovery ... 792

Deleting an RDS Custom snapshot ... 796

(10)

Deleting RDS Custom automated backups ... 797

Migrating an on-premises database to RDS Custom for SQL Server ... 799

Prerequisites ... 799

Backing up the on-premises database ... 799

Uploading the backup file to Amazon S3 ... 800

Downloading the backup file from Amazon S3 ... 800

Restoring the backup file to the RDS Custom for SQL Server DB instance ... 800

Upgrading a DB instance for RDS Custom for Oracle ... 802

Viewing valid RDS Custom for Oracle upgrade targets ... 802

Upgrading an RDS Custom DB instance ... 803

Viewing pending upgrades ... 804

Upgrade failure ... 804

Upgrading a DB instance for RDS Custom for SQL Server ... 806

Troubleshooting RDS Custom DB issues ... 807

Viewing RDS Custom events ... 807

Subscribing to event notifications ... 807

Troubleshooting CEV creation ... 808

Support perimeter and unsupported configurations ... 808

Fixing unsupported configurations ... 809

How Amazon RDS Custom replaces an impaired host ... 815

Troubleshooting RDS Custom for Oracle upgrade issues ... 817

Working with RDS on AWS Outposts ... 819

Prerequisites ... 819

Support for Amazon RDS features ... 821

Supported DB instance classes ... 824

Customer-owned IP addresses ... 826

Creating DB instances ... 828

Considerations for restoring DB instances ... 834

MariaDB on Amazon RDS ... 835

Common management tasks ... 835

MariaDB versions ... 837

MariaDB feature support ... 838

MariaDB 10.6 support ... 838

MariaDB 10.5 support ... 839

MariaDB 10.4 support ... 840

MariaDB 10.3 support ... 840

MariaDB 10.2 support ... 841

Features not supported ... 841

Supported storage engines ... 842

The InnoDB storage engine ... 842

The MyRocks storage engine ... 842

File size limits ... 843

MariaDB security ... 844

SSL support ... 846

Cache warming ... 847

Dumping and loading the buffer pool on demand ... 847

Database parameters ... 848

Common DBA tasks ... 848

Local time zone ... 848

InnoDB reserved word ... 850

Deprecated MariaDB versions ... 850

Connecting to a DB instance running MariaDB ... 850

Finding the connection information ... 851

Connecting from the MySQL command-line client (unencrypted) ... 854

Connecting from the MySQL command-line client with SSL (encrypted) ... 855

Troubleshooting ... 855

Updating applications for new SSL/TLS certificates ... 857

(11)

Determining whether a client requires certificate verification in order to connect ... 857

Updating your application trust store ... 858

Example Java code for establishing SSL connections ... 859

Upgrading the MariaDB DB engine ... 861

Overview ... 861

Major version upgrades ... 862

Upgrading a MariaDB DB instance ... 863

Automatic minor version upgrades ... 863

Importing data into a MariaDB DB instance ... 866

Importing data from an external database ... 867

Importing data to a DB instance with reduced downtime ... 869

Importing data from any source ... 882

Working with MariaDB replication ... 887

Working with MariaDB read replicas ... 887

Using GTID-based replication ... 896

Replication with an external database instance ... 899

Options for MariaDB ... 906

MariaDB Audit Plugin support ... 906

Parameters for MariaDB ... 910

Viewing MariaDB parameters ... 910

MySQL parameters that aren't available ... 911

Migrating data from a MySQL DB snapshot to a MariaDB DB instance ... 913

Performing the migration ... 913

Incompatibilities between MariaDB and MySQL ... 915

MariaDB on Amazon RDS SQL reference ... 916

mysql.rds_replica_status ... 916

mysql.rds_set_external_master_gtid ... 917

mysql.rds_kill_query_id ... 919

Microsoft SQL Server on Amazon RDS ... 921

Common management tasks ... 921

Limitations ... 923

DB instance class support ... 925

Security ... 926

Compliance programs ... 927

HIPAA ... 927

SSL support ... 928

Version support ... 928

Version management ... 929

Database engine patches and versions ... 929

Deprecation schedule ... 930

Feature support ... 930

SQL Server 2019 features ... 930

SQL Server 2017 features ... 931

SQL Server 2016 features ... 931

SQL Server 2014 features ... 932

SQL Server 2012 features ... 932

SQL Server 2008 R2 deprecated on Amazon RDS ... 933

CDC support ... 933

Features not supported and features with limited support ... 933

Multi-AZ deployments ... 934

Using TDE ... 935

Functions and stored procedures ... 935

Local time zone ... 937

Supported time zones ... 937

Licensing SQL Server on Amazon RDS ... 945

Restoring license-terminated DB instances ... 945

SQL Server Developer Edition ... 945

(12)

Connecting to a DB instance running SQL Server ... 946

Before you connect ... 946

Finding the DB instance endpoint and port number ... 946

Connecting to your DB instance with SSMS ... 947

Connecting to your DB instance with SQL Workbench/J ... 949

Security group considerations ... 951

Troubleshooting ... 951

Updating applications for new SSL/TLS certificates ... 953

Determining whether any applications are connecting to your Microsoft SQL Server DB instance using SSL ... 953

Determining whether a client requires certificate verification in order to connect ... 954

Updating your application trust store ... 955

Upgrading the SQL Server DB engine ... 957

Overview ... 958

Major version upgrades ... 958

Multi-AZ and in-memory optimization considerations ... 959

Option group considerations ... 960

Parameter group considerations ... 960

Testing an upgrade ... 960

Upgrading a SQL server DB instance ... 961

Upgrading deprecated DB instances before support ends ... 961

Importing and exporting SQL Server databases ... 962

Limitations and recommendations ... 962

Setting up ... 963

Using native backup and restore ... 966

Compressing backup files ... 976

Troubleshooting ... 977

... 978

Importing and exporting SQL Server data using other methods ... 979

Working with SQL Server read replicas ... 988

Configuring read replicas for SQL Server ... 988

Read replica limitations with SQL Server ... 988

Troubleshooting a SQL Server read replica problem ... 989

Multi-AZ for RDS for SQL Server ... 990

Adding Multi-AZ to a SQL Server DB instance ... 991

Limitations, notes, and recommendations ... 991

Determining the location of the secondary ... 993

Migrating to Always On AGs ... 994

Additional features for SQL Server ... 995

Using SSL with a SQL Server DB instance ... 996

Configuring security protocols and ciphers ... 999

Using Windows Authentication with a SQL Server DB instance ... 1004

Amazon S3 integration ... 1014

Using Database Mail ... 1028

Instance store support for tempdb ... 1039

Using extended events ... 1041

Options for SQL Server ... 1044

Listing the available options for SQL Server versions and editions ... 1045

Native backup and restore ... 1046

Transparent Data Encryption ... 1049

SQL Server Audit ... 1052

SQL Server Analysis Services ... 1059

SQL Server Integration Services ... 1077

SQL Server Reporting Services ... 1091

Microsoft Distributed Transaction Coordinator ... 1101

Common DBA tasks for SQL Server ... 1113

Accessing the tempdb database ... 1114

(13)

Analyzing database workload with Database Engine Tuning Advisor ... 1116

Collations and character sets ... 1118

Creating a database user ... 1121

Determining a recovery model ... 1122

Determining the last failover time ... 1122

Disabling fast inserts ... 1123

Dropping a SQL Server database ... 1123

Renaming a Multi-AZ database ... 1123

Resetting the db_owner role password ... 1124

Restoring license-terminated DB instances ... 1124

Transitioning a database from OFFLINE to ONLINE ... 1125

Using CDC ... 1125

Using SQL Server Agent ... 1127

Working with SQL Server logs ... 1129

Working with trace and dump files ... 1130

MySQL on Amazon RDS ... 1131

Common management tasks ... 1131

MySQL versions ... 1133

Deprecation of MySQL version 5.6 ... 1135

MySQL features not supported by Amazon RDS ... 1136

Supported storage engines ... 1137

Storage-full behavior ... 1137

MySQL security ... 1138

Password Validation Plugin ... 1139

SSL support ... 1140

Using memcached and other options with MySQL ... 1141

InnoDB cache warming ... 1141

Dumping and loading the buffer pool on demand ... 1142

Local time zone ... 1142

Known issues and limitations ... 1144

Deprecated MySQL versions ... 1144

Connecting to a DB instance running MySQL ... 1146

Finding the connection information ... 1147

Connecting from the MySQL command-line client (unencrypted) ... 1149

Connecting from the MySQL command-line client with SSL (encrypted) ... 1150

Connecting from MySQL Workbench ... 1151

Connecting with the AWS JDBC Driver for MySQL ... 1152

Troubleshooting ... 1152

Updating applications for new SSL/TLS certificates ... 1154

Determining whether any applications are connecting to your MySQL DB instance using SSL ... 1155

Determining whether a client requires certificate verification to connect ... 1155

Updating your application trust store ... 1156

Example Java code for establishing SSL connections ... 1157

Upgrading the MySQL DB engine ... 1159

Overview ... 1159

Major version upgrades ... 1160

Testing an upgrade ... 1164

Upgrading a MySQL DB instance ... 1164

Automatic minor version upgrades ... 1165

Upgrading with reduced downtime ... 1167

Upgrading a MySQL DB snapshot ... 1170

Importing data into a MySQL DB instance ... 1172

Overview ... 1172

Importing data considerations ... 1174

Restoring a backup into a MySQL DB instance ... 1178

Importing data from an external database ... 1186

Importing data to a DB instance with reduced downtime ... 1188

(14)

Importing data from any source ... 1201

Working with MySQL replication ... 1206

Working with MySQL read replicas ... 1206

Using GTID-based replication ... 1217

Replication with an external database instance ... 1222

Exporting data from a MySQL DB instance ... 1229

Prepare an external MySQL database ... 1229

Prepare the source MySQL DB instance ... 1230

Copy the database ... 1231

Complete the export ... 1232

Options for MySQL ... 1234

MariaDB Audit Plugin ... 1235

memcached ... 1239

Parameters for MySQL ... 1243

Common DBA tasks for MySQL ... 1245

Ending a session or query ... 1245

Skipping the current replication error ... 1245

Working with InnoDB tablespaces to improve crash recovery times ... 1246

Managing the global status history ... 1248

Using Kerberos authentication for MySQL ... 1250

Setting up Kerberos authentication for MySQL DB instances ... 1251

Managing a DB instance in a domain ... 1257

Connecting to MySQL with Kerberos authentication ... 1258

Restoring a MySQL DB instance and adding it to a domain ... 1259

Kerberos authentication MySQL limitations ... 1259

Known issues and limitations ... 1260

InnoDB reserved word ... 1260

Inconsistent InnoDB buffer pool size ... 1260

Index merge optimization returns wrong results ... 1260

Log file size ... 1261

MySQL parameter exceptions for Amazon RDS DB instances ... 1261

MySQL file size limits in Amazon RDS ... 1262

MySQL Keyring Plugin not supported ... 1263

MySQL on Amazon RDS SQL reference ... 1264

Overview ... 1264

SQL reference conventions ... 1265

mysql.rds_set_master_auto_position ... 1265

mysql.rds_set_external_master ... 1266

mysql.rds_set_external_master_with_delay ... 1268

mysql.rds_set_external_master_with_auto_position ... 1271

mysql.rds_reset_external_master ... 1273

mysql.rds_import_binlog_ssl_material ... 1274

mysql.rds_remove_binlog_ssl_material ... 1276

mysql.rds_set_source_delay ... 1276

mysql.rds_start_replication ... 1277

mysql.rds_start_replication_until ... 1277

mysql.rds_start_replication_until_gtid ... 1278

mysql.rds_stop_replication ... 1279

mysql.rds_skip_transaction_with_gtid ... 1280

mysql.rds_skip_repl_error ... 1281

mysql.rds_next_master_log ... 1282

mysql.rds_innodb_buffer_pool_dump_now ... 1283

mysql.rds_innodb_buffer_pool_load_now ... 1284

mysql.rds_innodb_buffer_pool_load_abort ... 1284

mysql.rds_set_configuration ... 1284

mysql.rds_show_configuration ... 1286

mysql.rds_kill ... 1287

(15)

mysql.rds_kill_query ... 1287

mysql.rds_rotate_general_log ... 1288

mysql.rds_rotate_slow_log ... 1288

mysql.rds_enable_gsh_collector ... 1288

mysql.rds_set_gsh_collector ... 1289

mysql.rds_disable_gsh_collector ... 1289

mysql.rds_collect_global_status_history ... 1289

mysql.rds_enable_gsh_rotation ... 1289

mysql.rds_set_gsh_rotation ... 1290

mysql.rds_disable_gsh_rotation ... 1290

mysql.rds_rotate_global_status_history ... 1290

Oracle on Amazon RDS ... 1291

Oracle overview ... 1292

Oracle features ... 1292

Oracle versions ... 1295

Oracle licensing ... 1307

Oracle instance classes ... 1309

Oracle architecture ... 1312

Oracle parameters ... 1314

Oracle character sets ... 1314

Oracle limitations ... 1317

Connecting to an Oracle instance ... 1320

Finding the endpoint ... 1320

SQL developer ... 1322

SQL*Plus ... 1324

Security group considerations ... 1325

Dedicated and shared server processes ... 1325

Troubleshooting ... 1325

Modifying Oracle sqlnet.ora parameters ... 1326

Securing Oracle connections ... 1330

Encrypting with SSL ... 1330

Using new SSL/TLS certificates ... 1330

Configuring Kerberos authentication ... 1333

Configuring UTL_HTTP access ... 1345

Administering your Oracle DB ... 1354

System tasks ... 1362

Database tasks ... 1375

Log tasks ... 1391

RMAN tasks ... 1399

Oracle Scheduler tasks ... 1416

Diagnostic tasks ... 1421

Other tasks ... 1427

Importing data into Oracle ... 1438

Importing using Oracle SQL Developer ... 1438

Importing using Oracle Data Pump ... 1439

Oracle Export/Import utilities ... 1448

Oracle SQL*Loader ... 1448

Oracle materialized views ... 1449

Working with Oracle replicas ... 1451

Overview of Oracle replicas ... 1451

Replica requirements for Oracle ... 1452

Preparing to create an Oracle replica ... 1454

Creating an Oracle replica in mounted mode ... 1455

Modifying the Oracle replica mode ... 1456

Troubleshooting Oracle replicas ... 1457

Options for Oracle ... 1458

Overview of Oracle DB options ... 1458

(16)

Amazon S3 integration ... 1460

Application Express (APEX) ... 1473

Java virtual machine (JVM) ... 1484

Enterprise Manager ... 1487

Label security ... 1502

Locator ... 1505

Multimedia ... 1508

Native network encryption (NNE) ... 1511

OLAP ... 1519

Secure Sockets Layer (SSL) ... 1522

Spatial ... 1529

SQLT ... 1532

Statspack ... 1538

Time zone ... 1541

Time zone file autoupgrade ... 1545

Transparent Data Encryption (TDE) ... 1550

UTL_MAIL ... 1552

XML DB ... 1555

Upgrading the Oracle DB engine ... 1556

Overview of Oracle upgrades ... 1556

Major version upgrades ... 1558

Minor version upgrades ... 1559

SE2 upgrade paths ... 1559

Upgrade considerations ... 1560

Testing an upgrade ... 1562

Upgrading an Oracle DB instance ... 1562

Upgrading an Oracle DB snapshot ... 1563

Tools and third-party software for Amazon RDS for Oracle DB instances ... 1565

Setting up ... 1566

Using Oracle GoldenGate ... 1572

Using the Oracle Repository Creation Utility ... 1585

Configuring CMAN ... 1590

Installing a Siebel database on Oracle on Amazon RDS ... 1592

Oracle database engine release notes ... 1595

Oracle Database 21c (21.0.0.0), Oracle Database 19c (19.0.0.0), and Oracle Database 12c Release 2 (12.2.0.1) ... 1595

Oracle versions 12.1.0.2 and 11.2.0.4 ... 1596

Database engine: 21.0.0.0 ... 1597

Database engine: 19.0.0.0 ... 1599

Database engine: 18.0.0.0 ... 1701

Database engine: 12.2.0.1 ... 1733

Database engine: 12.1.0.2 ... 1793

PostgreSQL on Amazon RDS ... 1904

Common management tasks ... 1905

The database preview environment ... 1908

Features not supported in the preview environment ... 1908

Creating a new DB instance in the preview environment ... 1908

PostgreSQL limitations ... 1909

PostgreSQL versions ... 1910

Deprecation of PostgreSQL version 9.6 ... 1910

PostgreSQL 14 versions ... 1911

PostgreSQL 13 versions ... 1911

PostgreSQL 12 versions ... 1913

PostgreSQL 11 versions ... 1916

PostgreSQL 10 versions ... 1920

PostgreSQL 9.6 versions ... 1925

Deprecated PostgreSQL versions ... 1931

(17)

PostgreSQL extension versions ... 1932

Restricting installation of PostgreSQL extensions ... 1932

PostgreSQL trusted extensions ... 1933

PostgreSQL version 14 extensions supported on Amazon RDS ... 1934

PostgreSQL version 13 extensions supported on Amazon RDS ... 1936

PostgreSQL version 12 extensions supported on Amazon RDS ... 1939

PostgreSQL version 11.x extensions supported on Amazon RDS ... 1942

PostgreSQL version 10.x extensions supported on Amazon RDS ... 1945

PostgreSQL version 9.6.x extensions supported on Amazon RDS ... 1947

Connecting to a PostgreSQL instance ... 1951

Using pgAdmin to connect to a RDS for PostgreSQL DB instance ... 1953

Using psql to connect to your RDS for PostgreSQL DB instance ... 1955

Troubleshooting connections to your RDS for PostgreSQL instance ... 1955

Securing connections with SSL/TLS ... 1957

Using SSL with a PostgreSQL DB instance ... 1957

Updating applications to use new SSL/TLS certificates ... 1960

Using Kerberos authentication ... 1964

Availability ... 1964

Overview of Kerberos authentication ... 1965

Setting up ... 1966

Managing a DB instance in a Domain ... 1974

Connecting with Kerberos authentication ... 1975

Using a custom DNS server for outbound network access ... 1977

Turning on custom DNS resolution ... 1977

Turning off custom DNS resolution ... 1977

Setting up a custom DNS server ... 1977

Upgrading the PostgreSQL DB engine ... 1979

Overview of upgrading ... 1980

PostgreSQL version numbers ... 1981

Choosing a major version upgrade ... 1981

How to perform a major version upgrade ... 1982

Automatic minor version upgrades ... 1986

Upgrading PostgreSQL extensions ... 1988

Upgrading a PostgreSQL DB snapshot engine version ... 1989

Working with PostgreSQL read replicas ... 1991

Read replica configuration with PostgreSQL ... 1991

Monitoring PostgreSQL read replicas ... 1992

Read replica limitations with PostgreSQL ... 1992

Replication interruptions with PostgreSQL read replicas ... 1992

Troubleshooting PostgreSQL read replica problems ... 1993

Importing data into PostgreSQL ... 1996

Importing a PostgreSQL database from an Amazon EC2 instance ... 1997

Using the \copy command to import data to a table on a PostgreSQL DB instance ... 1999

Importing S3 data into RDS for PostgreSQL ... 2000

Transporting PostgreSQL databases between DB instances ... 2012

Exporting PostgreSQL data to Amazon S3 ... 2018

Overview of exporting to S3 ... 2018

Verify that your RDS for PostgreSQL version supports exports ... 2019

Specifying the Amazon S3 file path to export to ... 2019

Setting up access to an Amazon S3 bucket ... 2020

Exporting query data using the aws_s3.query_export_to_s3 function ... 2023

Troubleshooting access to Amazon S3 ... 2025

Function reference ... 2025

Invoking a Lambda function from RDS for PostgreSQL ... 2029

Step 1: Configure outbound connections ... 2029

Step 2: Configure IAM for your instance and Lambda ... 2030

Step 3: Install the extension ... 2031

(18)

Step 4: Use Lambda helper functions ... 2032

Step 5: Invoke a Lambda function ... 2032

Lambda function error messages ... 2035

Lambda function reference ... 2036

PostgreSQL features ... 2039

Custom data types and enumerations ... 2039

Event triggers for RDS for PostgreSQL ... 2040

Huge pages for RDS for PostgreSQL ... 2040

Logical replication ... 2041

RAM disk for the stats_temp_directory ... 2043

Tablespaces for RDS for PostgreSQL ... 2043

Common DBA tasks for RDS for PostgreSQL ... 2045

Working with the PostgreSQL autovacuum ... 2045

Controlling user access to PostgreSQL ... 2053

Logging mechanisms ... 2054

Using pgBadger for log analysis with PostgreSQL ... 2054

Limiting control over user passwords ... 2054

Working with parameters ... 2055

Understanding the rds_superuser role ... 2064

Using PostgreSQL extensions ... 2066

Using functions from orafce ... 2066

Managing partitions with the pg_partman extension ... 2068

Logging at the session and object level ... 2072

Scheduling maintenance with the pg_cron extension ... 2074

Reducing bloat with the pg_repack extension ... 2081

Upgrading and using PLV8 ... 2082

Managing spatial data with PostGIS ... 2084

Supported foreign data wrappers ... 2088

Using the log_fdw extension ... 2088

Working with an Oracle database ... 2089

Using postgres_fdw to access external data ... 2092

Security ... 2093

Database authentication ... 2094

Password authentication ... 2094

IAM database authentication ... 2095

Kerberos authentication ... 2095

Data protection ... 2095

Data encryption ... 2096

Internetwork traffic privacy ... 2111

Identity and access management ... 2112

Audience ... 2112

Authenticating with identities ... 2112

Managing access using policies ... 2114

How Amazon RDS works with IAM ... 2115

Identity-based policy examples ... 2118

Cross-service confused deputy prevention ... 2129

IAM database authentication ... 2131

Troubleshooting ... 2157

Logging and monitoring ... 2159

Compliance validation ... 2161

Resilience ... 2162

Backup and restore ... 2162

Replication ... 2162

Failover ... 2162

Infrastructure security ... 2163

Security groups ... 2163

Public accessibility ... 2163

(19)

VPC endpoints (AWS PrivateLink) ... 2164

Considerations ... 2164

Availability ... 2164

Creating an interface VPC endpoint ... 2165

Creating a VPC endpoint policy ... 2165

Security best practices ... 2166

Controlling access with security groups ... 2167

VPC security groups ... 2167

DB security groups ... 2167

DB security groups vs. VPC security groups ... 2168

Security group scenario ... 2168

Creating a VPC security group ... 2169

Associating with a DB instance ... 2169

Deleting DB VPC security groups ... 2169

DB security groups on EC2-Classic ... 2172

Master user account privileges ... 2180

Service-linked roles ... 2182

Service-linked role permissions for Amazon RDS ... 2182

Service-linked role permissions for Amazon RDS Custom ... 2185

Using Amazon RDS with Amazon VPC ... 2194

Working with a DB instance in a VPC ... 2194

Updating the VPC for a DB instance ... 2201

Scenarios for accessing a DB instance in a VPC ... 2202

Tutorial: Create an Amazon VPC for use with a DB instance ... 2208

Working with a DB instance not in a VPC ... 2214

Quotas and constraints ... 2220

Quotas in Amazon RDS ... 2220

Naming constraints in Amazon RDS ... 2222

Maximum number of database connections ... 2222

File size limits in Amazon RDS ... 2223

Troubleshooting ... 2225

Can't connect to DB instance ... 2225

Testing the DB instance connection ... 2226

Troubleshooting connection authentication ... 2227

Security issues ... 2227

Error message "failed to retrieve account attributes, certain console functions may be impaired." ... 2227

Resetting the DB instance owner password ... 2227

DB instance outage or reboot ... 2228

Parameter changes not taking effect ... 2228

DB instance out of storage ... 2229

Insufficient DB instance capacity ... 2230

MySQL and MariaDB issues ... 2230

Maximum MySQL and MariaDB connections ... 2231

Diagnosing and resolving incompatible parameters status for a memory limit ... 2231

Diagnosing and resolving lag between read replicas ... 2232

Diagnosing and resolving a MySQL or MariaDB read replication failure ... 2234

Creating triggers with binary logging enabled requires SUPER privilege ... 2235

Diagnosing and resolving point-in-time restore failures ... 2236

Replication stopped error ... 2237

Read replica create fails or replication breaks with fatal error 1236 ... 2237

Can't set backup retention period to 0 ... 2237

Amazon RDS API reference ... 2238

Using the Query API ... 2238

Query parameters ... 2238

Query request authentication ... 2238

Troubleshooting applications ... 2239

(20)

Retrieving errors ... 2239

Troubleshooting tips ... 2239

Document history ... 2240

Earlier updates ... 2288

AWS glossary ... 2308

(21)

Overview

What is Amazon Relational Database Service (Amazon RDS)?

Amazon Relational Database Service (Amazon RDS) is a web service that makes it easier to set up, operate, and scale a relational database in the AWS Cloud. It provides cost-efficient, resizable capacity for an industry-standard relational database and manages common database administration tasks.

NoteThis guide covers Amazon RDS database engines other than Amazon Aurora. For information about using Amazon Aurora, see the Amazon Aurora User Guide.

If you are new to AWS products and services, begin learning more with the following resources:

• For an overview of all AWS products, see What is cloud computing?

• Amazon Web Services provides a number of database services. For guidance on which service is best for your environment, see Running databases on AWS.

Overview of Amazon RDS

Why do you want to run a relational database in the AWS Cloud? Because AWS takes over many of the difficult and tedious management tasks of a relational database.

Topics

• Amazon EC2 and on-premises databases (p. 1)

• Amazon RDS and Amazon EC2 (p. 2)

• Amazon RDS Custom for Oracle and Microsoft SQL Server (p. 3)

Amazon EC2 and on-premises databases

Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the AWS Cloud.

Amazon EC2 eliminates your need to invest in hardware up front, so you can develop and deploy applications faster.

When you buy an on-premises server, you get CPU, memory, storage, and IOPS, all bundled together.

With Amazon EC2, these are split apart so that you can scale them independently. If you need more CPU, less IOPS, or more storage, you can easily allocate them.

For a relational database in an on-premises server, you assume full responsibility for the server, operating system, and software. For a database on an Amazon EC2 instance, AWS manages the layers below the operating system. In this way, Amazon EC2 eliminates some of the burden of managing an on- premises database server.

In the following table, you can find a comparison of the management models for on-premises databases and Amazon EC2.

Feature On-premises management Amazon EC2 management

Application optimization Customer Customer

(22)

Amazon RDS and Amazon EC2

Feature On-premises management Amazon EC2 management

Scaling Customer Customer

High availability Customer Customer

Database backups Customer Customer

Database software patching Customer Customer

Database software install Customer Customer

Operating system (OS) patching Customer Customer

OS installation Customer Customer

Server maintenance Customer AWS

Hardware lifecycle Customer AWS

Power, network, and cooling Customer AWS

Amazon EC2 isn't a fully managed service. Thus, when you run a database on Amazon EC2, you're more prone to user errors. For example, when you update the operating system or database software manually, you might accidentally cause application downtime. You might spend hours checking every change to identify and fix an issue.

Amazon RDS and Amazon EC2

Amazon RDS is a managed database service. It's responsible for most management tasks. By eliminating tedious manual tasks, Amazon RDS frees you to focus on your application and your users. We

recommend Amazon RDS over Amazon EC2 as your default choice for most database deployments.

In the following table, you can find a comparison of the management models in Amazon EC2 and Amazon RDS.

Feature Amazon EC2 management Amazon RDS management

Application optimization Customer Customer

Scaling Customer AWS

High availability Customer AWS

Database backups Customer AWS

Database software patching Customer AWS

Database software install Customer AWS

OS patching Customer AWS

OS installation Customer AWS

Server maintenance AWS AWS

Hardware lifecycle AWS AWS

Power, network, and cooling AWS AWS

(23)

Amazon RDS Custom for Oracle and Microsoft SQL Server

Amazon RDS provides the following specific advantages over database deployments that aren't fully managed:

• You can use the database products you are already familiar with: MySQL, MariaDB, PostgreSQL, Oracle, Microsoft SQL Server.

• Amazon RDS manages backups, software patching, automatic failure detection, and recovery.

• You can turn on automated backups, or manually create your own backup snapshots. You can use these backups to restore a database. The Amazon RDS restore process works reliably and efficiently.

• You can get high availability with a primary instance and a synchronous secondary instance that you can fail over to when problems occur. You can also use read replicas to increase read scaling.

• In addition to the security in your database package, you can help control who can access your RDS databases by using AWS Identity and Access Management (IAM) to define users and permissions. You can also help protect your databases by putting them in a virtual private cloud (VPC).

Amazon RDS Custom for Oracle and Microsoft SQL Server

Amazon RDS Custom is an RDS management type that gives you full access to your database and operating system.

You can use the control capabilities of RDS Custom to access and customize the database environment and operating system for legacy and packaged business applications. Meanwhile, Amazon RDS automates database administration tasks and operations.

In this deployment model, you can install applications and change configuration settings to suit your applications. At the same time, you can offload database administration tasks such as provisioning, scaling, upgrading, and backup to AWS. You can take advantage of the database management benefits of Amazon RDS, with more control and flexibility.

For Oracle Database and Microsoft SQL Server, RDS Custom combines the automation of Amazon RDS with the flexibility of Amazon EC2. For more information on RDS Custom, see Working with Amazon RDS Custom (p. 713).

With the shared responsibility model of RDS Custom, you get more control than in Amazon RDS, but also more responsibility. For more information, see Shared responsibility model (p. 715).

DB instances

A DB instance is an isolated database environment in the AWS Cloud. The basic building block of Amazon RDS is the DB instance.

Your DB instance can contain one or more user-created databases. You can access your DB instance by using the same tools and applications that you use with a standalone database instance. You can create and modify a DB instance by using the AWS Command Line Interface, the Amazon RDS API, or the AWS Management Console.

DB engines

A DB engine is the specific relational database software that runs on your DB instance. Amazon RDS currently supports the following engines:

(24)

DB instance classes

• MySQL

• MariaDB

• PostgreSQL

• Oracle

• Microsoft SQL Server

Each DB engine has its own supported features, and each version of a DB engine may include specific features. Additionally, each DB engine has a set of parameters in a DB parameter group that control the behavior of the databases that it manages.

DB instance classes

A DB instance class determines the computation and memory capacity of a DB instance. A DB instance class consists of both the DB instance type and the size. Each instance type offers different compute, memory, and storage capabilities. For example, db.m6g is a general-purpose DB instance type powered by AWS Graviton2 processors, while db.m6g.2xlarge is a DB instance class.

You can select the DB instance that best meets your needs. If your needs change over time, you can change DB instances. For information, see DB instance classes (p. 9).

NoteFor pricing information on DB instance classes, see the Pricing section of the Amazon RDS product page.

DB instance storage

Amazon EBS provides durable, block-level storage volumes that you can attach to a running instance. DB instance storage comes in the following types:

• General Purpose (SSD)

• Provisioned IOPS (PIOPS)

• Magnetic

The storage types differ in performance characteristics and price. You can tailor your storage performance and cost to the needs of your database.

Each DB instance has minimum and maximum storage requirements depending on the storage type and the database engine it supports. It's important to have sufficient storage so that your databases have room to grow. Also, sufficient storage makes sure that features for the DB engine have room to write content or log entries. For more information, see Amazon RDS DB instance storage (p. 52).

Amazon Virtual Private Cloud (Amazon VPC)

You can run a DB instance on a virtual private cloud (VPC) using the Amazon Virtual Private Cloud (Amazon VPC) service. When you use a VPC, you have control over your virtual networking environment.

You can choose your own IP address range, create subnets, and configure routing and access control lists.

The basic functionality of Amazon RDS is the same whether it's running in a VPC or not. Amazon RDS manages backups, software patching, automatic failure detection, and recovery. There's no additional cost to run your DB instance in a VPC. For more information on using Amazon VPC with RDS, see Amazon Virtual Private Cloud VPCs and Amazon RDS (p. 2194).

Amazon RDS uses Network Time Protocol (NTP) to synchronize the time on DB Instances.

(25)

AWS Regions and Availability Zones

AWS Regions and Availability Zones

Amazon cloud computing resources are housed in highly available data center facilities in different areas of the world (for example, North America, Europe, or Asia). Each data center location is called an AWS Region.

Each AWS Region contains multiple distinct locations called Availability Zones, or AZs. Each Availability Zone is engineered to be isolated from failures in other Availability Zones. Each is engineered to provide inexpensive, low-latency network connectivity to other Availability Zones in the same AWS Region. By launching instances in separate Availability Zones, you can protect your applications from the failure of a single location. For more information, see Regions, Availability Zones, and Local Zones (p. 59).

You can run your DB instance in several Availability Zones, an option called a Multi-AZ deployment.

When you choose this option, Amazon automatically provisions and maintains one or more secondary standby DB instances in a different Availability Zone. Your primary DB instance is replicated across Availability Zones to each secondary DB instance. This approach helps provide data redundancy and failover support, eliminate I/O freezes, and minimize latency spikes during system backups. In a Multi- AZ DB clusters deployment, the secondary DB instances can also serve read traffic. For more information, see Multi-AZ deployments for high availability (p. 64).

Security

A security group controls the access to a DB instance. It does so by allowing access to IP address ranges or Amazon EC2 instances that you specify.

For more information about security groups, see Security in Amazon RDS (p. 2093).

Monitoring an Amazon RDS DB instance

There are several ways that you can track the performance and health of a DB instance. You can use the Amazon CloudWatch service to monitor the performance and health of a DB instance. CloudWatch performance charts are shown in the Amazon RDS console. You can also subscribe to Amazon RDS events to be notified about changes to a DB instance, DB snapshot, DB parameter group, or DB security group.

For more information, see Monitoring metrics in an Amazon RDS instance (p. 490).

How to work with Amazon RDS

There are several ways that you can interact with Amazon RDS.

AWS Management Console

The AWS Management Console is a simple web-based user interface. You can manage your DB instances from the console with no programming required. To access the Amazon RDS console, sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

Command line interface

You can use the AWS Command Line Interface (AWS CLI) to access the Amazon RDS API interactively. To install the AWS CLI, see Installing the AWS Command Line Interface. To begin using the AWS CLI for RDS, see AWS Command Line Interface reference for Amazon RDS.

(26)

Programming with Amazon RDS

Programming with Amazon RDS

If you are a developer, you can access the Amazon RDS programmatically. For more information, see Amazon RDS application programming interface (API) reference (p. 2238).

For application development, we recommend that you use one of the AWS Software Development Kits (SDKs). The AWS SDKs handle low-level details such as authentication, retry logic, and error handling, so that you can focus on your application logic. AWS SDKs are available for a wide variety of languages. For more information, see Tools for Amazon web services .

AWS also provides libraries, sample code, tutorials, and other resources to help you get started more easily. For more information, see Sample code & libraries.

How you are charged for Amazon RDS

When you use Amazon RDS, you can choose to use on-demand DB instances or reserved DB instances.

For more information, see DB instance billing for Amazon RDS (p. 81).

For Amazon RDS pricing information, see the Amazon RDS product page.

What's next?

The preceding section introduced you to the basic infrastructure components that RDS offers. What should you do next?

Getting started

Create a DB instance using instructions in Getting started with Amazon RDS (p. 98).

Topics specific to database engines

You can review information specific to a particular DB engine in the following sections:

• MariaDB on Amazon RDS (p. 835)

• Microsoft SQL Server on Amazon RDS (p. 921)

• MySQL on Amazon RDS (p. 1131)

• Oracle on Amazon RDS (p. 1291)

• PostgreSQL on Amazon RDS (p. 1904)

(27)

DB instances

Amazon RDS DB instances

A DB instance is an isolated database environment running in the cloud. It is the basic building block of Amazon RDS. A DB instance can contain multiple user-created databases, and can be accessed using the same client tools and applications you might use to access a standalone database instance. DB instances are simple to create and modify with the Amazon AWS command line tools, Amazon RDS API operations, or the AWS Management Console.

NoteAmazon RDS supports access to databases using any standard SQL client application. Amazon RDS does not allow direct host access.

You can have up to 40 Amazon RDS DB instances, with the following limitations:

• 10 for each SQL Server edition (Enterprise, Standard, Web, and Express) under the "license-included"

model

• 10 for Oracle under the "license-included" model

• 40 for MySQL, MariaDB, or PostgreSQL

• 40 for Oracle under the "bring-your-own-license" (BYOL) licensing model

NoteIf your application requires more DB instances, you can request additional DB instances by using this form.

Each DB instance has a DB instance identifier. This customer-supplied name uniquely identifies the DB instance when interacting with the Amazon RDS API and AWS CLI commands. The DB instance identifier must be unique for that customer in an AWS Region.

The identifier is used as part of the DNS hostname allocated to your instance by RDS. For example, if you specify db1 as the DB instance identifier, then RDS will automatically allocate a DNS endpoint for your instance, such as db1.123456789012.us-east-1.rds.amazonaws.com, where 123456789012 is the fixed identifier for a specific region for your account.

Each DB instance supports a database engine. Amazon RDS currently supports MySQL, MariaDB, PostgreSQL, Oracle, Microsoft SQL Server, and Amazon Aurora database engines.

When creating a DB instance, some database engines require that a database name be specified. A DB instance can host multiple databases, or a single Oracle database with multiple schemas. The database name value depends on the database engine:

• For the MySQL and MariaDB database engines, the database name is the name of a database hosted in your DB instance. Databases hosted by the same DB instance must have a unique name within that instance.

• For the Oracle database engine, database name is used to set the value of ORACLE_SID, which must be supplied when connecting to the Oracle RDS instance.

• For the Microsoft SQL Server database engine, database name is not a supported parameter.

• For the PostgreSQL database engine, the database name is the name of a database hosted in your DB instance. A database name is not required when creating a DB instance. Databases hosted by the same DB instance must have a unique name within that instance.

Amazon RDS creates a master user account for your DB instance as part of the creation process. This master user has permissions to create databases and to perform create, delete, select, update, and insert operations on tables the master user creates. You must set the master user password when you create a DB instance, but you can change it at any time using the AWS CLI, Amazon RDS API operations, or the

(28)

DB instances

AWS Management Console. You can also change the master user password and manage users using standard SQL commands.

NoteThis guide covers non-Aurora Amazon RDS database engines. For information about using Amazon Aurora, see the Amazon Aurora User Guide.

(29)

DB instance classes

DB instance classes

The DB instance class determines the computation and memory capacity of an Amazon RDS DB instance.

A DB instance class consists of both the DB instance type and the size. The DB instance class you need depends on your processing power and memory requirements.

For more information about instance class pricing, see Amazon RDS pricing.

Topics

• DB instance class types (p. 9)

• Supported DB engines for DB instance classes (p. 11)

• Determining DB instance class support in AWS Regions (p. 28)

• Changing your DB instance class (p. 31)

• Configuring the processor for a DB instance class (p. 31)

• Hardware specifications for DB instance classes (p. 44)

DB instance class types

Amazon RDS supports three types of instance classes: standard, memory optimized, and burstable performance. For more information about Amazon EC2 instance types, see Instance types in the Amazon EC2 documentation.

The following are the standard DB instance types available:

db.m6g – General-purpose instance classes powered by AWS Graviton2 processors. These deliver balanced compute, memory, and networking for a broad range of general purpose workloads.

You can modify a DB instance to use one of the DB instance classes powered by AWS Graviton2 processors by completing the same steps as any other DB instance modification.

db.m6gd – General-purpose instance classes powered by AWS Graviton2 processors. These deliver balanced compute, memory, and networking for a broad range of general purpose workloads. These have local NVMe-based SSD block-level storage for applications that need high-speed, low latency local storage.

These DB instance classes are only supported for Multi-AZ DB clusters. For more information about Multi-AZ DB clusters, see Multi-AZ DB cluster deployments (p. 70).

db.m5d – Newest generation instance classes that are optimized for low latency, very high random I/O performance, and high sequential read throughput.

db.m5 – Latest generation general-purpose instance classes that provide a balance of compute, memory, and network resources, and are a good choice for many applications. The db.m5 instance classes provide more computing capacity than the previous db.m4 instance classes. They are powered by the AWS Nitro System, a combination of dedicated hardware and lightweight hypervisor.

db.m4 – General-purpose instance classes that provide more computing capacity than the previous db.m3 instance classes.

db.m3 – General-purpose instance classes that provide more computing capacity than the previous db.m1 instance classes.

The following are the memory optimized DB instance types available:

db.x2g – Instance classes optimized for memory-intensive applications and powered by AWS Graviton2 processors. These offer low cost per GiB of memory.

(30)

DB instance class types

You can modify a DB instance to use one of the DB instance classes powered by AWS Graviton2 processors by completing the same steps as any other DB instance modification.

db.z1d – Instance classes optimized for memory-intensive applications. These offer both high compute capacity and a high memory footprint. High frequency z1d instances deliver a sustained all core frequency of up to 4.0 GHz.

db.x1e – Instance classes optimized for memory-intensive applications. These offer one of the lowest price per gibibyte (GiB) of RAM among the DB instance classes and up to 3,904 GiB of DRAM-based instance memory.

db.x1 – Instance classes optimized for memory-intensive applications. These offer one of the lowest price per GiB of RAM among the DB instance classes and up to 1,952 GiB of DRAM-based instance memory.

db.r6g – Instance classes powered by AWS Graviton2 processors. These are ideal for running memory- intensive workloads in open-source databases such as MySQL and PostgreSQL.

You can modify a DB instance to use one of the DB instance classes powered by AWS Graviton2 processors by completing the same steps as any other DB instance modification.

db.r6gd – Instance classes powered by AWS Graviton2 processors. These are ideal for running memory-intensive workloads in open-source databases such as MySQL and PostgreSQL. These have local NVMe-based SSD block-level storage for applications that need high-speed, low latency local storage.

These DB instance classes are only supported for Multi-AZ DB clusters. For more information about Multi-AZ DB clusters, see Multi-AZ DB cluster deployments (p. 70).

db.r5b – Instance classes that are memory optimized for throughput-intensive applications. Powered by the AWS Nitro System, db.r5b instances deliver up to 60 Gbps bandwidth and 260,000 IOPS of EBS performance, which is the fastest block storage performance on EC2.

db.r5d – Instance classes that are optimized for low latency, very high random I/O performance, and high sequential read throughput.

db.r5 – Latest generation instance classes optimized for memory-intensive applications. These offer improved networking and Amazon Elastic Block Store (Amazon EBS) performance. They are powered by the AWS Nitro System, a combination of dedicated hardware and lightweight hypervisor.

db.r3 – Instance classes that provide memory optimization.

The following are the burstable performance DB instance types available:

db.t4g – Newest-generation general-purpose instance classes powered by Arm-based AWS Graviton2 processors. These deliver better price performance than previous-generation burstable performance DB instance classes for a broad set of burstable general-purpose workloads. Amazon RDS T4g instances are configured for Unlimited mode, which means that they can burst beyond the baseline over a 24-hour window for an additional charge.

You can modify a DB instance to use one of the DB instance classes powered by AWS Graviton2 processors by completing the same steps as with any other DB instance modification.

db.t3 – Next generation instance classes that provide a baseline performance level, with the ability to burst to full CPU usage. T3 instances are configured for Unlimited mode. These instance classes provide more computing capacity than the previous db.t2 instance classes. They are powered by the AWS Nitro System, a combination of dedicated hardware and lightweight hypervisor.

db.t2 – Instance classes that provide a baseline performance level, with the ability to burst to full CPU usage. T2 instances can be configured for Unlimited mode. We recommend using these instance classes only for development and test servers, or other nonproduction servers.

(31)

Supported DB engines

NoteThe DB instance classes that use the AWS Nitro System (db.m5, db.r5, db.t3) are throttled on combined read plus write workload.

For DB instance class hardware specifications, see Hardware specifications for DB instance classes (p. 44).

Supported DB engines for DB instance classes

The following are DB engine–specific considerations for DB instance classes:

Microsoft SQL Server

DB instance class support varies according to the version and edition of SQL Server. For instance class support by version and edition, see DB instance class support for Microsoft SQL Server (p. 925).

Oracle

DB instance class support varies according to the Oracle Database version and edition. RDS for Oracle supports additional memory-optimized instance classes. These classes have names of the form db.r5.instance_size.tpcthreads_per_core.memratio. For the vCPU count and memory allocation for each optimized class, see Supported Oracle DB instance classes (p. 1310).

In the following table, you can find details about supported Amazon RDS DB instance classes for each Amazon RDS DB engine.

Instance class MariaDB Microsoft

SQL Server MySQL Oracle PostgreSQL

db.m6g – standard instance classes powered by AWS Graviton2 processors

db.m6g.16xlarge All MariaDB

10.6 versions, all MariaDB 10.5 versions, and MariaDB version 10.4.13 &

higher 10.4 versions

No MySQL 8.0.17

& higher No All

PostgreSQL 14 & 13 versions, and PostgreSQL 12.3 & higher 12 versions

db.m6g.12xlarge All MariaDB

10.6 versions, all MariaDB 10.5 versions, and MariaDB version 10.4.13 &

higher 10.4 versions

No MySQL 8.0.17

& higher No All

PostgreSQL 14 & 13 versions, and PostgreSQL 12.3 & higher 12 versions

db.m6g.8xlarge All MariaDB

10.6 versions, all MariaDB 10.5 versions, and MariaDB version

No MySQL 8.0.17

& higher No PostgreSQL

14 and 13 versions, and PostgreSQL 12.3 & higher 12 versions

數據

Table size

參考文獻

相關文件

Using MS Access to design database, learning SQL commands and create forms and

files Controller Controller Parser Parser.

• Information retrieval : Implementing and Evaluating Search Engines, by Stefan Büttcher, Charles L.A.

 Evaluated deadline and cost perfor mance of various scheduling polici es under a large range of SLA cost function and

To tackle these problems, this study develops a novel approach integrated with some graph-based heuristic working rules, robust back-propagation neural network (BPNN) engines

The Performance Evaluation for Horizontal, Vertical and Hybrid Schema in Database Systems.. -A Case Study of Wireless Broadband

This database includes antigen’s PDB_ID, all sites (include interaction and non-interaction) of a nine amino acid sequence of primary structure and secondary structure.. After

For example, both Illumination Cone and Quotient Image require several face images of different lighting directions in order to train their database; all of