Data Studio User Manual
Data Studio User Manual
8.0.2.SPC2
User Manual
Issue 01
Date 2020-06-30
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective
holders.
Notice
The purchased products, services and features are stipulated by the contract made between Huawei and
the customer. All or part of the products, services and features described in this document may not be
within the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements,
information, and recommendations in this document are provided "AS IS" without warranties, guarantees
or representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.
Website: https://www.huawei.com
Email: [email protected]
Contents
5 Getting Started...................................................................................................................... 55
5.1 Starting Data Studio............................................................................................................................................................ 55
5.2 Data Studio User Interface................................................................................................................................................ 57
5.3 Data Studio Menus...............................................................................................................................................................58
5.3.1 File.......................................................................................................................................................................................... 58
5.3.2 Edit.......................................................................................................................................................................................... 59
5.3.3 Run......................................................................................................................................................................................... 63
5.3.4 Debug.................................................................................................................................................................................... 64
5.3.5 Settings................................................................................................................................................................................. 64
5.3.6 Help........................................................................................................................................................................................ 65
5.4 Data Studio Toolbars........................................................................................................................................................... 66
5.5 Data Studio Right-Click Menus........................................................................................................................................ 66
8 References............................................................................................................................. 297
8.1 Performance Specification............................................................................................................................................... 297
9 Troubleshooting...................................................................................................................299
10 Security Management..................................................................................................... 307
10.1 Overview............................................................................................................................................................................. 307
10.2 Login History..................................................................................................................................................................... 307
10.3 Password Expiry Notification....................................................................................................................................... 308
10.4 Securing the Application In-Memory Data............................................................................................................. 308
10.5 Data Encryption for Saved Data................................................................................................................................. 308
10.6 SQL History........................................................................................................................................................................ 308
10.7 SSL Certificates..................................................................................................................................................................309
10.8 Verify Software Package Integrity.............................................................................................................................. 318
11 FAQs..................................................................................................................................... 323
12 Glossary............................................................................................................................... 329
2.1 Overview
2.2 Intended Audience
2.3 Change History
2.4 Document Conventions
2.5 Third Party Licenses
2.6 Reference Documents
2.1 Overview
This section provides information about this manual.
Content Conventions
The purchased products, services and features are stipulated by the contract made
between Huawei Technologies Co., Ltd. and the customer. All or part of the
products, services and features described in this document may not be within the
purchase scope or the usage scope. Unless otherwise specified in the contract, all
statements, information, and recommendations in this document are provided "AS
IS" without warranties, guarantees or representations of any kind, either express
or implied.
Symbol Conventions
The symbols that may be found in this document are defined as follows.
Symbol Description
GUI Conventions
The GUI conventions that may be found in this document are defined as follows:
Convention Description
Code Conventions
The code conventions that may be found in this document are defined as follows:
Convention Description
Convention Description
google-guava 28.0
google-guice 4.2.0
gson 2.8.6
JSqlParser 1.2
GaussDB Tools 8.0.2.SPC2_Open Written offer listing the open source software
Source Software Notice.doc used and their license information
3.1 Overview
3.2 Supported Functions
3.3 Constraints and Limitations
3.4 Structure of Release Package
3.5 System Requirements
3.1 Overview
Data Studio provides a graphical interface which supports essential features of the
database. This simplifies database development and application building tasks.
● database
● schema
● functions
● procedures
● tables
● sequences
● columns
● indexes
● constraints
● views
● tablespaces
● triggers
● synonym
Data Studio also allows the database developer to debug and fix defects in the
PL/SQL code using debug operations such as step into, step out, step over,
continue, and terminate.
The following figure provides the operational context of database and Data
Studio:
Connection Profiles
Adding a Connection
Renaming a Connection
Editing a Connection
Removing a Connection
Viewing Connection
Properties
Databases
Creating a Database
Disconnecting All
Databases
Connecting to Database
Disconnecting Database
Renaming a Database
Dropping a Database
Viewing a Database
Properties
Schemas
Creating a Schema
Exporting DDL
Renaming a Schema
Dropping a Schema
Functions/Procedures
Creating Function/
Procedure
Debugging a PL/SQL
Function
Dropping a Function/
Procedure
Exporting a Function/
Procedure DDL
Editing a Function/
Procedure
Breakpoint Operations
Callstack Operations
Variables Operations
View Source
Tables
Renaming a Table
Truncating a Table
Reindexing a Table
Analyzing a Table
Vacuuming a Table
Dropping a Table
Showing DDL
ER Diagram
Trigger Management
Columns
Rename Column
Drop Column
Constraints/Keys/
Creating a Constraint
Renaming a Constraint
Dropping a Constraint
Indexes
Renaming an Index
Dropping an Index
Partitions
Rename a Partition
Drop a Partition
Sequences
Creating Sequence
Dropping a Sequence
Dropping a Sequence
Cascade
Views
Creating a View
Grant/Revoke Privilege
Dropping a View
Renaming a View
Tablespaces
Creating a Tablespace
Renaming a Tablespace
Setting Maximum
Tablespace Size
Dropping a Tablespace
Users/Roles
Create User/Role
Viewing/Editing User/Role
Properties
Search Objects
Edit
SQL Terminal
Auto Commit
Auto-suggest
Error Locator
Execute queries
SQL Assistant
NOTE
Supported in
Chinese UI.
SQL Formatting
SQL History
Results
Search Results
Batch Operations
Batch Drop
Synonym Management
Synonym Management
Filtering stops after timout and display result for filtering done in time period. You
can set Timeout period in Preference->General->Object Browser->Filter
Timeout. For for information, refer Setting Filter Timeout.
Character Encoding
When viewing SQL, DDL, object names or data containing Chinese characters,
Data Studio encoding needs to be set to GBK provided OS supports GBK. For more
information on changing encoding settings, refer to Environment > Session
Setting.
Connection Management
Comma is considered as delimiter in Include/Exclude fields in Advanced tab of
add and edit connection window. Hence, schema name having comma is not
supported in Include/Exclude fields.
Database Tables
● In the Create Table wizard > Index tab and in the Create Index wizard, the
selected columns between list view, on remove, will not maintain order.
● When an operation has completed, and if the Data Studio window is not the
active window of the operating system, then the message dialog is shown
only when Data Studio window becomes active.
● The following limitations are applicable for Edit Table Data operations:
– Entering expression values in Edit Table Data tab is not supported.
– Data Studio allows editing of only fetched records.
– Edit table filter feature will not highlight search words within HTML tags
such as <, &, >.
– A cell containing single '&' in it will not be displayed in tooltip. A cell
containing two consecutive '&' will display as single '&' in the tooltip.
– Row focus is not retained on a newly added row. User must click on the
desired cell to start editing.
Function/Procedure
Function/Procedure created in SQL Terminal or Create Function/Procedure
wizard must end with / to indicate the end of function/procedure. Statements
entered after a function/procedure without / at the end will be treated as a single
query and may display errors during execution.
General
● A maximum of 100 tabs can be opened in the editor area. Tabs are based on
available resources of the host machine.
● A maximum of 64 characters (text only) is allowed for database object names
(database, schema, function, procedure, table, sequence, constraint, index,
view, and tablespace). There is no limit to the number of characters that can
be used in expressions and descriptions in Data Studio.
● A maximum of 300 result tabs can be opened on a logged instance of Data
Studio.
● If there are large objects loaded in Object Browser and Search Object window,
then expanding of objects in Object Browser may be slow and Data Studio
may become unresponsive.
● Resizing the width of a cell containing data exceeding the available display
area may cause DS to become unresponsive.
● When the data in a table cell is more than 1000 characters, it will appear
trimmed up to 1000 characters with "..." at the end.
– If the user copies the data from a cell in a table or Result tab and pastes
it on any editor (such as SQL terminal/PLSQL source editor, notepad or
any other external editor application), the entire data is pasted.
– If the user copies the data from a cell in a table or Result tab and pastes
it on an editable cell (same or different), the cell shows only the first
1000 characters with "..." in the end.
– When the table/Result tab data is exported, the exported file contains
the whole data.
Security
Data Studio validates SSL connection parameters only for the first connection
profile. If a second connection is opened, then the connection uses the same SSL
connection parameters when the Enable SSL field is checked.
For SSL connection, if security files are corrupted, DS will not be able to proceed with any
database operation. To recover from this, please remove security folder under the
corresponding profile folder and restart DS.
SQL Terminal
● Opening an SQL file containing a large number of queries may result in an
'Insufficient Memory' error. For more information, refer to 9 Troubleshooting.
● Data Studio does not disable the auto-suggest and hyperlink features in
commented text in the SQL Terminal.
● Hyperlink feature is not supported if schema or table name have either space
or dot (.) in them.
● Auto-suggest is not supported if the object name contains single or double
quotes in them.
● DS supports basic formatting of simple SELECT statements only and may not
work as expected for complex queries.
docs ● Contains Data Studio User Manual.pdf which provides you with
details on using Data Studio.
● Contains copyright notices, licenses, and the written offer for the
open source libraries used in Data Studio.
features Contains Eclipse (rich client protocol-GUI) and Data Studio features.
Folders/Files Description
UserData<USERNAME>/ Contains separate folders for each OS user who uses Data Studio.
● Autosave Autosave - Contains the auto saved information of unsaved queries
● Logs/ and functions/procedures.
● Preferences/ Logs - Contains Data Studio.log which stores log information of all
the
● Profile<PROFILE1,
PROFILE2....>/ operations performed in Data Studio.
– History/ Preferences - Contains the Preferences.prefs file which stores the
custom preferences.
● Security/
Profile - Contains the connection.properties, SQL History and
Profiles.txt files required to manage connection profiles in Data
Studio.
Security - Contains files required to manage security in Data Studio.
NOTE
● The UserData folder is created only after the first user opens an instance of
Data Studio.
● Logs folder, language, memory settings and log level are common for all
users.
● The Logs folder, Data Studio.log file, Preferences folder, Preferences.prefs
file, Profile folder, connection.properties file, Profiles.txt file, and security
folder are created after launching Data Studio.
● If Logs folder path is provided in Data Studio.ini file, then logs are created
in the specified path.
● When user is not able to log in to the Data Studio due to security keys are
corrupted.
Follow the steps to generate new security keys:
1. Delete the security folder from Data Studio\UserData\<UserId>\Profile
\<Profile ID>\security
2. Restart Data Studio.
Data Studio.exe Allows you to connect to the database and perform various
operations (like managing database objects, editing or executing
PL/SQL programs and so on).
GaussDB Tools 8.0.2.SPC2 Written offer listing the open source software used and their license
DS Open Source Software information.
Notice.doc
readme.txt Contains the features or fixed issues of current release version.
Hardware Requirements
Pre requisite: User's home directory should have at-least 100 MB free space.
The following table lists the minimum hardware requirements for Data Studio.
Software Requirements
Operating System Requirements
The following table lists the details of OS requirements for Data Studio.
SP2 (SUSE12.2)
SP3 (SUSE12.3)
SP4 (SUSE12.4)
7.5 (CentOS7.5)
7.6 (CentOS7.6)
Browser Requirements
The following table lists the details of browser requirements for Data Studio.
GNU libc Show DDL, Export DDL, Export DDL and Data
operations supported only GNU libc version
in the system are above 2.17.
GaussDB A V100R007C00
V100R007C10
V100R008C10
V300R002C00
8.0.0
8.1.0
GaussDB T V300R001C00
1.0.1
1.0.2
1.0.2.SPC5
1.0.2.SPC010
1.0.5
DWS 1.2.x
1.3.x
2.1.x
Step 1 Extract the required package. If the user prefer to install in other folder, then
admin should control the folder access permissions to users.
UserData folder is created after the first user launches Data Studio. Refer to 5.1 Starting
Data Studio in case of any error while launching Data Studio.
----End
Restart Data Studio to view parameter changes. Invalid parameters added in the
configuration file are ignored by Data Studio. All the below mentioned parameters are not
mandatory.
NOTE
● All the above parameters must be added before -vmargs.
● -startup and --launcher.library must be added as first and second parameter
respectively.
V4 Only x x No Communication
Possible
V4/V6 x x x
V6 Only No Communication x x
Possible
In this case, the Data Studio.log file is created in the c:\test1\<user name>\logs
path.
If any of the users does not have access to the path mentioned in the Data Studio.ini file,
then Data Studio closes with the below pop-up message.
----End
The Data Studio.log file will be created in the Data Studio\UserData\<user name>
\logs path if
● The path is not provided in the Data Studio.ini file.
For example: -logfolder=.
● The path provided does not exist.
You can use any text editor to open and view the Data Studio.log file.
If the flag value is 'true', then the stack trace details of exception, error or throw-
able will be saved in the log file.
If the flag value is 'false', then no stack trace details will be saved in the log file.
When the Data Studio.log file reaches the maximum file size of 10000 KB, it will
create a new file and save as Data Studio.log.1 automatically and the logs in Data
Studio.log are moved to Data Studio.log.1. When Data Studio.log file reaches the
maximum file size again, it will create a new file and save as Data Studio.log.2.
Latest logs are always written in Data Studio.log file. This process continues till
Data Studio.log.5 reaches the maximum file size and the cycle restarts. The Data
Studio deletes the old log file that is Data Studio.log.1. For example, the Data
Studio.log.5 renames to Data Studio.log.4, the Data Studio.log.4 renames to Data
Studio.log.3 and so on.
To enable performance logging in the server log file, the configuration parameter
log_min_messages must be enabled and value must be set as debug1 in the configuration
file data/postgresql.conf, that is, log_min_messages = debug1.
● If the user enters an invalid value to log level, then log level will be set to WARN.
● If the user does not provide any log level, then log level will be set to WARN.
The logger outputs all messages equal to or greater than its log level.
The order of the standard log4j levels are as follows:
OFF
FATAL
ERROR
WARN
INFO
DEBUG
TRACE
ALL
Note that GaussDB T also supports an IP black list, and the IP address blacklist
has a higher priority than an IP address whitelist. If a user or IP address whitelist
is configured but database access fails, check whether the IP address for
accessing is on the IP address blacklist.
● Query for a configured IP address blacklist.
zsql gaussdba/[email protected]:1888
SELECT VALUE FROM V$PARAMETER WHERE NAME = 'TCP_EXCLUDED_NODES';
If an IP address to be used for remotely connecting to the database is on the
IP address blacklist, record all the IP addresses on the blacklist.
● Delete the IP address from the IP address blacklist.
Run the following commands to reconfigure the IP address blacklist. A new IP
address blacklist overwrites the existing IP address blacklist in the system.
Therefore, the IP addresses in the following commands are those on the
original blacklist and the IP address to be used for remotely connecting to the
database must be excluded.
Assume that the original blacklisted IP addresses are IP1, IP2,..., IPn and that
the IP address to be used for remote connection is IP1. Do as follows:
● If GaussDB T is installed on a single host, run the following command
when the database is connected (the configuration takes effect
immediately):
ALTER SYSTEM SET TCP_EXCLUDED_NODES = '(IP2,...,IPn)';
● If GaussDB T is installed on multiple hosts, run the following command
when the database is disconnected (the configuration takes effect
immediately):
gs_gucZenith -c "TCP_EXCLUDED_NODES=(IP2,...,IPn)" -I CN1_ID,CN2_ID,...CNn_ID
● You can add an IPv4 address, IPv4 network segment, IPv6 address, or IPv6
network segment. For example:
host user 192.168.1.1
host user 192.168.1.1/24
host user 20AB::9217:acff:feab:fcd0
host user 20AB::9217:acff:feab:fcd0/64
In this example:
192.168.1.1 indicates an IPv4 host.
192.168.1.1/24 indicates all IP addresses on the 192.168.1.0 IPv4 segment.
20AB::9217:acff:feab:fcd0 indicates an IPv6 host.
20AB::9217:acff:feab:fcd0/64 indicates all IP addresses on the 20AB::/64 IPv6
segment.
● You can run the following command to create the user jack:
create user jack identified by xxxxxxx;
After a whitelist is configured, you can run the following command to query the V
$HBA view and check whether the whitelist is configured successfully:
SELECT * FROM SYS.V$HBA;
After the configuration is complete, you can use Data Studio to remotely connect
to a GaussDB T database server by using a listed username, its password, the
server IP address, and the port number.
Add new IP addresses to the IP address whitelist, which will overwrite original
addresses. In other words, the original IP address whitelist is deleted.
ALTER SYSTEM SET TCP_INVITED_NODES = '(192.168.1.1, 192.168.2.*)';
After the configuration is complete, ensure that the IP whitelist detection function is
enabled. Otherwise, the configuration does not take effect. To enable the IP address
whitelist detection function online, run the following command:
ALTER SYSTEM SET TCP_VALID_NODE_CHECKING = true;
The command needs to be executed only once across the lifecycle of a cluster. The function
takes effect immediately after the command execution, and there is no need to restart the
database.
Then, you can use Data Studio to remotely connect to a GaussDB T database
server by using any username, its password, the server IP address, and the port
number.
Then, you can use Data Studio to remotely connect to a GaussDB T database
server by using any username, its password, the server IP address, and the port
number.
Or
Or
Step 2 Before debug: Add breakpoint by Double click in the margin of terminal and
cancel breakpoint by double click in the margin of terminal.
Step 3 Debugging: Add breakpoint by Double click in the margin of terminal and cancel
breakpoint by Double click in the margin of terminal.
Step 5 When debugging, support show stack window, break window, variable window
and monitor window, but the debug is finished, these windows are hidden, and
support the function of these windows.
Step 6 If the connection is disconnected while debugging, then Data Studio prompts the
following error:
Step 7 Click OK to re-establish the connection and continue with debugging operation.
----End
Error line is highlighted in the PL/SQL Source Viewer in the following scenarios:
● When a PL/SQL function/procedure have compilation errors.
● When a PL/SQL function/procedure have semantic/run time error. For example, Divide
by Zero.
1. Click View Source to find the highlighted error causing line and to view the error icon X
appears at the margin.
2. Hovering on the error icon X mark, shows the error message.
3. Function or procedure is opened only when error message from server contains the
procedure name or the user has enough permission.
Information about parameter name and what value they take can be found in the
following Table 4-4 :
1. Once earlier mentioned commands are executed, then the db password will be
prompted in console.
2. In windows, you must use "DataStudio.bat"
For example
"DataStudio.bat" dbType=GaussDB_A connectionName=my_connection
host=10.XX.XX.XX hostPort=2554 dbName=postgres userName=dsuser
savePassword=current_session
1. Save password permanently option does not support through command line as
preferences will not be loaded while processing the arguments.
2. Command line arguments can only be entered in English in command prompt.
3. In Windows, if any error occurs while validating parameters, then error message is
displayed in console.
4. Data studio workbench closes if any validation fails.
5. This feature is supported for one connection only.
6. When pressed Ctrl+C during while DS is running, suppress terminate batch job (y/n)
is prompted in console in windows. No matter, what input is given at this point (Y or N),
DS will exit. This is OS behavior as DataStudio is launched through bat script.
7. When DS launched through command line arguments is restarted, you need to press
ENTER before typing password.
Constraints
Command line arguments have following constraints:
● Arguments need to be provided in option = value format
● There should not be any space on either side of =
● Two different arguments need to be separated with one or more spaces
● If a value contains space, value needs to be enclosed in double quotes.
For example, connectionName ="my connection”
Any error in usage of command line arguments is displayed in the command
prompt itself as follows:
5 Getting Started
Prerequisites
The StartDataStudio.bat batch file checks the version of Operating System (OS),
Java and Data Studio as a prerequisite to run Data Studio.
Step 1 In the Release package navigate to Tools folder, locate and double-click
StartDataStudio.bat to execute and check Java version compatibility.
The batch file checks the version compatibility and will launch Data Studio or
display appropriate message based on OS, Java and Data Studio version installed.
If the Java version installed is below 1.8, then appropriate error message is
displayed.
The scenarios checked by the batch file to confirm the required versions of the OS
and Java for DS.
----End
Item 15 and 16 are not visible until specific functionality is triggered.The following
figure uses GaussDB A as an example.
5.3.1 File
The File menu contains database connection options. Click File from main menu
or press Alt+F to open the File menu.
Exit Application dialog box is displayed prompting you to take the required
action.
Clicking on Force Exit button might not save the SQL History, if not saved yet.
● Graceful Exit button - To exit the application after saving the SQL History
information to disk in case the save is not complete at this point of time.
● Cancel button - To cancel exiting from the application.
----End
5.3.2 Edit
The Edit menu contains clipboard, Format, Find and Replace, and Search
Objects operations to use in the PL/SQL Viewer and SQL Terminal tab. Press Alt
+E to open the Edit menu.
Copy
Copy can also be used to copy objects from Object Browser.
Search Objects
Search Objects option allows you to search for object(s) from the Object Browser
based on the search criteria entered. The search operation can be executed either
from Edit > Search Objects menu or by clicking the from the Object Browser
toolbar. The result of search displays tree structure similar to Object Browser.
Right-click operations except for Refresh can be performed on the search result
objects. Modified objects as a result of drop, set schema, rename, and so on can
be viewed only from the main Object Browser after refresh. Right-click options on
group names (tables, schema, views and so on) are not allowed on search result
objects. Only objects to which you have access can be searched. Objects that you
do not have access do not appear in the Search Scope.
Newly added objects can be viewed in the Search window by clicking the refresh option at
the end of the object type.
Starts With A search text which starts with the searched character will be
displayed.
Exact Word A search text which matches exactly with searched characters
will be displayed.
Match case runs the search to match with the search text case.
5.3.3 Run
The Run menu contains options to execute a database object in the PL/SQL
Viewer tab and to execute SQL statements in the SQL Terminal tab. Press Alt+R
to open the Run menu.
5.3.4 Debug
The Debug menu contains debug operations to use in the PL/SQL Viewer and
SQL Terminal tab. Press Alt+D to open the Debug menu.
5.3.5 Settings
The Settings menu contains the option to change the language. Press Alt+G to
open the Settings menu.
5.3.6 Help
The Help menu contains the user manual and version information of Data Studio.
Press Alt+H to open the Help menu.
The Version displayed below is indicative and may not reflect the current version of Data
Studio.
● New Connection
● Remove Connection
● Connect To DB
● Disconnect From DB
● Disconnect All
● Open SQL Script
● Save SQL Script
● Connection Profile Drop-down List
● Open New SQL Terminal
● Execute DB Object
● Debug DB Object
● Compile a Function/Procedure
● Step Into
● Step Out
● Step Over
● Terminate Debugging
● Continue Debugging
● Format
● Upper Case
● Lower Case
● SQL Assistant
Right-clicking the connection profile allows you to select Rename, Edit, Remove
Connection, and Properties along with Refresh options.
Right-clicking the active database allows you to select Disconnect from DB, Open
Terminal, Properties, and Refresh options.
Right-clicking the inactive database allows you to select Connect to DB, Rename
Database, and Drop Database options.
Right-clicking the Schemas group allows you to select Create Schema, Grant/
Revoke and Refresh option.
Right-clicking the schema allows you to select Export DDL, Export DDL and Data,
Rename Schema, Drop Schema, Grant/Revoke, and Refresh options.
Export DDL and Data - Exports DDL and data of the schema
Right-clicking Tables allows you to select Refresh and Create table and Grant/
Revoke options.
Right-clicking Views allows you to select Refresh and Create View and Grant/
Revoke options.
Right-clicking the PL/SQL Viewer allows you to Cut, Copy, Paste, Select All,
Comment/Uncomment Lines, Comment/Uncomment Block, Compile, Execute,
Add Variable To Monitor, Debug with Rollback and Debug in the PL/SQL
Viewer tab.
Right-clicking the SQL Terminal allows you to Cut, Copy, Paste, Select All,
Execute Statement, Open, Save, Find and Replace, Execution Plan, Comment/
Uncomment, Save As, Format and Cancel in the SQL Terminal tab.
Right-clicking in the Messages tab allows you to Copy, Select All, and Clear the
contents of the Messages tab.
6.1 Overview
6.2 Connection Profiles
6.3 Databases
6.4 Schemas
6.5 Functions/Procedures
6.6 Tables (GaussDB A)
6.7 Tables(GaussDB T)
6.8 Sequences
6.9 Supporting Synonym Management for GaussDB T and GaussDB A
6.10 Supporting Package in GaussDB T
6.11 Supporting GUI for Displaying Scheduled Tasks
6.12 Views
6.13 Tablespaces
6.14 Users/Roles
6.15 SQL Terminal
6.16 Batch Operation
6.1 Overview
This section provides details on how to use features of Data Studio. Data Studio
requires a valid database connection to perform operations on the database.
Refer to 3.2 Supported Functions to see the list of functions and database(s)
supported by Data Studio.
6.2.1 Overview
When Data Studio is started, the New Database Connection dialog box will open
by default. To perform any DB operations, Data Studio must be connected to at
least one database.
Enter the connection parameters to create a new database connection between
Data Studio and the database in the server. Hovering over the connection name
will display the server information.
You need to fill all the mandatory parameters, that are marked with asterisk (*) to
complete the operation successfully.
Step 1 Choose File > New Connection from the main menu, or
While establishing a connection, if the preference file is corrupted or the preferences values
are invalid, then an error message is displayed informing you that preference values are
invalid and default values are set for preferences. To complete establishing a new database
connection operation, click OK.
Step 2 The table on the left lists the details of the existing connection profile(s) used to
connect to the database along with the server information.
The server information will be displayed only after one successful connection.
● Double clicking a connection name populates the connection parameters such
as Connection Name, Host, and Host Port.
If password is corrupted for any of the existing connection profiles or the key is
corrupted, then the password field needs to be filled in for all created connections.
● Clicking Delete Profile displays different pop-up messages based on the
connection status of database.
– If the database connection is active, then Remove Connection
Confirmation pop-up is displayed. Click Yes to disconnect all databases.
– If the database connection is not active, then Remove Connection
Confirmation pop-up is displayed.
– Clicking Delete Profile without a connection name displays a pop-up
stating to select at least one connection profile.
Step 3 Provide the following credentials to enter a new set of parameters to connect to
the database:
● You can click Clear to clear all fields in the New Database Connection dialog box.
● Use shortcut key (Ctrl+V) to paste data in Connection window. Data Studio does not
support right-click options for all dialog boxes.
● Select an option from the Save Password drop-down list. The options
available are:
– Permanently: Saves the password even after exiting Data Studio. While
establishing the connection for the first time this option will not be
available. Refer to the Save Password Permanently section for
information to hide/view this drop-down option.
– Current Session Only: Saves the password only for the current session.
– Do Not Save: Does not save the password. If this option is selected, Data
Studio will prompt for the password for certain operations like:
3. Provide the following information. The following files are required for secured
connection. Refer to 10.7 SSL Certificates section.
– To select the Client SSL Certificate, click and select the Client SSL
Certificate.
– To select the Client SSL Key, click and select the Client SSL key.
– To select the Root Certificate, click and select the Root Certificate.
– Select the SSL Mode from SSL Mode drop-down. Refer to table below for
description of different SSL modes.
▪ DS prompt for the Client key while accessing the gs_dump feature for the first
time.
▪ Selecting Client SSL Certificate and Client SSL Key ensures secured
connection for export of DDL and data using Data Studio.
▪ Selecting invalid file for Client SSL Certificate and/or Client SSL Key will result
in export failure. Refer to Troubleshooting.
▪ If you deselect Enable SSL check box and proceed, then Connection Security
Alert dialog box is displayed. Refer to Security Disclaimer for information to
display this security alert or not.
○ Continue - Clicking Continue proceeds with unsecured connection.
○ Cancel - Clicking Cancel proceeds to enable SSL.
○ Do not show again - Checking this field hides the Connection Security
Alert dialog box for subsequent connections for current logged instance
of Data Studio.
2. Enter the schema names using comma separator to load on priority while
establishing a connection in the Include field.
3. Enter the schema names using comma separator to avoid loading on priority
while establishing a connection in the Exclude field.
4. Select an option from the Load Objects options. The options available are:
– All Objects - Loads all objects.
– Objects allowed as per user privilege - Loads only objects that the user
has access. Refer to Minimum Privileges Requirement table for the
minimum access required for objects to be listed in Object Browser.
5. Enable Load child objects of Tables and Views option. If this option is
unchecked then Child objects of Tables and Views (Columns/Constraints/
Indexes) cannot be loaded during connection . If it sets to true All child
objects of Table/Views are loaded while Connection and Load Limit text box
is enabled and user can update load limit.
If it sets false then child objects of Table/Views cannot be loaded and Load
Limit text box is disabled.
6. Enter the load limit in Load Limit field. The maximum value allowed is 30000.
This is the database object count.
– If the number of object types (tables, view..) of the schema mentioned in the
Include field is greater than the value entered in the Load Limit field, then the
only the parent objects for a schema will be loaded. This implies that child objects
such as columns, constraints, indexes, functions with more than three parameters,
and so on will not be loaded.
– Schema names provided in the Include and Exclude lists are validated.
– If you do not have access to the schema name entered in the Include field, then
an appropriate error message is displayed for that schema during connection.
– If you do not have access to the schema name entered in the Exclude field, then
the schema will not be loaded in Object Browser after connection is established.
While Data Studio is connecting to the database, the following status bar shows
the status:
Once the connection is established, all schema objects will be displayed in the
Object Browser pane.
● Data Studio allows you to log in even if the password has expired with a message
informing that some operations may not work as expected. Refer to Password Expiry
for information to change this behavior.
● Refer to Cancel Connection section to cancel the connection.
● Postgres specific schemas are not displayed in the Object Browser.
----End
Cancel Connection
Follow the steps to cancel the connection operation:
----End
Lazy Loading
Lazy loading feature delays the loading of objects until required.
When you connect to a database only child objects of schema saved under
search_path will be loaded as shown below:
To load child objects expand the schema. During expansion of schema, the objects
under the schema will show as loading:
If you try to load an unloaded object while loading is in progress for another object, a pop-
up message is displayed informing you that another loading is in progress. The icon
next to the unloaded object disappears. Refresh at the object or database level to display
this icon again for loading.
Expand schema to load and view the child objects. The Object Browser can load child
objects of only one schema at a time.
A maximum of 50,000 objects will be loaded in the Object Browser pane within 1
minute.
You can set the loginTimeout value in Data Studio.ini file. The file is present in the
Data Studio\Data Studio.ini path.
Step 1 In the Object Browser pane, right-click the selected connection name and select
Rename Connection.
A Rename Connection dialog box is displayed prompting you to provide the new
name for the connection.
Step 2 Enter the new connection name. Select the OK to rename the connection.
The new connection name must be unique else the rename operation will fail.
----End
Step 1 In the Object Browser pane, right-click the selected connection name and select
Edit Connection.
Editing an active connection will require closing the connection and then
reopening the connection with the new properties. A warning message about
connections being reset is shown.
The Edit Connection dialog box is displayed.
Step 2 Click OK to proceed or Cancel to exit the operation.
Step 3 Edit the connection parameters. Connection parameters are explained in 6.2.2
Adding a Connection.
Step 4 Click OK to save the updated connection information.
● You can click Clear to clear all fields in the Edit Database Connection dialog box.
● If you click OK without modifying any of the connection parameters, no changes saved
dialog message is displayed. Until a connection parameter is changed the dialog
message is displayed.
● Data Studio allows you to log in even if the password has expired with a message
informing that some operations may not work as expected. Refer to Password Expiry
for information to change this behavior.
● Refer to Cancel Connection section to cancel the connection.
If SSL is not enabled, then a Connection Security Alert dialog box is displayed.
Step 5 Click Continue to proceed with unsecured connection or click Cancel to return to
the Edit Connection dialog to enable SSL.
Do not show again option is used to hide the Connection Security Alert dialog box for
subsequent connections.
----End
Step 1 Right-click the selected connection name and select Remove Connection.
A confirmation dialog box is displayed to remove the connection.
Step 2 Click Yes to remove the server connection.
The status bar displays the status of the completed operation.
This action will remove the connection from the Object Browser. Any unsaved
data will be lost.
----End
If the property of a connection is modified for the connection that is already opened, then
open the properties of the connection again to view the updated information on the same
opened window.
----End
Step 1 In the Object Browser pane, right-click the selected connection name and select
Refresh or press F5.
The status bar displays the status of the completed operation.
----End
The time taken to refresh the database depends on the number of objects present
in the database. For a large database, it is recommended to perform this operation
only if required.
● If you right-click the connection name and select Refresh, the connection
profile is refreshed. During refresh, the connection will be updated with the
latest copy from the server.
● If you right-click the Schema and select Refresh, all functions/procedures and
tables under the schema are refreshed. During refresh, all functions/
procedures and tables are updated with the latest copy from the server.
If any stored function/procedure is deleted from the database before the
refresh operation, then it will be removed from the Object Browser only after
you perform the refresh operation.
Step 2 Select Export Connections to export the connection profiles. Export Connection
Profiles window is displayed to the user to select the connections which needs to
be exported.
Select the location where you want to save the file and Click OK
If there is any match between the connections being imported and the existing
connections, a dialog box is displayed.
● Replace - The imported connection profile will be replaced with the existing
one.
● Copy, but keep both files - The imported connection profile will be renamed.
● Don't Copy - The existing connection profile will remain as it was.
● Do this for all conflicts - Same action will be repeated for all the matches.
Click any of the given options as per the scenario and click OK.
----End
6.3 Databases
Step 1 In the Object Browser pane, right-click the selected Databases group and select
Create Database.
This operation can be performed only when there is at least one active database.
Step 2 Enter the database name. Refer to server manual for database naming rules.
Step 3 Select the required type of encoding character set from the Database Encoding
drop-down list.
The database supports UTF-8, GBK, SQL_ASCII, and LATIN1 types of encoding
character sets. Creating the database with other encoding character sets may
result in erroneous operations.
Step 4 Select the Connect to the DB check box and click OK.
The status bar displays the status of the completed operation.
You can view the created database in the Object Browser. The system related
schema present in the server is automatically added to the new database.
Data Studio allows you to log in even if the password has expired with a message
informing that some operations may not work as expected when no other database is
connected in that connection profile. Refer to Password Expiry for information to change
this behavior.
----End
Cancel Connection
Follow the steps below to cancel the connection operation:
Step 1 Double-click the status bar to open the Progress View tab.
----End
Step 1 In the Object Browser pane, right-click the selected Databases group and select
Disconnect All. This will disconnect all the databases under that connection.
This operation can be performed only when there is at least one active database.
Connection properties populates all connection parameters (except password) that were
provided during the last successful connection with the database.
----End
Step 1 In the Object Browser pane, right-click the selected database name and select
Connect to DB.
● Data Studio allows you to log in even if the password has expired with a message
informing that some operations may not work as expected when no other database is
connected in that connection profile.
Refer to Password Expiry for information to change this behavior.
● Data Studio allows to log in based on the preference settings even if the password is
expired.
● Refer to Cancel Connection section to cancel the connection to database.
----End
Step 1 In the Object Browser pane, right-click the selected database name and select
Disconnect from DB.
----End
Step 1 In the Object Browser pane, right-click the selected database and select Rename
Database.
Step 2 Enter the new database name. Select the Connect to the DB? check box and click
OK.
----End
Step 1 In the Object Browser pane, right-click the selected database and select Drop
Database.
A popup message and status bar displays the status of the completed operation.
----End
If the property of a database is modified for the database that is already opened, then
refresh and open the properties of the database again to view the updated information on
the same opened window.
----End
6.4 Schemas
6.4.1 Overview
This section describes working with database schemas. All system schemas are
grouped under Catalogs and user schemas under Schemas.
Step 1 In the Object Browser pane, right-click the selected Schemas group and select
Create Schema.
Step 2 Enter the schema name and click OK. You can create the schema only if the
database connection is active.
You can view the new schema in the Object Browser pane.
The status bar displays the status of the completed operation.
----End
You can perform the following actions on a schema:
● Refresh a Schema - To refresh a schema, right-click the selected Schema
Name and select Refresh Schema. All the objects under that schema will be
refreshed.
● Rename Schema (Refer to 6.4.5 Renaming a Schema for more details)
● Drop Schema (Refer to 6.4.8 Dropping a Schema for more details)
● Export DDL (Refer to 6.4.3 Exporting Schema DDL for more details)
● Export DDL and Data (Refer to 6.4.4 Exporting Schema DDL and Data for
more details)
● Grant/Revoke Privilege (Refer to 6.4.7 Grant/Revoke Privilege for more
details)
When a create query without mentioning the schema name is executed from SQL
Terminal, the corresponding objects are created under the default schema of the
user.
When a select query is executed in SQL terminal without mentioning the schema
name, default schemas are searched to find these objects.
When Data Studio starts, the default schemas are set to <username>, public
schemas in same priority.
If another schema is selected in the drop down, selected schema will be set as
default schema, overriding previous setting.
The selected schema is set as default schema for all active connections of the
database (selected in the database list drop down).
Step 1 In the Object Browser pane, right-click the selected schema and select Export
DDL.
The Data Studio Security Disclaimer dialog box is displayed. You can turn off this
security disclaimer message. Refer to Security Disclaimer section for more
information.
Step 2 Click OK.
The Save As dialog box is displayed.
Step 3 In the Save As dialog box, select the location to save the DDL and click Save. The
status bar displays the progress of the operation.
● To cancel the export operation, double-click the status to open the Progress View tab
and click . For more information, refer to Canceling the export table data
operation.
● The exported file name will not be the same as schema name, if the schema name
contains characters which are not supported by Windows.
● Microsoft Visual C runtime file (msvcrt100.dll) is required to complete this operation.
Refer to Troubleshooting section for more information.
The Export message and status bar displays the status of the completed
operation.
GBK Yes
LATIN1 Yes
UTF-8 Yes
LATIN1 No
GBK No
UTF-8 Yes
Multiple objects can be selected to export DDL. Refer to Batch Export section for list of
objects not supported for export DDL operation.
----End
Step 1 In the Object Browser pane, right-click the selected schema and select Export
DDL and Data.
The Data Studio Security Disclaimer dialog box is displayed. You can turn off this
security disclaimer message. Refer to Security Disclaimer section for more
information.
Step 3 In the Save As dialog box, select the location to save the DDL and data and click
Save. The status bar displays the progress of the operation.
● To cancel the export operation, double-click the status to open the Progress View tab
and click . For more information, refer to Canceling the export table data
operation.
● The exported file name will not be the same as schema name, if the schema name
contains characters which are not supported by Windows.
● Microsoft Visual C runtime file (msvcrt100.dll) is required to complete this operation.
Refer to Troubleshooting section for more information.
The Export message and status bar displays the status of the completed
operation.
GBK Yes
LATIN1 Yes
UTF-8 Yes
LATIN1 No
GBK No
UTF-8 Yes
Multiple objects can be selected to export DDL and Data. Refer to Batch Export section for
list of objects not supported for export DDL and Data operation.
----End
Step 1 In the Object Browser pane, right-click the selected schema and select Rename
Schema.
Step 2 Enter the schema name and click OK.
You can view the renamed schema in the Object Browser.
The status bar displays the status of the completed operation.
----End
Step 1 In Object Browser right click on any object under Sequences. A menu option is
displayed.
Step 2 Select Show DDL option to see the DDL statements.
Or Select Export DDL menu option to export DDL statements.
Or Select Export DDL and Data menu option to export DDL statements and the
select statement.
Refer to the following image:
If user is sequence owner or sysadmin or has select privilege of the sequence, then only the
operation can be performed.
----End
----End
Step 1 In the Object Browser pane, right-click the selected schema and select Drop
Schema.
A confirmation dialog to drop the schema is displayed.
Step 2 Click OK to drop the schema. This action will remove the schema from the Object
Browser.
----End
6.5 Functions/Procedures
Step 2 Add the function/procedure by right-clicking in the tab and selecting Compile, or
choosing Run > Compile/Execute Statement from the main menu, or pressing
Ctrl+Enter to compile the function/procedure.
The Created function/procedure Successfully dialog box is displayed, and the
new function/procedure is displayed under the Object Browser. Click OK to close
the NewObject() tab and add the debug object in the Object Browser.
Refer to the Execute SQL Queries section for information on the reconnect option
in case connection is lost during execution.
Step 3 The * symbol next to the function/procedure name indicates that the function/
procedure is not compiled or added in the Object Browser.
You must refresh (using F5) the Object Browser to view the newly added debug
object.
● A popup message displays the status of the completed operation. The status bar does
not display the status of this operation.
● For C functions, debug operation is not supported.
----End
Step 3 Click Create PL/SQL Function. The new function/procedure tab is opened.
----End
Step 1 In the Object Browser pane, double-click the required function/procedure or SQL
function or right-click the function/procedure or SQL function and select View
Source. You must refresh the Object Browser to view the latest DDL.
The function/procedure or SQL function based on your selection is displayed.
Only one function/procedure or SQL function with the same schema, name, and
input parameters can be opened in Data Studio.
Step 2 After editing or updating, compile and execute the PL/SQL program or SQL
function. For more details, refer to 6.5.4.7 Executing a Function/Procedure.
If you execute the function/procedure or SQL function before compiling, a Source
Code Change dialog box is displayed.
Step 3 Click Yes to compile and execute the function/procedure.
The Messages tab displays the status of the completed operation.
Refer to Execute SQL Queries section for information on reconnect option in case
connection is lost during execution.
Step 4 After compiling the function/procedure or SQL function, refresh the Object
Browser (using F5) to view the updated code.
----End
----End
6.5.4.1 Overview
This section provides you with details on working with functions/procedures and
SQL functions in Data Studio.
Data Studio supports plpgsql and SQL languages for the operations are listed as follows:
● 6.5.1 Creating Function/Procedure
● 6.5.2 Editing a Function/Procedure
● 6.5.4.4 Exporting a Function/Procedure DDL
● 6.5.4.6 Dropping a Function/Procedure
6.5.4.2.1 Overview
During debugging operation if the connection is lost and the database is still
connected in Object Browser, then Connection Error dialog box is displayed:
● Yes - The connection is reestablished and restarts debug operation.
● No - Disconnects database in Object Browser.
● Disabling a breakpoint prevents the execution from pausing at the breakpoint, but
leaves the definition in place (to enable the breakpoint later).
● Deleting a breakpoint removes it permanently.
● The content of the Breakpoints pane can be copied to the clipboard using Alt+Y.
Step 1 Open the PL/SQL function where you want to add the breakpoint.
Step 2 In the PL/SQL Viewer, double-click the breakpoint ruler on the left side of the line
number column. The added breakpoint is indicated by an enable breakpoint sign
If the execution of the function does not break or stop during debugging, the breakpoint
that is already set will not be validated.
----End
In the PL/SQL Viewer tab, open the function in which you want to remove the
You can also enable or disable breakpoints using the Breakpoints pane as
explained above.
It is recommended to refresh the object and perform the debug operation again.
If the source code is changed after it is fetched from the server, and if you perform the
execution or debug operation with no breakpoint set, then the result of the source code at
the server will be displayed by Data Studio. It is always recommended to refresh before
performing debug or execute operation.
Step 1 Open the PL/SQL program and add a breakpoint at the line where you want to
perform debug operation.
For example:
Line 11, 12, 13.
Step 2 To start debugging, click or press Ctrl+D, or right-click the selected PL/SQL
program in the Object Browser and select Debug. The Debug Function/
Procedure dialog box appears prompting for your input.
If there is no input parameter, then Debug Function/Procedure dialog box will not appear.
Step 3 Provide your input and click OK. For varchar and date datatype, provide the input
value in single quotes and for numeric datatype, provide the input value with or
without single quotes.
To set NULL as the parameter value, enter NULL or null.
On clicking the Debug button, you will see an arrow pointing to the line
where breakpoint is set. The arrow indicates the line number at which execution
will resume from.
You can terminate debugging by clicking from the toolbar, or pressing F10, or
select Terminate Debugging from the Debug menu. After stopping the debug
operation, the execution of the function will not break for any breakpoint and the
execution will proceed normally.
The Callstack and Variables panes are populated.
The Variables pane shows the current value of variables. Mouse over the variable
in the function/procedure also shows the current value of variables.
You can step through the code using Step Into, Step Out or Step Over. For more
details, refer to 6.5.4.2.3 Controlling Execution .
Step 4 Click Continue to continue the execution till the next breakpoint (if any). The
result of the executed PL/SQL program is displayed in the Result tab and the
Callstack and Variables panes are cleared. You can copy the content of the
Result tab, by clicking .
● Select the breakpoint in the breakpoint check box and click in the
Breakpoints pane.
----End
When debugging is finished, the variable window will be minimized even if the variable
window is rearranged while debugging. If variable window is rearranged as a Terminal Tab
or Result Tab, on completion of debugging, the tab should be minimized manually. The
position of variable window is maintained after it is rearranged.
Step 1 Click the red button under Variables to disable System variables
----End
For the first time, parameter values are empty. Enter the value as required.
Click OK. The parameter values will be cached. Next time during the query
execution/debug same parameter values will be displayed.
Once the specific connection is removed, all the parameter values in cache are cleared.
If value is changed in the variable window, the same would reflect in the
monitor window if the variable is monitored and vice versa.
● Adding the variable by right click from the editor while debugging Function/
Procedure.
The Monitor window can be dragged anywhere in the Data Studio window.
Step 1 Check the Debug With Rollback box to enable the rollback feature during PL/SQL
debug
Or
Right click on SQL Terminal window where is PL/SQL function is executed.
Select Debug With Rollback option to enable rollback feature after debug is
finished.
Or
Right Click on any PL/SQL function under Functions/Procedure in Object Browser.
----End
A maximum of 100 PL/SQL Viewer tabs can be displayed at a time. If a new tab beyond
100 is opened, the tab of the calling function is closed. For example, if 100 tabs are already
opened and if one of the debug objects calls a new debug object (other than already
opened 100 tabs), then Data Studio will close the calling function, and open the new debug
object.
Step Into
To step through code one statement at a time, select Step Into from the Debug
menu, or press button, or press F7.
When stepping into a function, Data Studio executes the current statement and
then enters the break mode. The debug position will be indicated by an arrow
on the left ruler pane. If the executed statement calls another function, Data
Studio will step into that function. Once you have stepped through all the
statements in that function, Data Studio will jump back to the next statement of
the function it was called from.
To go into the next statement, press the Step Into (F7) button again. If you press
the Continue button, PL/SQL code execution will continue as normal.
For example:
In the following example, when you step into Line 10, you will move to line 'm :=
F3_TEST();', that is, Line 9 in f3_test(). You can step through all the statements in
f3_test() by stepping into each line by pressing the Step Into (F7) button
repeatedly. Once you have stepped through all the statements in that function,
Data Studio jumps to Line 10 in f2_test().
The currently debugging object is marked with symbol in the tab title with the
function name.
Step Over
Step over is the same as step into, except that when it reaches a call for another
function, it will not step into the function. The function will run, and you will be
brought to the next statement in the current function. F8 is the shortcut key for
step over. However, if there is a breakpoint set inside the called function, step over
will enter the function, and hit the set breakpoint.
In the below example, when you click Step Over in Line 10, Data Studio runs the
f3_test() function.
The cursor will be moved to the next statement in f2_test(), that is, Line 11 in
f2_test().
You can step over a function when you are familiar with the way the function
works and are sure that its execution will not affect the issue that you are
investigating.
Stepping over a line of code that does not contain a function call executes the line just like
stepping into the line.
Step Out
Stepping out of a sub-program continues execution of the function and then
suspends execution after the function returns to its calling function. You can step
out of a long function when you have determined that the rest of the function is
not significant to debug. However, if a breakpoint is set in the remaining part of
the function, then that breakpoint will be hit before returning to the calling
function.
Both stepping over and stepping out of a function will execute a function. The
shortcut key for the step out operation is Shift+F7.
Viewing Callstack
The Callstack pane displays the chain of functions as they are called. The
Callstack pane can be opened from the minimized window panel. The most recent
functions are listed on the top, and the least recent on the bottom. At the end of
each function name is the current line number in that function.
You can navigate among multiple functions through the Callstack pane by
double-clicking the function name in the Callstack pane.
For example, when f2_test() calls f3_test() at Line 10, the debug pointer will point
to the first valid executable line (which is Line 9, in the above example) in the
called function.
The content of the Callstack pane can be copied to the clipboard using Alt+J.
● Operating on Variables
● Viewing Results
Operating on Variables
The Variables pane is used to monitor information or evaluate values. The
Variables pane can be opened from the minimized window panel. Using this pane,
you can evaluate or modify variables or arguments in a PL/SQL function. As you
step through the code, the values of some local variables may change.
The content of the Variables pane can be copied to the clipboard using Alt+K.
You can double-click the corresponding row of the variable and manually change
variable values during run-time.
Click the Variable, Datatype, or Value column in the Variables pane to sort the
values.
For example, to change the value of the percentage variable from 5 to 15, double-
click the corresponding row in the Variable pane. The Set Variable Value dialog
box will open, which prompts you to input the variable value. Provide the variable
value and click OK.
To set NULL as the variable value, do not enter any value in text box.
● In the Variables pane, the parameter value will be displayed as NULL, if the input to the
parameter value is string literal 'NULL'.
● When the value is set to a variable using Data Studio, then the value of the variable is
same as the value returned by the statement "select expression" executed from gsql.
Setting/Displaying Description
Variables
Viewing Results
The Result tab displays the output for the PL/SQL debugging session, with the
corresponding function/procedure name at the top of the tab. The Result tab will
appear automatically, only if there is a result for the executed PL/SQL program.
You can copy the content of the Result tab, by clicking . Refer to 6.15.10
Working with the SQL Terminals for more information.
● The tool tip in the Result tab displays maximum of 10 lines, where each line contains
maximum of 80 characters.
● If the result of the executed query is NULL, it will be displayed as <NULL>.
● Tab characters (ASCII 009) in table data will not be displayed in the Results/View Table
Data/Properties window. Tab characters will be included correctly when copying/
exporting the data. Tool tip will also display the tab characters correctly.
Step 1 Press Ctrl+Space and enter the required parent DB object name. The DB objects
list is refined as you continue typing the DB object name. The DB objects list
displays all DB objects of the database connected to the SQL Terminal.
Step 2 To select the parent DB object, use the Up or Down arrow keys and press Enter
on the keyboard, or double-click the parent DB object. To select the child DB
object, use the Up or Down arrow keys and press Enter on the keyboard, or
double-click the child DB object.
Step 3 Enter . (period) to list all child DB objects.
Step 4 To select the child DB object, use the Up or Down arrow keys and press Enter on
the keyboard, or double-click the child DB object.
On selection, the child DB object will be appended to the parent DB object (with a
period '.').
● Auto-suggest also works on keywords, data types, schema names, table names, views,
and table name aliases in the same way as shown above for all schema objects that you
have access.
Following is a sample query with alias objects:
SELECT
table_alias.<auto-suggest>
FROM test.t1 AS table_alias
WHERE
table_alias.<auto-suggest> = 5
GROUP BY table_alias.<auto-suggest>
HAVING table_alias.<auto-suggest> = 5
ORDER BY table alias.<auto-suggest>
● Child objects of table alias will be displayed on pressing dot (.) after alias. The DB
objects list will not be refined as you continue typing DB object name. To refine DB
object name user has to press CTRL+SPACE or key configured in preference for Auto-
suggest.
● Auto-suggest may show "Loading" in Terminal for following scenarios:
– The object is not loaded due to the value mentioned in the Load Limit field. Refer
to 6.2.2 Adding a Connection for more information.
– The object is not loaded since it is added in the Exclude list option.
– There is a delay in fetching the object from the server.
● If there are objects with the same name in different case, then auto-suggest will display
child objects of both parent objects.
Example:
If there are two schemas with the name public and PUBLIC, then all child objects for
both these schemas will be displayed.
● Auto suggest for table alias is not supported in PL/SQL editor.
Step 5 Auto suggest popup should be displayed on minimum characters typed by user.
The DB objects list is refined as you continue typing the DB object name.
Minimum character configuration is provided in Preference--> Editor--> Auto
Suggest. Default value set is 2 characters. On typing 2nd character matching,
character list will be displayed. Refer Auto Suggest.
----End
Step 1 In the Object Browser pane, right-click the selected function/procedure and select
Export DDL.
Step 3 In the Save As dialog box, select the location to save the DDL and click Save. The
status bar displays the progress of the operation.
● To cancel the export operation, double-click the status to open the Progress View tab
and click .
● The exported file name will not be the same as function/procedure name, if the
function/procedure name contains characters which are not supported by Windows.
● Microsoft Visual C runtime file (msvcrt100.dll) is required to complete this operation.
Refer to Troubleshooting section for more information.
● Multiple objects can be selected to export DDL. Refer to Batch Export section for list of
objects not supported for export DDL operation.
The Export message and status bar displays the status of the completed
operation.
GBK Yes
LATIN1 Yes
UTF-8 Yes
LATIN1 No
GBK No
UTF-8 Yes
----End
----End
Follow the steps below to view functions/procedures or SQL functions:
Step 1 Press Ctrl and point to the procedure/function name or SQL function name.
Step 2 Click the highlighted function/procedure name or SQL function name. The
function/procedure or SQL function is displayed in a new PL/SQL Viewer tab
based on your selection.
----End
Follow the steps below to View Object DDL:
Step 1 Press Ctrl and point to the View Object DDL name.
Step 2 Click the highlighted View Object DDL name. The View Object DDL is displayed in
a new tab based on your selection.
----End
Step 1 In the Object Browser pane, right-click the selected function/procedure object and
select Drop Object.
Step 2 To drop objects in batches, right-click two or more selected function/procedure
objects and choose Drop Objects.
Step 3 In the confirmation dialog box, click Yes to complete the operation successfully.
The status bar displays the status of the completed operation.
----End
You can right-click the function/procedure in the Object Browser to perform the
following operations:
● Refresh the program to get the latest program from the server
● Execute the function/procedure or SQL function
● Debug the PL/SQL function
● Drop the debug object
Result tab contains IN and INOUT parameter along with OUT parameter.
All parameter details contain Name, Data Type, Parameter Type and Value. OUT
parameter row is displayed in grey color to differentiate from IN and INOUT
paramete.The following figure uses GaussDB A as an exampler.
If the result is cursor type then Data Studio displays 3 dots […]. Double click on 3
dots displays the result in new popup.
Step 1 Double-click and open the PL/SQL program or SQL function. Each debug object
will open in a new tab. You can open a maximum of 100 tabs in Data Studio.
Step 2 Click in the toolbar, or choose Run > Execute DB Object from the main menu,
or right-click the program name in the Object Browser and select Execute.
Alternatively, you can right-click in the PL/SQL Viewer tab and select Execute.
Step 3 The Execute Function/Procedure dialog box is displayed prompting for your
input.
If there is no input parameter, then the Execute Function/Procedure dialog box will not
appear. Instead, the PL/SQL program will execute and the result (if any) will be displayed in
the Result tab.
Step 4 Provide your input for the function/procedure in the Execute PL/pgSQL dialog box
and click OK.
To set NULL as the parameter value, enter NULL or null.
● If you do not provide a value that starts with a single quote, then a single
quote (') will be added by Data Studio before and after the value and
typecasting is done.
● If you provide a value that starts with a single quote, an additional single
quote will not be added by Data Studio, but data type typecasting is done.
For example:
For supported data types, the execution queries are as follows:
select func('1'::INTEGER);
select func('1'::FLOAT);
select func('xyz'::VARCHAR);
● If quotes are already provided, you need to take care of escaping the quotes.
For example:
If the input value is ab'c, then you need to enter ab''c.
The PL/SQL program is executed in the SQL Terminal tab and the result is
displayed in the Result tab. You can copy the contents of the Result tab by
clicking . Refer to 6.15.10 Working with the SQL Terminals for more
information on toolbar options.
Refer to Execute SQL Queries section for information on reconnect option in case
connection is lost during execution.
----End
----End
6.6.1 Overview
This section describes how to work with tables effectively.
● You need to fill all the mandatory parameters that are marked with asterisk (*) to
complete the operation successfully.
● Constraints creation, renaming and dropping can be supported for regular table and
partition table.
● Automatically refresh updates object browser after creating, altering and deleting table
(Regular/Partition). Auto refresh is applicable for view creation and rename the created
view also. This feature is applicable for GaussDB T also.
6.6.2.1 Overview
This section describes the steps to create a Regular table.
Tables are logical structures maintained by the database manager. Tables are
made up of columns and rows. You can define tables as part of your data
definitions in the data perspective. Before you can define a table, you must first
have a database and a schema defined. This section shows you how to create new
table using Data Studio.
Follow the steps to define a table in your database:
Step 1 In the Object Browser pane, right-click Regular Tables, and select Create
Regular Table.
Step 2 Provide basic table information such as table name, tablespace, table type and so
on. For more details, refer to Providing General Information. To create a
tablespace, refer to Working with Tablespaces.
Step 3 Define column related information such as column name, data type schema, data
type, and column constraints. For more details, refer to Defining Columns.
Step 4 Select the data distribution information for the table. For more details, refer to
Selecting Data Distribution.
Step 5 Define the column constraints for different constraint types such as primary key,
unique, and check. For more details, refer to Defining Table Constraints.
Step 6 Define the index information for the table such as index name, access method,
tablespace and so on. For more details, refer to Defining Indexes.
In SQL Preview tab, you can view the SQL query automatically generated for the
inputs provided. For more details, refer to SQL Preview.
----End
Step 1 Enter the table name in the Table Name field. It specifies the name of the table
to be created.
Select Case check box to retain the capitalization of the text entered in Table Name field.
For example, if the table name entered is "Employee", then the table name is created as
"Employee".
The schema name under which the table is created is displayed in the Schema
drop-down.
Step 3 Select the tablespace from Tablespace drop-down. It specifies the name of the
tablespace in which the new table is to be created. If not provided, the default
tablespace of the table's schema will be used.
Step 4 Select the table type from Table Type drop-down. It specifies the type of the
table.
● Normal: If specified, the table is created as a normal table.
● Unlogged: If specified, the table is created as an unlogged table. Data written
to unlogged tables is not written to the write-ahead log, which makes it
considerably faster than ordinary tables. However, it is not crash-safe. An
unlogged table is automatically truncated after a crash or unclean shutdown.
The contents of an unlogged table are also not replicated to standby servers.
Any indexes created on an unlogged table are also automatically unlogged.
Step 6 Enter the description of the table in Description of Table box. It specifies a short
note on the table.
Step 7 After providing the general information about the table, click Next to define the
columns information for the table.
----End
Table below lists the supported fields for each Regular type tables:
Table Type
If Not Exists
With OIDS
Fill Factor
Defining Columns
A column defines a unit of information within a table's row. Each row is an entry
in the table. Each column is a category of information that applies to all rows.
When you add a table to a database, you can define the columns that compose it.
Columns determine the type of data that the table can hold.
After providing the general information about the table, click the Columns tab to
define the list of table columns. Each column contains name, data type, and other
optional properties.
You can perform the following operations on an existing column only for a
Regular table:
● Deleting a Column
● Editing a Column
● Moving a Column
Follow the steps below to define column(s) for the table:
Step 1 Enter the column name in Column Name field. It specifies the name of a column
to be created in the new table. This must be a unique name in the table.
Select Case check box to retain the capitalization of the text entered in Column Name
field. For example, if the column name entered is "Name", then the column name is created
as "Name".
Step 2 Select the Array Dimensions. It specifies the array dimensions for the column.
Example: If array dimension for a column is defined as integer [], then it will add
the column data as single dimension array.
The marks column in the above table was created as single dimension and
subject column as two dimensions.
Step 3 Select the data type of the column from Data Type drop-down. For example,
bigint for integer values.
For complex data types,
● Select the required schema from the Data type Schema drop-down list.
● Select the corresponding data type from the Data Type drop-down list. This
list displays the tables and views for the selected schema.
Step 4 Enter the precision/size value of the datatype entered in the Precision/Size field.
This option is available only if a data type can be defined with precision/size.
Step 5 Select the scale of the data type entered in the Scale field.
Step 6 Choose the following Column Constraints if required:
● NOT NULL - Specifies that this column is not allowed to contain null values.
● UNIQUE - Specifies that a column may contain only unique values.
● DEFAULT - Specifies the value that will be used for this column in case no
value is defined.
● CHECK - Specifies an expression producing a Boolean result which new or
updated rows must satisfy for an INSERT or UPDATE operation to succeed.
Step 7 To include comments for Column in Create Regular Table, add column
information in Description of Column (Max 5000 chars) text box and click Add
button. This is applicable for at Right click New Column dialog box in the object
browser and Table Properties Window for regular table.
Step 8 After you enter all information for new column, click Add. You can also delete a
column from a list or change the order of columns. After defining all columns,
click Next.
----End
Following Table lists the supported fields for each Regular type tables:
Array Dimensions
Not Null
Default
Unique
Check
Deleting a Column
Follow the steps to delete a column:
----End
Editing a Column
Follow the steps to edit a column:
Step 3 Edit the column details as required and click Update to save changes.
You must complete the edit operation and save the changes to continue with other
operations.
----End
Moving a Column
You can move a column to change the location of the column as required in the
table. To move a column, select the required column and click Up or Down.
Default
Hash
Replication
Primary Key
The primary key is the unique identity of a row and consists of one or more
columns.
Only one primary key can be specified for a table, either as a column constraint or
as a table constraint. The primary key constraint must name a set of columns that
is different from other sets of columns named by any unique constraint defined
for the same table.
Select the constraint type as PRIMARY KEY in the combo box and enter the
constraint name. Select the column from Available Columns list and click Add. If
you need a multi-column primary key, repeat this step for another column.
Optionally, you can select On Tablespace in which the index associated with a
PRIMARY KEY constraint will be created. If this parameter is not provided, the
index will be created in the same tablespace as the table.
Fillfactor for a table is a percentage between 10 and 100. The default value is 100
(complete packing). When a smaller fill factor is specified, INSERT operations will
pack table pages only up to the indicated percentage; the remaining space on
each page is reserved for updating rows on that page. This gives UPDATE
operation a chance to place the updated copy of a row on the same page as the
original, which is more efficient than placing it on a different page.
For a table whose entries are never updated, complete packing is the best choice,
but in heavily updated tables, smaller fill factors are appropriate. This parameter
cannot be set for TOAST tables.
INITIALLY DEFERRED: Select this check box to check the constraint at the set
default time.
You can remove a primary key from the list using the Delete button.
Mandatory parameters are marked with asterisk (*) in the corresponding field.
Unique
Select the constraint type as UNIQUE in the combo box and enter the constraint
name in the text box.
Select column in Available Columns list and click Add. If you need multi-column
unique, repeat this step for another column. After adding the first column, the
unique name is automatically filled from the table name. You can also change this
name.
Optionally, you can select Tablespace in which the index associated with a unique
constraint needs to be created. If this parameter is not provided, the index will be
created in the same tablespace as the table.
You can a remove unique from the list using Delete button.
Mandatory parameters are marked with asterisk (*) in the corresponding filed.
Check
Select the constraint type as CHECK in the combo box and enter the constraint
name in the text box.
When the INSERT or UPDATE operation is performed, and if the check expression
fails, then table data is not altered.
Then, click Add in Constraints group box. You can also remove a check from the
list using Delete button. Mandatory parameters are marked with asterisk (*) in
the corresponding field.
Table below lists the supported options for each Regular type tables:
Check
Unique
Primary Key
Defining Indexes
Creating indexes is optional. Indexes are primarily used to enhance database
performance. This operation constructs an index on the specified column(s) of the
specified table. Select the Unique Index check box to enable this option.
Choose the name of the index method from the Access Method list. The default
method is B-tree. Select the Tablespace in which the index must be created. If not
specified, the index is created in the default tablespace.
The Fillfactor for an index is a percentage that determines how full the index
method will try to pack index pages. For B-trees, leaf pages are filled to this
percentage during initial index build, and also when extending the index at the
right (adding new largest key values). If pages subsequently become completely
full, they will be split, leading to gradual degradation in the index's efficiency. B-
trees use a default fill factor of 90, but any integer value from 10 to 100 can be
selected. If the table is static, then a fill factor of 100 to minimize the index's
physical size. For heavily updated tables, an explain plan smaller fill factor is
better to minimize the need for page splits. Other index methods use fill factor in
different but roughly analogous ways; the default fill factor varies between
methods.
You can either enter a user-defined expression for the index or you can create the
index using the Available Columns list. Select the column in the Available
Columns list and click Add. If you need a multi-column index, repeat this step for
other columns.
After entering the required information for the new index, click Add.
You can also delete an index from the list using the Delete button. After defining
all indexes, click Next.
Table below lists the supported fields/options for each Regular type tables:
Unique Index
btree
gin
gist
hash
psort
spgist
Fill Factor
User Defined
Expression
Partial Index
SQL Preview
Data Studio generates a DDL statement based on the inputs provided in Create
New table wizard.
You can only view, select, and copy the query. You cannot edit the query.
● To select all queries, press Ctrl+A or right-click and select Select All.
● To copy the selected query, press Ctrl+C or right-click and select Copy.
Click Finish to create the table. On clicking the Finish button, the generated query
will be sent to the server. Any errors are displayed in the dialog box and status bar.
The Add New Column dialog box is displayed prompting you to add information
about the new column.
Step 2 Enter the details and click Add. You can view the added column in the
corresponding table.
Data Studio displays the status of the operation in the status bar.
----End
Rename Column
Follow the steps below to rename a column:
A Rename Column dialog box is displayed prompting you to provide the new
name.
Step 2 Enter the name and click OK. Data Studio displays the status of the operation in
the status bar.
----End
Step 1 Right-click the selected column and select Toggle Not Null.
A Toggle Not Null Property dialog box is displayed prompting you to set or reset
the Not Null option.
Step 2 In the confirmation dialog box, click OK to complete the operation successfully.
Data Studio displays the status of the operation in the status bar.
----End
Drop Column
Follow the steps below to drop the column:
Step 1 Right-click the selected column and select Drop Column. This operation deletes
the column from the table.
A Drop Column dialog box is displayed.
Step 2 Click OK to complete the operation successfully. Data Studio displays the status of
the operation in the status bar.
----End
Step 1 Right-click the selected column and select Set Column Default Value.
A dialog box with the current default value (if it is set) and prompting you to
provide the default value is displayed.
Step 2 Enter the value and click OK. Data Studio displays the status of the operation in
the status bar.
----End
Step 1 Right-click the selected column and select Change Data Type.
Change Data Type dialog box is displayed.
The existing data type will show as Unknown while modifying complex data types.
Step 2 Select the Data type Schema and Data Type. If the Precision/Size spin box is
enabled, enter the required details and click OK. Data Studio displays the status of
the operation in the status bar.
----End
Creating a Constraint
Follow the steps below to add a new constraint to the existing table:
Step 1 Right-click the selected constraint of the table and select Create constraint.
An Add New Constraint dialog box is displayed prompting you to add
information about the new constraint.
Step 2 Enter the Constraint Name, Check Expression, and click Add. You can view the
added constraint in the corresponding table.
Data Studio displays the status of the operation in the status bar.
The status bar will show the name of the constraint if it has been provided in the
Constraint Name field, else the constraint name will not be displayed as it is created by
database server.
----End
Renaming a Constraint
Follow the steps below to rename a constraint:
----End
Dropping a Constraint
Follow the steps below to drop the constraint:
----End
----End
Renaming an Index
Follow the steps below to rename an index:
----End
----End
Step 1 Right-click the selected index and select Change Fill Factor.
A Change Fill Factor dialog box is displayed prompting you to select the fill factor
details.
Step 2 Select the fill factor and click OK. Data Studio displays the status of the operation
in the status bar.
----End
Dropping an Index
Follow the steps below to drop an index:
Step 1 Right-click the selected index and select Drop Index. Data Studio prompts you to
confirm this operation.
The Drop Index dialog box is displayed.
Step 2 Click OK to complete the operation successfully. Data Studio displays the status of
the operation in the status bar. This operation deletes the index from the table.
When the last index of a table is dropped and if the table properties are checked, then Has
Index may reflect the value "TRUE", though the table has no index. This value is updated to
"FALSE" when a vacuum operation on the table is performed.
----End
Procedure
Step 1 Go to Object Browser > Regular Tables.
Step 2 Right click the Regular Tables.
View ER Diagram Context Menu is displayed.
View Style
Show Icons - Column Names and Icons are displayed by default.
Show Data Types - Display Data types and Precision / Size of the column.
Show Nullability - Display the Nullability of column values.
Show Comments - Display the table comments and column comments if exists.
Show Fully qualified names - Display the table name along with the owner
name.
Show Attributes
All - All attributes are displayed by default.
Any Keys - Display the Primary Key and Foreign Key attributes.
Primary key - Display the Primary Key of the entity.
None - Display only the table name. No other attributes are displayed.
● ToolBar: The toolbar displays various attributes which are used in ER Diagram
of table. To know about View Style and Show Attribute, right click and select
as follows:
Following Icon indicates the Primary Key and Foreign Key in ER Diagram.
When selecting single table also, it shows the table and its associated linked tables.
----End
Step 1 To view the newly created foreign table, right-click and select Refresh either at
database, schema and foreign table group level.
● GDS Foreign table is denoted with icon before the table name.
● HDFS Foreign table is denoted with icon before the table name.
● HDFS Foreign table with partition is denoted with icon before the table name.
----End
6.6.4.1 Overview
Partitioning refers to splitting what is logically one large table into smaller
physical pieces based on specific schemes. The table based on the logic is called a
partition table, and a physical piece is called a partition. Data is stored on these
smaller physical pieces, namely, partitions, instead of the larger logical partition
table.
Follow the steps below to define a table in your database:
Step 1 In the Object Browser pane, right-click Regular Tables, and select Create
Partition Table.
Step 2 Provide basic table information such as table name, tablespace, table type and so
on. For more details, refer to Providing General Information.
Step 3 Define column related information such as column name, data type schema, data
type, and column constraints. For more details, refer to Defining Columns.
Step 4 Select the data distribution information for the table. For more details, refer to
Selecting Data Distribution.
Step 5 Define the column constraints for different constraint types such as primary key,
unique, and check. For more details, refer to Defining Table Constraints.
Step 6 Define the index information for the table such as index name, access method,
tablespace and so on. For more details, refer to Defining Indexes.
Step 7 Define the partition information for the table such as partition name, partition
column, partition value and so on. For more details, refer to Defining Partitions.
In SQL Preview tab, you can view the SQL query automatically generated for the
inputs provided. For more details, refer to SQL Preview.
Step 8 To include comments for Column in Create Partition Table, add column
information in Description of Column (Max 5000 chars) text box and click Add
button.
----End
Step 2 Enter the ORC version number in the ORC Version field. This is applicable only for
HDFS Partition table.
Step 3 After providing the general information about the table, click Next to define the
columns information for the table.
Following Table lists the supported fields for each Partition type tables:
Table Type
If Not Exists
With OIDS
Fill Factor
----End
Defining Columns
Refer to Defining Columns to define column(s) for the table.
Following Table lists the supported fields for each Partition type tables:
Array Dimensions
Not Null
Default
Unique
Check
SQL Preview
Refer to SQL Preview
Editing a Partition
Follow the steps below to edit a partition:
You must complete the edit operation and save the changes to continue with other
operations
----End
Deleting a Partition
Follow the steps below to delete a partition:
----End
Defining Partitions
Table below lists the supported fields/options for each Partition type tables:
Partition Name
Partition Value
Step 1 If Row or Column is selected as Table Orientation in the General tab, then By
Range is displayed in the Partition Type section. If ORC is selected as Table
Orientation in the General tab, then By Value is displayed in the Partition Type
section.
Step 2 Select the column based on which partition needs be defined from the Available
● If Table Orientation is selected as Row or Column, then only one column can be
selected for partition.
● If Table Orientation is selected as ORC, then maximum of four columns can be
selected for partition.
● A maximum of 4 columns can be selected to define partition.
Partition Name, Partition Value, Tablespace and Partitions section are disabled for ORC
Partition tables.
Step 6 After you enter all information for partition, click Add.
Step 7 After defining all partitions, click Next.
----End
You can perform the following operations on an existing partition for Row or
Column Partition table. Below operations are not applicable for ORC Partition
table:
● Deleting a Partition
● Editing a Partition
Defining Indexes
Refer to Defining Indexes to define table indexes.
Unique Index
btree
gin
gist
hash
psort
spgist
Fill Factor
User Defined
Expression
Partial Index
Check
Unique
Primary Key
Default
Hash
Replication
Rename a Partition
Follow the steps below to rename a partition:
----End
Drop a Partition
Follow the steps below to drop a partition:
----End
Step 2 Select the objects to grant/revoke privilege from Object Selection tab and click
Next.
Step 3 Select the role from Role drop-down in Privilege Selection tab.
Step 4 Select Grant/Revoke in Privilege Selection tab.
Step 5 Select/unselect the required privileges in Privilege Selection tab.
In SQL Preview tab, you can view the SQL query automatically generated for the
inputs provided.
Step 6 Click Finish.
----End
6.6.6.1 Overview
This section describes how to manage tables effectively.
● You need to fill all the mandatory parameters, that are marked with asterisk (*) to
complete the operation successfully.
● Refresh is the only operation supported for foreign table.
After creating the table, you can perform operations on the existing table. Right-
click the selected table and select the required operation.
Context Menu
Additional options for table operations are available in the table context menu.
The context menu options available for table operations are:
View Table Data Opens the table data information. Refer to 6.6.7.7
Viewing Table Data
Edit Table Data Opens the edit table data window. Refer to 6.6.7.8
Editing Table Data
Option Description
Set table Description Sets the table description for the table. Refer to
6.6.6.7 Setting the Table Description
Set Tablespace Sets the tablespace for the table. Refer to 6.6.6.8
Setting the Tablespace
Set Schema Sets the schema for the table. Refer to 6.6.6.9 Setting
the Schema
Export Table Data Exports the table data. Refer to 6.6.7.4 Exporting
Table Data
Import Table Data Imports the table data. Refer to 6.6.7.6 Importing
Table Data
Show DDL Shows the DDL of the table. Refer to 6.6.7.5 Showing
DDL
Export DDL and Data Exports the DDL and data of the table. Refer to
6.6.7.3 Exporting Table DDL and Data
Step 2 Enter the table name and click OK. You can view the updated table name in the
Object Browser.
Data Studio displays the status of the operation in the status bar.
----End
Step 1 Right-click the selected table and select Truncate Table. This operation deletes
the data from an existing table.
Step 2 In the confirmation dialog box, click OK to complete the operation successfully.
A popup message and status bar displays the status of the completed operation.
----End
----End
----End
----End
Step 1 Right-click the selected table and select Set Table Description.
An Update Table Description dialog box is displayed. It prompts you to provide
the table description.
Step 2 Enter the description and click OK.
The status bar displays the status of the completed operation.
Step 3 To view the table description, right-click selected the table and select Properties.
----End
● This operation will not be successful if you do not have the required access.
● This operation is not available for Partition table.
----End
Step 2 Select the schema name from the drop-down list and click OK. The selected table
will be moved to the new schema.
The status bar displays the status of the completed operation.
----End
----End
Refer to 6.6.7.8 Editing Table Data section for more information on edit, save,
cancel, copy, paste, refresh operations.
NOTICE
When viewing table data, Data Studio automatically adjusts the column widths for
table view. Users can resize the columns as needed. If the text contents of a cell
exceeds the total available display area, then resizing the cell column may cause
DS to become unresponsive.
----End
----End
----End
6.6.7.1 Overview
This section describes how to manage table data.
Step 1 In the Object Browser pane, right-click the selected table and select Export DDL.
The Export DDL and Data dialog box is displayed.
Step 2 Click OK.
The Save As dialog box is displayed.
Step 3 In the Save As dialog box, select the location to save the DDL and click Save. The
status bar displays the progress of the operation.
● To cancel the export operation, double-click the status to open the Progress View tab
and click .
● The exported file name will not be the same as table name, if the table name contains
characters which are not supported by Windows.
● Microsoft Visual C runtime file (msvcrt100.dll) is required to complete this operation.
Refer to Troubleshooting section for more information.
The Export message and status bar displays the status of the completed
operation.
GBK Yes
LATIN1 Yes
UTF-8 Yes
LATIN1 No
GBK No
UTF-8 Yes
Multiple objects can be selected to export DDL on regular and partition tables. Refer to
Batch Export section for list of objects not supported for export DDL operation.
----End
Step 1 In the Object Browser pane, right-click the selected table and select Export DDL
and Data.
Step 3 In the Save As dialog box, select the location to save the DDL and click Save. The
status bar displays the progress of the operation.
● To cancel the export operation, double-click the status to open the Progress View tab
and click .
● The exported file name will not be the same as table name, if the table name contains
characters which are not supported by Windows.
● Microsoft Visual C runtime file (msvcrt100.dll) is required to complete this operation.
Refer to Troubleshooting section for more information.
The Export message and status bar displays the status of the completed
operation.
GBK Yes
LATIN1 Yes
UTF-8 Yes
LATIN1 No
GBK No
UTF-8 Yes
Multiple objects can be selected to export DDL and data on regular and partition tables. It
exports columns, rows, indexes, constraints, and partitions. Refer to Batch Export section
for list of objects not supported for export DDL and Data operation.
----End
Step 1 Right-click the selected table and select Export Table Data.
The Export Table Data dialog box is displayed with the following options:
● Format - Table data can be exported either as excel (xlsx/xls), CSV, Text or
binary format. By default Excel (xlsx) is selected.
● Include Header - This option is available for CSV and Text files. If selected, it
will include the column headers. By default, this option is selected when
exporting to CSV or Text file, although it is not a mandatory field. This field
will be disabled for excel (xlsx/xls) and binary format.
● Quotes - Use this option to define the quote character. You should enter only
single byte character for this field. Quote character should not be same as
delimiter. For CSV and Text format, by default this field is enabled, although it
is not a mandatory field. This field will be disabled for excel (xlsx/xls) and
binary format.
– If table data value has delimiter in their values, then it will use the
character mentioned in this field.
– If the Quote character is present in value, then that character will be
escaped with same quoted character.
– If result value has multiline values, then it will be quoted with quoted
character.
● Escape - Use this option to define the escape value. You should enter only
single byte character for this field. Escape value should not be same as quote
character. For CSV and Text format, by default this field is enabled, although it
is not a mandatory field. This field will be disabled for excel (xlsx/xls) and
binary format.
● Replace NULL with - Use this option to replace null value in the table with
string. New line or carriage return characters are non-acceptable values for
this field. Maximum of 100 characters can only be entered in this field. This
field value must be different from delimiter and quote values. For CSV and
Text format, by default this field is enabled, although it is not a mandatory
field. This field will be disabled for excel (xlsx/xls) and binary format.
● Encoding - The Encoding field will be pre-populated with the encoding
selection made in Preferences > Session Setting tab. This is not a mandatory
field.
Database and Data Studio encoding should be compatible with file encoding
to export proper data. Refer Table11-1 Supported combinations of file
encoding used in the Database and Data Studio and Table 11-2
Compatible Encoding Formats.
● Delimiter - Use this option to define delimiter. You can select the available
delimiter or mention customized delimiter in the Other field in the Delimiter
section. For CSV and Text format "," will be the default delimiter. Maximum of
10 bytes can only be entered in the Other field. For CSV and Text format, by
default this field is enabled, although it is not a mandatory field. This field
will be disabled for excel (xlsx/xls) and binary format. It is mandatory to enter
a value when Other field is selected.
● All Columns - Use this option to quick select all columns. By default this is
checked. To manually select columns, uncheck this and select columns from
the Available Columns list.
– Available Columns - You can use this column to select specific columns
to export.
– Selected Columns - This field displays the selected columns that will be
exported. The columns can be re-ordered. By default all columns display
in this field.
Refer to Column/Row Size in FAQ section for row and column size supported by xlsx
and xls.
● Output Path - Use this option to select the location to save the exported file.
The Output Path field is auto-populated with the selected path.
● Security Disclaimer - The security disclaimer is mentioned in this section, and
you should read and agree, to continue with the export operation.
– I Agree - By default this field is selected. You cannot proceed further if
this field is not checked.
– Do not show again - You can select this field to hide the Security
Disclaimer for subsequent export table data operation for current logged
instance of Data Studio.
● String, double, date, calendar, and boolean datatype will be stored as is in excel. All
other datatypes will be converted into string and stored in excel.
● For excel export if the cell size is beyond 32767, then exported cell data will be
truncated.
Step 3 Click Save to save the exported data in the selected format. The status bar
displays the progress of the operation.
The Data Exported Successfully dialog box and status bar displays the status of
the completed operation.
● If the disk is full while exporting the table, then Data Studio displays an I/O error.
Perform the following operations to resolve this error:
1. Click OK to close the connection profile.
2. Clean the disk.
3. Re-establish the connection and export the table data.
● The exported file name will not be the same as table name, if the table name contains
characters which are not supported by Windows.
● GaussDB T table data can be exported to only as excel (xlsx/xls).
----End
Step 1 Double-click the status bar to open the Progress View tab.
----End
● A new terminal is opened each time the Show DDL operation is executed.
● Microsoft Visual C runtime file (msvcrt100.dll) is required to complete this operation.
Refer to Troubleshooting section for more information.
GBK Yes
LATIN1 Yes
UTF-8 Yes
LATIN1 No
GBK No
UTF-8 Yes
----End
● You should know the export properties of the file that you are importing like
delimiter, quote, and escape character and so on. Export properties saved
during export operation cannot be changed while importing the file.
Follow the steps below to import table data:
Step 1 Right-click the selected table and select Import Table Data.
Data Studio displays the Import Table Data dialog box with the following options:
● Import Data File - This field displays the file path of the imported file. Use
the Browse button to select different file.
● Format - Table data can be imported as CSV, Text or binary format. By default
CSV is selected.
● Include Header - Use this option if the import file has column header. For
CSV and Text format, by default this field is selected, although it is not a
mandatory field. This field will be disabled for binary format.
● Quotes - You should enter only single byte character for this field. Quote
character should not be same as delimiter and null parameter. For CSV and
Text format, by default this field is selected, although it is not a mandatory
field. This field will be disabled for binary format.
● Escape - You should enter only single byte character for this field. If escape
value is same as quote value, then escape value will be replaced with '\0'. For
CSV and Text format, by default this field is selected with value as double
quotation mark, althougha it is not a mandatory field. This field will be
disabled for binary format.
● Replace with Null - You can use this field to replace null value in the table
with string. The same null string used while exporting should be used while
importing data and this need to be explicitly mentioned. For CSV and Text
format, by default this field is selected, although it is not a mandatory field.
This field will be disabled for binary format.
● Encoding - The Encoding field will be pre-populated with the encoding
selection made in Preferences > Session Setting tab. This is not a mandatory
field.
Database and Data Studio encoding should be compatible with file encoding
to import proper data. Refer Table 11-1Supported combinations of file
encoding used in the Database and Data Studio and Table11-2
Compatible Encoding Formats.
● Delimiter - You can select the available delimiter or mention customized
delimiter in the Other field in the Delimiter section. For CSV and Text format
"," will be the default delimiter. This field value should not be same as Quote
and Replace Null with field values. For CSV and Text format, by default this
field is selected, although it is not a mandatory field. This field will be
disabled for binary format. It is mandatory to enter a value when Other field
is selected.
● All Columns - Use this option to quick select all columns. By default this field
is selected. To manually select columns, uncheck this and unselect columns
from the Selected Columns list.
– Available Columns - You can use this column to select specific columns
to import.
– Selected Columns - This field displays the selected columns that will be
imported. By default all columns display in this field.
Step 2 Click the Browse button from the Import Data File field.
Step 3 In the Open dialog box, select the file to import and click Open.
The status bar displays the progress of the operation. The imported data is
appended to the existing table data.
The Data Imported Successfully dialog box and status bar displays the status of
the completed operation.
----End
Step 1 Double-click the status bar to open the Progress View tab.
The Messages tab and status bar displays the status of the canceled operation.
----End
Step 1 Right-click the selected table and select View Table Data.
The View Table Data tab is displayed where you can view the table data
information.
Advanced Copy Click the icon to copy content from result window
to clipboard. Results can be copied to include the
row number and/or column header. Refer to View
Query Results to set this preference. Shortcut key
- Ctrl+Shift+C.
Clear Search Click the icon to clear the search text entered in the
Text search field.
Refer to Execute SQL Queries section for column reordering and sort option.
NOTICE
– When viewing table data, Data Studio automatically adjusts the column
widths for an optimal table view. Users can resize the columns as needed.
If the text contents of a cell exceeds the total available display area, then
resizing the cell column may cause DS to become unresponsive.
– When the data in a table cell is more than 1000 characters, it will appear
trimmed up to 1000 characters with "..." at the end.
▪ If the user copies the data from a cell in a table or Result tab and
pastes it on any editor (such as SQL terminal/PLSQL source editor,
notepad or any other external editor application), the entire data is
pasted.
▪ If the user copies the data from a cell in a table or Result tab and
pastes it on an editable cell (same or different), the cell shows only
the first 1000 characters with "..." in the end.
▪ When the table/Result tab data is exported, the exported file contains
the whole data.
● Select part of cell content and press Ctrl+C or click to copy selected text from a cell.
● The size of the column is determined by the maximum content length column.
● You can save preference to define:
– Number of records to be fetched.
– Column width
– Copy option from result set.
Refer to Query Results for more information.
----End
BLOB
Editor's Data tab shows content in the form of Hex. If content is image, it is shown
in Image Tab. Text Tab displays content's corresponding ASCII Text.
Step 1 To input data into cell for the blob data type, double click the cell.
The Editor window is opened.
Step 2 Input data by opening a file through the button provided or by manual entering.
For manual entry, you can only enter hex values [a-fA-F0-9]. Other keys are
restricted in editor.
If the entered input has odd length, then a 0 would be added at end as per the
behavior.
Step 3 Once a file is opened, its corresponding hex is displayed in Data Tab, if that data is
any of type image, it is displayed in Image Tab, and the hex data's corresponding
ASCII string is displayed in Text tab.
The data is displayed in uppercase hex format.
Step 4 Once the data is entered, the cell is displayed with a watermark [BLOB] since the
data can be huge to view.
Data
Image
Text
All actions such as copy, export will be able to copy, export the watermark [BLOB]
as column data for BLOB Data type columns.
If a data of the type image is corrupted, either image may not be shown or tampered.
----End
Bytea
For bytea type, earlier mentioned information from BLOB data type remains same
except for the Data Tab. The information about Data tab for bytea type is as
follows:
● The display of data has "\x" prepended to the hex string, to know that the
format is hexadecimal and in lower case.
● When you enter the data manually, then there are two scenarios:
– Data can be entered without "\x" at start. This can be a normal ASCII
string input. Once OK is pressed, it is converted to hexadecimal first. This
can see by viewing the dialog again. There is no key restriction.
– Data entered with "\x" at start is considered as a hexadecimal. Hence,
there will be key restriction [a-fA-F0-9]. Also, the length of input
followed by "\x" cannot be odd. If it is odd, then the corresponding
message is displayed.
● If content is of the type other than image, data is shown but image tab displays
are not supported.
● The content size cannot exceed 4 MB. If so, then preview will not be available.
● When you click Export All, any format other than Excel have bytes instead of
watermark.
Step 1 Right-click the selected table and select Edit Table Data.
Refer to 6.6.7.7 Viewing Table Data section for description on copy and search
toolbar options.
----End
Data Studio validates only the following data types entered into cells:
Bigint, bit, boolean, char, date, decimal, double, float, integer, numeric, real,
smallint, time, time with time zone, time stamp, time stamp with time zone,
tinyint, and varchar.
Any related errors during this operation reported by database will be displayed in
Data Studio. Time with time zone and timestamp with time zone columns are
non-editable columns.
You can perform the following operations in the Edit Table Data tab:
● Insert
● Delete
● Update
● Copy
● Paste
Insert
Follow the steps to insert a row:
Step 2 Double-click the cell to modify and enter the required details in the row.
The Edit Table Data tab status bar shows the Query Submit Time, Number of
rows fetched, Execution time and Status of the operation.
NOTICE
Data Studio updates rows identified by the unique key. If a unique key is not
identified for a table and there are identical rows, then an update operation made
on one of the rows will affect all identical rows. Refresh the Edit Table Data tab
to view the updated rows.
● Changes to cells in a row that are not saved are highlighted in green. Once saved the
color resets to default color.
● Unsaved records are highlighted in red. The number of successful and failed records are
displayed in the status bar of the Edit Table Data tab.
● Clicking Save either saves all the valid changes or does not save anything if there are
invalid changes. Refer to Edit Table Data to set the behavior of save operation.
Step 4 Click to roll back the changes that are not saved.
----End
Data Studio allows you to edit the distribution key column only for a new row.
Delete
Follow the steps to delete a row:
– Deleted rows that are not saved are highlighted in red. Once saved the color resets
to default color.
– Unsaved records are highlighted in red. The number of successful and failed
records are displayed in the status bar of the Edit Table Data tab.
– Clicking Save either saves all the valid changes or does not save anything if there
are invalid changes. Refer to Edit Table Data to set the behavior of save operation.
Step 5 Click to roll back the changes that are not saved.
----End
Update
Follow the steps to update cell data:
– Changes to cells in a row that are not saved is highlighted in green. Once the
record is saved the color resets to default color.
– Unsaved records are highlighted in red. The number of successful and failed
records are displayed in the status bar of the Edit Table Data tab.
– Clicking Save either saves all the valid changes or does not save anything if there
are invalid changes. Refer to Edit Table Data to set the behavior of save operation.
Step 4 Click to roll back the changes that are not saved.
----End
During edit operation, Data Studio does not allow you to edit the distribution key
column as it is used by the DB to locate data in the database cluster.
Copy
You can copy data from the Edit Table Data tab.
Follow the steps below to copy data:
● Data can be copied to include the row number and/or column header. Refer to Query
Results to set this preference.
● Select part of cell content and press Ctrl+C or click to copy selected text from a cell.
----End
Paste
You can copy data from a CSV file and paste it into cells in the Edit Table Data
tab to insert and update records. If you paste onto existing cell data, the data is
overwritten with the new data from the CSV file.
Follow the steps below to paste data into a cell:
Select Remember the selection for this window option to hide the unique
definition window from displaying while continuing with the edit table data
– The number of copied cells from CSV must match the number of cells selected in
the Edit Table Data tab to paste the data.
– Use the to roll back the changes that are not saved.
– Changes to cells in a row that are not saved is highlighted in green. Once saved
the color resets to default color.
– Failed unsaved records are highlighted in red. The number of successful and failed
records are displayed in the status bar of the Edit Table Data tab.
– Clicking Save either saves all the valid changes or does not save anything if there
are invalid changes. Refer to Edit Table Data to set the behavior of save operation.
----End
During paste operation, Data Studio does not allow you to edit the distribution
key column as it is used by the DB to locate data in the database cluster.
Empty cells are shown as [NULL]. Empty cell in Edit Table Data tab can be searched using
the Null Values search drop-down.
Refer to Execute SQL Queries section for information on show/hide search bar,
sort, column reorder, and encoding options.
NOTICE
Ensure that connection reuse is enabled when you use the SQL Terminal to edit
temporary tables. Refer to 6.15.12 Managing SQL Terminal Connections for
information about enabling SQL Terminal Connection reuse.
The Result tab displays the results of the SQL query along with the query
statement executed.
Step 2 Edit the temporary table from the Result tab. Refer to the Execute SQL Queries
section for information on editing the resultset.
----End
6.7 Tables(GaussDB T)
6.7.1 Overview
This section describes how to work with tables effectively.
Tables are logical structures maintained by the database manager. Tables are
made up of columns and rows. You can define tables as part of your data
definitions in the data perspective. Before you can define a table, you must first
have a database and a schema defined. This section shows you how to create new
table using Data Studio.
Step 1 Right click Regular Tables on Object browser. Following menu is displayed:
----End
Tab Description
General Following are the behaviors of the buttons for this tab:
NOTE
Following are the editable fields of this tab: Table Name, Description,
PctFree.
Columns Following are the behaviors of the buttons for this tab:
NOTE
Following are the editable fields of this tab: Name, Data type, Is
Nullable, Default, Is Default Expression and Comments.
Index Following are the behaviors of the buttons for this tab
Tab Description
NOTE
This tab does not support modification of the existing fields.
Distributio This tab does not support addition and edition of fields.
n
Keys Following are the behaviors of the buttons for this tab.
NOTE
Following are the editable fields of this tab: -Enabled, Validated. Only for
Foreign Key and OLTP.
Checks Following are the behaviors of the buttons for this tab
Tab Description
NOTE
Following are the editable fields of this tab - Enabled, Validated.
Partition Following are the behaviors of the buttons for this tab
NOTE
This tab does not support the addition and edition of existing fields.
----End
● Canceling an ongoing task for alter queries is not supported from Terminal/Edit table
properties in cluster environment.
● In a cluster environment, if you cancel the ongoing task for multiple create table queries
and in that case, if it throws an error message displaying:
errMsg="current operation canceled"sql=create table <table
name><columns>distribute by<function>
There may be a possibility that the table is created in a few nodes of the same cluster.
So, performing operations on the table may throw an error as above.
In this case, it is recommended to drop the table and create the table again to proceed
further.
Property Description
----End
Procedure
Step 1 To display trigger, go to Object browser > Regular Table > Expand Table >
Triggers.
Step 2 To create trigger, right click on Triggers and select Create Trigger.
The options are loaded by current owner. The default value is selected for trigger
group's table.
Step 7 Uncheck Statement Level indicates the trigger is for each row.
Step 8 Click OK to open a new SQL terminal to show trigger creation DDL according to
user input.
----End
6.8 Sequences
Step 1 In the Object Browser pane, right-click Sequences under the particular schema
where you want to create the sequence and select Create Sequence.
Select Case check box to retain the capitalization of the text entered in Sequence
Name field. For example, if the sequence name entered is "Employee", then the
sequence name is created as "Employee".
2. Enter minimum value in Minimum Value field.
3. Enter the increase step value in Increment By field.
4. Enter maximum value in Maximum Value field.
In SQL Preview tab, you can view the SQL query automatically generated for the inputs
provided.
----End
Step 2 Select the objects to grant/revoke privilege from Object Selection tab and click
Next.
Step 3 Select the role from Role drop-down in Privilege Selection tab.
In SQL Preview tab, you can view the SQL query automatically generated for the
inputs provided.
----End
● Grant/Revoke Privilege
● Dropping a Sequence
● Dropping a Sequence Cascade
Dropping a Sequence
Individual or batch drop can be performed on sequences. Refer to 6.16.2
Dropping Batch of Objects section for batch drop.
----End
Step 1 Right-click the selected sequence and select Drop Sequence Cascade.
----End
Grant/Revoke Privilege
Follow the steps to grant/revoke privilege:
----End
Prerequisites
Synonyms must be displayed under all schemas.
Procedure
GaussDB T
Step 1 Right click on the Synonyms item popup to create synonym menu.
----End
GaussDB A
Procedure
Step 1 Right click on the Synonyms item popup to create synonym menu.
Step 2 Select Create Synonym.
2. Owner PUBLIC
Ctrl+C Copy
- Refresh
Ctrl+H Show/Hide
Ctrl+ S Search
----End
Procedure
Step 1 View the packages under each schema.
Double click on the Package or Package body to view the package source or right
click in the Package/Package Body Object Browser and select View Source to Open
the Package Source in the SQL Terminal.
Step 2 To create package, right click on the packages item popup to create package
menu.
Select the Create Package generate package template in the new SQL Terminal
as follows:
Step 3 To refresh packages, right click on the Packages item popup refresh packages
menu. Refresh fetches all the Package Objects from the server and display in the
view.
Step 4 To drop package, right click on the any package item popup drop package menu.
Drop package is available only on the Package, not applicable for Package Body
(Option disabled for Package Body).
Batch drop of packages supported.
Batch drop will not be allowed if package body is already selected.
----End
GaussDB A
Parameter Definition
Parameter Definition
----End
----End
Gauss T:
Gauss A:
----End
Step 1 Right click on jobs and select Drop to remove a job from the job queue.
Step 3 On success, the following message is displayed in Drop Job dialog box.
----End
----End
Step 1 Right click on job id and select View Job to view the job.
Gauss T:
Gauss A:
----End
To edit an existing job, follow the steps:
Step 1 Right click on job id and select edit job option for editing the job.
GaussDB T
GaussDB A
If you click Restore button, then all initial values will be restored in Edit job.
----End
6.12 Views
The status bar will not display message on completion of this operation.
----End
----End
Step 3 In the Save As dialog box, select the location to save the DDL and click Save. The
status bar displays the progress of the operation.
● To cancel the export operation, double-click the status to open the Progress View tab
and click .
● The exported file name will not be the same as view name, if the view name contains
characters which are not supported by Windows.
● Multiple objects can be selected to export the view DDL. Refer to Batch Export section
for list of objects not supported for export view DDL operation.
The Export message and status bar displays the status of the completed
operation.
GBK Yes
LATIN1 Yes
UTF-8 Yes
LATIN1 No
GBK No
UTF-8 Yes
----End
Dropping a View
Individual or batch drop can be performed on views. Refer to 6.16.2 Dropping
Batch of Objects section for batch drop.
Follow the steps below to drop the view:
----End
Step 1 Right-click the selected view and select Drop View Cascade.
The Drop View dialog box is displayed.
Step 2 Click Yes to drop the view and its dependent database objects.
The status bar displays the status of the completed operation.
----End
Renaming a View
Follow the steps below to rename the view:
----End
Step 2 Select the required schema from the drop-down list and click OK.
The status bar displays the status of the completed operation.
If the required schema contains a view with the same name as the current view,
then Data Studio does not allow setting the schema for the view.
----End
----End
Step 1 Right-click the selected column name under the view and select Set View Column
Default Value.
A dialog box with the current default value (if it is set) is displayed which prompts
you to provide the default value.
Step 2 Enter the value and click OK.
Data Studio displays the status of the operation in the status bar.
----End
If the property of a View is modified that is already opened, then refresh and open the
properties of the View again to view the updated information on the same opened window.
----End
Grant/Revoke Privilege
Follow the steps below to grant/revoke privilege:
----End
show parameter/parameters
This command displays all parameters with their current values.
show parameter/parameters%
DESC
DESC keyword is used to find the information on the columns of a particular table.
DESCRIBE
6.13 Tablespaces
After creating a new tablespace, it will be available in the Create New table
wizard. For more information, refer to 6.6.2 Creating Regular Table.
Follow the steps below to create a tablespace for GaussDB A, and DWS database:
Step 1 Right-click Tablespaces and select Create Tablespace. The Create Tablespace
dialog box is displayed.
You need to fill all the mandatory parameters that are marked with asterisk (*) to complete
the operation successfully.
● Name: Enter the name of the tablespace. For example, New_Tablespace.
● Location: Enter the path to store the tablespace on the database. For
example, \home\user1\
One path is limited to only one tablespace. Access permissions to the path
must be set by the user.
● Unlimited Size: Select this check box to set unlimited maximum size of the
tablespace.
Once the Unlimited Size field is checked, the Max Size field becomes non-editable.
● Max Size: Enter the maximum size of the tablespace. The supported range is
1 KB - 9,007,199,254,740,991 KB. The only acceptable value in this field is
positive whole number.
● Select an option from the Max Size drop-down list. The options available are:
– KB: Specifies the Max Size in kilobytes.
– MB: Specifies the Max Size in megabytes.
– GB: Specifies the Max Size in gigabytes.
– TB: Specifies the Max Size in terabytes.
– PB: Specifies the Max Size in petabytes.
● File System: Select the type of file system.
– Select General to create the tabular type of tablespace.
– Select HDFS to create the Hadoop Distributed File System (HDFS) type of
tablespace.
● Address: Enter the NameNode IP address (IPv4) of the HDFS cluster and port
number of the active and standby nodes.
For example, xx.xx.xx.xx:xxxx
● HDFS Configuration File Path: Enter the path of the HDFS cluster
configuration file. This is a mandatory field for HDFS file system.
● HDFS Data Store Path: Enter the HDFS data storage path. This is a
mandatory field for HDFS file system.
● Sequential Page Cost: Sets the optimizer's estimated cost of a disk page
fetch that is part of a series of sequential fetches. Enter the sequential read
page overhead. The supported range is 0 - 1.79769e+308 (double byte). The
default value is 1 which is also the recommended value. The acceptable
values are either positive whole number or positive decimals with one decimal
point.
● Random Page Cost: Sets the optimizer's estimated cost of a non-
sequentially-fetched disk page. Enter the random read page overhead. The
supported range is 0 - 1.79769e+308 (double byte). The default value is 4
which is also the recommended value. The acceptable values are either
positive whole number or positive decimals with one decimal point.
NOTICE
Although the server allows to set the value of Random Page Cost to less
than that of Sequential Page Cost, it is not physically sensitive to do so.
However, setting them equal makes sense if the database is entirely cached in
RAM, because in that case there is no penalty for fetching pages out of
sequence. Also, in a heavily-cached database you must lower both values
relative to the CPU parameters, since the cost of fetching a page already in
RAM is much smaller than it would normally be.
If the server does not support HDFS file system, then Address, HDFS Configuration File
Path, and HDFS Data Store Path, fields becomes non-editable.
Step 3 Click OK. You can view the new tablespace in the Object Browser.+
The status bar displays the status of the completed operation.
When OK is clicked, the Run in Background option is enabled. This option helps in
continuing with other operations on the database while the tablespace is being created in
the background. Once the tablespace is created a pop-up message is displayed with success
or failure notification. Alternatively clicking or pressing Esc runs the tablespace
creation operation in background.
----End
Follow the steps below to create a new tablespace for GaussDB T database:
Step 1 Right-click Tablespaces and select Create Tablespace. The Create Tablespace tab
box is displayed.
Step 2 Enter the following information in General tab:
● Tablespace Name: Enter the name of the tablespace. For example,
New_Tablespace.
Step 3 Enter the following information in Data File tab.
● File Name: Enter the path of the new data file in the operating system and
the file name of the new data file. If the file name is a relative path, then the
file is saved in the data directory by default.
● File Size: Enter the size of the data file.
● Autoextend: true/false. By default, this parameter is set to false.
Autoextend - true
– You can manually specify the size of each extension.
– You can set the following attributes:
cannot be greater than 8TB. If the upper limit and Autoextend Size
is specified, then the specified upper limit cannot be lesser than the
value in Autoextend Size and File Size.
Autoextend - false
If this field is set to false, then the system does not automatically extend the
value.
----End
Step 2 Add the required fields. Refer to 6.13.1 Creating a Tablespace section for
different field definition.
----End
Renaming a Tablespace
Follow the steps below to rename a tablespace for GaussDB A and DWS database:
Step 2 Enter the new name for the tablespace and click OK.
----End
Follow the steps below to rename a tablespace for GaussDB T database:
----End
----End
Step 1 Right-click the selected tablespace and select Set Tablespace Option.
The Set Tablespace Option dialog box is displayed.
Step 2 Enter the Random Page Cost and Sequential Page Cost and click OK.
The status bar displays the status of the completed operation.
----End
Step 1 Right-click the selected tablespace and select Set Tablespace MaxSize.
The Set Tablespace Maxsize dialog box is displayed.
Step 2 To set an unlimited value for the maximum size of the tablespace, select the
Unlimited Size check box.
To set a custom value for the maximum size of the tablespace, enter the
maximum size of the tablespace in the Max Size text box. The supported range is
----End
Dropping a Tablespace
Follow the steps below to drop the tablespace for GaussDB A, DWS database:
----End
Step 2 Select the data file to be dropped and click to delete a row.
----End
The tablespace DDL is displayed in a new SQL Terminal tab with the terminal
name format as 'tablespacename@servername'. You must refresh the Object
Browser to view the latest DDL.
----End
Step 2 Modify the required fields. Refer to 6.13.1 Creating a Tablespace section for
different field definition.
----End
6.14 Users/Roles
Users and roles have similar concepts in databases. In practice, you are advised to
use a role to manage permissions rather than to access databases.
Users - They are set of database users. These users are different from operating
system users. These users can assign privileges to other users to access database
objects.
Role - This can be considered as a user or group based on the usage. Roles are at
cluster level, and hence applicable to all databases in the cluster.
6.14.1.1 GaussDB A
The following description refers to the OLAP database.
Adding User/Role
Follow the steps below to create user/role:
Step 1 Right-click Users/Roles and select Create User/Role. The Create User/Role dialog
box is displayed.
Step 2 Provide basic table information such as name, password, and privileges. For more
details, refer to Providing General Information.
Step 3 Define advanced information such as connect limit, validity, resource pool, role,
and administrator group. For more details, refer to Defining Advanced Option
In SQL Preview tab, you can view the SQL query automatically generated for the
inputs provided. For more details, refer to SQL Preview.
----End
Step 1 Enter the user/role name in the Name field. It specifies the name of the user/role
to be created.
Step 2 Enter password for user/role in Password field.
Step 3 Reconfirm the password in Re-enter Password field.
Step 4 Select the privileges to set for user/role from Privileges section.
Step 5 Click Next to define the advanced columns information for user/role.
----End
Step 1 Input the number of concurrent connections the role can make in the Connection
Limit field.
Set the connection to -1 for the unlimited connections.
Step 2 Select a date and time when the role's password becomes valid Start Date field. If
this field is not filled, then the password will be valid all time.
Step 3 Select a date and time after which the role's password is no longer valid. If this
field is not filled, then the password will be valid all time.
Step 4 Select the resource pool from Resource Pool drop-down.
Step 5 Select the role group from Role Group drop-down.
Step 6 Select the administrator group from Administrator Group drop-down.
Step 7 Click Next.
----End
SQL Preview
Data Studio generates a DDL statement based on the inputs provided in Create
User/Role wizard.
You can only view, select, and copy the query. You cannot edit the query.
● To select all queries, press Ctrl+A or right-click and select Select All.
● To copy the selected query, press Ctrl+C or right-click and select Copy.
Click Finish to create the user/role. On clicking the Finish button, the generated
query will be sent to the server. Any errors are displayed in the dialog box and
status bar.
6.14.1.2 GaussDB T
Follow the steps to add user in OLTP database:
Adding User
Step 1 Right click on the users.
Step 2 Click on Create User.
Step 3 Create User dialog box will appear. Provide the name of the user, password and
tablespace information. Refer to Providing General Information.
Provide System Privilege information. Refer to Providing System Privilege
Information.
Provide Role Privilege. Refer to Providing Role Privilege Information.
View the SQL query automatically generated for the inputs provided. Refer to
Reviewing SQL Preview.
----End
Step 1 Enter the user name in the Name field. It specifies the name of the user to be
created.
Step 2 Enter password for user in Password field.
Step 3 Reconfirm the password in Re-enter Password field.
Step 4 Select the default tablespace.
Step 5 Select the temporary tablespace.
----End
----End
----End
● To select all queries, press Ctrl+A or right-click and select Select All.
● To copy the selected query, press Ctrl+C or right-click and select Copy.
Adding Role
Follow the steps to add role in OLTP database:
Step 3 Create Role dialog box will appear. Provide the name of the role, password. Refer
to Providing General Information.
View the SQL query automatically generated for the inputs provided. Refer to
Reviewing SQL Preview.
----End
● Dropping a User/Role
● Viewing/Editing User/Role Properties
● Viewing the User/Role DDL
Dropping a User/Role
Follow the steps to drop a user/role:
----End
Data Studio displays the properties (General, Privilege, and Membership) of the
selected user/role in different tabs.
Refer to 6.6.7.8 Editing Table Data section for information on edit, save, cancel,
copy, and refresh operations.
----End
----End
Step 1 In the Object Browser pane, right-click the selected database and select Open
Terminal or click on the toolbar or Ctrl+T shortcut key to open new SQL
terminal.
The new SQL Terminal tab is displayed.
----End
● Data Studio supports a maximum of 100 SQL terminals and tabs in total. Each SQL
Terminal will have multiple Result and one Messages tab based on the number of
times a query is executed. If the connection with the database is lost, then the
corresponding SQL Terminals are not disabled.
● Restoring individual SQL Terminal or tabs is not possible. The restore operation restores
the complete set of minimized SQL Terminals and tabs.
● Data Studio resets the numbering counter of SQL Terminal after all terminals are closed.
● Data Studio resets the numbering counter of Resultset after all the tabs are closed.
● Data Studio resets the numbering counter for show DDL Tablespace, show DDL Users/
Roles, Batch Drop tab, Result tab and Execution Plan tab.
Errors and warnings are displayed which do not have accompanying results in the
status bar. Results of successful executions are displayed in the Result tab.
Follow the steps to open a new SQL Terminal on a different connection profile:
Step 1 On the toolbar, select the required connection from the connection profile drop-
down list.
Step 2 In the Object Browser pane, right-click the selected database in the connection
profile and select Open Terminal or click on the toolbar. The new SQL
Terminal tab is displayed.
----End
Managing Right Click Option On Result Window, Edit Table Data,View Table
Data, View Data
This feature allows to copy, export cell data to excel files and generate SQL files of
queries as well.
Right click on the result window after the result of the SQL query is shown. Right
Click Menu is displayed as follows:
Follow the steps for including row number and column header in Result Set:
Step 4 Under Result Advanced Copy option check Include column header and Include
row number boxes.
----End
Generated SQLs are not valid for result sets derived from queries with JOINs, Expressions,
Views, Set operators, Aggregate functions, GROUP By clause and column aliases.
----End
● Selecting multiple cell data and searching may show some incorrect results in text mode
as all the information is copied in plain text to the search window.
● In case of Chinese data, width alignment may not be correct due to difference in
character width as compared to English.
● The Cancel button now has been removed from the toolbar.
● Execution Progress Bar is also shown in compiling/debugging of function/procedures in
PL/SQL editor .
● The time format shown in the progress bar will be as: w hrs x min y sec z ms.
● For batch execution in SQL Terminal, the progress bar is shown with total elapsed time
on completion.
This Static Check analysis is available for both Gauss A & T Grammer.
All the Rules are configured in rules.json with the following structure:
{
"name": "SelectShouldNotPresentStar",
"disable": false,
"dbtype": [
"GaussA",
"GaussT"
],
"priority": "LOW",
"type": "BEST_PRACTICE"
}
You can right click under SQL terminal to obtain Static Code Check.
Rules Defined:
Compliant Solution:
SELECT *
FROM my_table
WHERE NOT EXISTS (SELECT 1 FROM another_table WHERE nullable_column = my_table.my_column)
SELECT *
FROM my_table
WHERE my_column NOT IN (SELECT nullable_column FROM another_table WHERE nullable_column
IS NOT NULL)
An INSERT statement that does not explicitly list the columns being inserted into,
as well as the values being inserted, is dependent for correct functioning on the
structure of the table not changing. Additionally, not having the explicit column
list degrades the readability and understandability of the code. Therefore, INSERT
statements should always contain an explicit column list.
Compliant Solution:
INSERT INTO PERSONS (ID, LAST_NAME, FIRST_NAME)
VALUES (1, 'DUPONT', 'Marcel')
When the value of a LIKE clause starts with '%', '[...]' or '_', indexes on the
searched column are ignored, and a full table scan is performed instead.
Even though the ORDER BY clause supports using column numbers, doing so
makes the code difficult to read and maintain. Therefore the use of column names
is preferred.
Compliant Solution:
SELECT FIRST_NAME, LAST_NAME, REGION
FROM PERSONS
ORDER BY LAST_NAME, FIRST_NAME
Compliant Solution
SELECT firstname, lastname
FROM persons
WHERE city = 'NEW YORK'
Compliant Solution:
SELECT *
FROM sys.[databases] AS [sd]
WHERE EXISTS (SELECT 1
FROM [sys].[master_files] AS [mf]
WHERE [mf].[database_id] = [sd].[database_id])
For that reason, comparison operators should never be used to make comparisons
with NULL; IS NULL and IS NOT NULL should be used instead.
Compliant Solution:
UPDATE books
SET title = 'unknown'
WHERE title IS NULL
This rule ignores operators + and *, and expressions: 1=1, 1<>1 and 1!=1.
11. Related statements and "WHEN" clauses in a "CASE" should not have the
same condition
A CASE statements is evaluated from top to bottom. At most, only one branch will
be executed: the first one with a condition that evaluates to true.
Therefore, duplicating a condition automatically leads to dead code. Usually, this is
due to a copy/paste error. At best, it's simply dead code and at worst, it is a bug
that is likely to induce further bugs as the code is maintained, and obviously it
could lead to unexpected behavior.
Compliant Solution:
SELECT
CASE col1
WHEN 1
THEN 'A'
WHEN 2
THEN 'B'
WHEN 3
THEN 'C'
ELSE 'D'
END
FROM table1
----End
The number of queries saved in the SQL History dialog box is based on the value
defined in Preferences > Editor > SQL History pane. Refer to the SQL History
section to modify the SQL History count. Data Studio overwrites the older queries
into the SQL history after the list is full. The executed query is automatically
stored in the list.
The SQL History dialog box has the following columns:
● Pin Status - Displays the pinned status of the queries. Pinned queries will
always show on the top and it will not be deleted from the history even when
the list is full.
● SQL Statement - Displays the SQL query. The number of characters for an
SQL query displayed in the SQL Statement column is based on the number
defined in Preferences > Editor > SQL History pane. Refer to the SQL
History section to modify the number of characters for a query.
● Number of Records - Displays the now of records fetched by the SQL query.
● Start Time - Displays the time the query execution was started.
● Execution Time - Displays the time taken to execute the query.
● Database Name - Displays the name of the database.
● Execution Status - Displays the execution status of the query as Success or
Failure.
Deleting the connection profile deletes the history. If the SQL History dialog box is
closed, the query is not removed from the list.
You can perform the following operations in the SQL History dialog box:
● Loading an SQL query into the SQL terminal
● Loading multiple SQL queries into the SQL terminal
● Deleting an SQL query
● Deleting all SQL queries
● Pinning an SQL query
----End
Step 2 Click .
The queries are appended to the cursor position in the SQL Terminal.
----End
If you continue the execution on error, then each statement in the terminal will be running
as a scheduled job and runs one after the other. The execution status is updated in the
console and job is listed in the progress bar. When the time difference between Job
Execution, Progress Bar Update and Console Update is very minimal, you will not be able to
open the progress bar and stop the execution. In such scenarios you have to close the SQL
Terminal to come out of execution.
----End
----End
Step 1 Click .
----End
The pinned queries appear on top once the SQL History window is closed and re-opened.
The Pin Status column displays the pinned status of the query.
----End
The Pin Status column displays the unpinned status of the query.
----End
Step 1 Choose File > Open from the main menu. Alternatively, click Open on the toolbar
or right-click the SQL Terminal and select Open.
If the SQL Terminal has existing content, then there will be an option to override
the existing content or append content to it.
Step 3 In Open dialog box, select the SQL file to import and click Open.
Icon is different. On mouse over the source file and corresponding database
connection will be displayed on File Terminal.
----End
● The encoding type of the SQL file must match the encoding type specified in
preferences.
● Label of the file terminal will start with * if any of its content is edited. Dirty flag is
removed once the file terminal is saved.
● File Terminals cannot be renamed, one terminal is always mapped to one Source Script
File, but one script can be opened in multiple terminals.
● You can open SQL scripts only on SQL Terminals.
Data Studio allows you to save and open SQL scripts in the SQL Terminal. After
saving the changes, SQL Terminal will be changed to a File Terminal.
Data Studio displays the status of the operation in the status bar.
● The script is saved as an SQL file. Data Studio sets the read/write permission for the
saved SQL file. To ensure security, you must set the read/write permissions for folders.
● When a change is made in a file and if that associated file is unavailable, it will trigger
Save As option.
– In any case, if saving of the source file is failed due to some reason, then user is
prompted with Save As option to save the content as a new source file. If you
choose not to save (that is cancel Save As), then File Terminal gets converted into
an SQL Terminal.
– The changes made to File Terminals are not Auto Saved.
----End
Step 3 Select the location to save the script and click Save.
----End
When there are unsaved changes in File Terminals, then user will be given an option to
save or cancel on graceful exit of data studio.
Step 2 Click the highlighted table name. The properties of the selected table is displayed.
----End
----End
Step 2 Click the highlighted view name. The properties of the selected view is displayed.
----End
Step 1 Click on close button of the application. Exit Application dialog box will appear.
Saving File Terminal dialog box appears.Unsaved dirty file terminal is displayed.
----End
Saving File Terminal dialog box will not appear in case of Force Exit.
Alternatively, you can choose Run > Cancel from the main menu or right-click in
the SQL Terminal and select Cancel, or from Progress View tab select Cancel.
----End
When you cancel the query, the execution stops at the currently executing SQL
statement.
Database changes made by the canceled query are rolled back and the queries
following the canceled query are not executed.
A query is not canceled and the Result tab shows the result when:
1. The server has finished execution of the query and is preparing the result.
2. The result of the executed query is being transferred from the server to the
Data Studio client.
A query cannot be canceled while viewing the query Execution Plan. For more
details, refer to 6.15.8 Viewing the Query Execution Plan and Cost.
PL/SQL Formatting
Follow the steps to format PL/SQL statements:
Alternatively, use the key combination Ctrl+Shift+F or choose Edit > Format from
the main menu.
----End
SQL Formatting
Data Studio supports formatting of simple SQL SELECT, INSERT, UPDATE, DELETE
statements which are syntactically correct. It also supports Create, Drop, Truncate.
Now, you are able to configure the rules in the preferences section for the
formatter. Also you can Export/Import the rules to/from Disk.
Refer the following configurations from Data Studio:
General
On the General tab page, you can modify the rules that apply to general aspects
of PL/SQL. All modifications are immediately visible in the Preview pane at the
bottom of the dialog, and most options are self-explanatory.
Control Structures
DML
Parameter Declaration
Tab character size The number of characters that a hard tab represents.
This is useful to correctly align comments that contain
hard tabs.
Item Lists These rules apply to all item lists that do not fall into the
categories of the other tab pages.
● On one line
● On one line if possible
● One item per line
● Fit
Empty Lines You can define that empty lines should be removed, and
that the beautifier will insert empty lines by its own
rules, or that groups of subsequent empty lines should
be merged into one empty line, or that all empty lines
are preserved.
The other tab pages contain rules that apply to specific aspects of PL/SQL code. These rules
are self-explanatory in the preview pane.
Step 1 Press Ctrl+Space and enter the required parent DB object name. The DB objects
list is refined as you continue typing the DB object name. The DB objects list
displays all DB objects of the database connected to the SQL Terminal.
Step 2 To select the parent DB object, use the Up or Down arrow keys and press Enter
on the keyboard, or double-click the parent DB object.
Step 4 To select the child DB object, use the Up or Down arrow keys and press Enter on
the keyboard, or double-click the child DB object.
On selection, the child DB object will be appended to the parent DB object (with a
period '.').
● Auto-suggest also works on keywords, data types, schema names, table names, views,
and table name aliases in the same way as shown above for all schema objects that you
have access.
Following is a sample query with alias objects:
SELECT
table_alias.<auto-suggest>
FROM test.t1 AS table_alias
WHERE
table_alias.<auto-suggest> = 5
GROUP BY table_alias.<auto-suggest>
HAVING table_alias.<auto-suggest> = 5
ORDER BY table alias.<auto-suggest>
● Auto-suggest may show "Loading" in Terminal for following scenarios:
– The object is not loaded due to the value mentioned in the Load Limit field. Refer
to 6.2.2 Adding a Connection for more information.
– The object is not loaded since it is added in the Exclude list option. Refer to 6.2.2
Adding a Connection for more information.
– There is a delay in fetching the object from the server.
● If there are objects with the same name in different case, then auto-suggest will display
child objects of both parent objects.
Example:
If there are two schemas with the name public and PUBLIC, then all child objects for
both these schemas will be displayed.
----End
Follow the steps below to view the plan and cost for a required SQL query:
Step 1 Enter the query or use an existing query in the SQL Terminal and click on the
SQL Terminal toolbar to view explain plan.
To view explain analyze, click the drop-down from , select Include Analyze,
and click .
The Execution Plan opens in tree view format as a new tab at the bottom by
default.The display mode has a tree shape and text style.
The data shown in tree explain plan and visual explain may vary, since the execution
parameters considered by both are not the same.
Following are the parameters selected for explain plan with/without analyze and
the columns displayed:
Aggregate
Group Aggregate
Function
Hash
Hash Join
Nested Loop
Modify Table
Partition Iterator
Row Adapter
Seq Scan on
Set Operator
Sort
Stream
Union
Unknown
Hover over the highlighted cells to identify the heaviest, costliest, and slowest
node. Cells will be highlighted only for tree view.
If multiple queries are selected, explain plan with/without analyze will be
displayed only for last query selected.
Each time execution plan is executed, the plan opens in a new tab.
If the connection is lost and the database is still connected in Object Browser, then
Connection Error dialog box is displayed:
● Yes - The connection is reestablished and retrieves explain plan and cost.
● No - Disconnects database in Object Browser.
Toolbar menu in the Execution Plan window:
Tree Format This icon is used view explain plan in tree format.
Text Format This icon is used view explain plan in text format.
Refer to Execute SQL Queries for information refresh, SQL preview, and search
bar.
Refresh operation re-executes the explain/analyze query and refreshes the plan in
the existing tab.
The result is displayed in the Messages tab.
On clicking the image of Export Execution Plan button, Data Studio should export
the whole data present in the Execution Plan tab. This option is available in both
Text and tree format of data.
----End
query and server performance. It helps to analyze the query path taken by the
database and identifies heaviest, costliest and slowest node.
The graphical execution plan shows how the table(s) referenced by the SQL
statement will be scanned (plain sequential scan and index scan).
The SQL statement execution cost is the estimate at how long it will take to run
the statement (measured in cost units that are arbitrary, but conventionally mean
disk page fetches).
You can open multiple result tabs when you run multiple queries for visual explain
plan. Initially it used to load the first tab depends upon selecting other tab, data
correspond to particular tab can render. Each tab contains the Visual Explain Plan
Diagram, reset button, corresponding query in the tool bar, properties (General
properties / Specific properties) correspond to particular query.
Costliest - Highest Self Cost plan node.
Heaviest - Maximum number of rows output by a plan node is considered
heaviest node.
Slowest - Highest execution time by a plan node.
Follow the steps to view the graphical representation of plan and cost for a
required SQL query:
Step 1 Enter the query or use an existing query in the SQL Terminal and click on the
SQL Terminal toolbar. Alternatively, press ALT+CTRL+X together.
Visual Plan Analysis window is displayed.
Refer to 6.15.8 Viewing the Query Execution Plan and Cost section for
information on reconnect option in case connection is lost while retrieving the
execution plan and cost.
● 6 - Plan Node - General tab - Provides the node information for each node.
Row Name Description
I/O Read Time (ms) Time taken for making any I/O read
operation for the node
I/O Write Time (ms) Time taken for making any I/O write
operation for the node
Based on the plan node type additional information may display. Few
examples:
● 7 - Plan Node - DN Details tab - Provides detailed data node information for
each node. DN Details are available only if data is being collected from data
node.
Refer to 6.6.7.7 Viewing Table Data section for description on copy and
search toolbar options.
----End
● Auto Commit
● Execute SQL Queries
● Backup Unsaved Queries/Functions/Procedures
● Locate Error
● Search in PL/SQL Viewer or SQL Terminal
● Go to Line in PL/SQL Viewer or SQL Terminal
● Comment/Uncomment
● Indent/Un-indent Lines
● Insert Space
● Execute Multiple Functions/Procedures or Queries
● Rename SQL Terminal
● SQL Assistant
● Using Templates
Auto Commit
Auto Commit option can be switched on or off based on the Preferences settings.
Refer Transaction section for further details on how to enable and disable Auto
Commit option.
● For OLAP, server will open a transaction for all the SQL statements. (For Example:
select statement, explain select statement, set parameter)
● For OLTP, Server will open transaction for only DML statements. (For Example:
INSERT statement, UPDATE statement, DELETE statement)
Reuse Connection
It enables the user to choose the same SQL terminal connection or new
connection for the result set. The choice affects the record visibility as per the
isolation levels defined in the database server.
● When Reuse Connection is ON, terminal connection will be used for data
manipulation and refresh of the result window.
For some data base temp tables that are created or used by the terminal can be
edited from the result window.
● When Reuse Connection is OFF, new connection will be used for data
manipulation and refresh of the result window.
For some database temp tables cannot be edited from the result window.
● Auto Commit ON- Reuse Connection is enabled and ON by default. You can switch it
OFF if needed.
● Auto Commit OFF- Reuse Connection is disabled and ON.
----End
Refer to Table 7-1 for more details about the behavior of Auto Commit and
Reuse Connection .
You can check the status bar to view the status of a query being executed.
The Result tab displays the results after executing the function/procedure(s) or
SQL queries along with the query statement executed.
If the connection is lost during execution and the database is still connected in
Object Browser, then Connection Error dialog box is displayed:
● Reconnect - The connection is reestablished.
● Reconnect and Execute - With Auto commit on, execution will continue from
failure statement. With Auto commit off, execution will continue from
position of cursor.
● Cancel - Disconnects database in Object Browser.
Failure to reconnect after three attempts will disconnect the database in
Object Browser. Connect to the database in Object Browser and retry
execution.
● For long running queries, result set can be edited only after the complete results are
fetched.
● Editing of query results are only allowed in following scenarios:
● Select is from a single table
● Either select all columns or subset of columns [No aliases, aggregate functions,
expressions on columns]
● All WHERE condition
● All ORDER BY clause
● On regular, partition, and temporary tables.
● Committing an empty row assigns Null to all columns.
● Only result set of queries executed on tables available in Object Browser is editable.
● Editing of query results is allowed only for queries executed in SQL Terminal.
The column width definition can be set using Settings > Preferences option. Refer
to Query Results to set this parameter.
Column Reorder
Column reordering can be performed by clicking and dragging the selected
column header to the desired position.
Multi-Column Sort
This feature allows users to sort table data of some pages by multiple columns. In
addition, you can set the priority of columns for sorting.
Step 2 Click Add Column. Choose the column you want to sort from the drop down.
----End
Data Type Read only text field Shows data type of the
column selected.
Except following data types, all the other data types will be sorted by their string value
(Alphabetical order):
TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, REAL, DOUBLE, NUMERIC, BIT, BOOLEAN,
DATE, TIME, TIME_WITH_TIMEZONE, TIMESTAMP, TIMESTAMP_WITH_TIMEZONE.
: Icons having three dots have the third and onwards priority.
Export all This icon is used to export all data either in excel
data (xlsx/xls), CSV, Text or Binary format. Refer to
6.6.7.4 Exporting Table Data.
NOTE
● Columns mentioned in the query is auto-populated
in the Selected Columns section with Available
Columns section empty.
● To export the query results, the query is re-
executed using a new connection. The exported
results may differ from the data in the results tab.
● Disabled for explain/analyze queries. To export
explain/analyze queries use the Export current
page data option.
Search This icon is used to search the result set based on the
criteria defined. Search text are case insensitive.
Clear Search This icon is used to clear the search text entered in
Text the search field.
Option Description
Close Others Closes all other result windows except for the active result
window.
Close All Closes all result windows including the active result window.
NOTICE
When viewing table data, Data Studio automatically adjusts the column
widths for a good table view. Users can resize the columns as needed. If the
text contents of a cell exceeds the total available display area, then resizing
the cell column may cause DS to become unresponsive.
● Each time a query is run in SQL Terminal tab, a new result window opens. To view
the results in the new window, you must select the newly opened window.
● Set the focusOnFirstResult configuration parameter to false to automatically set
focus to the newly opened Result window. Refer to 4.1 Installing and Configuring
Data Studio for details.
● Each row, column and selected cells can be copied from the result set.
● Export all data operation will be successful even after the connection is removed.
● If the content of the column have spaces between the words, then word wrap is
applied to fit the column within the display area. Word wrap is not applied if the
content does not have any spaces between the words.
● Select part of cell content and press Ctrl+C or click to copy selected text from
a cell.
● The size of the column is determined by the maximum content length column.
● You can save preference to define:
● Number of records to be fetched
● Column width
● Copy option from result set
Refer to Query Results for more information
● If any column of resultset tab has Lock Image icon in it, then values are not
editable.
Error Locator
During execution of query/function/procedure in case of an error the error locator
message is displayed.
Yes - Click Yes to continue with the execution.
No - Click No to stop the execution.
Select Do not show additional errors for this execution option to hide the error
message popup from displaying while continuing with the current execution.
Line number and position of error displays in Messages tab. The corresponding
line number is marked with icon along with red underline at the position of
the error in the Terminal/PL/SQL Viewer. Hovering over displays the error
message. Refer to 11 FAQs section to understand in certain scenarios why the line
number and error detail does not match.
Step 1 Choose Edit > Find and Replace from the main menu.
Alternatively press Ctrl+F.
Find and Replace dialog box is displayed.
Step 2 Enter the text to be searched in the Find what field, and click the Find Next
button.
Select Wrap around option to continue the search after reaching the last line in the SQL
queries or PL/SQL statements.
----End
----End
Comment/Uncomment
Comment/uncomment option is used to comment/uncomment lines or block of
lines.
Follow the steps below to comment/uncomment lines in PL/SQL Viewer or SQL
Terminal:
----End
Follow the steps below to comment/uncomment block of lines/content in PL/SQL
Viewer or SQL Terminal:
----End
Indent/Un-indent Lines
The indent/un-indent option is used to shift lines as per the indent size defined in
the Preferences tab.
Follow the steps to indent lines in PL/SQL Viewer or SQL Terminal:
----End
Follow the steps to un-indent lines in PL/SQL Viewer or SQL Terminal:
Only selected lines that have available tab space will be un-indent. For example, if multiple
lines are selected, and one of the selected line starts at position 1, then pressing Shift+Tab
will un-indent all the lines except for the one starting at position 1.
----End
Insert Space
The Insert Space option is used to replace a tab with spaces based on the indent
size defined in the Preferences tab.
Follow the steps to replace a tab with spaces in PL/SQL Viewer or SQL Terminal:
----End
Step 1 Enter multiple SQL queries in the SQL Terminal tab as follows:
Step 2 Click in the SQL Terminal tab, or press Ctrl+Enter, or choose Run > Compile/
Execute Statement from the main menu.
● If the queries are not selected for execution, then only the query in the line where cursor
is placed will be executed.
● If the cursor is placed next to an empty line, then the next available query statement
will be executed.
● If the cursor is placed at the last line which is blank, then no query will be executed.
● If a single query is written in multiples lines and the cursor is placed at any line of the
query, then that query is executed. Queries are separated using semicolon (;).
----End
Insert '/' in a new line after the function/procedure and click in the SQL
Terminal tab.
Follow the steps to execute PL/SQL statements and SQL queries on different
connections:
In the toolbar, select the required connection from the connection profiles drop-
down list and click in the SQL Terminal tab.
Step 1 In the SQL Terminal tab right-click and select Rename Terminal.
A Rename Terminal dialog box is displayed prompting you to provide the new
name for the Terminal.
Step 2 Enter the new name and select OK to rename the Terminal.
----End
SQL Assistant
The SQL Assistant tool provides suggestion or reference for the information
entered in the SQL Terminal and PL/SQL Viewer. Follow the steps to open SQL
Assistant:
When Data Studio is launched SQL Assistant panel displays with related syntax
topics. As you type a query in the SQL Terminal topics related to the query is
displayed. It also provides precautions, examples, syntax, function, and parameter
description. Select the text and use the right-click option to copy selected
information or copy and paste to SQL Terminal.
● You can enable/disable the SQL Assistant tool permanently. Refer to 7.3-SQL Assistant
to enable/disable this option.
● SQL Assistant icon ( ) from the toolbar can be used to open the SQL Assistant
window.
● This feature is available for:
● GaussDB A V100R002C70, GaussDB A V100R002C80, and GaussDB A 6.5.RC2
versions.
● GaussDB T V100R006C00, GaussDB T V300R001C00, V300R001C10,
GaussDB_100_1.0.0, GaussDB_100_1.0.1, and GaussDB_100_1.0.2 versions.
Other than the above mentioned versions, Data Studio will fetch the default SQL
Assistant.
Using Templates
Data Studio provides an option to insert frequently used SQL statements in the
SQL Terminal/PL/SQL Viewer using the Templates option. Some of the commonly
used SQL statements are saved for ease of use. You can create, modify existing
templates or remove templates. Refer to Adding/Modifying Templates section
for information on adding, removing, and creating new templates.
The following table lists the default templates:
Name Description
df delete from
is insert into
o order by
s* select from
sf select from
sl select
A text is selected and the shortcut key Displays entries that match the text
is used before the selection to the nearest
space or new line character.
No text selected and the shortcut key Displays entries that match the text
is used before the cursor to the nearest space
or new line character.
● Using the shortcut key without entering text in SQL Terminal/PL/SQL Viewer displays all
entries in the Templates.
● If the text entered in SQL Terminal/PL/SQL Viewer has only a single match, then it will
be replaced directly in the SQL Terminal/PL/SQL Viewer without listing them out.
● After you click Open SQL Assistant button, the SQL Assistant pane is displayed. If you
close the pane, it will be closed for all the terminals unless you click Open SQL
Assistant button again.
----End
Step 2 Click .
You can check the status bar to view the status of the result being exported.
Step 3 Click OK. Data Studio displays the status of the operation in the Messages tab.
If the disk is full while exporting the results, then Data Studio displays an error in the
Messages tab. Clean the disk, re-establish the connection and export the result data.
----End
The Messages tab shows the Execution Time, Total result records fetched, and
the path where the file is saved.
You can check the status bar to view the status of the page being exported.
Step 6 Click OK. Data Studio displays the status of the operation in the Messages tab.
If the disk is full while exporting the results, then Data Studio displays an error in the
Messages tab. Clean the disk, re-establish the connection and export the result data.
----End
Use new connection when there are multiple queries queued for execution in
existing connection as the queries are executed sequentially and there may be a
delay. Always reuse existing connection while working on temp tables. Refer to the
6.6.8 Editing Temporary Tables section to edit temp tables.
Refer to the FAQs section for the behavior of query execution with reuse and new
connection.
----End
6.16.1 Overview
You can view database objects to which you have access in Object Browser in the
tree format. For example, you can view the schema names within the selected
database and the corresponding table names within the selected schema.
The Object Browser displays only the objects that satisfy the following minimum
privilege type requirement for the current user.
Database Connect
Schema Usage
Table Select
Column Select
Sequences Usage
Function/Procedure Execute
Tablespace Create
It is not necessary that child objects of a parent object to which you have access
will be displayed in Object Browser. For example, if you have access to a table
but not have access to one of the columns in that table, then Object Browser
displays only the table with columns to which you have access. The columns which
you do not have access are not displayed. If access to an object is revoked when
an operation is being performed, then an error message is displayed stating that
you do not have access to perform the operation, and the object is removed from
Object Browser after refresh.
● Schemas
● Functions/Procedures
● Tables
● Sequences
● Views
● Columns, Constraints, and Indexes
● Tablespaces
All default created schemas except for public are grouped under Catalogs and
user schemas are grouped under Schemas below the respective database.
The Object Browser filter option opens a new tab, where you can enter search scope. After
providing text and press Enter to start search. For usability improvement, a search bar is
provided on the object browser component and on entering the object name of interest, the
tree (if expanded) shall display only the objects that match the filter criteria.
For the nodes that are not expanded the filter rules will be applied when the node is
expanded.
Step 1 Press Ctrl+left-click (select objects one by one) or Shift+left-click (select objects
in a bunch) to select the objects to be dropped.
Option Description
● Select part of cell content and press Ctrl+C or click to copy selected text from a cell.
● When you select multiple objects in object browser to drop, a batch drop window is
opened and its menu icons are enabled in the menu bar. If you disconnect the database,
the icons will remain disabled and will not be enabled even after reconnecting. You
need to reselect the objects to drop and the selected objects will be available in the new
terminal window.
----End
Batch grant/revoke is allowed only with the same object type within that schema.
Step 1 Press Ctrl+left-click (select objects one by one) or Shift+left-click (select objects
in a bunch) to select the objects to grant/revoke privileges.
Step 2 Right-click and select Grant/Revoke.
Grant/Revoke dialog box is displayed.
Step 3 Refer to 6.4.7 Grant/Revoke Privilege section to grant/revoke privilege.
----End
7.1 Overview
7.2 General
7.3 Editor
7.4 Security
7.5 Environment
7.6 Result Management
7.7 Export/Import
7.1 Overview
This section provides details on how to personalize Data Studio using preferences
settings.
7.2 General
This section provides details on how to personalize shortcut keys.
Step 4 Enter the required shortcut key in the Binding text box.
For example, to change the shortcut key for Step Into from F7 to F6, enter F6 in
the Binding text box.
Step 5 Click OK.
The Restart Data Studio dialog box is displayed.
Step 6 Click Yes to restart Data Studio. If any export, import or execution operations are
in progress, then the Restart Confirmation dialog box is displayed.
Step 7 Click OK to close running jobs and restart or click Cancel to abort restart
operation.
----End
Follow the steps below to remove the shortcut keys:
Step 5 Click Yes to restart Data Studio. If any export, import or execution operations are
in progress, then the Process Is Running dialog box is displayed.
Step 6 Click OK to wait for operations to complete or click Force Restart to discard
operations.
----End
Follow the steps below to restore the default shortcut keys:
Step 5 Click Yes to restart Data Studio. If any export, import or execution operations are
in progress, the Process Is Running dialog box displays.
Step 6 Click OK to wait for operations to complete or click Force Restart to discard
operations.
----End
Shortcut Keys
Data Studio supports keyboard short cut keys similar to other windows based
application. The following table lists some of the shortcut keys for effective usage
of the functionalities provided by Data Studio. To customize the shortcut keys,
refer to Setting the Shortcut Keys.
Redoing Ctrl+Y
Step Skip F8
Step into F7
Locate the last element in the Object Browser Alt+Page Down or Alt+End
Shearing Ctrl+X
Template Alt+Ctrl+Space
Pastes Ctrl+V
Execute Ctrl+E
After timeout, you can point over the following highlighted icon using computer mouse to
check which server is not filtered completely.
----End
7.3 Editor
This section provides details on how to personalize syntax coloring, SQL history
information, templates, and formatter.
Syntax Coloring
Follow the steps below to customize the SQL highlight color:
Step 3 Click the color button to customize the color for the type of syntax.
For example, click to customize the color for Strings. The color picker dialog
box is displayed.
Use the color picker to set the required color for a specific syntax category. You
can choose basic colors or define custom colors in the color picker.
Click Restore Defaults from Syntax Coloring pane to reset to default color scheme.
Step 4 Click OK. The Restart Data Studio dialog box is displayed.
Step 5 Click Yes to restart Data Studio. If any export, import or execution operations are
in progress, then Data Studio displays the Process is running dialog box.
Step 6 Click Force Restart to discard operations and restart Data Studio. Click OK to
continue performing operations.
The Preferences.prefs file contains the custom color settings. If the file is corrupted, Data
Studio will display the default values.
The custom color(s) will be set after you restart Data Studio.
----End
SQL History
You can customize Data Studio to set the number of SQL history count that can
be made available and also the number of characters for the query for each of the
query saved in SQL history.
Follow the steps to customize the number of executed queries and number of
characters in the query to be saved in SQL History:
Step 3 Set the number of queries to be saved in SQL History Count field.
Minimum value is 1 and maximum is 1000. The current value set for this preference will be
displayed.
Step 4 Set the number of characters to be allowed in each query that is saved in the SQL
History in the SQL Query Characters field.
Minimum value is 1 and maximum is 1000. Enter "0" in this field to set no character limit.
The current value set for this preference will be displayed.
● Click Restore Defaults from SQL History pane to reset to default value.
● The default value for SQL History Count is 50 and SQL Query Characters it is 1000.
● If the new value entered is lesser than the old value and if there is going to be a data
loss, then a message is displayed informing about the data loss and if you would like to
continue with the operation.
● If there are unsaved changes and you navigate away from this pane, then a message
displays to state that there are unsaved changes.
● Pinned queries are not affected by the changes made to the SQL History Count field.
Example: If the number of pinned queries is 50 and the SQL History Count is set to 25,
then SQL History will show 50 pinned queries.
● The SQL Query Characters changes affects only queries added post the configuration
change.
----End
Adding Templates
You can customize Data Studio to create new, edit existing, and remove templates.
Refer to the Using Templates section for detailed information on templates.
Restoring the settings to default removes all user defined templates from the list.
----End
Modifying Templates
Follow the steps below to edit templates:
----End
Removing Templates
Follow the steps below to remove templates:
Default templates that are removed can be added back using Restore Removed option. It
will restore the template to the last updated change. Restore Removed option is not
applicable to user defined templates.
----End
----End
Formatter
You can customize Data Studio to set the tab width and convert tab to spaces
while performing indent and unindent operation. Refer to Indent/Un-indent Lines
section to perform indent/unindent operation and replace tab with spaces.
Follow the steps to customize the indent size and convert tab to spaces:
Step 4 Enter the indent size in Indent Size. Based on the number specified in this field,
the indent/unindent/space length is defined.
----End
Transaction
Follow the steps to edit Transaction settings:
● Select Disable to switch off the auto commit feature. Commit and Rollback
button can be used manually for committing or reverting changes.
----End
Folding
Follow the steps for Folding:
● Enable: This indicates enable SQL folding feature. Supported SQL statements
can be folded or unfolded.
● Disable: This indicates disable SQL folding feature.
Modification in settings reflects in newly opened editor. The editor which is already
opened will remain with previous settings until restart.
----End
Static Check
Follow the steps for Static Check
----End
Font
Follow the steps for Font set up:
----End
Auto Suggest
Follow the steps for Auto Suggest:
2. Data types
3. Loaded Database Objects
----End
7.4 Security
This section provides details on how to personalize password and security
disclaimer display.
Yes Selecting this option enables you to view the "Permanently" save
password option from the Save Password drop-down in the
connection window.
Step 4 Click OK. The Restart Data Studio dialog box is displayed.
Step 5 Click Yes to restart Data Studio. If any export, import or execution operations are
in progress, then Data Studio displays the Process is running dialog box.
Step 6 Click Force Restart to discard operations and restart Data Studio. Click OK to
continue performing operations.
Click Restore Defaults from Password pane to reset to default values. The default value is
No.
----End
Password Expiry
This section provides details on how to continue/discontinue working with Data
Studio once password expires using the Password setting.
Follow the steps below to modify the behavior of Data Studio once password
expires:
Step 3 Select the required option. Refer table below to understand the customization
options available:
Option Outcome
Yes Selecting this option allows you to log in to Data Studio after the
password has expired.
NOTE
A message displays informing you that the password has expired and some
operations may not work as expected in the following scenarios:
● Establishing a new connection.
● Editing a connection.
● Connecting to a database while creating the database when no other
database is connected in that connection profile.
● Connecting to a database when no other database is connected in that
connection profile.
No Selecting this option will not allow you to login to Data Studio once
the password has expired. A message displays informing you that
the password has expired.
Step 4 Click OK. The Restart Data Studio dialog box is displayed.
Step 5 Click Yes to restart Data Studio. If any export, import or execution operations are
in progress, then Data Studio displays the Process is running dialog box.
Step 6 Click Force Restart to discard operations and restart Data Studio. Click OK to
continue performing operations.
----End
Security Disclaimer
You can enable/disable to display the security disclaimer for any unsecured
connection/file operations.
Follow the steps below to modify the display of security disclaimer:
Option Outcome
Enable Selecting this option displays the security disclaimer each time you try
to establish an unsecure connection or perform a file operation.
Disable Selecting this option will not display the security disclaimer while
establishing an unsecure connection or performing a file operation.
You need to agree to the security implications that may arise due to
unsecure connection.
Step 4 Click OK. The Restart Data Studio dialog box is displayed.
Step 5 Click Yes to restart Data Studio. If any export, import or execution operations are
in progress, then Data Studio displays the Process is running dialog box.
Step 6 Click Force Restart to discard operations and restart Data Studio. Click OK to
continue performing operations.
Click Restore Defaults from Security Disclaimer pane to reset to default values. The
default value is Enable.
----End
7.5 Environment
Session Setting
Follow the steps to set Data Studio and file encoding:
Data Studio supports only UTF-8 and GBK file encoding types.
Step 5 Click OK. The Restart Data Studio dialog box is displayed.
Step 6 Click Yes to restart Data Studio. If any export, import or execution operations are
in progress, then Data Studio displays the Process Is Running dialog box.
Step 7 Click Force Restart to discard operations and restart Data Studio. Click OK to
continue performing operations.
● Click Restore Defaults from Session Setting pane to reset to default values. The
default value for Data Studio Encoding and File Encoding is UTF-8.
● Only UTF-8 and GBK encoding is supported by GaussDB T database.
----End
SQL Assistant
Follow the steps to enable/disable SQL Assistant tool:
● Click Restore Defaults from Session Setting pane to reset to default value. The default
value for SQL Assistant is Enable.
● SQL Assistant is not supporting for Linux operating system.
----End
Query/Function/Procedure Backup
Refer to the Backup Unsaved Queries/Functions/Procedures section for
information on backup feature provided by Data Studio.
Follow the steps to enable/disable backup of unsaved data in SQL
Terminal/PL/SQL Viewer:
Click Restore Defaults from Session Setting pane to reset to default value. Backup of data
will be enabled by default with 5 minutes as the default time interval.
----End
Follow the steps to enable/disable data encryption of saved data:
Click Restore Defaults from Session Setting pane to reset to default value. Encryption will
be enabled by default.
----End
Follow the steps to set the size of Import Table Data Limit/Import File Data
Limit.
Import Table Data Limit value defines the maximum size of the table data to be
imported.
Import File Data Limit value defines the maximum size of the file to be imported.
Step 3 Click OK.
----End
Follow the steps to perform rendering
Step 3 Provide required number of objects in a batch, want to be rendered. Range is from
1000 to 100000. Default value is 10000.
If you provide any value which is less than 100 or more than 1000, then Invalid
Range, (1000 - 100000) error message is displayed.
Step 4 Click OK.
----End
Query Results
Set the number of records to be fetched in the query results:
Option Outcome
Fetch All records Selecting this option enables you to fetch all the
records in the query results.
Fetch custom number of Selecting this option enables you to set the number
records of records that needs to be fetched in the query
results.
NOTE
This column accepts value between 100 and 5000.
Click Restore Defaults from Query Results pane to reset to default values. The default
value is Fetch custom number of records (1000).
----End
Option Outcome
Content Length Selecting this option enables you to set the column
width based on the content length of the column.
Custom Length Selecting this option enables you to set the column
width based on the value entered in this field.
NOTE
This column accepts value between 100 and 500.
Click Restore Defaults from Query Results pane to reset to default values. The default
value is Content Length.
----End
Set preference to copy column name and row number from query results:
Option Outcome
Include column header Selecting this option enables you to copy column
headers from the query results.
Include row number Selecting this option enables you to copy the
selected content along with the row number from
the query results.
Click Restore Defaults from Query Results pane to reset to default values. The default
value is Include column header.
----End
You can enable/disable to display the data encoding type in edit, view, and query
results window.
Step 3 Select Include result data encoding to include the Encoding drop-down in edit,
view, and query results table.
● Click Restore Defaults from Result Management pane to reset to default values.
Include result data encoding will be unselected by default.
● Edit table, view table properties and query execution must be performed again to apply
the changes.
----End
You can enable/disable to display the data text mode in query results window.
Step 3 Select Include result data TextMode under Result Data Text Mode pane to
display text mode in query results.
----End
Option Outcome
Overwrite Resultset Current result set opened window/s are closed and
new result set window is opened.
You can configure Max Result Window count by providing the value in Max ResultSet.
Default value is 200 and range is from 100 to 300.
----End
Click Restore Defaults from Edit Table Data pane to reset to default values. The default
value is Save Valid Data.
----End
7.7 Export/Import
This section provides details on how to personalize export DDL operation.
Export DDL
You can set preference to include tablespace in DDL while exporting DDL using
the Export DDL setting.
Set include tablespace in DDL:
● Click Restore Defaults from Export DDL pane to reset to default values. The default
value is Include Tablespace in DDL.
● This feature is not supported by GaussDB T.
----End
Export Data
You can configure for whether to export data or not under Settings > Preference >
Export/Import > Export setting.
----End
Based on enable this option to allow Export Data check box, you can enable/disable
following export scenarios:
● Copy Data, Copy to Excel in resultset
● Export DDL and Data option in Schema
● Export DDL and Data option in Sequence
● Export DDL and Data, Export Table Data in Table
● Export all data, Export current page data in result tab
● Right click options (export and generate sql) in result tab
Export Timeout
Step 1 Choose Settings > Preferences from the main menu.
The Preferences dialog box is displayed.
Step 2 Choose Export/Import > Export >Export Timeout.
Default Timeout [86400 Sec] is selected by default.
Step 3 Select Custom Timeout and provide required value in Sec.
----End
----End
8 References
To improve performance load all objects rather than loading them based on user
privilege. Minimum Privileges Requirement table provides information on the
minimum access required for objects to be listed in Object Browser.
9 Troubleshooting
installed on the system causes this error. Update the JRE to version
1.8.0_141 or above with appropriate bit number.
– Java Incompatibility:
bit version installed on the system causes this error. Update the JRE
version to 1.8.0_141 or above with appropriate bit number.
It is recommended to run the batch file to check compatibility and launch
Data Studio. Refer to 5.1 Starting Data Studio for more information.
3. While running the StartDataStudio.bat file the following message
displays. What do I do?
Solution:
Message Solution
4. Why does Data Studio not connect to the server even with all valid
inputs?
Solution: Check whether the server is running in the specified IP and port.
Check for availability of the specified user by connecting through gsql.
5. What do I do for connection issues while using Data Studio?
Solution: A connection issue that may occur while using Data Studio is
explained with an example:
Establish a database connection.
Run the query.
Only the current database will be disconnected. Other databases will remain
connected and re-connection is possible.
Re-connect to the database to proceed with execution.
6. While fetching a function/procedure containing Chinese comments
through a Java application, the Chinese characters are not visible. What
do I do
Solution: Set Preferences > Session Setting > Data Studio Encoding and
File Encoding to GBK, so that Chinese characters are displayed properly.
7. Connecting to large database, loading large number of queries into SQL
Terminal, may result into 'Out of Memory' error or 'Java Heap Space'
error. What is the solution?
Solution: 'Out of Memory' error or 'Java Heap Space' error occurs when Data
Studio has used up the maximum allocated Java memory. By default, the
configuration file Data Studio.ini (located in the Data Studio install path)
contains the entry "-Xmx1200m", where 1200m denotes 1200 MB as the
maximum Java memory that can be used by Data Studio. The memory usage
is based on the size of data fetched by Data Studio.
To resolve this issue, increase the Java memory size to the desired value. For
example, update "-Xmx1200m" to "-Xmx2000m" and restart Data Studio. If
the updated memory size is used up as well, the same issue might reoccur.
● As an example for 64-bit Data Studio and 8 GB RAM the value of the Xmx
parameter must not cross 2044 MB and for 64-bit Data Studio and 8 GB RAM the
value of the Xmx parameter must not cross 6000 MB. The limit may vary based on
user's current memory usage.
For example:
-Xms1024m
-Xmx1800m
● The maximum file size that Data Studio can support in the SQL Terminal is based
on the value of the Xmx parameter in the Data Studio.ini file and available
memory.
8. While executing an SQL query which returns a large amount of data,
Data Studio displays an 'Insufficient Memory' error. What do I do?
Solution: Data Studio will disconnect the connection profile. Re-establish the
connection and continue execution.
9. While exporting DDL or data why do I get export failed message?
Solution: This could happen due to any of the following reasons:
– Invalid file for Client SSL Certificate and/or Client SSL Key have been
selected. Select the correct file and try again. Refer to 6.2.2 Adding a
Connection on establishing connection.
– Identity of the object in the database could have been changed. Check if
the identity of the object has been changed and try again.
– You may have insufficient privileges. Contact the database administrator
to obtain appropriate privileges.
10. While performing Show DDL operation why do I get show DDL failed
message?
Solution: This could happen due to any of the following reasons:
– Invalid file for Client SSL Certificate and/or Client SSL Key have been
selected. Select the correct file and try again. Refer to 6.2.2 Adding a
Connection on establishing connection.
– Identity of the object in the database could have been changed. Check if
the identity of the object has been changed and try again.
– You may have insufficient privileges. Contact the database administrator
to obtain appropriate privileges.
11. While performing Show DDL or Export DDL operation, why do I get this
error message?
"Failed to start the program, because MSVCRT100.dll is missing. Try
reinstalling the program to solve the problem?"
Solution: This is because the operation requires gs_dump.exe to execute, and
it requires the Microsoft VC runtime library msvcrt100.dll.
To solve this, copy the msvcrt100.dll file from the \Windows\System32 folder
to \Windows\SysWOW64 folder.
12. Why does the saved connection profile details not show when I try to
establish a connection?
Solution: This could happen if the Profile folder under User Data folder is not
available or modified manually. Make sure the Profile folder is present with
correct naming convention.
13. When I close and reopen Data Studio the SQL query history information
is lost. Why does this happen?
Solution: This could happen if the Profile folder is missing under User Data
folder or the folder has been modified. Make sure the Profile folder is present
with correct naming convention.
14. When I try to modify any preference error saving preference message
displays. Why do I get this error message?
Solution: This can happen if the Preferences folder is not present or renamed.
Restart Data Studio to resolve this issue.
15. What do me do when Data Studio becomes idle and Data Studio.log file
states "No more handles"?
Solution: Restart Data Studio.
16. What happens if an error occurs after I have edited a table and I am
unable to make further changes?
Solution: All previously edited data will be lost. Close the Edit Table Data
window and perform the changes again.
17. Why do I keep getting the message "The number of pasted cell and the
selected cell does not match" even though I have made the correct
number of cell selection?
A: This can happen if the settings in Preferences > Query Results is set to
include column header. The selected cells includes the column header cells as
well. Modify the settings to disable include column header option and try
again.
18. Why am I not able to edit the temp table with Reuse Connection option
off?
A: Turning off Reuse Connection option creates new session. Created temp
tables are available for current session only. Turn on Reuse Connection option
to edit temporary tables. Refer to 6.15.12 Managing SQL Terminal
Connections section for more information.
19. What happens if same column is added more than once in Multi-Column
sort pop-up?
A: When same column is added more than once in multi-sort pop-up table,
and Apply is clicked, a notification is displayed as follows. You need to click
OK and select the correct column to sort.
20. What happens if a column name is not selected in at least one of the sort
criteria and Apply is clicked?
A: Following notification is displayed. Once you select a valid column name
and click Apply again, this notification is not displayed.
21. What happens when you click on cancel when multiple create table
queries are running in SQL terminal window?
10 Security Management
10.1 Overview
10.2 Login History
10.3 Password Expiry Notification
10.4 Securing the Application In-Memory Data
10.5 Data Encryption for Saved Data
10.6 SQL History
10.7 SSL Certificates
10.8 Verify Software Package Integrity
10.1 Overview
NOTICE
Ensure that the operating system and the required software's (refer to System
Requirements for more details) are updated with the latest patches to prevent
vulnerabilities and other security issues.
This section provides the security management information for Data Studio.
● If the pop-up displays the message "Last login details not available", then it implies that
the connected database does not support the last login display feature.
● This feature is not available for GaussDB T database.
● Your password will expire within 7 days from the date of notification. If the
password expires, contact the database administrator to reset the password.
● The password must be changed every 90 days.
While running Data Studio in trusted environment, user must ensure to prevent
malicious software to scan or access the memory which is used to store
application data including sensitive information.
Alternatively, you can choose Do Not Save while connecting to the database, so
that password does not get saved in the memory.
You can ensure encryption of auto saved data by enabling encryption option from
Preferences page. Refer to Query/Function/Procedure Backup section for steps
to encrypt the saved data.
NOTICE
The information on using SSL certificates is included only for reference purposes.
For details on the certificates and for security guidelines for managing the
certificates and related files, refer the database server documentation.
Data Studio can connect to the database using the Secure Sockets Layer [SSL]
option. The following files are required to add a connection.
# Certificate/Key Description
Step 1 Establish a CA environment- Assume that user omm is created and the CA path
is test.
Log in to SUSE Linux as user root and switch to user omm.
Execute the following command:
mkdir test
cd /etc/ssl
Command:
cp openssl.cnf ~/test
cd ~/test
Command:
openssl req -config openssl.cnf -new -key demoCA/private/cakey.pem -out demoCA/careq.pem
commonName = world
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
F9:91:50:B2:42:8C:A8:D3:41:B0:E4:42:CB:C2:BE:8D:B7:8C:17:1F
X509v3 Authority Key Identifier:
keyid:F9:91:50:B2:42:8C:A8:D3:41:B0:E4:42:CB:C2:BE:8D:B7:8C:17:1F
Certificate is to be certified until Feb 28 02:17:11 2018 GMT (365 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
Until the CA root certificate is generated and signed. The root certificate is
demoCA/cacert.pem.
Step 5 Generate a private key for the server certificate- Generate a private key file
named server.key.
Command:
openssl genrsa -aes256 -out server.key 2048
Issue the generated server certificate request file. After the file is issued, a formal
server certificate is generated.
Select y for server.crt
openssl ca -config openssl.cnf -in server.req -out server.crt -days 3650 -md sha256
Perform the following operations to disable password protection for the private
key:
Remove the password protection of the server private key.
openssl rsa -in server.key -out server.key
If the password protection of the server private key is not removed, use the gs_guc
tool to encrypt the storage password. After the password is encrypted using
gs_guc encrypt -M server -K Test@123 -D ./
After the password is encrypted using gs_guc, two private key password protection
files server.key.cipher and server.key.rand are generated.
Step 8 Generate the client certificate and private key -
The method and requirements for generating the client certificate and client
private key are the same as those for generating the server certificate and server
private key.
Generate a client private key.
openssl genrsa -aes256 -out client.key 2048
After the generated certificate request file for client is signed and issued, the
formal client certificate client.crt is generated.
openssl ca -config openssl.cnf -in client.req -out client.crt -days 3650 -md sha256
If METHOD is set to cert in the pg_hba.conf file of the server, the client must use the
username (common name) configured in the license file (client.crt) for the database
connection. If METHOD is set to md5 or sha256, the client does not have this restriction.
Perform the following operations to disable password protection for the private
key:
Remove the password of the client private key.
openssl rsa -in client.key -out client.key
If password protection for a client private key is not removed, you need to use
gs_guc tool to encrypt the storage password.
gs_guc encrypt -M client -K Test@123 -D ./
After the password is encrypted using gs_guc, two private key password
protection, files client.key.cipher and client.key.rand are generated.
To convert the client key to the DER format, perform the following steps:
openssl pkcs8 -topk8 -outform DER -in client.key -out client.key.pk8 -nocrypt
----End
Replacing Certificates
By default, the security certificate and private key required by the SSL connection
are configured for OpenGauss. You can replace them with your own certificate and
private key.
Prerequisites
You need to apply for formal certificates and keys of the server and client from the
CA.
Precautions
The openGauss database supports only X509v3 certificates in PEM format.
Procedure
You can run the gs_om -t cert --rollback command to remotely invoke the
interface and gs_om -t cert --rollback -L
Step 4 Restart the openGauss database.
gs_om -t stop
gs_om -t start
The certificate has the rollback function. You can roll back the certificate before the last
certificate replacement. You can run the gs_om -t cert --rollback command to remotely
invoke this interface. Use gs_om -t cert --rollback -L to locally invoke this interface. After
the certificate is successfully replaced, roll back the certificate based on the version of the
certificate to be replaced.
----End
Server Configuration
After the SSL mode is enabled, the root certificate, server certificate, and private
key must be provided.
The configuration procedure is as follows (assuming that the user certificate file is
stored in the data directory /gaussdb/data/datanode and the default file name is
used):
In the Unix system, the permission setting of server.crt and server.key must
prevent any external or group access. Run the following command to implement
this:
chmod 0600 server.key
Step 4 Set client access authentication parameters. The IP address is the IP address of the
host to be connected.
gs_guc set -Z coordinator -I all -N all -h "hostssl all all 127.0.0.1/32 cert"
gs_guc set -Z coordinator -I all -N all -h "hostssl all all IP/32 cert"
Indicates that clients in the 127.0.0.1/32 network segment are allowed to connect
to the openGauss server in SSL authentication mode.
NOTICE
If Method is set to cert in the pg_hba.conf file on the server, only the client using
the user name (common name) set in the certificate (client.crt) can connect to
the database. If this parameter is set to md5 or sha256, there is no restriction on
the user who connects to the database.
When the DataStudio tool selects the client SSL key, the key file cannot be selected, and the
*.pk8 file needs to be selected. However, the downloaded certificate does not contain the
pk8 file.
Step 2 During login to Data Studio, password is not validated for Two Way SSL
authentication.
----End
Download ->PGPVerify Tool from the following uniform resource locator (URL):
https://support.huawei.com/enterprise/en/tool/pgp-verify-TL1000000054
The target web page may be displayed in Chinese. To change the language to English, click
the earth mark (Worldwide) on the top of the page, and then choose English. Now you can
download the English document.
● Download the PGPVerify tool (PGPVerify.exe)
a. Click the version number in the Version list.
Downloaded file has the PGPVerify.exe for windows in the below path.
Download DataStudio Zip file and .asc file from Support Site path.
● Create new folder (DS) and place both the DataStudio package and .asc file.
● Each software package has a digital signature file, which is used for software package
verification. When downloading the software package, download the corresponding
digital signature file whose name is Software package name .asc.
----End
● Single Verify:
a. Double-click PGPVerify.exe to start it,
If you have used this verification tool on the same computer before, the last key
you selected will be automatically reloaded when you use this tool once again.
c. Verify the software integrity using Single Verify.
Click on the single verify button and select the .asc file.
d. Check the result.
● Multiple Verify: If you want to verify multiple packages. For example, if you
want to verify multiple times of different packages them place (Software
packages and its corresponding .asc files) under same folder (For example, DS
here).
a. Double-click PGPVerify.exe to start it.
b. Load the public key file (KEYS.txt).
11 FAQs
A: After the number of opened Terminals or tabs reaches a certain limit based
on screen resolution an icon ( ) displays with a drop-down option at the
end of the Terminal list. Click the icon and select the required Terminal
from the drop-down list. If the is not available, then use the tooltip to
identify the Terminal or tab. Terminal name can be searched by typing the
search value above the list of SQL Terminal names.
Example:
– *s, this displays all Terminal name that starts with s.
– test, this displays all Terminal name that starts with test.
– *2, this displays all Terminal name that contains 2 in them.
16. Why after I change the language DS restarts but the language does not
change?
A: Sometimes the language may not reflect the selected change post restart.
Manually restart DS to open the tool in selected language.
17. Why does the last login details information not display?
A: At times the server returns an error while trying to fetch last login details.
In such scenarios the last login pop-up message does not display.
18. When viewing/exporting DDL, why does the Chinese text not show
properly?
A: This happens if the SQL, DDL, object names or data contains Chinese text
and the Data Studio file encoding is not set to GBK. To solve this, go to
Settings > Preferences > Environment > File Encoding Preferences and set
the encoding to GBK.
The supported combinations of Database and Data Studio encoding for
export operation are shown in Table1 Supported combinations of file
encoding.
To open/view the exported files in Windows Explorer: Files exported with
UTF-8 encoding can be opened/viewed by double-clicking it or by right-
clicking on the file and selecting Open. Files exported with GBK encoding
must be opened in MS-Excel® using the import external data feature (Data >
Get External Data > From Text).
19. Why do I get the error message "Conversion between GBK and LATIN1 is
not supported"?
A: This message occurs if the Data Studio and Database encoding selected are
incompatible. To solve this, select the compatible encoding. Compatible
encoding is shown in Table 11-2
LATIN1 Yes
SQL_ASCII Yes
LATIN1 No
SQL_ASCII Yes
LATIN1 Yes
GBK Yes
20. Why is the PL/SQL procedure I compiled and executed is saved as PL/SQL
function?
A: The database does not differentiate between PL/SQL function and
procedure. According to the database all procedures are functions. Hence
PL/SQL procedure is saved as PL/SQL function.
21. Why is that I am not able to edit the distribution key?
A: The database allows you to edit the distribution key only for the first insert
operation.
22. While editing table data if I do not enter a value for default value
column, will the value be added by the database server?
A: Yes, the database server will add the value but the value will not be visible
after save in the Edit Table Data tab. Use the refresh option from the Edit
Table Data tab or re-open the table again to view the added default value(s).
23. While modifying/deleting table data why do I get a pop-up stating that
more than one matching row found?
A: This happens because there are additional rows detected for modification/
deletion based on Custom Unique Key or All Columns selection. If Custom
Unique Key is selected, then it will delete/modify the rows that have exact
match of the data in the column selected for deletion/modification. If All
Columns is selected, then it will delete/modify the rows that match data in all
columns. Hence this duplicate records matching the Custom Unique Key or All
Columns will be deleted/modified if Yes is selected. If No is selected, the row
that is not saved will be marked for correction.
24. When I right-click on a text box I see additional context menu options.
Why does this happen?
A: The additional context menu options like Right to left Reading order, Show
Unicode control characters and so on are provided by Windows 7 in case the
keyboard you are using supports right to left and left to right input.
25. What are the objects that are not supported for batch export DDL & DDL
and Data operations?
A: Following objects are not supported for DDL & DDL and Data operations.
Export DDL:
Connection, database, tablespace, foreign table, sequence, column, index,
constraint, partition, function/procedure group, regular tables group, views
group, schemas group, and catalogs group.
Export DDL and Data:
Connection, database, tablespace, foreign table, sequence, column, index,
constraint, partition, function/procedure, view, regular tables group, schemas
group, and catalogs group.
26. Will the queries in SQL Terminal commit if the resultset is modified and
saved with Reuse Connection On and Auto Commit Off?
A: No. Queries will only be committed when COMMIT command is executed
in the Terminal.
Auto Commit Reuse Connection Resultset Save
On On Commit
On Off Commit
27. When I query a temp table from a new SQL Terminal the resultset
displays incorrect table details. Why does this happen?
A: When you query a temp table from a new SQL Terminal or with the Reuse
Connection Off, the resultset displays information of a regular/partition/
foreign table, if a table with the same name as the temp table exists.
If the Reuse Connection is On, the resultset displays information of the temp table
even if another table with the same name exists.
28. Which are the operations that are performed on a locked object does not
run in the background but needs to be manually closed?
A: Following are the operations that do not run in background while the
object is locked in another operation:
Operations
Renaming partition -
29. Do we have a limit on the column and row size while exporting table
data to excel?
A: Yes, xlsx format supports maximum of 1 million rows and 16384 columns
and xls format supports maximum of 64K rows and 256 columns.
12 Glossary
Term Definition
Column constraints Column constraints are restrictions on the data that can be inserted into a
given column.
Term Definition
Database A database administrator (short form DBA) is a person responsible for the
Administrator (DBA) installation, configuration, upgrade, administration, monitoring and
maintenance of databases in an organization.
The role includes the development and design of database strategies,
monitoring and improving database performance and capacity, and
planning for future expansion requirements. They may also plan, co-
ordinate and implement security measures to safeguard the database.
Debug Object Debug Object is an abstraction of any database debug-able objects like
functions/procedures.
Drop-down menu A menu that opens vertically on-screen to display context-related options.
Also called pop-up menu or pull-down menu.
Term Definition
Field A field is a segment of database record for query and display. It is a part
of a record used for a particular category of data.
Properties of a field:
● Field name
● Field type
● Field size
● Wildcard Value: Default value (this is provided only for Field types,
namely, UINT8, UINT16, UINT32, STRING, VSTRING, and IP_ADDRESS).
Hadoop Distributed Hadoop distributed file systems allow data access with a high throughput
File System (HDFS) and are applicable to large-scale data set applications.
In-memory database An in-memory database (IMDB; also main memory database system or
MMDB) is a database management system that primarily relies on main
memory for computer data storage. It is contrasted with database
management systems which employ a disk storage mechanism. Main
memory databases are faster than disk-optimized databases since the
internal optimization algorithms are simpler and execute fewer CPU
instructions. Accessing data in memory reduces the I/O reading activity
when querying the data which provides faster and more predictable
performance than disk. In applications where response time is critical,
such as telecommunications network equipment and mobile ads
networks, main memory databases are often used.
Key Store A key store is a file that contains your public and private keys.
Menu Bar The horizontal strip across the top of an application's window. Each word
on the strip has a context sensitive drop-down menu containing features
and actions that are available for the application in use.
Term Definition
Null Value A field that does not contain a data item is said to have a null value. In a
numeric field, a null value is not the same as a value of zero; in a
character field, a null value is not the same as a blank -- both the numeric
zero and blank character are definite values. A null value indicates that
the field's value is undefined -- its value is not known.
Object Browser The object browser gives you access to all information that is relevant to
PL/SQL development:
● Create, view, edit, rename and drop objects.
● View properties of the database and table.
● Query and edit the data of tables and views.
PL/SQL Functions A function is a named PL/SQL block which is similar to a procedure. The
major difference between a procedure and a function is, a function must
always return a value, but a procedure may or may not return a value.
Primary Key A primary key uniquely specifies a tuple within a table. In order for an
attribute to be a primary key it must not repeat. While natural attributes
(attributes used to describe the data being entered) are sometimes good
primary keys, surrogate keys are often used instead.
Term Definition
Query A complete select statement that specifies 1) the columns and tables from
which data is to be retrieved, 2) optionally, conditions that the data must
satisfy, 3) optionally, computations that are to be performed on the
retrieved column values, and 4) optionally, a desired ordering of the result
set.
Relational Database A relational database is a database that has a collection of tables of data
items, all of which is formally described and organized according to the
relational model. Data in a single table represents a relation, from which
the name of the database type comes. In typical solutions, tables may
have additionally defined relationships with each other.
Row One set of related values for all of the columns declared in a given table.
Also known as a record occurrence.
SSL Secure Sockets Layer: A security protocol that works at a socket level.
This layer exists between the TCP layer and the application layer to
encrypt/decode data and authenticate concerned entities.
Step Into Step Into executes a single program statement at a time. If the execution
point is located on a call to a subprogram, Step Into steps into that
subprogram and places the execution point on its first statement. If the
execution point is located on the last statement of a subprogram, Step
Into returns from the subprogram, placing the execution point on the line
of code that follows the call to the subprogram from which you are
returning.
Term Definition
Step Out Step Out leaves the current subprogram and goes to the next statement.
Step Over Step Over bypasses the next subprogram (unless the subprogram has a
breakpoint) and goes to the next statement after the subprogram. If the
execution point is located on a subprogram call, it runs that subprogram
without stopping (instead of stepping into it), then positions the
execution point on the statement that follows the call. If the execution
point is located on the last statement of a subprogram, Step Over returns
from the subprogram, placing the execution point on the line of code that
follows the call to the subprogram from which you are returning.
Stored Procedure A stored procedure or in simple a proc is a named PL/SQL block which
performs one or more specific task. This is similar to a procedure in other
programming languages. A procedure has a header and a body. The
header consists of the name of the procedure and the parameters or
variable passed to the procedure. The body consists or declaration section,
execution section and exception section similar to a general PL/SQL Block.
A procedure is similar to an anonymous PL/SQL block but it is named for
repeated usage.
Trust Store A trust store is a key database file that contains the public keys for your
partners' self-signed and CA certificates. The public key is stored as a
signer certificate. For commercial CA, the CA root certificate is added.
Because the trust store file does not contain your private key, the trust
store file can be more publicly accessible than the key store file.
URI Uniform Resource Identifier: A URI is the unique name used to access
the resource. It is not necessarily a specific file location (For example, it
may be a call to an application or a database), which is why it is preferred
over the similar acronym URL (Uniform Resource Locator).
View Views restrict access to specific rows or columns of a table. A view can be
created from one or more tables and is determined by the query used to
create the view.