আমাদেও পেলিক্স

এথেনা ফেডারেটেড ক্যোয়ারী ব্যবহার করে আপনার ওরাকল ডাটাবেস জিজ্ঞাসা করুন এবং আপনার অ্যামাজন এস 3 ডেটা হ্রদে ডেটা যুক্ত করুন

উত্স নোড: 995983

আপনি যদি ডেটা লেক ব্যবহার করেন আমাজন সিম্পল স্টোরেজ সার্ভিস (Amazon S3) and use Oracle as your transactional data store, you may need to join the data in your data lake with Oracle on অ্যামাজন রিলেশনাল ডাটাবেস পরিষেবা (Amazon RDS), Oracle running on অ্যামাজন ইলাস্টিক কম্পিউট ক্লাউড (Amazon EC2), or an on-premises Oracle database, for example to build a dashboard or create consolidated reporting.

In these use cases, আমাজন এথেনা ফেডারেটেড কোয়েরি allows you to seamlessly access the data you’re your Oracle database without having to move the data to the S3 data lake. This removes the overhead in managing such jobs.

In this post, we walk you through a step-by-step configuration to set up Athena Federated query using এডাব্লুএস ল্যাম্বদা to access data in Oracle on Amazon RDS.

For this post, we will be using the Oracle Athena Federated query connector developed by ট্রায়াঞ্জ. The runtime includes Oracle XE running on Amazon EC2 and Amazon RDS. Your Oracle instance can be on Amazon RDS, Amazon EC2, or on premises. You can deploy the Trianz Oracle AFQ connector available in the AWS সার্ভারহীন অ্যাপ্লিকেশন ভান্ডার.

আসুন সমাধান নিয়ে আলোচনা শুরু করি এবং তারপরে জড়িত পদক্ষেপগুলি বিশদভাবে বর্ণনা করি।

সমাধান ওভারভিউ

Data federation is the capability to integrate data in another data store using a single interface (অ্যামাজন অ্যাথেনা). The following diagram depicts how Athena federation works by using Lambda to integrate with a federated data source.

Athena হল একটি ইন্টারেক্টিভ ক্যোয়ারী সার্ভিস যা স্ট্যান্ডার্ড SQL ব্যবহার করে Amazon S3-এ ডেটা বিশ্লেষণ করা সহজ করে তোলে। আপনার কাছে যদি Amazon S3 ব্যতীত অন্য কোনো উৎসে ডেটা থাকে, তাহলে আপনি Athena Federated Query ব্যবহার করতে পারেন সেই জায়গায় ডেটা অনুসন্ধান করতে বা একাধিক ডেটা উৎস থেকে ডেটা বের করতে এবং Amazon S3-এ সংরক্ষণ করতে পাইপলাইন তৈরি করতে পারেন। এথেনা ফেডারেটেড ক্যোয়ারী দিয়ে, আপনি রিলেশনাল, অ-রিলেশনাল, অবজেক্ট এবং কাস্টম ডেটা সোর্সে সংরক্ষিত ডেটা জুড়ে SQL কোয়েরি চালাতে পারেন।

যখন একটি ফেডারেটেড ক্যোয়ারী চালানো হয়, তখন অ্যাথেনা কোয়েরির অংশগুলি সনাক্ত করে যেগুলিকে ডাটা সোর্স সংযোগকারীতে রাউট করা উচিত এবং ল্যাম্বডা দিয়ে সেগুলি চালায়৷ ডেটা সোর্স সংযোগকারী উৎসের সাথে সংযোগ তৈরি করে, ক্যোয়ারী চালায় এবং ফলাফলগুলি এথেনায় ফেরত দেয়। যদি ডেটা Lambda RAM রানটাইম মেমরির সাথে খাপ খায় না, তবে এটি ডেটাকে Amazon S3 এ ছড়িয়ে দেয় এবং পরে অ্যাথেনা অ্যাক্সেস করে।

