Redshift CREATE, ALTER, DROP, RENAME Database Commands and Examples

You can use Redshift PostgreSQL to create, drop, rename and change the database owners. Below given some important commands that you should know if you are working as a Redshift database administrator. In this article, we will check Redshift create, drop, rename database commands and some of examples. Read: Redshift Create View Syntax and Examples Amazon Redshift Data Types and Best Practices Amazon Redshift Data Types and Best Practices Netezza Create Database Command You can use CREATE DATABASE command to create new database in Redshift cluster: Redshift CREATE DATABASE Syntax:…

Continue ReadingRedshift CREATE, ALTER, DROP, RENAME Database Commands and Examples
Comments Off on Redshift CREATE, ALTER, DROP, RENAME Database Commands and Examples

Redshift Fixed-Width File Loading Options and Examples

Fixed width text files are special cases of text files where the format is specified by column widths, pad character and left or right alignment. In this format column width are in terms of units of characters. In this article, we will learn about Redshift Fixed-Width file loading options and examples. Fixed-Width File Overview In general, fixed-length format files use ordinal positions, which are offsets to identify where fields are within the record of the file. Fixed-width data files have uniform lengths for each column of data. Each field in…

Continue ReadingRedshift Fixed-Width File Loading Options and Examples
Comments Off on Redshift Fixed-Width File Loading Options and Examples

Amazon Redshift Update Join Syntax – Update using other Table

In the database world, we use database tables (in fact tables) to store information. Data is collected over the specific period of time and it may or may not be accurate at the time of loading. In some cases, you may want to update the table based on the data available in other table over same or other database on same server. In this article, check Amazon Redshift Update Join Syntax and example on how to change table with data from other table. Amazon Redshift Update Join Table The process…

Continue ReadingAmazon Redshift Update Join Syntax – Update using other Table
Comments Off on Amazon Redshift Update Join Syntax – Update using other Table

Access Redshift using psql without Password Prompt – Use psql System Variables

Users can access Amazon Redshift database using a PostgreSQL- compatible psql client. Users can always connect to the Redshift database via leader node. In this article, we will see how to access redshift using psql without password prompt. You can use psql system variables to store required credentials. Access Redshift using psql without Password Prompt Password less access is useful when you are trying to execute Redshift queries from scripts such as shell or perl scripts. Option 1. Export Amazon Redshift Database Environmental Variables In order to access Redshift database…

Continue ReadingAccess Redshift using psql without Password Prompt – Use psql System Variables
Comments Off on Access Redshift using psql without Password Prompt – Use psql System Variables

How to Identify Netezza Server I/O Usage using System Views?

You may have to query Netezza system tables or views to get information about system, for example, to identify Netezza server I/O Usage. These kind of information will help you to manage Netezza server and databases. As a server maintenance activity, you may have to regularly to identify Netezza Server I/O and monitor regularly to minimize the performance degrade. Identify Netezza Server I/O Usage using System Views Below query provides the Netezza I/O usage i.e. identify read and write details on Netezza disks. select cast(START_TIME as date) as startDate, cast(END_TIME…

Continue ReadingHow to Identify Netezza Server I/O Usage using System Views?
Comments Off on How to Identify Netezza Server I/O Usage using System Views?

How to List Netezza Database High Volume Tables?

You may have to query Netezza system tables or views to get information about system, for example, list Netezza database high volume tables. These kind of information will help you to manage Netezza server and databases. As a server maintenance activity, you may have to regularly verify the Netezza database table size and identify the growing tables in server to minimize the performance degrade. How to List Netezza Database High Volume Tables? Below query provides the information of big or high volume tables of database available in the Netezza data…

Continue ReadingHow to List Netezza Database High Volume Tables?
Comments Off on How to List Netezza Database High Volume Tables?

How to Get Netezza databases Allocated, Used, Available Space?

You may have to query Netezza system tables to get information about system, for example, get Netezza databases allocated, used, available space. These kind of information will help you to manage Netezza server and databases. As a server maintenance activity, you may have to regularly verify the Netezza database size to minimize the performance degrade. Get Netezza databases Allocated, Used, Available Space Below query provides the information of size of each database available in the Netezza server. This query is useful for the Netezza administrator who frequently verify the databases…

Continue ReadingHow to Get Netezza databases Allocated, Used, Available Space?
Comments Off on How to Get Netezza databases Allocated, Used, Available Space?

Netezza Count All Database Objects – System Table Query

You may have to query few system tables to get information about system, for example, get list of all tables, views, system tables, synonyms, sequences, etc available in Netezza data warehouse appliance. Getting object details information will help you to identify and manage Netezza system better. You can identify the tables or view which are needs to be deleted or removed from Netezza server. Below are few queries that are consolidated to provide useful information: Netezza Count All Database Objects – Tables, Views, Synonyms, System Tables, Databases Below query provide…

Continue ReadingNetezza Count All Database Objects – System Table Query
Comments Off on Netezza Count All Database Objects – System Table Query

Export Redshift Table Data to Local CSV format

You can export the Redshift table in many ways. Redshift export table is done using either UNLOAD command, COPY command or PostgreSQL command. Using UNLOAD or COPY command is fasted way to export Redshift table, but with those commands you can unload table to S3 bucket. You have to use the PostgreSQL or psql to export Redshift table to local CSV format. Export Redshift Table Data to Local CSV format To export Redshift table to local directory, you must install the PostgreSQL in your machine. You can use the psql…

Continue ReadingExport Redshift Table Data to Local CSV format
Comments Off on Export Redshift Table Data to Local CSV format

Redshift Set Operators: UNION, EXCEPT/MINUS and INTERSECT

You can use the Redshift set operators to combine similar data sets from two or more SELECT statements. Here the similar data set literally mean, the data type of the result set should also match, otherwise you have to explicitly type cast data when using Redshift set operators. Types of Redshift Set Operators Redshift supports the three types of set operators: UNION [DISTINCT] and UNION ALL INTERSECT [DISTINCT] EXCEPT [DISTINCT] or MINUS [DISTINCT] Redshift Set Operators Syntax Below is the syntax of Set operators in Redshift: query { UNION […

Continue ReadingRedshift Set Operators: UNION, EXCEPT/MINUS and INTERSECT
Comments Off on Redshift Set Operators: UNION, EXCEPT/MINUS and INTERSECT