
User's Guide
Part II. Tutorials
Chapter 4. Managing Databases with Sybase Central
Navigating the main Sybase Central window
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's capabilities by yourself.
Start Sybase Central
- To start Sybase Central in Windows 95 or Windows NT 4.0, select Start->Programs->SQL Anywhere->Sybase Central.
- To start Sybase Central from Windows NT prior to Version 4.0, double-click Sybase Central in the SQL 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 SQL 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.
Connecting to a database from Sybase Central
This section describes how to connect to the sample database using the user ID DBA and the password SQL.
Logging on
The sample database contains the user ID "DBA", a user with full administration and resource creation rights. The password for this user is "SQL".By default, all newly-created SQL 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. |
To connect to the sample database:
- Start the sample database (SADEMO.DB) by selecting the Standalone Sample Database menu item from the Sybase SQL Anywhere 5.0 menu. Select Start->Programs->SQL Anywhere 5.0->Standalone Sample Database.
The SQL Anywhere engine and sample database must be running for any of the following steps to work properly.
- From the same Sybase SQL Anywhere 5.0 menu, start Sybase Central by clicking the Sybase Central menu item.
- On the Sybase Central toolbar, click the Connect toolbar button or select Connect from the Tools menu on the menu bar.
- Enter the user ID DBA and the password SQL, and click OK.
You can save connection parameters as connection profilesto avoid retyping often-used connection parameters. For information about connection profiles, search the Sybase Central online help index for "Connection Profiles".
Viewing a database schema
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.
Expanding a database container
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 causes the container to the selected container 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.
Viewing the tables in a database
The following illustrates the steps taken to examine the contents of a table folder in a database container.
To examine the tables in a database:
- 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.
Viewing database object properties
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 schema. From the pop-up menu choose Properties.
- While holding the Alt key, double-click database schema in the right panel.
- With a database schema 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 SQL 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.
- 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.
You should explore the sample database until you are comfortable locating database objects in the Sybase Central main window.
