Step1: Verify if the ENA driver is installed on the EC2 Instance by running the modinfo command as below: modinfo
Continue readingHow to add column to a table in Redshift
Below is the syntax to add a new column to an existing table in Redshift database. ALTER TABLE table_name ADD
Continue readingHow to create a group and add users to group in Redshift
create group group_name; GRANT USAGE ON SCHEMA schema_name TO GROUP group_name; alter group group_name add user user_name; commit;
Continue readingHow to change column data type in Redshift
BEGIN TRANSACTION; ALTER TABLE schemaname.tablename RENAME TO tablename_old; CREATE TABLE schemaname.tablename (); –New definition INSERT INTO schemaname.tablename SELECT * FROM
Continue readingHow to change the table owner of a Redshift table
Check the current owner of the table using the below query where table_name is the name of your table and
Continue readingHow to list all S3 buckets and contents of a bucket
Below is the command to list all S3 buckets owned by you: aws s3 ls To list all the contents
Continue readingHow to rename folders and files in S3
To Rename a folder aws s3 –recursive mv s3://bucketname/prefix_old/ s3://bucketname/prefix_new/ To Rename a file aws s3 mv s3://bucketname/prefix/filename_old s3://bucketname/prefix/filename_new
Continue readingHow to copy files from one S3 bucket to another using wildcard
aws s3 cp s3://bucketname1/prefix1/prefix2/ s3://bucketname2/prefix/ –recursive –exclude “” –include “searchterm*”
Continue readingHow to search for files in S3 bucket folder using wildcard
aws s3 ls s3://bucketname/prefix1/prefix2/ | grep searchterm* | awk ‘{print $4}’
Continue readingHow to add Sort and Dist Keys to an existing Redshift table
Command to Add or Modify a Sort key: ALTER TABLE schema.table_name ALTER SORTKEY (column_name); Command to Add or Modify a
Continue reading