First Guide to SQL Anywhere Studio
PART 2. Getting Results with SQL Anywhere Studio
CHAPTER 4. Managing Databases with Sybase Central
This tutorial introduces the Sybase Central user interface. It also describes how to start Sybase Central, how to connect to a database, and how to view a database schema in Sybase Central.
After completing the tutorial you should feel comfortable exploring Sybase Central by yourself.
To start Sybase Central in Windows 95 or Windows NT 4.0, select Start->Programs->Sybase->Sybase Central.
To start Sybase Central from Windows NT prior to Version 4.0, double-click Sybase Central in the Adaptive Server Anywhere Program Manager group.
The main Sybase Central window appears.
The Sybase Central window is modeled after the Explorer in Windows 95 and Windows NT 4.0. The main window is split into two vertically-aligned panels. The left panel displays a hierarchical view of database objects or containers in a tree-like structure. A container is a database object that can hold other database objects, including other containers. Sybase Central is at the root of the tree. Plug-ins for Sybase Central, such as the Sybase Adaptive Server Anywhere database management system, occupy the first level after the root level.
The right panel displays the contents of the container that has been selected in the left panel. The contents of a container can be viewed in the right panel in several ways: as large icons, small icons, as a list, and alongside their associated details. You can switch between these views by clicking the buttons on the Tool Bar immediately below the Window menu.
This section describes how to connect to the sample database using the user ID DBA and the password SQL.
Logging on By default, all newly-created Adaptive Server Anywhere databases contain this user ID and password. It is the responsibility of the database administrator to provide the desired level of security by changing passwords and creating other user IDs. |
Start the sample database (asademo.db) by selecting the Personal Server Sample menu item from the Sybase Adaptive Server Anywhere 6.0 menu. Select Start->Programs->Adaptive Server Anywhere 6.0->Personal Server Sample.
The Adaptive Server Anywhere server and sample database must be running for any of the following steps to work properly.
From the same Sybase Adaptive Server Anywhere 6.0 menu, start Sybase Central by clicking the Manage Adaptive Server Anywhere menu item.
On the Sybase Central toolbar, select Connect->Adaptive Server Anywhere from the Tools menu.
Enter the user ID DBA and the password SQL, and click OK.
You can save connection parameters as connection profiles to avoid retyping often-used connection parameters. For information about connection profiles, search the Sybase Central online help index for Connection Profiles.
A database schema is the collection of all objects in the database. Sybase Central displays a database schema as a hierarchy of containers and their contents. This section describes how to view the schema of a database.
There are a variety of methods for viewing the objects in a database, including the following.
Click a container in the left panel to select that container. The right panel then shows the contents of the selected container. Among the contents of the server container are all the databases you've attached to, including ones you have not yet connected to by entering a user ID and password.
Click once on the plus or minus sign next to containers in the left panel to expand or collapse the hierarchical tree of objects. This allows you to view database objects at levels below the level of the currently selected container. If no plus or minus sign appears next to a container it contains no objects extending beyond the level of that container.
Press the plus or minus keys on the numeric keypad when the selected container has a plus or minus sign beside it. This expands or contracts the container.
Using the right mouse button, click on an object in the right panel and a pop-up menu is displayed. Choose the Open menu item. If the object is a container object—one that can contain other objects such as folders—this causes the object to be selected in the left panel, and displays the contents of that container in the right panel.
Double-clicking a container in either panel expands the tree in the left panel and displays the contents of the newly-selected container in the right panel.
Double-clicking on the container in the left panel expands or contracts the object's hierarchy in addition to selecting it and displaying its contents in the right panel.
The left panel displays container objects only. The right panel displays the contents of the container object selected in the left panel.
The following illustrates the steps taken to examine the contents of a table folder in a database container.
Select the Tables folder. You may have to expand the server and database objects in the hierarchical tree in the left panel in order to view the Tables folder.
Each table in the Tables folder is itself a container. Select a table in the left panel to reveal the contents of that table in the right panel. Each table object contains folders for columns, foreign keys, relations, indexes, and triggers.
Expand the table object in the left panel to reveal its contents in the hierarchical tree. Select each object in the table container by clicking on it once in the left panel. The right panel will display the contents of the table object selected in the left panel.
The properties of database objects such as a database or stored procedures, can be viewed using any of the following methods. In all cases, a tabbed dialog box called a property sheet will be displayed, revealing all editable and non-editable properties.
Using the right mouse button, click on a database object. From the pop-up menu choose Properties.
While holding the Alt key, double-click a database object in the right panel.
With a database object selected in the right panel, press the Alt and Enter keys simultaneously.
With a database object selected in either the left or right panel, choose Properties from the File menu.
You can navigate a database by clicking or double-clicking in either panel. Explore the contents of the other folders in the database. Every Adaptive Server Anywhere database contains individual folders for the following:
Tables Base tables stored in the database.
Views Computed tables, stored in the database as a query and evaluated when accessed.
Procedures & Functions for using a module-based language consisting of SQL procedures.
User & Groups for administering who is permitted to use the database.
Integrated Logins for enabling users to connect to a database using their Windows or Windows NT user name and password.
Java Objects for building logic and rich data types into your database.
User-defined Data Types for creating non-standard data types.
SQL Remote for administering replication of data in the database.
DB Spaces for creating more than one .db file for the database.
Connected Users for monitoring current connections to a database.
You should explore the sample database until you are comfortable locating database objects in the Sybase Central main window.