এথেনা ডেটা সোর্স সংযোগকারী ব্যবহার করে যা অভ্যন্তরীণভাবে ফেডারেটেড কোয়েরি চালানোর জন্য ল্যাম্বডা ব্যবহার করে। ডেটা সোর্স সংযোগকারীগুলি পূর্ব-নির্মিত এবং এথেনা কনসোল বা সার্ভারলেস অ্যাপ্লিকেশন রিপোজিটরি থেকে স্থাপন করা যেতে পারে। ব্যবহারকারীর ক্যোয়ারী জমা দেওয়ার উপর ভিত্তি করে, সংযোগকারীরা নির্দিষ্ট ডেটা উপাদানগুলিতে অ্যাক্সেস প্রদান বা সীমাবদ্ধ করতে পারে।

এই সমাধানটি বাস্তবায়ন করতে, আমরা নিম্নলিখিত পদক্ষেপগুলি সম্পূর্ণ করি:

  1. Create a secret for the Oracle instance using এডাব্লুএস সিক্রেটস ম্যানেজার.
  2. Lambda ব্যবহার করার জন্য একটি S3 বালতি এবং সাবফোল্ডার তৈরি করুন।
  3. Configure Athena federation with the Oracle XE instance.
  4. এথেনার সাথে ফেডারেটেড প্রশ্ন চালান।

পূর্বশর্ত

Before getting started, make sure you have an Oracle database up and running.

Create a secret for the Oracle instance

Our first step is to create a secret for the Oracle instance with a username and password using Secrets Manager.

  1. সিক্রেটস ম্যানেজার কনসোলে, নির্বাচন করুন অন্ধিসন্ধি.
  2. বেছে নিন একটি নতুন গোপন সংরক্ষণ করুন.
  3. নির্বাচন করা অন্যান্য ধরণের রহস্য.
  4. Enter the credentials as key-value pairs (username, password) for your Oracle XE instance.

  1. জন্য গোপন নাম, আপনার গোপন জন্য একটি নাম লিখুন. উপসর্গ ব্যবহার করুন OracleAFQ তাই এটি খুঁজে পাওয়া সহজ।
  2. অবশিষ্ট ক্ষেত্রগুলি তাদের ডিফল্টে ছেড়ে দিন এবং নির্বাচন করুন পরবর্তী.
  3. আপনার গোপন সৃষ্টি সম্পূর্ণ করুন.

Lambda এর জন্য একটি S3 বালতি তৈরি করুন

On the Amazon S3 console, create a new S3 bucket and subfolder for Lambda to use. For this post, I use athena-accelerator/oracle.

Configure Athena federation with the Oracle XE instance

To configure Athena federation with your Oracle instance, complete the following steps:

  1. AWS সার্ভারলেস অ্যাপ্লিকেশন রিপোজিটরি কনসোলে, নির্বাচন করুন উপলব্ধ অ্যাপ্লিকেশন.
  2. অনুসন্ধান ক্ষেত্রে, লিখুন TrianzOracleAthenaJDBC.

  1. জন্য আবেদনের নামপ্রবেশ করান TrianzOracleAthenaJDBC.
  2. জন্য গোপন নাম উপসর্গপ্রবেশ করান OracleAFQ_XE.
  3. জন্য SpillBucketপ্রবেশ করান Athena-accelerator/oracle.
  4. জন্য JDBCConnectorConfig, বিন্যাস ব্যবহার করুন oracle://jdbc:oracle:thin:${secretname}@//hostname:port/servicename.

উদাহরণস্বরূপ, আমরা প্রবেশ করি oracle://jdbc:oracle:thin:${OracleAFQ_XE}@//12.345.67.89:1521/xe.

  1. জন্য স্পিল এনক্রিপশন অক্ষম করুনপ্রবেশ করান false.
  2. জন্য LambdaFunctionNameপ্রবেশ করান oracleconnector.
  3. জন্য সিকিউরিটি গ্রুপ আইডি, enter the security group ID where the Oracle instance is deployed.

আপনার সংযোগের উপর ভিত্তি করে বৈধ ইনবাউন্ড এবং আউটবাউন্ড নিয়মগুলি প্রয়োগ করা নিশ্চিত করুন৷

  1. জন্য SpillPrefix, আপনার তৈরি করা S3 বাকেটের নিচে একটি ফোল্ডার তৈরি করুন এবং নাম উল্লেখ করুন (উদাহরণস্বরূপ, athena-spill).
  2. জন্য সাবনেটাইডস, use the subnets where the Oracle instance is running with comma separation.

