Sybase Database introduction (1)

Source: Internet
Author: User
Tags sybase database

1. Sybase Database Introduction 

1. Version

In 1984, Mark B. Hiffman and Robert Epstern created Sybase and launched Sybase database products in 1987. SYBASE has three major versions: one is the version running under the UNIX operating system, the other is the version running in the Novell Netware environment, and the other is the version running in the Windows NT environment. The latest version is 12.5, which is widely used in mainstream Unix operating systems. Ibm aix, HP unix, Digital Unix, and Sun solaris.

2. Sybase database features

1) It is a database based on the customer/server architecture.
Generally, relational databases are based on Master/Slave models. In the Master/Slave structure, all applications run on one machine. The user only sends commands through the terminal or simply views the running results of the application. In the customer/Server structure, applications are run on multiple machines. One machine is the customer of another system or the server of another machine. These machines are connected through the LAN or WAN. Benefits of the customer/server model:
● It supports resource sharing and load balancing among multiple devices
● Allow the environment to accommodate multiple hosts and make full use of the existing systems of the Enterprise

2) It is a truly open database

Because of the customer/Server structure, applications are run on multiple machines. Furthermore, applications running on the client do not have to be Sybase products. For general relational databases, pre-compilation is provided to allow applications written in other languages to access the database. Sybase Database, not only provides a simple pre-compilation, but also exposes the application interface DB-LIB, encouraging third parties to write DB-LIB interfaces. Since open customer DB-LIB allows identical calls to be used on different platforms, it makes it easy for applications accessing the DB-LIB to port from one platform to another.

3) It is a high-performance database.
The real attraction of Sybase is its high performance. It is embodied in the following aspects:
● Programmable Database
A Programmable database is created by providing a stored procedure. Stored procedures allow users to write their own database subroutines. These child routines are pre-compiled, so you do not have to compile, optimize, and generate query plans for each call. Therefore, the query speed is much faster.
● Event-driven triggers
A trigger is a special stored procedure. You can use a trigger to start another stored procedure to ensure database integrity.
● Multi-clue
Another innovation in the Sybase database architecture is multi-clue. Generally, databases rely on the operating system to manage connections to databases. When multiple users are connected, the system performance will be greatly reduced. The Sybase database does not allow the operating system to manage processes, and manages the connection to the database as part of itself. In addition, Sybase's database engine replaces the operating system to manage some hardware resources, such as ports, memory, and hard disks, bypassing the operating system and improving performance.

3. Sybase Database Composition

The Sybase database consists of three parts:

(1) An online relational database management system Sybase SQL Server for database management and maintenance;
Sybase SQL Server is a programmable database management system. It is the core software of the entire Sybase product and plays a role in data management, high-speed buffer management, and transaction management.

(2) A set of front-end tools Sybase SQL Toolset that support the establishment and development of database application systems;
ISQL is an SQL syntax analyzer that interacts with SQL Server. ISQL receives the SQL language from the user, sends it to SQL Server, and displays the results in a formal manner on the user's standard output.

DWB is a data workbench and a major component of Sybase SQL Toolset. It enables users to set and manage databases on SQL Server, it also provides users with a simple method to add, update, and retrieve database information. All functions of ISQL can be completed in DWB. Since DWB is based on Windows and menus, it is easier to operate than ISQL and is a convenient and practical database management tool.
APT is one of the main products of Sybase customer software and is also the main environment for practical application development. The APT workbench is a tool set used to create applications. It can create very simple to very complex applications, and is mainly used to develop applications based on table forms. The user interface uses a window and menu drive to complete the development of the Form, menu, and processing through a series of options.

(3) Sybase Open Client/Open Server, which connects application software from other vendors in a heterogeneous environment with any type of data.
Through the DB-LIB library of Open Client, applications can access SQL Server. With the SERVER-LIB of Open Server, applications can access other database management systems.
Ii. SYBASE concepts

Sybase SQL Server is a multi-database system. These databases include system databases and user databases. Both the system database and user database are built on the database device.

1. Database Devices

All databases are created on the database device. A database device is not an identifiable physical device, but an original disk partition or operating system file used to store databases and database objects. When adding a new database device, you must "initialize" these devices ". The initialization process is to change the physical disk, disk partition, or operating system file to a device that the SYBASE Database can recognize. Initialize the database device using the disk init command:
DISK INIT
NAME = Device NAME,
PHYSNAME = physical device name,
VDEVNO = Virtual Device number,
SIZE = number of blocks
Here, NAME refers to the NAME of the DATABASE device, which will be used for the create database and alter database commands. PHYSNAME is the original disk partition or operating system file name. VDEVNO is the identification number of the database device. It must be unique in SQL Server. The unit of SIZE is 2 K. For a newly created database, the minimum SIZE is the SIZE of the model database, that is, 1024 2 k blocks, 2 M ).
For example,/* initialize the M physical device in the/dev directory to the database device tele114_log01 of SYBASE */
1> disk init
2> name = "tele114_log01 ",
3> physname = "/dev/rtelelog"
4> vdevno = 4
5> size = 204800/* 2Kbyte * 204800 = 400Mbyte */
6> go

2. Segment 

Database devices are logically divided into database segments to allow a specified object to be placed on a specified segment when an object is created). A database device can have up to 192 segments, the storage space on 255 logical devices. When you create a database, SQL SERVER automatically creates three segments in the database: SYSTEM, LOGSEGMENT, and DEFAULT, these three segments are used to store the system tables, transaction logs, and other database objects of the database.

To create segments in a database, follow these steps:
X initialize the physical device with Disk init
X makes the database device available to the database by using the Create database AND alter database on clauses, so the new device is automatically added to the default and system segments of the database.
Once the database device exists and is available to the database, use the Stored Procedure Sp_addsegment to define the database segment. Syntax:
Sp_addsegment segment name, database name, device name

3. System Database 

The following system databases automatically generated when the Sybase Database is installed:
● Master database;
● Model database model;
● System process database sybsystemprocs;
● Temporary database tempdb.
You can also select the following databases:
● Security audit database sybsecurity;
● Example database pubs2;
● Command syntax database sybsyntax.

1) master database
It contains many system tables and system processes. It controls the operations of user databases and SQL Server in general and forms the data dictionary of SYBASE system. MASTER database records:
● Login account SQL Server Username); syslogins, sysremolelogins
● Execution process; sysprocesses
● Modifiable environment variables; sysconfigures
● System error message; sysmessages
● Information of each database on the SQL server; sysdatabases
● Storage space occupied by each database; sysusages
● Information on tapes and tapes installed on the system; sysdevices
● Activity lock information; syslocks


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.