SQLBase 12 Command Center User's Guide
SQLBase 12 Command Center User's Guide
Product Version 12
SQLBase™: Command Center User’s Guide
Copyright © 2016 Open Text. All rights reserved. OpenText is a trademark or registered trademark of
Open Text. The list of trademarks is not exhaustive of other trademarks, registered trademarks, product
names, company names, brands and service names mentioned herein are property of Open Text or
other respective owners.
Disclaimer
No Warranties and Limitation of Liability. Every effort has been made to ensure the accuracy of the
features and techniques presented in this publication. However, Open Text Corporation and its affiliates
accept no responsibility and offer no warranty whether expressed or implied, for the accuracy of this
publication.
Warning: This software is protected by copyright law and international treaties. Unauthorized
reproduction or distribution of this program, or any portion of it, may result in severe civil and criminal
penalties, and will be prosecuted to the maximum extent possible under the law.
ii
Table of Contents
iii
Uninstall Database ................................................................................................................................................. 14
Drop Database ......................................................................................................................................................... 14
SQLTalk Session....................................................................................................................................................... 14
Editing Objects ........................................................................................................................................................ 15
Table ............................................................................................................................................................................ 15
Script Generator and the "Default" Column ................................................................................................ 17
Unload Table ............................................................................................................................................................ 18
Index............................................................................................................................................................................ 19
Foreign Key ............................................................................................................................................................... 20
FK Reference ............................................................................................................................................................ 22
Trigger ........................................................................................................................................................................ 23
User Rights ............................................................................................................................................................... 24
Synonym .................................................................................................................................................................... 25
View ............................................................................................................................................................................. 27
Procedure .................................................................................................................................................................. 30
User Name................................................................................................................................................................. 33
Chapter 3 – Administration ..............................................................................................................................35
Create New Task Database and Install Service ........................................................................................... 35
Register Task Database ........................................................................................................................................ 37
Task Database Options ................................................................................................................................................. 38
New Task ................................................................................................................................................................... 39
Task Tab ..................................................................................................................................................................... 39
Steps Tab.................................................................................................................................................................... 40
New Operator .......................................................................................................................................................... 40
SMTP Settings .......................................................................................................................................................... 40
Remove Task Database......................................................................................................................................... 41
Viewing Tasks .................................................................................................................................................................. 41
Tasks QuickTab ....................................................................................................................................................... 41
Events QuickTab ..................................................................................................................................................... 42
iv
Chapter 1 – Getting Started
SQLBase Command Center is a tool for managing and maintaining SQL databases. SQLBase Command Center
is really two tools:
SQLBase Command Center
GUI-based application that simplifies database management.
Service for MS-Windows™
Automated and time-specific background tasks for performing scheduled tasks, such as database index
updating.
This document assumes a basic knowledge of SQL, databases, and database servers. While it covers the
relevant SQL commands that are implemented by the SQLBase Command Center, it is not a textbook on SQL
or databases.
1
Chapter 2 – Workspace
Register a Server
1. Select Workspace > Add Server.
The Workspace ribbon contains your server and database administration options, such as adding and
removing a server. When adding a server, you can also press F3. A dialog appears for registering the
server.
2
Repeat these steps for each server you want to register.
Register a Database
1. Select Workspace > Add Database.
Alternatively, you can press the F2. A dialog appears for registering the database.
GUI Overview
The GUI includes a set of ribbons for performing actions within SQLBase Command Center and a workspace.
4
Ribbons
The Edit, View, and Help ribbons provide basic actions for editing (copy, paste, etc.), arranging windows in
the workspace, and accessing help materials.
The Workspace ribbon contains basic server and database administrative actions, including adding a server
and adding a database (which you have already used).
Refresh Updates the current workspace view; alternatively, you can press F5.
Workspace Window
The workspace window is divided into a left pane and a right pane. The left pane contains a list of all servers,
databases, and administration databases for the current workspace. You can drill down to specific nodes in
the tree the same way you explore files in Windows Explorer.
Selecting a node on the left displays one or more QuickTabs on the right that contain information about the
selected object. The number and kind of QuickTabs that appear depend on the object selected. The following
sections describe the QuickTabs for a table.
Contents QuickTab
The Contents QuickTab displays the elements of the selected object. Click the Name column header to sort
these elements.
5
SQL Script QuickTab
The SQL Script QuickTab displays a log for each database of the DDL (Data Definition Language) SQL
commands that have been executed on that database.
Server Options
Right-click a server node in the left window pane of the workspace to access a menu of operations that you
can perform on that server.
6
Remove Server
Removes a server from the workspace. Any changes made to the server (or any of its databases) remain with
the server (or its databases).
Install Database
Installs a new (existing) database on the server. This provides the same functionality as the Install Database
command.
Uninstall Database
Uninstalls a database from the server. This provides the same functionality as the Uninstall Database
command.
7
Create Database
Creates a new, empty database on the server. This provides the same functionality as the Create Database
command, including the ability to specify the collation for the database.
Drop Database
Physically delete an existing database from the server. This provides the same functionality as the Drop
Database command.
SQLTalk Session
Establishes one or more SQLTalk sessions.
8
To establish a session, enter the database, username, and password for the database you want to access
through SQLTalk and then click Connect. SQLBase Command Center displays the connection under Current
Connections.
To use an existing session, select it from the Current Connections list and click Use. SQLBase Command Center
opens SQLTalk. SQLTalk opens into a new window. See the SQLTalk Command Reference guide for more details.
To remove an existing session, select it from the Current Connections list and click Disconnect.
Database Options
Right-click a database node in the left window pane of the workspace to access a menu of operations that
you can perform on that database.
9
Check Database
Runs a check against the database using the Check dialog. You can run a system check, a table check, and/or
an index check.
Click ! to initiate the check routine. Each initiated check routine is generally executed in a separate thread.
This allows multiple checks to be executed simultaneously without affecting the applications. SQLBase
Command Center stores the results of the analysis. Click the "Hand" to pause a check routine at any time.
View the results by clicking the appropriate node in the left window pane. SQLBase Command Center displays
the results on the right.
Remove Database
Removes the database from the current workspace. Removing a database does not physically delete that
database from the server. SQLBase will ask you to verify whether you really want to remove the database.
New Object
Right-click a database in the left window pane to access a menu of operations you can perform on that
database. The following describes the new objects that you can create:
Table
To create a new table, right-click the database you want, and select New Object > Table. The Create Table
dialog appears.
Enter the name of the table you want to create in the Name field and then click OK. This opens a detail dialog
box for creating the new table. This dialog is divided into three sections that can be viewed and edited using
the Columns, Compilation, and SQL Script QuickTabs.
10
Columns QuickTab
Click New to add a new column. Enter the new field name(s) and related attributes for the table. Click Delete
to delete a column. Click the Arrow to change the order of selected columns.
Compilation QuickTab
This QuickTab displays the results of compiling the SQL script for creating the table. Click Compile to start a
compilation.
11
This QuickTab displays the SQL script that is automatically generated when a table is created with field names.
You can now add these changes to the database by clicking the Apply. You can also save the generated SQL
script in a separate file for documentation purposes or to execute it at a later time using Save Script.
View
Right-click a database and select New Object > View to create a new view in the selected database.
Enter the name of the view you want to create in the Name field and then click OK. This opens a detail dialog
box for creating the new view. For additional methods on manipulating the new view, refer to the relevant
documentation section on editing database objects.
Stored Procedure
Right-click a database and select New Object > Stored Procedure to create a new procedure in the selected
database.
Enter the name of the procedure you want to create in the Name field and then click OK. This opens a Details
dialog box for creating the new procedure.
User
Right-click a database and select New Object > User to create a new user name in the selected database.
12
Enter the database logon name of the new user in the User field and then assign a password. You also have
the option of granting a few privileges here. Click OK and you will be asked to confirm the password. Click OK
after the password is confirmed and the new user is created in the database with the selected privileges.
Unload Database
Creates different types of Unloads for the database. The Unload field provides the different types of actions
that you can select.
13
Uninstall Database
Uninstalls the database from the database server.
Drop Database
Physically deletes the selected database from the server. If the database is also registered, SQLBase
Command Center provides an option to remove the database from the workspace.
SQLTalk Session
Establishes and then opens a SQLTalk session for the database. See the SQLTalk Command Reference guide for
more details.
14
You can also see the session by right-clicking the server and selecting SQLTalk session from the menu.
SQLBase Command Center displays a dialog that lists all current sessions.
Editing Objects
The SQLBase Command Center provides an edit mode for editing database objects. Access this edit mode in
any of the following ways:
Right-clicking an object in the left window pane and selecting Edit
Right-clicking an object in the right window pane and selecting Edit
Double-clicking the right window pane
Table
Edit a table in a database by right-clicking the table in the left window pane and selecting Edit. SQLBase opens
the table into edit mode.
Use the buttons in the object toolbar to insert a new column next to the selected column, delete the selected
column, or move the selected column up or down in the table with the arrow buttons.
15
<CTRL+Ins>
<CTRL+Del>
<CTRL + Up Arrow>
<CTRL + Down Arrow>
Note: !!! W A R N I N G !!! If you delete a column and the column is part of an index, the script generator
will delete the index before deleting the column. If the column is contained within a foreign key, or
another foreign key points to this column, the script generator will delete the foreign key before
deleting the column.
To change the order of the columns, the script generator has to recreate the table using the DDL and DML
commands described above. This feature allows you to maintain the structure of the columns in your tables.
Click Compile to compile the SQL script that will be used to make your changes. Use the Compilation
QuickTab to view the results of a compilation.
Use the SQL Script QuickTab to view the SQL script that the compilation generated.
16
Script Generator and the "Default" Column
The default column is always used when the script generator in the SQLBase Command Center requires an
UPDATE or INSERT statement to complete a DDL action. The script generator then recommends what it thinks
is the optimal value for the default column, but you can change the recommended value to whatever you like.
Example:
If the column type of a column is changed from NULL to NOT NULL, the script generator will try to insert a
default character in the columns which do not have a value.
If the ISLAND.SYSADM.COMPANY.CITY column is changed from NULL to NOT NULL, the following is
recommended as the default value:
@if(@isna(STATE),' ',STATE)
In this case, the following SQL commands will be executed:
A space character will be inserted in all the rows that do not have a value in the STATE column.
update SYSADM.COMPANY set STATE = @if(@isna(STATE),' ',STATE)
where STATE is null;
The actual DDL command is executed.
alter table SYSADM.COMPANY modify STATE varchar(30) not null;
If all you do is decrease the length of the CITY column from 30 to 20, the script generator will recommend
@left(CITY,20) as the default value.
However, because a DDL command cannot decrease the length of a column, the script generator has to
recreate the entire table. This occurs in three stages.
Stage 1:
A new SYSADM.TMP_COMPANY table is created with the new data structure.
create table SYSADM.TMP_COMPANY ( COMPANY_ID smallint not null,
COMPANY_NAME varchar(30),STATE varchar(20), ADDRESS varchar(50),
CITY varchar(30),ZIP char(10),COUNTRY varchar(30), PHONE
varchar(20), FAX varchar(20), TERMS char(30), LINE smallint,CORPORATE_URL
char(128)
) pctfree 10;
drop index SYSADM.COMP_ID;
create unique index SYSADM.COMP_ID on SYSADM.TMP_COMPANY ( COMPANY_ID
asc) pctfree 10;
alter table SYSADM.TMP_COMPANY primary key ( COMPANY_ID);
Stage 2:
The data from original table is transferred to the new table.
insert into SYSADM.TMP_COMPANY ( COMPANY_ID, COMPANY_NAME, STATE, ADDRESS, CITY,
ZIP, COUNTRY, PHONE, FAX, TERMS, LINE, CORPORATE_URL)
select
COMPANY_ID, COMPANY_NAME, @left(STATE,20), ADDRESS, CITY,
17
ZIP, COUNTRY, PHONE, FAX, TERMS, LINE,CORPORATE_URL from
SYSADM.COMPANY;
Stage 3:
The old table is deleted, the new table is renamed to the name of the original table and the other table
properties are generated for the "new" table.
drop table SYSADM.COMPANY;
Note: !!! W A R N I N G !!! If the structure of a table is changed and a view points to this table, the view will
be deleted from the SQLBase Server without warning.
Unload Table
Creates different types of Unloads for the table.
18
Whether to execute the action on the database server or on the client
The name and location of the SQL file to be generated
Whether to overwrite the generated file if it exists
Whether to store the data in a compressed format
Index
Edit the indexes of a table by first selecting the table in the left window pane and then selecting the Indexes
QuickTab on the right.
Alternatively, you can select the index you want to edit under Indexes in the left window pane.
In the table-index area, double-click a column to open that column into the Index Editing dialog. Click New
and then select a column from the dropdown to add that column to the index.
As with manipulating tables, you can compile this process and view the generated SQL script. You can apply
the script to the database or store it separately.
19
Click Save Script to save the script in a separate file.
Foreign Key
Edit the foreign keys on a table by first selecting the table in the left window pane and then selecting the
Foreign Keys QuickTab on the right.
Double-click an existing foreign key (FK) to open it into the Foreign Key editing dialog box.
20
To prevent syntax errors, after the referenced table is changed, the names of the primary key columns in that
table are listed in the Primary Key Columns column. When assigning the foreign key columns, use only
columns that match the data type. For an “integer” primary key, only “integer” foreign key columns are
recommended.
As with manipulating tables, you can compile this process and view the generated SQL script. You can apply
the script to the database or store it separately.
21
FK Reference
Edit foreign key references by first selecting the table in the left window pane and then selecting the FK
References QuickTab on the right.
Double-click an existing foreign key reference to open it into the Foreign Key edit dialog.
As with manipulating tables, you can compile this process and view the generated SQL script. You can apply
the script to the database or store it separately.
22
Trigger
Edit triggers by first selecting the table in the left window pane and then selecting the Trigger QuickTab on
the right.
Double-click an existing trigger to open it into the Trigger editing dialog. Here you can enter the necessary
code for the trigger that has to be modified or recreated.
As with manipulating tables, you can compile this process and view the generated SQL script. You can apply
the script to the database or store it separately.
23
User Rights
Edit user rights for a table by first selecting the table in the left window pane and then selecting the User
Rights QuickTab on the right.
Double-click one of the users to open that user into the User Rights editing dialog. Here you can configure
specific permissions.
24
As with manipulating tables, you can compile this process and view the generated SQL script. You can apply
the script to the database or store it separately.
Synonym
Edit synonyms by first selecting the table in the left window pane and then selecting the Synonyms QuickTab
on the right.
25
Double-click one of the synonyms to open it into the Synonyms editing dialog. Click New to add a synonym to
the table.
As with table manipulations, this process can be compiled and the generated SQL script can be viewed and
then either applied to the database or stored separately.
26
View
Select Views in the window pane on the left to see an overview of the views already stored in the database
on the right.
Select a specific view in the left window pane to see detailed information about that view on the right. The
Columns QuickTab displays the columns for the view. The Text QuickTab displays the SQL statement for the
view.
27
Double-click on a view (from the list on the right) to open that view into the View editing dialog. Click New to
add a column to the view.
Now you can configure the procedure according to your requirements, assign permissions and assign
synonyms.
28
As with manipulating tables, you can compile this process and view the generated SQL script. You can apply
the script to the database or store it separately.
29
Procedure
Edit procedures by first selecting Procedures in the left window pane for the database you want to edit. An
overview of the procedures already stored in the database appears in the right window pane.
30
Double-click a procedure from the list on the right to open it into the Stored Procedures editing dialog.
Now you can configure the procedure according to your requirements, assign permissions and assign
synonyms.
31
As with manipulating tables, you can compile this process and view the generated SQL script. You can apply
the script to the database or store it separately.
32
User Name
Edit user names by first selecting User Names in the left window pane for the database you want to edit. An
overview of the user names already stored in the database appears in the right window pane.
Double-click one of the user names on the list to the right to open the user name into the Edit Database User
dialog.
33
Note: !!! W A R N I N G !!! If you click Delete, the user name will be deleted from the database without
notification. This process is performed without a previously created SQL script and is therefore not
logged.
34
Chapter 3 – Administration
The SQLBase Command Center administration feature contains three components:
Task database
Windows NT 4.0 / 2000 service application
Administration node in the SQLBase Command Center workspace
All tasks for controlling the service applications are stored in the task database. This database can be installed
on any SQLBase server. However, you must make sure that the service application can establish a connection
to this server. SQLBase Command Center includes a default SBTASK database that you can use. You can also
create your own task database.
The service consists of the sbccsrv.exe and smtp_mail.dll program files. The SQLBase Command Center
registers the sbccsrv.exe file on a Windows NT 4.0 / 2000 workstation or server as a SQLBase Manager Task-
Scheduling Service.
Note: If you want to use the service, you must select the Service option during installation.
The administration node in the SQLBase Command Center provides tools for configuring and controlling the
service. All the data (operators, SMTP settings, tasks, and so on) required by the task database is stored in this
area.
Note: If you want to use the service administration component, you must select the Administration option
during installation.
To properly set up the SQLBase Command Center administration feature, you must first create the task
database (and install the service for that database) and then add the database to the Administration node.
35
2. On the Task-Database tab, specify or enter the following:
Server – server for the new task database
Password – password for the new task database
Database – name for the new task database
3. Click Create.
The SQLBase Command Center creates the database in your default database directory.
The SQLBase Command Center includes a database structure for recording administration data. This is
structured as a compressed Unload SQL script (CreateTask.sql). You’ll need to load this file into the task
database.
4. Still on the Task-Database tab, specify or enter the following:
SQL File – path for the CreateTask.sql file
Compress – set checkbox
Password – optional
By default, no password is assigned for the SYSADM of this database.
5. Click the Load button.
SQLBase Command Center adds the data structure to your task database. You must next register a service
for your task database.
6. Select the Service tab.
If there is already a service installed, and this is not the service you want to use, click Uninstall before
continuing.
36
7. Specify or enter the following:
Database – name of the task database that will use this service
Password – password for that task database
Start Type – how to set up the Windows NT/2000 Service on the task database
8. Click Install.
SQLBase Command Center registers the service. Now you have to start the newly set up SQLBase
Command Center Task-Scheduling Service in the Windows Service Manager. Consult the Windows
documentation for more information on the Windows Service Manager.
Note: !!! W A R N I N G !!! If you want to uninstall the SQLBase Command Center, first make sure the
SQLBase Command Center Task-Scheduling Service is stopped and then uninstall it using the
Task/Service Administration of the SQLBase Command Center. To install or uninstall a service on
Windows 2000/XP, you must be a member of the Administrators group. On Vista/ Server 2008, you
must be the administrator user. After uninstalling the service, you can uninstall the SQLBase
Command Center software with the Windows Software Setup.
37
Server – server that contains the task database
Database – name of the task database
User – administrative username for the database
Password – administrative password for the database
3. Click Connect.
SQLBase Command Center registers the task database and displays it under the Administration node in
the left window pane.
38
New Task
Use New Task to create a new task in the task database.
Task Tab
Specify the following:
Name – name of the task
Description – description for documentation purposes of the task
Active – clear or set to turn the task off or no.
In the Database/Server area:
Specify the database server for which the task is being created in the Server and Database fields. Also
enter the user and password (if required) under whose privileges the task is executed. You can also check
whether a connection to the database is possible based on the specifications you made by clicking Test
Connect. An appropriate message will appear.
In the Schedule options area:
Specify when and how often the task is to be executed. This includes a validity period (from/to), the
schedule (daily, weekly, monthly), and the execution time.
In the Operator/Mail Options area:
Specify who is to be informed of task messages via SMTP email.
39
Steps Tab
Use this tab to add each step for the task. To create a new task step, click New. SQLBase Command Center
records steps consecutively just like a batch job. Depending on the task type selection, you generally have to
fill in most of the fields on this QuickTab.
If you add multiple steps, you can change their order if necessary (using the arrows).
New Operator
Use Operator to set up a new operator. Enter the name and email address of the operator who is to be
notified of any error messages from the system.
SMTP Settings
Use SMTP Settings to set up the access data on the SMTP server so that messages can be sent automatically
to the operators. Enter the necessary information for your SMTP server.
40
Remove Task Database
Removes the task database from workspace, but does not delete the database. Any tasks that you added
remain with the database.
Viewing Tasks
You can select an task database on the left to see a list of that database’s tasks and event logs on the right in
QuickTabs. You can also right-click an administration database and select Explore > Tasks or Explore > Logs.
Tasks QuickTab
Use this tab to see a list of tasks on the current task database.
You can right-click a task to display a menu of actions to perform against that task, such as editing the task. As
with new tasks, you can add, delete, and modify steps when editing a task.
41
Events QuickTab
Use the Logs QuickTab to view an overview of the tasks that have been executed for that database. You can
also view, filter, and delete the task-specific events using the task editor.
42