নিশ্চিত করুন যে সাবনেটটি একটি VPC-তে রয়েছে এবং এতে NAT গেটওয়ে এবং ইন্টারনেট গেটওয়ে সংযুক্ত রয়েছে৷

  1. নির্বাচন করুন আমি স্বীকার করছি চেক বাক্স
  2. বেছে নিন স্থাপন করুন.

নিশ্চিত করুন যে এডাব্লুএস আইডেন্টিটি এবং অ্যাক্সেস ম্যানেজমেন্ট (IAM) ভূমিকাগুলির AWS সার্ভারলেস অ্যাপ্লিকেশন রিপোজিটরি অ্যাক্সেস করার অনুমতি রয়েছে, এডাব্লুএস ক্লাউডফর্মেশন, আমাজন এস 3, অ্যামাজন ক্লাউডওয়াচ, AWS CloudTrail, সিক্রেটস ম্যানেজার, ল্যাম্বদা, এবং এথেনা। আরও তথ্যের জন্য, দেখুন এথেনা ফেডারেটেড কোয়েরির অনুমতি দেওয়ার জন্য IAM অনুমতি নীতির উদাহরণ.

এথেনার সাথে ফেডারেটেড প্রশ্ন চালান

ব্যবহার করে আপনার ফেডারেটেড প্রশ্নগুলি চালান lambda:trianzoracle against tables in the Oracle database. trianzoracle is the name of lambda function which we have created in step 7 of previous section of this blog

lambda:trianzoracle ফরম্যাট ব্যবহার করে একটি রেফারেন্স ডেটা সোর্স সংযোগকারী ল্যাম্বডা ফাংশন lambda:MyLambdaFunctionName। আরো তথ্যের জন্য দেখুন ফেডারেটেড প্রশ্ন লেখা।

The following query joins the dataset between Oracle and the S3 data lake.

মূল কর্মক্ষমতা সেরা অনুশীলন

If you’re considering Athena Federated query with Oracle, we recommend the following best practices:

  • Athena Federated query works great for queries with predicate filtering because the predicates are pushed down to the Oracle database. Use filter and limited-range scans in your queries to avoid full table scans.
  • If your SQL query requires returning a large volume of data from the Oracle database to Athena (which could lead to query timeouts or slow performance), unload the large tables in your query from Oracle to your S3 data lake.
  • The star schema is a commonly used data model in Oracle. In the star schema model, unload your large fact tables into your S3 data lake and leave the dimension tables in Oracle. If large dimension tables are contributing to slow performance or query timeouts, unload those tables to your S3 data lake.
  • When you run federated queries, Athena spins up multiple Lambda functions, which causes a spike in database connections. It’s important to monitor the Oracle database WLM queue slots to ensure there is no queuing. Additionally, you can use concurrency scaling on your Oracle database cluster to benefit from concurrent connections to queue up.

উপসংহার

In this post, you learned how to configure and use Athena Federated query with Oracle. Now you don’t need to wait for all the data in your Oracle data warehouse to be unloaded to Amazon S3 and maintained on a day-to-day basis to run your queries.

You can use the best practice considerations outlined in the post to help minimize the data transferred from Oracle for better performance. When queries are well written for Federated query, the performance penalties are negligible.

আরো তথ্যের জন্য, দেখুন এথেনা ব্যবহারকারী নির্দেশিকা এবং Amazon Athena ফেডারেটেড কোয়েরি ব্যবহার করে.


লেখক সম্পর্কে

নবনীত শুক্লা বিশ্লেষণে AWS বিশেষজ্ঞ সমাধান আর্কিটেক্ট। তিনি গ্রাহকদের তাদের ডেটা থেকে অন্তর্দৃষ্টি উন্মোচন করতে সহায়তা করার বিষয়ে উত্সাহী৷ সংস্থাগুলিকে ডেটা-চালিত সিদ্ধান্ত নিতে সাহায্য করার জন্য তিনি সমাধান তৈরি করছেন।

Source: https://aws.amazon.com/blogs/big-data/query-your-oracle-database-using-athena-federated-query-and-join-with-data-in-your-amazon-s3-data-lake/

সময় স্ট্যাম্প:

থেকে আরো ডেস্কটপ AWS