Unable to create Redshift tables using aws nodejs sdk - node.js

I am looking at Redshift
sdk
and can't seem to find a method wherein i can programmatically create tables and define rows for a database.
Can't figure out what I am missing here ?

You don't create tables in Redshift via the AWS SDK. You would perform that type of database function by connecting to Redshift using a PostgreSQL database driver. The AWS SDK is for creating and managing the server resources, you still connect to the database in a more traditional way to execute SQL commands.

Related

Database migration from AWS Aurora Serverless v1

We have a plan to create a new application, which won't have the same architecture of the current one, and will definitely have some differences in the tables' schemas. Our current application's database is running on a AWS Aurora Serverless v1 cluster, with MySQL 5.7. We need to migrate data from the old application to the new one, making some schema changes in some places.
One solution is to create dumps of the old tables, in an easily readable format like csv, then import the data in the new application, picking the data as needed. This will require writing bespoke code on both applications to export data from one and import it into the other.
Considering that we are in AWS, and we intend to keep using it, choosing Aurora as a database (we'll have to decide whether use a provided solution or go with Serverless v2), is there any service to export data from one Aurora Serverless v1 cluster to another Aurora cluster, making changes along the way?
I know that database snapshots exist, but that's not exacly our goal. We need to migrate data from one database to another, not creating another copy of the first one. I've seen that there is a service, called "AWS Database Migration Service", that's used to migrate data into RDS, but does this service suit our needs, to get data from one Aurora Serverless database, do some changes, and then put it into another RDS database of our choice?
You could use following options to accomplish your goal.
1.- AWS Database Migration Service, this service provide you capabilities to replicate your data and also perform some schema transformation during replication process. You can create selection and transformation rules, the service will execute those rules and apply changes to the target schemas. You could review more details on this link.
https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.SelectionTransformation.Transformations.html
2.- AWS Glue Studio, it is ETL service that allows you extract, convert and transfer data between source and target databases.
What is AWS Glue Studio?
Automate ETL jobs between Amazon RDS for SQL Server and Azure Managed SQL using AWS Glue Studio

how to transfer/migrate data from Source Oracle DB to aws oracle rds

I have a request to move Source Oracle DB into AWS Oracle RDS. I research on AWS page to find out the solution, but AWS guide very complex such as upload dump file to S3, download file dump...I don't want to do on this way because it very take time. Any one have any solution to move database to AWS Oracle RDS?
My updated: Source Oracle DB is not use any AWS service. It only installed on phycical server.
Please help share any solution/tools can use to migrate
You can use the AWS native Database Migration Service (AWS DMS). Below is the link to the AWS DMS workshop.
https://catalog.us-east-1.prod.workshops.aws/workshops/77bdff4f-2d9e-4d68-99ba-248ea95b3aca/en-US/oracle-oracle/data-migration
In the link, source database is mentioned as AWS RDS, but you can connect to any source database at on-premises or other locations. All you need is connectivity (between source Oracle and AWS target RDS Oracle) along with source database host IP, database port and db user credentials with necessary permissions to pull data from source. Usually for database migrations a direct connect is recommended to avoid data transfer related issues, but can also be done over VPN (can be slow for large migrations)
Start with the pre-requisites (permissions, grants etc.) to prepare the source database for migration as mentioned in the link above.
Other tools to explore would be to use Database native tools, like for Oracle we get Data Pump (export/import), for which we will have to use S3 for dumping the source data and then importing into AWS RDS from S3. This may be ok for one time activity. But for large number of migrations AWS DMS with a stable connectivity is the way to go.
Third option I can think of is use of AWS Snowball, if there is no reliable connectivity between source and AWS for large data transfer. AWS Snowball edge storage can be requested to your db location and hooked up to the network. Dump the database export into the Snowball and ship it back to AWS. They will copy the DB dump to a S3 bucket and from there we can import it into RDS.
Hope that helps...
You can use SQL Developer Tool to copy database from source to AWS Oracle RDS (I am using SQL Developer Tool version 19.2.1.247)
Before migrate you need the below things to prepare/configure on AWS Oracle RDS, to ensure the same with Source Oracle DB
Create the same user who assigned to your schema/database
If Source Oracle DB is using tablespace, you must be create the same tablespace
After prepared, You will do the below steps on SQL Developer Tool
Using admin account to created a connect to Source Oracle DB server.
Using admin account to created a connect to Oracle AWS server.
Go to Tools -> Database Copy...
On Dialog, choose source db and destination db
INFO:If you are using tablespace on source db, you must be choose [Tablespace Copy] like that:
Click Next to continue and waiting to transfer.

How to run RDS SQL Server select queries in AWS lambda using boto3 RDS client python?

I am going through AWS boto3 rds documentation for running sql select query on table which is present in RDS SQL Server using python in AWS lambda, but I didn't find any info. Don't we have any option to run RDS SQL queries in AWS lambda? Any ideas!
rds_client = boto3.client('rds')
boto3 library provides API to communicate with AWS API. The AWS RDS API includes of
Listing all RDS Instances
Create new RDS Instances
Stop RDS Instances
Modify RDS Instances
etc
For Lambda or any programming language to communicate with database server, we first need to install database driver. Think of it as a middle-man (drivers) that collect instructions of programming language, convert it to database understandable language, then database to process it and return the information to the middle-man, and middle-man translate it to something your programming language can understand. Boto3 does not come with any relational database drivers.
To allow Lambda to work your RDS SQL Server, you have to install Python's SQL Server driver and upload to Lambda. You can either package it as a standalone zip or make it as a Lambda Layer that can be used across by multiple Lambda Functions. The commonly used SQL Server driver for python is pyodbc
Someone on medium.com have make a blogpost about this.

Azure Data Factory - AWS Oracle Database to Azure SQL Server

Is it possible to connect ADF to an Oracle database on AWS as source and migrate data to an Azure SQL Server?
I've made some attempties and the result was always timeout.
The goal was achieved using an Integration Runtime, but didn't wanted to use it. I'd like a direct connection.
I've made some attempties and the result was always timeout.
Hi,Vinicius. Based on the Oracle connector,no more special properties you need to configure except host,user,password properties etc for Oracle database on AWS. You could check the supported versions of an Oracle database.
If you still have timeout issue, you could commit feedback to azure data factory to find an official statement.
Since you want to avoid IR, maybe you could refer to below solutions:
1.Try export data to AWS S3 and ADF supports AWS S3 connector as source.
2.Try to use Data Integration - Kettle tool to transfer data by jdbc driver.

Amazon RDS - How to Create new DB using PHP API?

In a SAAS app, written in PHP, how to create a new mysql database in an existing RDS instance?
The documentation for php api here:
http://docs.aws.amazon.com/aws-sdk-php/guide/latest/service-rds.html
doesn't show any such function available under available operations section at the bottom.
How do we do that??
There is no such option provided in RDS API. When you call CreateDBInstance API, you can specify the DBName but that is at the time of creating a new RDS instance. Once you have created the instance, then there is no provision to create a new DB on it.
I would imagine you need to connect via PHP using ODBC (or whatever that PHP supports) to the RDS endpoint and then create a new DB just like you are connecting to a non-RDS remote DB.

Resources