Teradata Studio Features
Teradata Studio Features
Page 1
Table of Contents
Optimize Effectiveness ....................................................................................................................3
Key Features ....................................................................................................................................4
Modular Display ..............................................................................................................................6
Teradata Studio Toolbar ..................................................................................................................8
Data Source Explorer View ...........................................................................................................10
Creating Connections.....................................................................................................................12
Creating Database Objects .............................................................................................................14
Creating Database Objects (continued) .........................................................................................16
Creating a SQL Statement (SQL Editor) .......................................................................................18
Project Explorer View ...................................................................................................................20
HELP TABLE Command ..............................................................................................................21
Other SQL HELP Commands .......................................................................................................22
Setting a Default Database.............................................................................................................24
The Teradata SHOW Command ................................................................................................26
Other SQL SHOW Commands ......................................................................................................27
Session Information via SELECT .................................................................................................28
Session Information via HELP SESSION .....................................................................................29
SQL Editor .....................................................................................................................................30
SQL Editor with Outline View ......................................................................................................32
Using SQL Query Builder .............................................................................................................33
Result Set Viewer ..........................................................................................................................34
SQL History View .........................................................................................................................35
Teradata View ................................................................................................................................36
Shortcuts to Data Source Objects ..................................................................................................37
Shortcuts to Typing Object Names ................................................................................................38
Commenting Lines of SQL ............................................................................................................39
Logging on to Multiple Systems....................................................................................................40
Teradata Load Wizard ...................................................................................................................41
Choosing Studio or Studio Express ...............................................................................................42
The Employee_Sales Database ......................................................................................................44
The Emp_Views Database .............................................................................................................45
Summary ........................................................................................................................................46
Page 2
Optimize Effectiveness
Teradata Studio is a client-based graphical interface used to perform Teradata database
administration, external data access and query tasks. Teradata Studio is built on the Eclipse
Rich Client Platform (RCP), taking advantage of the RCP framework for building and deploying
native GUI applications. It extends the Eclipse Data Tools Platform (DTP) to enhance Teradata
Database access. Teradata Studio can be run on Windows, Linux, and Mac OSX operating
systems. The Eclipse platform is designed as an open tools platform but architected so that its
components (or a subset of its components) can be used to build RCP applications. This allows
Teradata Studio to benefit from the many high quality Eclipse features available while focusing
on value-add for Teradata.
Teradata Studio is designed to replace Teradata Index Wizard, Teradata Statistics Wizard,
Teradata Visual Explain, Teradata System Emulation Tool, SQL Assistant, and Teradata
Administrator. It can also replace 3rd party products such as AquaFold (Aqua Data Studio) and
Quest (TOAD). Teradata Studio has these advantages over those products:
Page 3
Key Features
Teradata Studio combines ease of use and automation elements of Teradata Database
architecture and features to provide the most efficient environment to deploy, no matter how
many applications or subject areas you have.
Teradata Studio is a query tool written for relational database developers. It is intended for SQLproficient developers who know how to formulate queries for processing on Teradata or other
ODBC-compliant Databases. Used as a discovery tool, Teradata Studio catalogs submitted
instructions to arrive at a derived answer.
Teradata Studio delivers the following capabilities.
Create databases, users, tables, views, stored procedures, user-defined functions and userdefined types.
Display information about databases, users, tables, views, macros, stored procedures,
user-defined functions and user-defined types.
Modify and drop databases and users.
Administer roles and profiles.
Grant or revoke access and system rights.
Manage privileges on database objects.
Copy table, view, stored procedure, macro or user-defined type definitions to another
database, or to another system.
Drop or rename tables, views, stored procedures, macros or user-defined functions.
Move space from one database to another.
Modular display that allows you to move panels around, creating a custom look and feel.
Data Source Explorer:
View database objects, such as databases, tables, macros, stored procedures, userdefined functions, user-defined types, views, and triggers.
Menu options to run stored procedures, macros, and user-defined functions.
Find objects.
Use Connection Profile Wizard to create connection profiles using the Teradata JDBC
driver.
Create, modify, format and execute SQL queries against both the Teradata and Aster
Databases through SQL Editor.
Maintain a historical record of submitted queries with timings and status information.
Export result sets to Excel, XML or text files.
Import external data from Excel, .csv and Hadoop HDFS into data labs.
Setup the rules for query and access logging.
For administrative functions, Teradata Studio will provide a preview of the SQL statements and
allow the user to save the SQL to a file or display it in the SQL Editor.
Page 4
Modular display
Copy objects
Compare objects
Teradata View
Move space
SQL Editor
Find objects
Page 5
Modular Display
The Teradata Studio display includes the Teradata Studio Toolbar along with six view panels:
Data Source Explorer contains the database object tree display. It is here that you can
create connection profiles to your Teradata Database systems and interact with the
database objects.
Project Explorer provides a hierarchical view of the Projects and their resource files.
It is here that you can select SQL files for editing or create new SQL files.
SQL Editor displayed when a SQL file is opened. Initially, the SQL Editor is opened
to provide an area to enter SQL statements. The user must provide a connection profile
in order to execute the SQL statements. Double clicking on a file in the Project Explorer
will cause the file to be opened in the SQL Editor View.
Teradata SQL History contains the results when executing SQL statements and
running database routines, user-defined functions, and triggers. Each time SQL is
executed, the command is saved in the History window. This allows you to run them
again.
Teradata View displays detailed information about database object. Click the
Teradata View so that it is in focus. Then select an object from the Data Source Explorer
and detailed information about that object is displayed in the Teradata View.
Teradata Result Set Viewer displays the result set data. Individual Result Set tabs are
created for each result set. The Result Set Viewer also contains a toolbar with actions
that can occur on the result set data, such as saving, exporting, or printing the result set
data.
You can rearrange the various panels and windows to fit your workflow preferences. Studio
supports moving, hiding, docking and detaching the different panel views. Panels can be moved
by dragging the panels tab to any edge of the Studio window.
Page 6
Studio Toolbar
Project Explorer
SQL Editor
Data Source Explorer
Teradata SQL History
Teradata Result Set Viewer
Teradata View
Page 7
File Actions Toolbar The File Actions toolbar buttons are used when editing a SQL
file. They include Save, SaveAs, Cut, Copy, Paste, Undo, Redo, Print, and Show
Whitespace.
SQL Tools Toolbar The SQL Tools toolbar buttons are used to perform actions on the
SQL statements within the SQL Editor. They include Execute as Individual Statements,
Execute as One Statement, Explain, Format, Prompt for Notes, Code Assist Autoactivation. SELECT Statement and SHOW DDL are activated when a table is selected in
the DSE.
Data Tools Toolbar The Data Tools toolbar buttons provide actions that are performed
on a database table, such as Show Row Count, FastLoad and FastExport.
Security Toolbar The Security toolbar buttons provide actions to administer Profiles
and Roles, as well as grant and revoke Rights and Privileges. Administer Profiles, Roles,
Logon Rights, and Connect Through Rights is activated from the Database node at the
top of the Data Source Explorer tree. Other rights and privileges are activated from the
specific object affected by the rights or privileges.
Find Actions Toolbar The Find Actions toolbar provides quick access to the Find
Object and Find Next Object.
Navigation Toolbar The Navigation toolbar buttons are used to reference locations
within the SQL file. They include Next Annotation, Previous Annotation, and Last Edit
Location.
A view can also contain its own toolbar and drop down menu. These toolbar buttons and menu
items provide actions on the data managed by the view. Included in the view toolbar are buttons
to minimize, maximize, and restore the view. Maximizing the view will cause the view to take
over the entire Teradata Studio window display. Click the Restore button to return the view back
to its previous display.
Page 8
Page 9
Page 10
Move Space
Copy/Compare Objects
Drop
Create Database
Create User
Modify Database
Create Procedure
Create Macro
Create View
Privileges
Column Rights
Create Authorization
Access Logging
Query Logging
System Rights
Administer Logon Rights
Administer Connect Through Rights
Page 11
Creating Connections
When you start Teradata Studio, you will be prompted for a connection. In our case, we will
start by selecting the Teradata Database.
You can create connections to your database using the Connection Profile Wizard. The wizard is
invoked from the Data Source Explorer by right clicking on the Database Connections folder.
Teradata Studio provides an option to create connection profiles for additional database servers
other than Teradata. You must provide the specific database server JDBC drivers for databases
other than Teradata.
The Connection Profile Wizard is based on a driver template that references an embedded
Teradata JDBC driver. Enter the database server name, user name, password, and default
database name into the wizard dialog screen. The Authentication Mechanism allows you to
choose an advanced logon mechanism, such as LDAP or Kerberos, or select the default
mechanism, PASSWORD_PROTECTED. If you wish to save your password to disk, check the
Save Password box. Otherwise, the password is stored in the profile and only active throughout
the Teradata Studio session. When Teradata Studio is closed, the unsaved password is removed
before the profile is written to disk. You will be prompted for the password the next time you
connect to that profile.
Optionally, you can choose a different Teradata JDBC driver than the embedded Teradata JDBC
driver. You can also add or remove the JDBC properties, as well as save the properties to an
external file. The external file is called jdbcConnectionProperties.properties and located in
the workspace .metadata/Teradata directory. The jdbcConnectionProperties.properties file
allows you to share a set of JDBC properties with other Teradata Studio users. If the file exists
when creating a new Teradata connection profile, it will load those property values into the list
of JDBC connection properties. If the file exists but it is empty, the connection wizard will
assume that no JDBC properties are specified and the Teradata JDBC driver will use the default
settings.
Page 12
Page 13
Page 14
Page 15
Page 16
8. Choose the
Primary Key,
Indexes, and
Foreign Keys for
the table
4
5
Page 17
Page 18
Execute
Execute Parallel
Page 19
To execute a
script, right
mouse click
and select
Execute
Page 20
The HELP TABLE command returns information about a database or user object.
Qualifications for SQL are databasename.tablename.columnname
Explorer Tree
information on table
Employee
SQL Request
Cursor on column
Last_Name shows
hidden information
Result of HELP
TABLE command on
table Employee
Page 21
Page 22
Employee_Sales;
Dave_Jones;
Database Objects:
HELP TABLE
HELP VIEW
HELP MACRO
HELP COLUMN
HELP INDEX
HELP STATISTICS
HELP CONSTRAINT
HELP VOLATILE TABLE
HELP JOIN INDEX
HELP HASH INDEX
HELP TRIGGER
HELP PROCEDURE
HELP FUNCTION
Employee;
Emp_Views.emp;
payroll_3;
Employee_Sales.employee.last_name;
employee;
employee;
employee.over_21;
vol_tab1;
Employee_Sales.Employee;
Employee_Sales.Department;
trigger1;
proc1;
func1;
The three different levels for referencing objects are: Database, Table and Column.
Page 23
Page 24
Default database
Changes the
default database to
Employee_Sales.
Clicking on SQL
Statement in History
will recall it to the Query
Window later.
Page 25
Set (do not store duplicate rows in this table vs. multiset allow duplicate rows)
(Permanent) Journaling references
Fallback
Character Set Latin
Not Case Specific
Checksum
There are default options for these settings and were likely obtained by these defaults.
Double Click to
open in a new
window. This
allows for
copying the text.
Page 26
Database Objects:
SHOW TABLE
SHOW VIEW
SHOW MACRO
SHOW TRIGGER
SHOW PROCEDURE
SHOW FUNCTION
Employee;
Emp_Views.emp;
payroll_3;
Employee_Sales.trig1;
proc1;
func1;
For a complete list of objects referenced by the SHOW command you can issue the
following:
HELP 'SQL SHOW';
We will take a closer look at this special syntax in a later module.
Page 27
One method for retrieving information about your current session is to reference the
session variables below. (These are sometimes referred to as Built-in Functions)
The SELECT is the main focus of the next module.
Logon User
Page 28
Session Number
Database Default
LOGON DATE
LOGON TIME
TRANSACTION SEMANTICS
For a complete list of values, feel free to issue this command during a lab. Much of the
information displayed from using this statement is described in other courses such as Advanced
SQL, Physical Implementation, and Application Design and Development.
Another method for listing session information is to issue the request shown below.
Note that the scroll bar indicates more information is available for viewing.
Page 29
SQL Editor
The SQL Editor view is displayed when a SQL file is opened. Double clicking on a file in the
Project Explorer will cause the file to be opened in the SQL Editor.
The SQL Editor provides an area for you to enter your SQL statements. As an option, you can
enable the auto activation of code assist by clicking the toolbar button. If this option is enabled,
as you type, SQL code assist will pop up annotations (spellcheck for SQL) showing a list of
expected keywords. If a database name is entered followed by a dot, the content assist will
display the list of tables from your database for you to select from. (Note: By default, auto
activation of code assist is disabled. Also, you must select a Teradata Database connection
profile type in order for SQL code assist to work.)
Code assist will also provide a list of SQL Templates. At the start of the SQL statement, hit the
Ctrl+SPACE keys and a pop up list of templates is displayed. Scroll down until you find the
template you want and double click on it to insert the template into your SQL Editor file.
Anchor statements are provided that you can navigate through by tabbing. You can also edit or
add your own SQL Templates via the SQL Editor Preferences page.
Parameterized queries can also be created in the SQL Editor. The query contains parameters
indicated by question marks. When the query is executed, the user is prompted for the parameter
value(s). Named parameters allow the user to specify a name for the parameter.
The SQL Editor also provides syntax coloring for your SQL statements. You can change the
colors of comments, keywords, identifiers, types, or other syntax items via the SQL Editor
Preferences page.
When right clicking in the SQL Editor window, a SQL Editor Context menu appears with
options to execute the SQL statement(s) in your SQL file.
The following options are presented:
Teradata Studio provides a graphical interface for creating SQL statements, referred to as the
SQL Query Builder. You can edit an existing statement using the SQL Query Builder by
selecting the statement within the SQL Editor and choosing the Edit in SQL Query Builder
menu option.
Page 30
Auto activation
SQL
Editor
Page 31
Page 32
Page 33
Page 34
The SQL History provides extensive information about the SQL execution:
Execution elapsed time
DBMS time
Fetch time
Database server
Row count
Parameter displays
SQL statement
SQL statement type
Tool Options
Page 35
Teradata View
The Teradata View contains more detailed information about the database objects. When an
object is selected in the Data Source Explorer, it is automatically displayed in the Teradata View.
You can click on the tabs to display additional information on the database object. The Teradata
View toolbar and menu also contains the dialog buttons to create or administer the database
objects.
Databases
Users
Tables
Views
Macros
Stored Procedures
UDFs
User Defined Types
Space and Skew
Page 36
Page 37
You can drag objects from the Data Source Explorer to the Scrapbook to
have the full name added quickly.
Click and Drag from here to there.
Page 38
Page 39
Page 40
Page 41
Business Users
Ad-hoc Type Queries
Users
Novices
DBAs
Power Users
Data Scientists
Enterprise Users
DBAs
Data Scientists
Page 42
Studio and Studio Express are very similar with the exception of Studio
having more features than Express. It has:
Administrative Dialogs
Create and Drop Dialogs
Copy and Compare Objects
Hadoop Data Transfer (Smart Loader for Hadoop)
If you don't need those features, Studio Express may be a better fit for you.
Both products are available on the Developer Exchange Download page as
free downloads.
Page 43
Page 44
Page 45
Summary
Characteristics of Teradata Studio include:
Windows-based utility that is used to access any JDBC Compliant
database.
GUI access to the Teradata Dictionary.
SQL commands like SHOW and HELP can also be used to provide
dictionary information.
History can be used to recall a previously issued request to the Query
Window.
Query Builder feature allows for easy creation of SQL statements.
Provides a Data Source Explorer to easily view database objects.
Remember:
You must always be mindful of the current database default setting.
A database default is set via a SQL request.
There are two databases used for labs: Employee_Sales (tables) and
Emp_Views (views).
Page 46