1、UNIT9 Database 9-1 Technical Part9-2 Reading Material 9-1 Technical Part 9-1-1 DefinitionA database is also called an electronic database,referring to any collection of data,or information,that is specially organized for rapid search and retrieval by a computer.A database has the following implicit
2、properties:A database is a logically coherent collection of data with some inherent meaning.A random assortment of data cannot be referred to as a database.A database is designed,built,and populate with data for a specific purpose.It has an intended group of users and some preconceived applications
3、in which these users are interested.A database represents some aspect of the real world,sometimes called the miniworld.Changes to the miniworld are reflected in the database.9-1-2 IntroductionsDatabase-System ApplicationsDatabases are widely used.Here are some representative applications:1.Enterpris
4、e InformationSales:for customer,product,and purchase information.Accounting:for payments,receipts,account balances,assets and other accounting information.Human resources:for information about employees,salaries,payroll taxes,and benefits,and for generation of paychecks.Manufacturing:for management
5、of the supply chain and for tracking production of items in factories,inventories of items inwarehouses and stores,and orders for items.Online retailers:for sales data noted above plus online order tracking,generation of recommendation lists,and maintenance of online product evaluations.2.Banking an
6、d FinanceBanking:for customer information,accounts,loans,and banking transactions.Credit card transactions:for purchases on credit cards and generation of monthly statements.Finance:for storing information about holdings,sales,and purchases of financial instruments such as stocks and bonds;also for
7、storing real-time market data to enable online trading by customers and automated trading by the firm.3.Universities:for student information,course registrations,and grades(in addition to standard enterprise information such as human resources and accounting).4.Airlines:for reservations and schedule
8、 information.Airlines were among the first to use databases in a geographically distributed manner.5.Telecommunication:for keeping records of calls made,generating monthly bills,maintaining balances on prepaid calling cards,and storing information about the communication networks.As the list illustr
9、ates,databases form an essential part of every enterprise today,storing not only types of information that are common to most enterprises,but also information that is specific to the category of the enterprise.Data ModelsUnderlying the structure of a database is the data model:a collection of concep
10、tual tools for describing data,data relationships,data semantics,and consistency constraints.A data model provides a way to describe the design of a database at the physical,logical,and view levels.There are a number of different data models.The data models can be classified into following categorie
11、s:1.Relational ModelThe relational model uses a collection of tables to represent both data and the relationships among those data.Each table has multiple columns,and each column has a unique name.Tables are also known as relations.The relational model is an example of a record-based model.Record-ba
12、sed models are so named because the database is structured in fixed-format records of several types.Each table contains records of a particular type.Each record type defines a fixed number of fields,or attributes.The columns of the table correspond to the attributes of the record type.The relational
13、 data model is the most widely used data model,and a vast majority of current database systems are based on the relational model.2.Entity-Relationship ModelThe entity-relationship(E-R)data model uses a collection of basic objects,called entities,andrelationships among these objects.An entity is a“th
14、ing”or“object”in the real world that is distinguishable from other objects.The entity-relationship model is widely used in database design.3.Object-Based Data ModelObject-oriented programming(especially in Java,C+,or C#)has become the dominant software-development methodology.This led to the develop
15、ment of an object-oriented data model that can be seen as extending the E-R model with notions of encapsulation,methods(functions),and object identity.The object-relational data model combines features of the object-oriented data model and relational data model.4.Semistructured Data ModelThe semistr
16、uctured data model permits the specification of data where individual data items of the same type may have different sets of attributes.This is in contrast to the data models mentioned earlier,where every data item of a particular type must have the same set of attributes.The Extensible Markup Langu
17、age(XML)is widely used to represent semistructured data.5.XML DatabaseAn XML database is a data persistence software system that allows data to be stored in XML format.This data can then be queried,exported and serialized into the desired format.XML databases are usually associated with document-ori
18、ented databases.OConnell gives one reason for the use of XML in databases:the increasingly common use of XML for data transport,which has meant that“data is extracted from databases and put into XML documents and vice-versa”.It may prove more efficient(in terms of conversion costs)and easier to stor
19、e the data in XML format.Two major classes of XML database exist:XML-enabled:these map all XML to a traditional database(such as a relational database),accepting XML as input and rendering XML as output.This term implies that the database does the conversion itself(as opposed to relying on middlewar
20、e).Native XML(NXD):the internal model of such databases depends on XML and uses XML documents as the fundamental unit of storage,which are,however,not necessarily stored in the form of text files.6.Multimedia DatabaseMultimedia data typically means digital images,audio,video,animation and graphics t
21、ogether with text data.The acquisition,generation,storage and processing of multimedia data in computers and transmission over networks have grown tremendously in the recent past.The huge amount of data in different multimedia-related applications warranted to have databases as databases provide con
22、sistency,concurrency,integrity,security and availability of data.From an user perspective,databases provide functionalities for the easy manipulation,query and retrieval of highly relevant information from huge collections of stored data.MultiMedia Databases(MMDBs)have to cope up with the increased
23、usage of a large volume of multimedia data being used in various software applications.The applications include digital libraries,manufacturing and retailing,art and entertainment,journalism and so on.Some inherent qualities of multimedia data have both direct and indirect influence on the design an
24、d development of a multimedia database.MMDBs are supposed to provide almost all the functionalities,a traditional database provides.Apart from those,a MMDB has to provide some new and enhanced functionalities and features.MMDBs are required to provide unified frameworks for storing,processing,retrie
25、ving,transmitting and presenting a variety of media data types in a wide variety of formats.At the same time,they must adhere to numerical constraints that are normally not found in traditional databases.Concept of DBMSA database management system(DBMS)is a software package with computer programs th
26、at controls the creation,maintenance,and use of a database.It allows organizations to conveniently develop databases for various applications.A database is an integrated collection of data records,files,and other objects.A DBMS allows different user application programs to concurrently access the sa
27、me database.DBMSs may use a variety of database models,such as the relational model or object model,to conveniently describe and support applications.It typically supports query languages,which are in fact high-level programming languages,dedicated database languages that considerably simplify writi
28、ng database application programs.Database languages also simplify the database organization as well as retrieving and presenting information from it.A DBMS provides facilities for controlling data access,enforcing data integrity,managing concurrency control,and recovering the database after failures
29、 and restoring it from backup files,as well as maintaining database security.9-1-3 Application Case or ExampleSQL Server MonitorMicrosoft SQL Server is a relational database-management system that scales from laptops and desktops to enterprise servers,with a compatible version,based on the Windows M
30、obile operating system,available for handheld devices such as Pocket PCs,SmartPhones,and PortableMedia Centers.SQL Server provides a suite of tools for managing all aspects of SQL Server development,querying,tuning,testing,and administration.Most of these tools center around the SQL Server Managemen
31、t Studio.SQL Server Management Studio provides a common shell for administering all services associated with SQL Server,which includes Database Engine,Analysis Services,Reporting Services,SQL ServerMobile,and Integration Services.SQL(Structured Query Language,referred to as sequel or by the letters
32、S-Q-L)is a language that gives users an interface to a relational database where they can find and process data stored within.At the present time,it is the most widely used database language.In the database,information is stored in tables that are made up of many columns and rows.Each column handles
33、 a specific type of information,and each row represents a record entered into the table.A row may represent a customer,and each column may contain specifics about that customer.Microsoft SQL Server is a packaged brand of SQL that many companies use and depend on for their daily operation.When a comp
34、any installs SQL Server,it is usually used for several purposes,with the server administrator creating a database for each use.For more information about Microsoft SQL Server,visit M:http:/ with the full version of SQL Server,Microsoft has also developed MSDE(Microsoft Desktop Engine)which works lik
35、e SQL server,but has a 2GB limit on data,and contains a single database.There is also a user interface with SQL Server that is not used by MSDE.No matter which version of SQL Server you use,you should always be concerned with its proper function and constant availability.Without it,the information i
36、n the database cannot be retrieved and many of your applications that rely on the database will simply not work.Using a network monitoring tool like Whats Up Gold Premium Edition you can keep a constant watch over specific items or parameters in your SQL server.The following section describes the ap
37、plication and how you can use it to monitor your databases.Monitoring SQL Server WhatsUp Gold Standard and Premium Editions can monitor and report the status of the standard services associated with standard TCP/IP servers,such as SMTP,POP3,and IMAP,FTP,HTTP.If any of these services fail,your users
38、will be unable to get mail,transfer files,or use the web.It is a good idea to set up monitoring on these services so that you are the first to know if they fail.The SQL Server Monitor extends monitoring to parameters reported by Microsoft SQL Server(and Microsoft MSDE),allowing you to get an early w
39、arning of a degradation in performance.For example,you can monitor system parameters on your SQL Server database server to see if performance is within an expected range,and if not,you can intervene before the SQL Server fails.In other words,you can detect a looming problem before it causes an appli
40、cation or service failure.The SQL Server Monitor supports monitoring of Microsoft SQL Server 2000 or later versions,and MSDE 2000 or later versions,which can be on any machine in your network.Getting Started With the SQL Monitor Before configureuring your SQL monitor(s),you should determine which pa
41、rameters and services you need to monitor.You should also consider whether you want to create a single monitor with multiple parameters,several monitors with one parameter or service,or a combination of the two.If you create a single monitor to watch all of the parameters,you will not know which par
42、ameter has the problem until you do a little research.There is more set up time with the other options,but the troubleshooting time is greatly reduced.Note:To use some of the parameters,you must configure your System Data Source(ODB)name for the SQL Server.This is done in the Windows Data Sources(OD
43、B)Administrator.During the creation of your monitors,you also assign the alerts and actions you want WhatsUp to fire when one of the monitors goes down.Configuring a SQL Monitor To configure an instance of the SQL Server Monitor,you must first have Whats Up Gold Premium Edition installed.Then:1.From
44、 the Configure menu,select Active Monitor Library.2.The Active Monitor Library is the starting point for creating any Active Monitor in Whats Up Gold.This dialog shows all of the Active Monitors in your database.3.Add an SQL monitor:Click New.The Select Active Monitor Type dialog appears.Select SQL
45、Service Monitor and click OK.The New SQL Service Monitor(See Figure 9-1)dialog appears.4.Select the parameters and or processes to add to the monitor.Once the Active Monitor is created,you can assign that monitor to the device representing the computer running the SQL Server.You may also use the mon
46、itor during device discovery.Figure 9-1 New SQL Server MonitorAn ExampleTo monitor user activity,well create a monitor called“SQLUser,”then select Users as the only parameter to monitor.1.Access the SQL Server Monitor properties as described in the section above.2.Name the monitor“SQLUser.”3.Make su
47、re that Users is the only parameter that has a check in the box to the left to it.You will need to clear the selections for the other parameters and also for the processes.4.Click the Users parameter to select it,and then click Configure.The Users Threshold dialog appears.You should have in mind how
48、 many users or connections you want to consider as a threshold,and enter those values in the appropriate boxes on the dialog.5.When finished,click OK to add the SQLUser monitor to the Active Monitor Library.Once the monitor has been created,you are ready to add the“SQLUser”monitor to your SQL server
49、 device.1.Select the device that represents the SQL server.Double-click the device to display its properties.2.Select the Active Monitors icon.3.On the Active Monitor dialog,click Add.The Active Monitor wizard appears.4.Follow the wizard to add the active monitor to the device.9-2 Reading Material 9
50、-2-1 Reading comprehensionApplication Programs and User InterfacesAlthough many people interact with databases,very few people use a query language to interact with a database system directly.The most common way in which users interact with databases is through an application program that provides a