In my current work we are migrating some of our workload to Redshift. And that includes migrating many of tables from Oracle to Amazon Redshift. We know these two are very different platforms and we cant simply copy the Oracle’s DDL and create a table on Redshift. Redshift doesn’t(yet) enforce primary keys, the data types […]
Here are the most often used command on Oracle and their equivalent in Redshift 1. Show Schema Oracle Way: Redshift Way: 2. Describe a table and see the field names, types, encoding etc. Oracle Way: Redshift Way: 3. Find Disk Usage Per Table Oracle Way: Redshift Way :
This is another useful script, in the series of Redshift related tools and scripts that I find very useful. The following query gives you all tables and their row count and disk size on a given database in Redshift cluster. You can tweak it and customize more as per your requirements. Important attributes to remember here […]
Every once in a while one of my test jobs fails, throwing this error that the table-space its created in has no further space to allocate for this table. And then comes the next sets of steps. Find out the other table space which is free. Here is a very basic sql scripts which I […]
Redshift as a database is still evolving and every now and then we face issues which is a piece of cake in other mature databases. For example, if you want to get all columns and their data-types in Oracle you would simply write “Describe ” But there is no such thing in Redshift as of […]
Every once in a while one of my test jobs fails, throwing this error that the table-space its created in has no further space to allocate for this table. And then comes the next sets of steps. Find out the other table space which is free. Here is a very basic sql scripts which I […]
This is a very simple script to perform a task which almost every other database developer faces in his day to day job. To finding and deleting duplicate records. I would try to answer it in 3 simpler steps Step1: Lets say you want to find the duplicate records for a pair of attributes c1 […]
Wrote this code some time back for a programming interview, sharing it for everyone’s use. Its a 64 character encoded URL shortener code written in java. The code does not use any database backend but can be easily modified to support that. import java.util.HashMap; import java.util.Random; /* * URL Shortener */ public class URLShortener […]
Introduction to Databases and MySQL – Google Code University – Google Code Getting Started with MySQLThe first thing you need to do to start learning MySQL is get access. We’ll assume that you have access and can start up the command line interface. It will look something like: mysql -uroot -ppassword You should see the […]
Count Occurrence of Character in a String Using MySQL « In Piscean’s Heart Since there is no inbuilt MySQL function to count the occurrence of a character in string, we can do it by using these steps: 1. Counting the number of characters in the original string 2. Temporarily ‘deleting’ the character you want to […]