Migrate to Amazon RDS for Oracle with cost optimization

海外精选
海外精选的内容汇集了全球优质的亚马逊云科技相关技术内容。同时,内容中提到的“AWS” 是 “Amazon Web Services” 的缩写,在此网站不作为商标展示。
0
0
{"value":"When migrating Oracle Database applications to Amazon Web Services, you have many opportunities to modernize and optimize your architecture. This migration provides increased agility and flexibility, as well as the potential to migrate to a fully managed service, such as [ Amazon Relational Database Service (Amazon RDS) for Oracle](https://aws.amazon.com/rds/oracle/). RDS for Oracle offers compute scaling, automated backups, event notifications, and [more](https://aws.amazon.com/rds/features/?pg=ln&sec=be). It also helps relieve DBAs and other IT staff of many traditional aspects of Oracle Database infrastructure administration, allowing them to focus their attention on application aspects that lend more value to the business. In this post, we discuss several of our frequently recommended steps to optimize costs when migrating and running Oracle databases on Amazon Web Services. Implementing these steps requires detailed database and application knowledge. As such, this post is targeted at DBAs and DBA managers.\n\n\nMigrating is a prime time to optimize costs by right-sizing resources to the needs of the workload, taking advantage of Amazon Web Services automation and features you didn’t have in your traditional data centers, and reevaluating your need for legacy solutions and third-party add-ons. Although a lift and shift in the simplest sense would be an easy path to the cloud, that method brings with it all the over-provisioning and legacy aspects of your on-premises solution. Analyzing your true needs as you embark on the migration project allows you to potentially avoid migrating unnecessary data, reduce downtime compared to implementing changes separately, and save time by combining testing efforts. You don’t need to address everything during the migration, but look for changes with a clear return on investment (ROI). You may even find that certain applications can be completely retired or absorbed into another system.\n\n\n#### **Retire what you can**\n\nThe first suggestion is obvious on one level: after all, there is no cheaper way to run an application than not running it at all. But it’s worthwhile to verify that each database and its hosted applications are still relevant when you’re planning for migration. They may be running simply because no one bothered to stop them—or a stopped system was restarted after an incident as part of an outdated playbook. Know what you’re moving, who the stakeholders are, and what the database supports before moving forward with decommissioning or migrating the workload.\n\nRetiring a database that is already running on Amazon RDS for Oracle is easy: by default, the service takes a final snapshot of the instance before deleting it. You can restore that snapshot later if you determine you need access to that data. Amazon RDS allows you to [upgrade the snapshot](https://aws.amazon.com/blogs/database/best-practices-for-upgrading-amazon-rds-for-oracle-database-snapshots/)if the major version has been deprecated in the meantime.\n\n\n#### **Examine feature usage and question the need for Enterprise Edition over Standard Edition**\n\n\nAfter you identify an Oracle database that you need to migrate, examine its Oracle Database [edition and feature requirements](https://docs.oracle.com/en/database/oracle/oracle-database/21/dblic/Licensing-Information.html#GUID-0F9EB85D-4610-4EDF-89C2-4916A0E7AC87). For more information about Enterprise Edition (EE) vs. Standard Edition Two (SE2), refer to [Rethink Oracle Standard Edition Two on Amazon RDS for Oracle](https://aws.amazon.com/blogs/database/rethink-oracle-standard-edition-two-on-amazon-rds-for-oracle/).\n\nThe price difference between EE and SE2 is substantial. If an application doesn’t require EE features or add-ons, migrating it to SE2 can remove dependence on EE licenses and [higher support costs](https://houseofbrick.com/blog/choosing-the-right-oracle-database-edition-standard-vs-enterprise/#:~:text=Typically%20for%20EE%2C%20this%20is,for%20SE2%20it%20is%20%24350) as well as provide the option to run on Amazon RDS for Oracle License Included (LI) instances or an open-source database engine. LI instances allow you to pay as you go for Oracle Database licensing as well as the compute instance, which opens up additional savings potential and avoids long-term license purchases and contracts. Amazon RDS for Oracle offers synchronous replication to a second Availability Zone and automated failover for both EE and SE2 with [Multi-AZ deployments](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.MultiAZ.html), providing an alternative to Oracle Data Guard or self-managed storage replication. We have discussed ways to remove reliance on features such as partitioning and alternative methods for [SQL plan management](https://aws.amazon.com/blogs/database/managing-your-sql-plan-in-oracle-se-with-amazon-rds-for-oracle/) previously. Consider a combination of [Amazon RDS Performance Insights](https://aws.amazon.com/rds/performance-insights/) and [Oracle Statspack](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.Statspack.html) for your performance analysis needs, rather than Oracle Diagnostics and Tuning Packs for Oracle Enterprise Manager, which are separately licensed on top of EE. Amazon RDS for Oracle supports [Oracle Transparent Data Encryption (TDE)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.AdvSecurity.html), which requires licensing the Advanced Security Option, and it also provides [Amazon RDS storage encryption](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Encryption.html) via [Amazon Web Services Key Management Service](http://aws.amazon.com/kms) (Amazon Web Services KMS) keys natively.\n\n\n#### **Implement reasonable application query and Oracle instance tuning changes and baseline performance ahead of the migration**\n\n\nTuning an application reduces its resource consumption, whether in a data center or in the cloud, and we recommend performing regular analysis and tuning of database applications—especially prior to migration. A poorly performing query impacts the user experience, but it also requires more resources to run. More resources consumed—often across multiple aspects of compute, memory, storage operations and throughput, and network bandwidth—means greater costs that don’t add value to the application, and these should be reduced or eliminated. Be sure to baseline the database performance prior to the migration; this will help you determine whether performance issues are related to the migration itself or the application. Performance Insights supports [Oracle query run plan capture](https://aws.amazon.com/about-aws/whats-new/2022/01/amazon-rds-performance-query-execution-plan-capture-oracle/) to help you identify changes during the migration.\n\n\n#### **Examine recent resource consumption for current needs and target the appropriate instance class and size**\n\n\nWhen you’re determining resource requirements for a database application, it’s critically important to understand actual resource consumption and not simply duplicate the current resource allocation. In a capital expenditure model where servers are typically refreshed every few years, administrators often have to over-provision systems for today’s usage in anticipation of growth before the next refresh cycle. This leads to lower cost-efficiency while the workload doesn’t need those additional resources. However, when running your application on Amazon RDS for Oracle or self-managed Oracle on [Amazon Elastic Compute Cloud](https://aws.amazon.com/ec2)(Amazon EC2), provisioning a larger instance and making more resources available to the database is a matter of just a few minutes’ outage. This means it’s easy to respond quickly to changes in workload demand—both increases and decreases—rather than guessing at future needs. It also enables you to stay up to date with the latest instance type with a new chipset and the fastest CPUs. Newer chipsets and higher clock speeds can mean fewer CPU cores are required to support a given workload, potentially allowing you to downsize to a smaller instance and save costs. Oracle has provided tools such as the Automatic Workload Repository (AWR, EE only) and Statspack (EE and SE2) to help DBAs assess performance and resource requirements. We have built a [solution](https://aws.amazon.com/blogs/database/right-sizing-amazon-rds-instances-at-scale-based-on-oracle-performance-metrics/) based on Oracle AWR data to help you assess resource requirements at scale.\n\nRemember: when you provision a CPU for a commercial database, you’re generally required to pay a database license cost whether the database actively uses that CPU or not. Your goal should be to minimize CPU consumption and then provision only what you need for a given workload to avoid wasting money on infrastructure and licensing. Amazon RDS for Oracle offers the latest generation of [EC2 instance classes](https://aws.amazon.com/rds/instance-types/) with excellent performance/price ratios and also offers [extended memory instances](https://aws.amazon.com/about-aws/whats-new/2021/06/amazon-rds-for-oracle-now-supports-additional-memory-configurations-of-the-r5-instance-class/) with up to 32:1 memory-to-vCPU ratio for right-sizing. Additionally, watch out for databases on premises that have been over-provisioned on CPU and RAM to make up for under-performing storage. Amazon RDS for Oracle offers high-performance, low-latency block storage options with [Amazon Elastic Block Store](https://aws.amazon.com/ebs/) (Amazon EBS). Allocating the amount and class of storage the database needs can be cheaper in the long run than allocating additional cores and RAM.\n\nConsider also your actual performance requirements for an application, as opposed to its current performance. Similar to over-provisioning for future growth, allocating more resources than required to achieve your performance objectives potentially means wasting money on unnecessary performance improvements. Determine what performance you need today, and allocate resources to achieve that performance, without spending more to achieve unnecessary gains.\n\n\n#### **Consider migrating large objects and historical data to an object store, like Amazon S3**\n\n\nBlock storage is more expensive than object storage. Many serverless applications can interact directly with objects on [Amazon Simple Storage Service ](https://aws.amazon.com/s3/) (Amazon S3), which is a highly available and extremely durable object store. Replacing large objects (LOBs) with Amazon S3 URLs can drastically reduce the total storage capacity required for the database, moving the objects out where other applications can potentially interact with them more easily, and making the database smaller and cheaper to run. Additionally, some open-source databases interact with LOBs differently, meaning removing them from the database can be a step toward eventually migrating to an open-source database engine. This will require application changes but may well be worth it for databases where the bulk of data is in the form of LOBs.\n\nYou may consider a similar approach to implementing data life cycling, where you perform one-time exports of old data by partition, date range, or other data characteristic, storing the resulting export files in Amazon S3 and removing the data from the database. In the event the data is needed later, you can import the data back into the primary database or create a separate database instance to which to restore the historical data while it’s needed, and then drop that instance when it’s no longer required. [Oracle Data Pump](https://docs.oracle.com/en/database/oracle/oracle-database/21/sutil/oracle-data-pump.html#GUID-501A9908-BCC5-434C-8853-9A6096766B5A) can perform such an export, or you can use [Oracle SQLcl](https://www.oracle.com/tools/downloads/sqlcl-downloads.html) or a custom procedure to export data directly into a comma-separated value (CSV) format that, when stored in Amazon S3, may be accessed by other tools, such as [Amazon EMR](), for analysis.\n\n\n#### **Determine HA and DR requirements per application and implement solutions granularly**\n\n\nBusiness-critical applications require high availability (HA), and nearly every application needs a disaster recovery (DR) plan. But Recovery Point Objectives (RPOs) and Recovery Time Objectives (RTOs) vary widely by application and environment. With a monolithic architecture running bin-packed databases, every core has to be licensed for every database option, whether a given database needs the option or not. In Amazon RDS for Oracle, you can host each database on its own instance, allowing you to enable HA features, such as [Multi-AZ deployments](https://aws.amazon.com/blogs/aws/multi-az-option-for-amazon-rds-oracle/) and Oracle Data Guard-based replication within an Amazon Web Services Region or even across Regions with [Oracle replicas](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-replicas.overview.html), on a per-instance basis. This allows you to optimize the license allocation and spend for applications that truly need these features, while relying on [automated backups](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html)and even [cross-Region automated backups](https://aws.amazon.com/blogs/database/managed-disaster-recovery-with-amazon-rds-for-oracle-cross-region-automated-backups-part-1/) for applications with less stringent RPO and RTO requirements.\n\n\n#### **Consolidate smaller, related applications into a single database, and break up larger, unrelated applications into their own databases**\n\n\nDatabase bin packing is still very common: A small number of physical servers, with each CPU licensed for the database software, and a large number of smaller databases co-hosted for maximum cost-efficiency of those licenses. This results in a smaller number of servers and database installations to manage, but the downside is that this model presents little option for hardware, operating system, or database maintenance without impacting multiple aspects of the business. Buying a small server to host a database is risky—What if the database outgrows the server? In Amazon Web Services, changing out the underlying instance class or shape is efficient, reducing risk. Applications may be commingled or separated as appropriate for your business needs. In today’s microservices landscape, it makes sense to split up applications for individual right-sizing and scaling, customized maintenance needs and windows, and DR solutions tailored to individual RPO and RTO requirements. We recommend only commingling those applications that truly make sense to run together.\n\n\n#### **Consider a caching service for frequently requested objects**\n\n\n[Caching for relational databases](https://aws.amazon.com/caching/database-caching/) with [Amazon ElastiCache](https://aws.amazon.com/elasticache/) is another area where a purpose-built system can offload frequently run queries and requested objects to a high-performing system, delivering even lower response times to applications while reducing the read load directed toward the database. This type of change requires application changes but can improve application responsiveness while also reducing the database infrastructure allocation.\n\n\n#### **Take advantage of Amazon Web Services-native services and features**\n\n\nAfter closely examining the requirements of each database application, consider what functionality may be offloaded to a managed service. Amazon RDS for Oracle delivers optional [EBS encryption](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Encryption.html) for your database, and it automatically backs up your database in-Region and can be configured to back up cross-Region with just a few clicks. With automated backups, you can perform a [point-in-time restore (PITR)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIT.html) operation to a new database instance with only a few clicks or a single API call. You can refresh a non-production environment from a snapshot of production in minutes. You can also use replicas to provide DR options and facilitate blue-green deployments. Multiple options are available in Amazon Web Services to improve your operations over on-premises environments, making them run faster, with less effort, and less expensively.\n\n\n#### **Turn off instances when they’re not in use to save on instance charges**\n\n\nYou can stop EC2 and RDS for Oracle instances as needed and save on instance costs (allocated storage is still charged) until you need them available again. You can use [Amazon Web Services Instance Scheduler](https://aws.amazon.com/solutions/implementations/instance-scheduler/) or [Amazon Web Services Lambda](http://aws.amazon.com/lambda) to start the instance at the beginning of the workday and stop it at the end, cutting the instance costs significantly for environments that don’t need 24×7 availability. For more information about using Lambda with Amazon RDS, refer to S[chedule Amazon RDS stop and start using Amazon Web Services Lambda](https://aws.amazon.com/blogs/database/schedule-amazon-rds-stop-and-start-using-aws-lambda/). We also have burstable instances for applications that see occasional spikes, and these instances can burst to absorb the additional load and provide greater cost-efficiency than allocating a larger instance full time.\n\n\n#### **Iterate on these best practices**\n\n\nAs with performance tuning, cost optimization is rarely ever completely done. Applications change, in turn altering their resource requirements, and data volumes fluctuate. In the absence of comprehensive data life cycling processes, a database will continue to grow over time. Although we recommend frequently monitoring an application’s performance and resource requirements, you can also configure [Amazon CloudWatch](https://aws.amazon.com/cloudwatch/) alerts to notify DBAs when resource consumption crosses an upper or lower threshold, indicating that it’s time to think about scaling up or down. You can even configure a Lambda function to perform a scaling operation for you when the alarm is triggered.\n\nOnce you have a good idea of your instance needs, purchasing a [Reserved Instance](https://aws.amazon.com/rds/reserved-instances/) can substantially reduce operating costs for RDS for Oracle instances. If you can eliminate your reliance on EE features and migrate to SE2, you may also consider the License Included (LI) option for Amazon RDS for Oracle. In the LI model, you don’t need to purchase Oracle licenses separately. Amazon Web Services holds the license for the Oracle database software. In this model, if you have an Amazon Web Services Support account with case support, contact Amazon Web Services Support for both Amazon RDS and Oracle Database service requests.\n\n\n#### **Conclusion**\n\n\nIn this post, we discussed best practices for cost optimization when migrating Oracle databases to Amazon RDS for Oracle. Because every environment is unique, some of our suggestions will have greater impact than others to your specific use case.\n\nIf you have questions about planning your migration or how to implement any of these suggestions, we encourage you to work with your account team to locate an [Amazon Web Services Partner](https://aws.amazon.com/rds/partners/?pg=cpg&sec=cat&cp=tb&blog-posts-cards.sort-by=item.additionalFields.modifiedDate&blog-posts-cards.sort-order=desc&partner-solutions-cards.sort-by=item.additionalFields.partnerNameLower&partner-solutions-cards.sort-order=asc&awsf.partner-solutions-filter-partner-type=*all&awsf.partner-solutions-filter-product=*all&awsf.partner-solutions-filter-location=*all) or engage an Amazon Web Services specialist to work directly with you.\n\n\n#### **About the Author**\n\n\n![image.png](https://dev-media.amazoncloud.cn/1ee1fe06ab0f4b388eb502debd519790_image.png)\n\n**Nathan Fuzi** is a Principal Oracle Specialist Solutions Architect at Amazon Web Services. He is a frequent presenter at Amazon Web Services Data Modernization Week and Amazon Web Services Online Tech Talks. Nathan works directly with Amazon Web Services customers to migrate, run, and optimize their database applications on Amazon RDS for Oracle. With over 20 years of experience in the database realm, he enjoys helping customers build technical solutions to solve business problems.","render":"<p>When migrating Oracle Database applications to Amazon Web Services, you have many opportunities to modernize and optimize your architecture. This migration provides increased agility and flexibility, as well as the potential to migrate to a fully managed service, such as <a href=\"https://aws.amazon.com/rds/oracle/\" target=\"_blank\"> Amazon Relational Database Service (Amazon RDS) for Oracle</a>. RDS for Oracle offers compute scaling, automated backups, event notifications, and <a href=\"https://aws.amazon.com/rds/features/?pg=ln&amp;sec=be\" target=\"_blank\">more</a>. It also helps relieve DBAs and other IT staff of many traditional aspects of Oracle Database infrastructure administration, allowing them to focus their attention on application aspects that lend more value to the business. In this post, we discuss several of our frequently recommended steps to optimize costs when migrating and running Oracle databases on Amazon Web Services. Implementing these steps requires detailed database and application knowledge. As such, this post is targeted at DBAs and DBA managers.</p>\n<p>Migrating is a prime time to optimize costs by right-sizing resources to the needs of the workload, taking advantage of Amazon Web Services automation and features you didn’t have in your traditional data centers, and reevaluating your need for legacy solutions and third-party add-ons. Although a lift and shift in the simplest sense would be an easy path to the cloud, that method brings with it all the over-provisioning and legacy aspects of your on-premises solution. Analyzing your true needs as you embark on the migration project allows you to potentially avoid migrating unnecessary data, reduce downtime compared to implementing changes separately, and save time by combining testing efforts. You don’t need to address everything during the migration, but look for changes with a clear return on investment (ROI). You may even find that certain applications can be completely retired or absorbed into another system.</p>\n<h4><a id=\"Retire_what_you_can_6\"></a><strong>Retire what you can</strong></h4>\n<p>The first suggestion is obvious on one level: after all, there is no cheaper way to run an application than not running it at all. But it’s worthwhile to verify that each database and its hosted applications are still relevant when you’re planning for migration. They may be running simply because no one bothered to stop them—or a stopped system was restarted after an incident as part of an outdated playbook. Know what you’re moving, who the stakeholders are, and what the database supports before moving forward with decommissioning or migrating the workload.</p>\n<p>Retiring a database that is already running on Amazon RDS for Oracle is easy: by default, the service takes a final snapshot of the instance before deleting it. You can restore that snapshot later if you determine you need access to that data. Amazon RDS allows you to <a href=\"https://aws.amazon.com/blogs/database/best-practices-for-upgrading-amazon-rds-for-oracle-database-snapshots/\" target=\"_blank\">upgrade the snapshot</a>if the major version has been deprecated in the meantime.</p>\n<h4><a id=\"Examine_feature_usage_and_question_the_need_for_Enterprise_Edition_over_Standard_Edition_13\"></a><strong>Examine feature usage and question the need for Enterprise Edition over Standard Edition</strong></h4>\n<p>After you identify an Oracle database that you need to migrate, examine its Oracle Database <a href=\"https://docs.oracle.com/en/database/oracle/oracle-database/21/dblic/Licensing-Information.html#GUID-0F9EB85D-4610-4EDF-89C2-4916A0E7AC87\" target=\"_blank\">edition and feature requirements</a>. For more information about Enterprise Edition (EE) vs. Standard Edition Two (SE2), refer to <a href=\"https://aws.amazon.com/blogs/database/rethink-oracle-standard-edition-two-on-amazon-rds-for-oracle/\" target=\"_blank\">Rethink Oracle Standard Edition Two on Amazon RDS for Oracle</a>.</p>\n<p>The price difference between EE and SE2 is substantial. If an application doesn’t require EE features or add-ons, migrating it to SE2 can remove dependence on EE licenses and <a href=\"https://houseofbrick.com/blog/choosing-the-right-oracle-database-edition-standard-vs-enterprise/#:~:text=Typically%20for%20EE%2C%20this%20is,for%20SE2%20it%20is%20%24350\" target=\"_blank\">higher support costs</a> as well as provide the option to run on Amazon RDS for Oracle License Included (LI) instances or an open-source database engine. LI instances allow you to pay as you go for Oracle Database licensing as well as the compute instance, which opens up additional savings potential and avoids long-term license purchases and contracts. Amazon RDS for Oracle offers synchronous replication to a second Availability Zone and automated failover for both EE and SE2 with <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.MultiAZ.html\" target=\"_blank\">Multi-AZ deployments</a>, providing an alternative to Oracle Data Guard or self-managed storage replication. We have discussed ways to remove reliance on features such as partitioning and alternative methods for <a href=\"https://aws.amazon.com/blogs/database/managing-your-sql-plan-in-oracle-se-with-amazon-rds-for-oracle/\" target=\"_blank\">SQL plan management</a> previously. Consider a combination of <a href=\"https://aws.amazon.com/rds/performance-insights/\" target=\"_blank\">Amazon RDS Performance Insights</a> and <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.Statspack.html\" target=\"_blank\">Oracle Statspack</a> for your performance analysis needs, rather than Oracle Diagnostics and Tuning Packs for Oracle Enterprise Manager, which are separately licensed on top of EE. Amazon RDS for Oracle supports <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.AdvSecurity.html\" target=\"_blank\">Oracle Transparent Data Encryption (TDE)</a>, which requires licensing the Advanced Security Option, and it also provides <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Encryption.html\" target=\"_blank\">Amazon RDS storage encryption</a> via <a href=\"http://aws.amazon.com/kms\" target=\"_blank\">Amazon Web Services Key Management Service</a> (Amazon Web Services KMS) keys natively.</p>\n<h4><a id=\"Implement_reasonable_application_query_and_Oracle_instance_tuning_changes_and_baseline_performance_ahead_of_the_migration_21\"></a><strong>Implement reasonable application query and Oracle instance tuning changes and baseline performance ahead of the migration</strong></h4>\n<p>Tuning an application reduces its resource consumption, whether in a data center or in the cloud, and we recommend performing regular analysis and tuning of database applications—especially prior to migration. A poorly performing query impacts the user experience, but it also requires more resources to run. More resources consumed—often across multiple aspects of compute, memory, storage operations and throughput, and network bandwidth—means greater costs that don’t add value to the application, and these should be reduced or eliminated. Be sure to baseline the database performance prior to the migration; this will help you determine whether performance issues are related to the migration itself or the application. Performance Insights supports <a href=\"https://aws.amazon.com/about-aws/whats-new/2022/01/amazon-rds-performance-query-execution-plan-capture-oracle/\" target=\"_blank\">Oracle query run plan capture</a> to help you identify changes during the migration.</p>\n<h4><a id=\"Examine_recent_resource_consumption_for_current_needs_and_target_the_appropriate_instance_class_and_size_27\"></a><strong>Examine recent resource consumption for current needs and target the appropriate instance class and size</strong></h4>\n<p>When you’re determining resource requirements for a database application, it’s critically important to understand actual resource consumption and not simply duplicate the current resource allocation. In a capital expenditure model where servers are typically refreshed every few years, administrators often have to over-provision systems for today’s usage in anticipation of growth before the next refresh cycle. This leads to lower cost-efficiency while the workload doesn’t need those additional resources. However, when running your application on Amazon RDS for Oracle or self-managed Oracle on <a href=\"https://aws.amazon.com/ec2\" target=\"_blank\">Amazon Elastic Compute Cloud</a>(Amazon EC2), provisioning a larger instance and making more resources available to the database is a matter of just a few minutes’ outage. This means it’s easy to respond quickly to changes in workload demand—both increases and decreases—rather than guessing at future needs. It also enables you to stay up to date with the latest instance type with a new chipset and the fastest CPUs. Newer chipsets and higher clock speeds can mean fewer CPU cores are required to support a given workload, potentially allowing you to downsize to a smaller instance and save costs. Oracle has provided tools such as the Automatic Workload Repository (AWR, EE only) and Statspack (EE and SE2) to help DBAs assess performance and resource requirements. We have built a <a href=\"https://aws.amazon.com/blogs/database/right-sizing-amazon-rds-instances-at-scale-based-on-oracle-performance-metrics/\" target=\"_blank\">solution</a> based on Oracle AWR data to help you assess resource requirements at scale.</p>\n<p>Remember: when you provision a CPU for a commercial database, you’re generally required to pay a database license cost whether the database actively uses that CPU or not. Your goal should be to minimize CPU consumption and then provision only what you need for a given workload to avoid wasting money on infrastructure and licensing. Amazon RDS for Oracle offers the latest generation of <a href=\"https://aws.amazon.com/rds/instance-types/\" target=\"_blank\">EC2 instance classes</a> with excellent performance/price ratios and also offers <a href=\"https://aws.amazon.com/about-aws/whats-new/2021/06/amazon-rds-for-oracle-now-supports-additional-memory-configurations-of-the-r5-instance-class/\" target=\"_blank\">extended memory instances</a> with up to 32:1 memory-to-vCPU ratio for right-sizing. Additionally, watch out for databases on premises that have been over-provisioned on CPU and RAM to make up for under-performing storage. Amazon RDS for Oracle offers high-performance, low-latency block storage options with <a href=\"https://aws.amazon.com/ebs/\" target=\"_blank\">Amazon Elastic Block Store</a> (Amazon EBS). Allocating the amount and class of storage the database needs can be cheaper in the long run than allocating additional cores and RAM.</p>\n<p>Consider also your actual performance requirements for an application, as opposed to its current performance. Similar to over-provisioning for future growth, allocating more resources than required to achieve your performance objectives potentially means wasting money on unnecessary performance improvements. Determine what performance you need today, and allocate resources to achieve that performance, without spending more to achieve unnecessary gains.</p>\n<h4><a id=\"Consider_migrating_large_objects_and_historical_data_to_an_object_store_like_Amazon_S3_37\"></a><strong>Consider migrating large objects and historical data to an object store, like Amazon S3</strong></h4>\n<p>Block storage is more expensive than object storage. Many serverless applications can interact directly with objects on <a href=\"https://aws.amazon.com/s3/\" target=\"_blank\">Amazon Simple Storage Service </a> (Amazon S3), which is a highly available and extremely durable object store. Replacing large objects (LOBs) with Amazon S3 URLs can drastically reduce the total storage capacity required for the database, moving the objects out where other applications can potentially interact with them more easily, and making the database smaller and cheaper to run. Additionally, some open-source databases interact with LOBs differently, meaning removing them from the database can be a step toward eventually migrating to an open-source database engine. This will require application changes but may well be worth it for databases where the bulk of data is in the form of LOBs.</p>\n<p>You may consider a similar approach to implementing data life cycling, where you perform one-time exports of old data by partition, date range, or other data characteristic, storing the resulting export files in Amazon S3 and removing the data from the database. In the event the data is needed later, you can import the data back into the primary database or create a separate database instance to which to restore the historical data while it’s needed, and then drop that instance when it’s no longer required. <a href=\"https://docs.oracle.com/en/database/oracle/oracle-database/21/sutil/oracle-data-pump.html#GUID-501A9908-BCC5-434C-8853-9A6096766B5A\" target=\"_blank\">Oracle Data Pump</a> can perform such an export, or you can use <a href=\"https://www.oracle.com/tools/downloads/sqlcl-downloads.html\" target=\"_blank\">Oracle SQLcl</a> or a custom procedure to export data directly into a comma-separated value (CSV) format that, when stored in Amazon S3, may be accessed by other tools, such as <a href=\"\" target=\"_blank\">Amazon EMR</a>, for analysis.</p>\n<h4><a id=\"Determine_HA_and_DR_requirements_per_application_and_implement_solutions_granularly_45\"></a><strong>Determine HA and DR requirements per application and implement solutions granularly</strong></h4>\n<p>Business-critical applications require high availability (HA), and nearly every application needs a disaster recovery (DR) plan. But Recovery Point Objectives (RPOs) and Recovery Time Objectives (RTOs) vary widely by application and environment. With a monolithic architecture running bin-packed databases, every core has to be licensed for every database option, whether a given database needs the option or not. In Amazon RDS for Oracle, you can host each database on its own instance, allowing you to enable HA features, such as <a href=\"https://aws.amazon.com/blogs/aws/multi-az-option-for-amazon-rds-oracle/\" target=\"_blank\">Multi-AZ deployments</a> and Oracle Data Guard-based replication within an Amazon Web Services Region or even across Regions with <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-replicas.overview.html\" target=\"_blank\">Oracle replicas</a>, on a per-instance basis. This allows you to optimize the license allocation and spend for applications that truly need these features, while relying on <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html\" target=\"_blank\">automated backups</a>and even <a href=\"https://aws.amazon.com/blogs/database/managed-disaster-recovery-with-amazon-rds-for-oracle-cross-region-automated-backups-part-1/\" target=\"_blank\">cross-Region automated backups</a> for applications with less stringent RPO and RTO requirements.</p>\n<h4><a id=\"Consolidate_smaller_related_applications_into_a_single_database_and_break_up_larger_unrelated_applications_into_their_own_databases_51\"></a><strong>Consolidate smaller, related applications into a single database, and break up larger, unrelated applications into their own databases</strong></h4>\n<p>Database bin packing is still very common: A small number of physical servers, with each CPU licensed for the database software, and a large number of smaller databases co-hosted for maximum cost-efficiency of those licenses. This results in a smaller number of servers and database installations to manage, but the downside is that this model presents little option for hardware, operating system, or database maintenance without impacting multiple aspects of the business. Buying a small server to host a database is risky—What if the database outgrows the server? In Amazon Web Services, changing out the underlying instance class or shape is efficient, reducing risk. Applications may be commingled or separated as appropriate for your business needs. In today’s microservices landscape, it makes sense to split up applications for individual right-sizing and scaling, customized maintenance needs and windows, and DR solutions tailored to individual RPO and RTO requirements. We recommend only commingling those applications that truly make sense to run together.</p>\n<h4><a id=\"Consider_a_caching_service_for_frequently_requested_objects_57\"></a><strong>Consider a caching service for frequently requested objects</strong></h4>\n<p><a href=\"https://aws.amazon.com/caching/database-caching/\" target=\"_blank\">Caching for relational databases</a> with <a href=\"https://aws.amazon.com/elasticache/\" target=\"_blank\">Amazon ElastiCache</a> is another area where a purpose-built system can offload frequently run queries and requested objects to a high-performing system, delivering even lower response times to applications while reducing the read load directed toward the database. This type of change requires application changes but can improve application responsiveness while also reducing the database infrastructure allocation.</p>\n<h4><a id=\"Take_advantage_of_Amazon_Web_Servicesnative_services_and_features_63\"></a><strong>Take advantage of Amazon Web Services-native services and features</strong></h4>\n<p>After closely examining the requirements of each database application, consider what functionality may be offloaded to a managed service. Amazon RDS for Oracle delivers optional <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Encryption.html\" target=\"_blank\">EBS encryption</a> for your database, and it automatically backs up your database in-Region and can be configured to back up cross-Region with just a few clicks. With automated backups, you can perform a <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIT.html\" target=\"_blank\">point-in-time restore (PITR)</a> operation to a new database instance with only a few clicks or a single API call. You can refresh a non-production environment from a snapshot of production in minutes. You can also use replicas to provide DR options and facilitate blue-green deployments. Multiple options are available in Amazon Web Services to improve your operations over on-premises environments, making them run faster, with less effort, and less expensively.</p>\n<h4><a id=\"Turn_off_instances_when_theyre_not_in_use_to_save_on_instance_charges_69\"></a><strong>Turn off instances when they’re not in use to save on instance charges</strong></h4>\n<p>You can stop EC2 and RDS for Oracle instances as needed and save on instance costs (allocated storage is still charged) until you need them available again. You can use <a href=\"https://aws.amazon.com/solutions/implementations/instance-scheduler/\" target=\"_blank\">Amazon Web Services Instance Scheduler</a> or <a href=\"http://aws.amazon.com/lambda\" target=\"_blank\">Amazon Web Services Lambda</a> to start the instance at the beginning of the workday and stop it at the end, cutting the instance costs significantly for environments that don’t need 24×7 availability. For more information about using Lambda with Amazon RDS, refer to S<a href=\"https://aws.amazon.com/blogs/database/schedule-amazon-rds-stop-and-start-using-aws-lambda/\" target=\"_blank\">chedule Amazon RDS stop and start using Amazon Web Services Lambda</a>. We also have burstable instances for applications that see occasional spikes, and these instances can burst to absorb the additional load and provide greater cost-efficiency than allocating a larger instance full time.</p>\n<h4><a id=\"Iterate_on_these_best_practices_75\"></a><strong>Iterate on these best practices</strong></h4>\n<p>As with performance tuning, cost optimization is rarely ever completely done. Applications change, in turn altering their resource requirements, and data volumes fluctuate. In the absence of comprehensive data life cycling processes, a database will continue to grow over time. Although we recommend frequently monitoring an application’s performance and resource requirements, you can also configure <a href=\"https://aws.amazon.com/cloudwatch/\" target=\"_blank\">Amazon CloudWatch</a> alerts to notify DBAs when resource consumption crosses an upper or lower threshold, indicating that it’s time to think about scaling up or down. You can even configure a Lambda function to perform a scaling operation for you when the alarm is triggered.</p>\n<p>Once you have a good idea of your instance needs, purchasing a <a href=\"https://aws.amazon.com/rds/reserved-instances/\" target=\"_blank\">Reserved Instance</a> can substantially reduce operating costs for RDS for Oracle instances. If you can eliminate your reliance on EE features and migrate to SE2, you may also consider the License Included (LI) option for Amazon RDS for Oracle. In the LI model, you don’t need to purchase Oracle licenses separately. Amazon Web Services holds the license for the Oracle database software. In this model, if you have an Amazon Web Services Support account with case support, contact Amazon Web Services Support for both Amazon RDS and Oracle Database service requests.</p>\n<h4><a id=\"Conclusion_83\"></a><strong>Conclusion</strong></h4>\n<p>In this post, we discussed best practices for cost optimization when migrating Oracle databases to Amazon RDS for Oracle. Because every environment is unique, some of our suggestions will have greater impact than others to your specific use case.</p>\n<p>If you have questions about planning your migration or how to implement any of these suggestions, we encourage you to work with your account team to locate an <a href=\"https://aws.amazon.com/rds/partners/?pg=cpg&amp;sec=cat&amp;cp=tb&amp;blog-posts-cards.sort-by=item.additionalFields.modifiedDate&amp;blog-posts-cards.sort-order=desc&amp;partner-solutions-cards.sort-by=item.additionalFields.partnerNameLower&amp;partner-solutions-cards.sort-order=asc&amp;awsf.partner-solutions-filter-partner-type=*all&amp;awsf.partner-solutions-filter-product=*all&amp;awsf.partner-solutions-filter-location=*all\" target=\"_blank\">Amazon Web Services Partner</a> or engage an Amazon Web Services specialist to work directly with you.</p>\n<h4><a id=\"About_the_Author_91\"></a><strong>About the Author</strong></h4>\n<p><img src=\"https://dev-media.amazoncloud.cn/1ee1fe06ab0f4b388eb502debd519790_image.png\" alt=\"image.png\" /></p>\n<p><strong>Nathan Fuzi</strong> is a Principal Oracle Specialist Solutions Architect at Amazon Web Services. He is a frequent presenter at Amazon Web Services Data Modernization Week and Amazon Web Services Online Tech Talks. Nathan works directly with Amazon Web Services customers to migrate, run, and optimize their database applications on Amazon RDS for Oracle. With over 20 years of experience in the database realm, he enjoys helping customers build technical solutions to solve business problems.</p>\n"}
目录
亚马逊云科技解决方案 基于行业客户应用场景及技术领域的解决方案
联系亚马逊云科技专家
亚马逊云科技解决方案
基于行业客户应用场景及技术领域的解决方案
联系专家
0
目录
关闭
contact-us