How to quickly get started to use AWS Redshift

1. Create Redshift cluster
Create Redshift cluster and proceed by yourself, i will not cover about it here, since this is very straight, just following instruction is enough. Actually you will follow just like this:
etc.




2. Once you create Redshift cluster, navigate to "Connect Client" page

Click on "JDBC Driver" and select "JDBC 4.0 (.jar)" file, then download it.


3. Visit http://www.sql-workbench.net/  , then find the following link, click and download workbench file:
"Current stable version: Build 118 (2015-08-16) "

4. Then navigate to the folder, where downloaded workbench file "Build 118 (2015-08-16) " , right click on it and extract in somewhere.

Using terminal navigate to extracted folder and find the file "sqlworkbench.sh", give permission to execute:

sudo chmod 777 sqlworkbench.sh

then

./sqlworkbench.sh

Running this shell, it opens workbench.

Click File > Manage Drivers

looks something like this


Click on "new paper" icon on top-left corner to create new driver option.

Insert followings:

Name: AWSRedshift(or whatever for your recongition later)
Library: Click open folder button, select previously downloaded JDBC 4.0 driver file:




Sample URL: copy and paste from "Connection Cluster" page

Then click on File >  Connect Window

In Username, type the name of the master user.(See from Cluster's detail)
In Password, type the password when you registered upon creation of Redshift cluster
Check "Auto commit box", click "Save" and "OK":



Now its done for connection.


for detailed see:
docs.aws.amazon.com/redshift/latest/mgmt/connecting-using-workbench.html

#======== Upload sample data from AWS S3 ====================
1. It is good idea first upload your data to AWS S3 just the way it is. Then copy it to Redshift.

In case of importing data, the "COPY" command is much more preferable, rather than "INSERT", because "INSERT" seems to take long time(see http://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html)

Here is sample :

create table catdemo(catid smallint, catgroup varchar(10), catname varchar(10), catdesc varchar(50));

copy catdemo
from 's3://awssampledbuswest2/tickit/category_pipe.txt'
credentials 'aws_access_key_id=<access-key-id>;aws_secret_access_key=<secret-access-key>';

Comments