文档库 最新最全的文档下载
当前位置:文档库 › Modeling Real-Time Database Concurrency Control Protocol Two-Phase-Locking in Uppaal

Modeling Real-Time Database Concurrency Control Protocol Two-Phase-Locking in Uppaal

Modeling Real-Time Database Concurrency Control Protocol Two-Phase-Locking in Uppaal
Modeling Real-Time Database Concurrency Control Protocol Two-Phase-Locking in Uppaal

Modeling Real-Time Database Concurrency Control Protocol Two-Phase-Locking in Uppaal

Martin Kot

Center for Applied Cybernetics

Dept.of Computer Science,

Technical University of Ostrava

17.listopadu15,70833Ostrava-Poruba,Czech Republic

Email:martin.kot@vsb.cz

Abstract—Real-time database management systems(RT-DBMS)are recently subject of an intensive research.Model checking algorithms and veri?cation tools are of great concern as well.In this paper we show some possibilities of using a veri?cation tool Uppaal on some variants of pessimistic concur-rency control protocols used in real-time database management systems.We present some possible models of such protocols expressed as nets of timed automata,which are a modeling language of Uppaal.

I.I NTRODUCTION

Many real-time applications need to store some data in a database.It is possible to use traditional database management systems(DBMS).But they are not able to guarantee any bounds on a response time.This is the reason why so-called real-time database management systems(RTDBMS)emerged. Research in RTDBMS focused on evolution of transaction processing algorithms,priority assignment strategies and con-currency control techniques.But the research was based espe-cially on simulation studies.Hence at Technical university of Ostrava,V′a clav Kr′o l,Jindˇr ichˇCernohorsk′y and Jan Pokorn′y designed and implemented an experimental real-time database system called V4DB[6],which is suitable for study of real time transaction processing.The system is still in further development but some important results were obtained already. Formal veri?cation is of great interest recently and?nds its way quickly from theoretical papers into a real live.It can prove that a system(or more exactly a model of a system)has a desired behavior.The difference between testing and formal veri?cation is that during testing only some possible computa-tions are chosen.Formal veri?cation can prove correctness of all possible computations.A drawback of formal veri?cation is that for models with high descriptive power are almost all problems undecidable.It is important to?nd a model with an appropriate descriptive power to capture a behavior of a system,yet with algorithmically decidable veri?cation problems.

In this paper we consider so called model checking(see e.g.[3],[8]).This form of veri?cation uses a model of a system in some formalism and a property expressed usually in the form of formula in some temporal logic.Model checking Author acknowledges the support by the Czech Ministry of Education, Grant No.1M0567.algorithm checks whether the property holds for the model of a system.There are quite many automated veri?cation tools which implement model checking algorithms.Those tools use different modeling languages or formalisms and different logics.

The idea of the research described in this paper came from authors of V4DB.They were interested in using a veri?cation tool on their system.They would like to verify and compare different variants of algorithms and protocols used in RTDBMS.To our best knowledge,there are only rare attempts of automated formal veri?cation of real-time database system.In fact we know about one paper([9])only where authors suggested a new pessimistic protocol and veri?ed it using Uppaal.They presented two small models covering only their protocol.

There is not any veri?cation tool intended directly for real-time database systems.We have chosen the tool Uppaal because it is designed for real-time systems.But,it is supposed to be used on so-called reactive systems,which are quite different from database systems.So we need to solve the problem of modeling data records of the database and some other problems.Then we would like to check some important properties of used protocols and algorithms,for example: absence of a deadlock when using an algorithm which should avoid deadlock in the transaction processing,processing trans-action with bigger priority instead of transactions with smaller priority and so on.

Big problem of veri?cation tools is so called state space explosion.Uppaal is not able to manage too detailed models. On the other hand,too simple models can not catch important properties of a real system.So we need to?nd a suitable level of abstraction.

One of the most important and crucial parts of RTDBMS is concurrency control.There were many different concur-rency control protocols suggested.In this paper,we will concentrate on variants of a pessimistic protocol called two-phase-locking(2PL).First variant is basic2PL protocol,then slightly modi?ed version where deadlines are used to abort waiting transactions and?nally2PL–high priority where a transaction with higher priority can restart a transaction with a smaller priority.We will show that it is possible to model those protocols,to some level of abstraction,using modeling

language of Uppaal.These examples will show possibilities of modeling other similar pessimistic protocols and even some

other parts of RTDBMS.The models are inspired by the RTDBMS system V4DB in some way.V4DB is experimental so it has some simpli?cations which we can use to obtain simpler models yet with important behavior covered(as V4DB has).But it is possible to use ideas shown in this paper for veri?cation of concurrency control algorithms in general. We will also mention a few simple formula with an Uppaal’s answer to show model checking possibilities on suggested models.

II.V ERIFICATION TOOL U PPAAL

Uppaal([2],[4])is a veri?cation tool for real-time systems. It is jointly developed by Uppsala University and Aalborg University.It is designed to verify systems that can be modeled as networks of timed automata extended with some further features such as integer variables,structured data types,user de?ned functions,channel synchronization and so on.

A timed automaton is a?nite-state automaton extended with clock variables.A dense-time model,where clock variables have real number values and all clocks progress synchronously, is used.In Uppaal,several such automata working in parallel form a network of timed automata.

An automaton has locations and edges.Each location has an optional name and invariant.An invariant is a conjunction of side-effect free expressions of the form x

Particular automata in the network synchronize using chan-nels and values can be passed between them using shared variables.A state of the system is de?ned by the locations of all automata and the values of clocks and discrete variables. The state can be changed in two ways-passing of time (increasing values of all clocks)and?ring an edge of some automaton(possibly synchronizing with another automaton or other automata).

Some locations may be marked as committed.If at least one automaton is in a committed location,time passing is not possible,and the next change of the state must involve an outgoing edge of at least one of the committed locations. Each edge may have a select,a guard,a synchronization and an assignment.Select gives a possibility to choose non-deterministically a value from some range.Guard is a side-effect free expression that evaluates to a boolean.The guard must be satis?ed when the edge is?red.Synchronization label is of the form Expr!or Expr?where Expr evaluates to a channel.An edge with c!synchronizes with another edge(of another automaton in the network)with label c?.Both edges have to satisfy all?ring conditions before synchronization. There are urgent channels as well–synchronisation through such a channel have to be done in the same time instant when it is enabled(it means,time passing is not allowed if a synchronisation through urgent channel is enabled).An assignment is a comma separated list of expressions with a side-effect.It is used to reset clocks and set values of variables.

z:int[0,5]

x>=5 && y==0

synchr!

Fig.1.Graphical representation of a timed automaton in Uppaal Figure1shows how the described notions are represented graphically in Uppaal.There are3locations named A,B and C.Location A is initial and B is committed.Moreover A has an invariant x<=15with the meaning that the automaton could be in this location only when the value of the clock variable x is less or equal15.The edge between A and B has the select z:int[0,5]–it nondeterministically chooses an integer value from the range0to5and stores it in variable z.This edge also has the guard x>=5&&y==0.This means that it can be?red only when the value of the clock variable x is greater or equal5and the integer variable y has the value0.Data types of variables are de?ned in a declaration section.Further it has synchronization label synchr!and an assignment x=0,y=z reseting the clock variable x and setting the value of z to the integer variable y.

Uppaal has some other useful features.Templates are au-tomata with parameters.These parameters are substituted with given arguments in the process declaration.This enables easy construction of several alike automata.Moreover,we can use bounded integer variables(with de?ned minimal and maximal value),arrays and user de?ned functions.These are de?ned in declaration sections.There is one global declaration section where channels,constants,user data types etc.are speci?ed. Each automaton template has own declaration section,where local clocks,variables and functions are speci?ed.And?nally, there is a system declaration section,where global variables are declared and automata are created using templates. Uppaal’s query language for requirement speci?cation is based on CTL(Computational Tree Logic,[5]).It consist of path formulae and state formulae.State formulae describe individual states and path formulae quantify over paths or traces of the model.

A state formula is an expression that can be evaluated for a state without looking at the behavior of the model.For example it could be a simple comparison of a variable with a constant x<=5.The syntax of state formulae is similar to the syntax of guards.The only difference is that in a state formula disjunction may be used.

There is a special state formula deadlock.It is satis?ed in all deadlock states.The state is deadlock if there is not any action transition from the state neither from any of its delay successors.

Path formulae can be classi?ed into reachability,safety and liveness.Reachability formulae ask if a given state formula is satis?ed by some reachable state.In Uppaal we use syntax E<>?where?is a state formula.

Safety properties are usually of the form:“something bad

will never happen”.In Uppaal they are de?ned positively:“something good is always true”.We use A[]?to express, that a state formula?should be true in all reachable states, and E[]?to say,that there should exist a maximal path such that?is always true.

There are two types of liveness properties.Simpler is of

the form:“something will eventually happen”.We use A<>?meaning that a state formula?is eventually satis?ed.The other form is:“leads to a response”.The syntax is?-->ψwith the meaning that whenever?is satis?ed,then eventually ψwill be satis?ed.

The simulation and formal veri?cation are possible in Up-paal.The simulation can be random or user assisted.It is more suitable for veri?cation whether the model corresponds with the real system.Formal veri?cation should con?rm that the system has desired properties expressed using the query language.There are many options and settings for veri?cation algorithm in Uppaal.For example we can change representation of reachable states in memory.Some of the options lead to less memory consumption,some of them speed up the veri?cation.But improvement in one of these two characteristic leads to a degradation of the other usually. For more exact de?nitions of modeling and query languages and veri?cation possibilities of Uppaal see[2].

III.P ESSIMISTIC PROTOCOL TWO-PHASE-LOCKING

In this section we suggest one model of pessimistic con-currency control protocol.Of course,it is not the only one possible.

Two-phase-locking protocol is based on data locks.Before access to data the transaction must have a lock.All locks granted to a transaction are released after all operations of this transaction are executed.There are two types of locks-for read and write.The?rst is used for the operation select and the latter for update,delete and insert.Either one write lock or several read locks can be on a particular record(for simplicity,in our model will be only one read lock allowed for one record).If a transaction can not get a lock for a request it is placed in a queue of this record.After an existing lock is released,a new lock is granted to the?rst transaction in the queue.

The suggested model consists of several timed automata created using two templates.One type of automata represents data records in a database.The template is shown on the Figure2.Each record automaton has an integer ID stored in rec_id.There are three locations corresponding to two types of locks and to an unlocked state.Channels rd_ch[x]and wrt_ch[x]are used for requests for read and write locks on record x.Channel rls_ch[x]is for release(unlock)request. The second template shown on the Figure3is intended to create automata representing active transactions in the system. In V4DB is a number of active transactions bounded(pre-dispatcher module of RTDBMS holds the queue of incoming transactions and passes them to a dispatcher in such a way that it avoids overloading).So it is possible to represent one active (i.e.currently in execution)transaction as one automaton.

ReadLock WriteLock

Fig.2.Automaton representing a record in a database

ReadRequest

WriteRequest

Fig.3.Transaction automaton for two-phase-locking protocol After successful end of a transaction the same automaton represents some other transaction.

For simplicity,all transactions are supposed to have the same number of operations(given by a constant OPERATIONS).Each operation accesses one record(i.e.needs one lock).A type of operations and an accessed record is for a real RTDBMS in fact random because it is determined outside the RTDBMS.We do not need to model concrete operations, only locks.The record is chosen nondeterministically using select rec:rec_id_t.The operation is then immediately (due to a committed location)chosen nondeterministically by using one of three possible edges.If a transaction owns the demanded type of a lock on the accessed record,it does not asks the lock again.If it has only a read lock,it can ask change to a write lock.In the array locked is stored the information about owned locks,variable locks contains the number of operations for which locks are gained and real_locks the number of records locked by this transaction.

If the transaction has all necessary locks,the automaton is in a location Working.This represents execution of database

Fig.4.Transaction automaton for modi?cation of two-phase-locking protocol operations.The time spent in this location is bounded by constants MIN_OPER_TIME and MAX_OPER_TIME.After the execution,all locks are released instantly(using committed states and edges between them).

The described model simulates basic variant of2PL protocol where a deadlock can arise when some transactions wait mutually for locks granted to other transactions.A small modi?cation where transactions exceeding their deadline may be aborted can solve the problem with deadlocks.

IV.M ODIFICATION OF A MODEL OF TWO-PHASE-LOCKING

PROTOCOL

A template for database record automata remains the same as in the previous model(Figure2).A changed transaction automata template is shown on Figure4.

There is a clock variable tr_time added.It measures time from the beginning of transaction execution.If a transaction is waiting for a lock and it reaches its deadline(for simplicity same for all transactions given by a constant DEADLINE),it can be aborted.This means that all locks previously granted to this transaction are released.

We can use Uppaal to verify that this solution is really suf-?cient to avoid deadlock.For Uppaal,reachability properties are more suitable.So

the formula E<>deadlock

restart[lock_holder]!

locked[rec_id]=FREE,

lock_type[rec_id]=FREE,

lock_holder=req_trans,

restarted=false

Fig.5.Automaton representing a record in a database for2PL-HP protocol

means that deadlock is reachable in the model and this property is not satis?ed.Hence it is veri?ed that the system is deadlock-free.

V.P ESSIMISTIC PROTOCOL TWO-PHASE-LOCKING

HIGH-PRIORITY

The last modi?cation of our model is for a protocol two-phase-locking high-priority(2PL–HP).If a lock is requested by a transaction with a higher priority the transaction with a lower priority holding this lock may be restarted.

For this model we change both automata templates.A new template for database record automata is depicted on Figure 5.

In the global declarations are de?ned two arrays–locked and lock_type.The?rst one contains information about transactions holding locks for particular records and the latter one contains information about types of particular locks. lock_holder is a local variable of one record automaton used for the ID of transaction holding the lock on this record. As almost all is chosen nondeterministically(including the order of activating particular transaction automata),we can

Fig.6.Transaction automaton for2PL-HP protocol

model priorities using ID numbers of transaction automata–higher ID means higher priority.

If the automaton is in the location Unlocked,all requests passed through channels rd_ch and wrt_ch are answered immediately through a channel granted and informations about this lock are saved to above mentioned arrays and variable.

If the automaton is in the location WriteLock or ReadLock and a new request arrives,it has to restart a transaction holding the lock(priorities are checked before the request in a transaction automaton).Restarted transaction x is contacted using a channel restart[x].Then the lock is granted to a requesting transaction using channel grant.If a write lock is requested from the location ReadLock,there is a possibility to grant it without any other activity(except for the change of a type of lock in lock_type array).This is done when requesting transaction(req_trans)is the same as the current holder of the read lock(lock_holder). The transaction automata template has to be changed as well.The modi?ed version is depicted on the Figure6. There are added edges leading to a new location Restart from all locations where an automaton can be during pass-ing of time.All those edges have synchronization label restart[trans_id].In this way a transaction(with an ID stored in a variable trans_id)can be restarted anytime by a record automaton.In the location Restart all previ-ously gained locks are released and the waiting transaction with higher priority is noti?ed using global boolean variable restarted.A function next()returns the smallest ID number of a record on which is the transaction actually holding a lock.

Requests for locks are guarded.A requested record(speci-?ed by the variable req_rec)has to be unlocked or locked by a transaction with smaller priority.It comes handy to use 0(constant FREE is de?ned as0)in the array locked[] for unlocked records and ID of transaction automaton(i.e.the priority of transaction)plus one for a lock holder.Than the guard

trans_id+1>locked[req_rec]

is true whenever the lock on req_rec is hold by a transaction with a smaller priority or this record is unlocked.d by a transaction with a smaller priority or this record is unlocked. As in the previous case,although for this model Uppaal can verify that it is deadlock-free.We can use the same formula

E<>deadlock

and the answer is negative(i.e.no deadlock is reachable). Furthermore we can check e.g.if the transaction with the highest priority could be possibly restarted.The num-ber of transaction automata is given using a constant TRANSACTIONS.Hence the greatest ID number(this means priority too)is TRANSACTIONS-1.The formula is

E<>Transaction(TRANSACTIONS-1).Restart

and it is not satis?ed,i.e.this transaction could not be restarted. For all other transactions x the formula

E<>Transaction(x).Restart

is satis?ed.

VI.C ONCLUSION

In the previous sections,several timed automata were shown.They form models of three variants of pessimistic concurrency control protocols used in real-time database man-agement systems.Of course,this were not the only possible models.The purpose was to show that some important aspects of the real-time database system such as a concurrency control can be modeled using such a relatively simple model as nets of timed automata are.The models can be extended in many different ways to capture more behavior of those protocols and thus allow many properties to be described as a formula in the logic of Uppaal and then checked using its veri?cation algorithms.Even on presented models(without any extensions or modi?cations)different properties have been checked and some simple samples of them were presented in this paper.

Some properties can not be expressed using Uppaal’s mod-i?cation of CTL.The possible solution to this problem is to try some other veri?cation tool with other query language. Other parts of real-time database system or other concur-rency control protocols can be modeled too.For example priority assignment algorithms have signi?cant in?uence on performance database management system.This is our poten-tial future work.

R EFERENCES

[1]Alur,R.,Dill,D.L.:Automata for modeling real-time systems.Proc.of

Int.Colloquium on Algorithms,Languages,and Programming,volume 443of LNCS,pages322-335,1990.

[2]Behrmann,G.,David,A.,Larsen,K.G.:A Tutorial on Uppaal.Avail-

able on-line at http://www.it.uu.se/research/group/darts/papers/texts/new-tutorial.pdf(September7,2007)

[3]Berard,B.,Bidoit,M.,Petit,A.,Laroussinie,F.,Petrucci,L.,Schnoebe-

len,P.:Systems and Software Veri?cation,Model-Checking Techniques and Tools.ISBN978-3540415237,Springer,2001.

[4]David,A.,Amnell,T.:Uppaal2k:Small Tutorial.Available on-line at

http://www.it.uu.se/research/group/darts/uppaal/tutorial.ps(September7, 2007)

[5]Henzinger,T.A.:Symbolic model checking for real-time https://www.wendangku.net/doc/b815744097.html,r-

mation and computation,111:193-244,1994.

[6]Kr′o l,V.:Metody ovˇeˇr ov′a n′?vlastnost′?real-time datab′a zov′e ho syst′e mu

s pouˇz it′?m jeho experiment′a ln′?ho modelu.Dissertation thesis.VSB-Technical university of Ostrava,2006(in Czech).

[7]Kr′o l,V.,Pokorn′y,J.,ˇCernohorsk′y,J.:The V4DB project-support

platform for testing the algorithms used in real-time databases.WSEAS Transactions on Information Science&Applications,Issue10,V olume 3,October2006.

[8]McMillan,K.L.:Symbolic Model Checking.ISBN978-0792393801,

Springer,1993.

[9]Nystr¨o m, D.,Nolin,M.,Tesanovic, A.,Norstr¨o m,Ch.,Hansson,J.:

Pessimistic Concurrency-Control and Versioning to Support Database Pointers in Real-Time Databases.Proc.of the16th Euromicro Conference on Real-Time Systems,pages261-270,IEEE Computer Society,2004.

基于ER图的数据库设计与简单操作管理信息系统

实验报告 实验名称:基于ER图的数据库设计与简单操作 班级: 姓名: 学号: 实验时间: 2010年5月18日 成绩:指导老师: 一、实验目的: (1能够正确运用数据库的基本理论和方法。 (2熟悉常用关系型数据库的设计和基本操作。 (3熟悉关系数据库规范化设计理论,能够设计并建立科学合理的数据库,正确建立数据库中表与表之间的关系。 (4进一步正确理解数据库设计思路,培养分析问题、解决问题的能力,提高查询资料和撰写书面文件的能力。 二、实验设备及主要内容 实验设备:“Microsoft SQL Server”——“企业管理器”和“查询分析器”主要内容: 1.高等院校学生补考管理业务需求描述。高等院校补考管理系统应具备编辑补考学生信息、安排补考时间地点等基本管理功能,具体要求如下:

3对教室的编号、地点和容纳人数进行编辑。 4自动安排补考的时间、地点(即教室。 5录入学生的补考成绩。 6分别按照院系、专业、班级等查询参加补考的学生信息。 7按照补考的时间和地点查询参加补考的学生信息。 8查询和打印补考时间、地点的安排。 9查询和打印补考不及格学生的信息。 2.设计数据库。根据上述业务描述,设计数据库总体方案,明确数据库中表的结构,各表中关键字的设置,表与表之间的关系。 3.根据功能需求,以SQL语句的形式分类列出系统应涉及的数据操作。 4.利用Access、VFP或SQL server建立数据库,并成功实现基本数据操作。 5.提交书面实验报告。 三、实验步骤 步骤一:按照上述要求进行数据库和表的设计。具体包括:领域描述、概念模型用E-R图描述、从E-R图导出关系数据模型。 步骤二:选择Access、VFP或SQL server实现数据库操作。

水务管理系统数据库建设

水务系统数据库及其管理系统建设

一、概述 根据实际情况,结合本项目需求,从水安全、水资源、水环境等各类数据的 存储与管理要求出发,依据“统一规划、统一标准、统一设计、数据共享”的基 本原则,建立局核心数据库及各行业数据库。 各数据库的建设要以水务局信息化规划和各类标准化体系为依据,充分考虑与其它行业的协调及统一,避免数据库的封闭建设,提高数据的可用性,满足相关行业业务需要的数据库。 数据库建设是系统建设的重要支撑,根据信息中心建设所涉及到的各种数据的存储、管理特点,数据库整体结构采用“集中与分布相结合”的方式。 二、数据库设计原则 数据的一致性与标准性 数据库的设计除遵循数据库设计的软件行业标准外,还遵循国家、地方标准及行业的习惯性事实标准,以方便数据交流及功能的实行。 为方便与其他系统之间进行数据交换,数据库的设计将充分考虑以前已建立系统的数据。 数据的实用性与完整性 数据库设计充分考虑工作的实际情况和实际应用特点,按照系统规模和实际需求,遵循“先进性与实用性并重”的原则,保证数据的实用性。

数据完整性用来确保数据库中数据的准确性。数据库中的完整性一般是通过约束条件来控制的。约束条件可以检验进入数据库中的数据值。约束条件可以防止重复或冗余的数据进入数据库。在系统中可以利用约束条件来保证新建或修改 后的数据能够遵循所定义的业务知识。 数据的独立性和可扩展性 设计时需要做到数据库的数据具有独立性,独立于应用程序,使数据库的设计及其结构的变化不影响程序,反之亦然。另外,根据设计开发经验,需求分析 再详细,使用人员所提的需求不可能全面提出,此外,业务也是在变化的,所以 数据库设计要考虑其扩展性能,使得系统增加新的应用或新的需求时,不至于引起整个数据库结构的大的变动。 数据的安全性 数据库是整个信息系统的核心和基础,它的设计要保证安全性。通过设计一个合理和有效的备份和恢复策略,在数据库因天灾或人为因素等意外事故,导致数据库系统毁坏,要能在最短的时间内使数据库恢复。通过做好对数据库访问的授权设计,保证数据不被非法访问。 数据分级管理机制 根据系统访问角色,将用户分成领导决策分析用户、系统管理用户、运行浏览用户和运行调度用户等几个角色,分别赋予角色访问数据的权限和使用系统功 能的权限,严格控制角色登录,实现数据的分级管理。 统一考虑空间、属性、设施、模型数据的兼容性 数据库设计的时候充分考虑数据采集、数据入库、数据应用的紧密结合。便于在空间数据的基础上进行设施及相关属性的考虑;空间数据格式设计时充分考

数据库系统基础教程(第二版)课后习题答案

Database Systems: The Complete Book Solutions for Chapter 2 Solutions for Section 2.1 Exercise 2.1.1 The E/R Diagram. Exercise 2.1.8(a) The E/R Diagram Kobvxybz Solutions for Section 2.2 Exercise 2.2.1 The Addresses entity set is nothing but a single address, so we would prefer to make address an attribute of Customers. Were the bank to record several addresses for a customer, then it might make sense to have an Addresses entity set and make Lives-at a many-many relationship. The Acct-Sets entity set is useless. Each customer has a unique account set containing his or her accounts. However, relating customers directly to their accounts in a many-many relationship conveys the same information and eliminates the account-set concept altogether. Solutions for Section 2.3 Exercise 2.3.1(a) Keys ssNo and number are appropriate for Customers and Accounts, respectively. Also, we think it does not make sense for an account to be related to zero customers, so we should round the edge connecting Owns to Customers. It does not seem inappropriate to have a customer with 0 accounts;

数据库系统安全开发和改造规范

某某石油管理局企业标准 数据库系统安全开发和改造规范 某某石油管理局发布 前言 本标准由某某石油管理局计算机应用及信息专业标准化委员会提出并归口。 本标准由某某石油管理局信息中心起草。 本标准的主要内容包括: 适用范围、术语定义、数据库的开发和改造等几部分。 1范围 本标准规定了局某某石油管理局某某油田数据库系统安全开发与改造规范。 本标准适用于某某油田(企业内部)数据库系统安全开发与改造的全过程。 2规范解释权 某某油田信息中心网络标准和规范小组 3基本原则 本规范是参考国家相应标准,并参考相应国际标准,并结合某某油田的相应实际而制定 4使用说明 1)本规范所提到的重要数据应用部门,如无特别说明,均指某某油田范围内 各个有重要数据(如生产数据,管理数据等)的部门,这里不具体指明,各单位可以参照执行。 2)本规范说明了如何在现有数据库系统上应用的开发与改造方法,但不包括 数据系统的应用与管理。也不说明数据库系统本身的开发与改造方法。 5总则 1)为加强某某油田各单位数据库技术管理,有效地保护和利用数据库技术资 源,最大程度地防范技术风险,保护使用者的合法权益,根据《中华人民共和国计算机信息系统安全保护条例》及国家有关法律、法规和政策,结合油田的实际情况,制定本规范。 2)本规范所称的数据库,是指所有与油田业务相关的信息存储体的集合。

3)某某油田中从事数据库开发与改造的人员,均须遵守本规范。 6数据库系统的基本概念 数据、数据库、数据库管理系统和数据库系统是与数据库技术密切相关的四个基本概念。 数据是数据库中存储的基本对象。数据在大多数人的头脑中第一个反应就是数字。其实数字只是最简单的一种数据,是数据的一种传统和狭义的理解。广义的理解,数据的种类很多,文字、图形、图像、声音、学生的档案记录、货物的运输情况等等,这些都是数据。 我们可以对数据做如下定义:描述事物的符号记录称为数据。描述事物的符号可以是数字,也可以是文字、图形、图像、声音、语言等,数据有多种表现形式,它们都可以经过数字化后存入计算机。 数据库,是存放数据的仓库。只不过这个仓库是在计算机存储设备上,而且数据是按一定的格式存放的。所谓数据库中,是指长期存储在计算机内、有组织的、可共享的数据集合。数据库中的数据按一定的数据模型组织、描述和存储,具有较小的冗余度、较高的数据独立性和易扩展性,并可为各种用户共享。 数据库管理系统是位于用户与操作系统之间的一层数据管理软件,它负责科学地组织和存储数据以及如何高效地获取和维护数据。 7数据库系统的分类 集中型在这种结构中,客户程序连接某台指定的机器并通过其完成交易。数据库放置在同一台机器上,或指定一台专门的机器充当数据库 服务器。 数据分布型数据分布型结构类似前一种结构,只是数据库分布在每台服务器上。它具有的优点是:无单点失败且可独立进行管理。我们可以 将这种结构用于数据分割,例如逻辑分割和地理分割。 数据集中型这种结构是对集中型的一种增强,由其中的一台机器作为数据存取服务器,而在前台提供更多的应用服务器,共享一个数据库服 务器。这种情况下,必须使用数据库软件提供的并行处理功能及硬件 厂商提供的硬件集群策略。 高可用性现在,所有用户都希望在硬件出现错误时,应用的迁移能更加简单,并且在迁移的同时能保证系统继续运行且尽量减少人工干预。 中间件可以提供这样的功能,它可以帮助操作系统自动迁移关键组件 到正常的机器上。 8数据库类型的开发方式与访问接口 数据库类型的开发方式主要是用分布式组件技术。组件是独立于特定的程序设计语言和应用系统、可重用和自包含的软件成分。组件是基于面向对象的,支持拖拽和即插即用的软件开发概念。基于组件技术的开发方法,具

《数据库基础及应用》网上作业(1-5章).

Access2010《数据库基础及应用》网上作业(1-6章) (共68 题 第1 题: (单选题, 1.5 分 有三个关系 R、S 和 T 如下: R S T A B m 1 n 2 B C 1 3 3 5 A B C m 1 3 由关系 R 和 S 通过运算得关系 T,则所使用的运算是________。 A)笛卡尔积 B)自然连接 C)并

D)交 [A]选A [B]选B [C]选C [D]选D 答案: B 第2 题: (单选题, 1.5 分 数据库技术的根本目标是要解决数据的_____。 [A]存储问题 [B]共享问题 [C]安全问题 [D]保护问题 答案: B 第3 题: (单选题, 1.5 分 下列叙述中错误的是_______。 [A]数据库系统是在文件系统之上加入数据库管理系统对数据进行管理 [B]各种数据库管理系统均基于某种数据模型 [C]数据库管理系统必须在操作系统支持下工作 [D]数据库系统比文件系统能够管理更多的数据 答案: D 第4 题: (单选题, 1.5 分

数据库管理系统通常提供授权功能来控制不同用户访问数据的权限,这主要是为了实现数据库的_____。 [A]可靠性 [B]一致性 [C]完整性 [D]安全性 答案: D 第5 题: (单选题, 1.5 分 有三个关系 R、S 和 T 如下: R S T D E F b0h1 y j p2 D E F g8f3 b0h1 c5z4 D E F b0h1

由关系 R 和 S 通过运算得到关系 T,则所使用的运算是________。 A)并 B)交 C)笛卡尔积 D)自然连接 [A]选A [B]选B [C]选C [D]选D 答案: B 第6 题: (单选题, 1.5 分 有两个关系 R 和 T 如下: R T A B C a 1 2 A B C c 3 2

城市公共基础数据库建设方案.

城市基础数据库系统建设方案

1.系统概述 长期以来,政府各部门内部拥有着大量城市基础数据资源,但由于管理分散,制度规范不健全,造成重复采集、口径多乱、数出多门;各部门的指标数据自成体系,标准不一,共享程度较差。随着政府向“经济调节、市场监管、社会管理和公共服务”管理职能的转变,就要求必须能够全面、准确掌握全地区经济社会发展态势,强化政府部门掌控决策信息资源的能力,政府部门间信息资源整合与共享需求越来越紧密,但当前部门间信息共享多是点对点方式,没有统一的数据交换管理平台。因此各部门对加快解决数据资源分散管理、数据共享不足的问题需求十分迫切,需要建立城市基础数据库(以下简称智慧城市公共基础数据库)系统以解决以上问题。 依托智慧城市公共基础数据库系统的建设,可以实现各委办局、各所辖地区的经济社会综合数据采集交换,为各部门提供更广泛的信息共享支持,一方面数据信息从各委办局、各所辖地区整合接入,另一方面也为政府和这些接入部门提供全面的共享服务。同时,以智慧城市公共基础数据库指标体系建立为基础,整合来自各委办局和各所辖地区的、经过审核转换处理的数据资源,可实现对经济社会信息的统一和集中存储,确保数据的唯一性和准确性,为今后政府工作提供一致的基础数据支持。 数据整合共享只是手段,数据分析服务才是目的。依托智慧城市公共基础数据库系统建设,可有效整合各政府部门所掌握的全市经济社会信息资源,满足政府业务对统一数据资源共享需要,进而提升形势分析预测水平,对政府在发展规划、投资布局、资源环境、管理创新、科学决策等业务提供强有力支持,提高了政府部门掌控全市经济社会发展态势能力。 2.建设目标 1)建立科学合理的智慧城市公共基础数据库指标体系,力求全面反映地区经济和社会发展的总体情况: 2)有组织、有计划、持续地对政府统计部门、政府各部门以及国民经济行业管理部门负责统计的关系到地区经济与社会发展的信息资源进行收集、整合,

数据库系统基础讲义第15讲关系模式设计之规范化形式

数据库系统之三 --数据建模与数据库设计 课程1:基本知识与关系模型 课程2:数据库语言-SQL 课程3:数据建模与数据库设计课程4:数据库管理系统实现技术数据库系统

第15讲关系模式设计之规范形式 Research Center on I ntelligent C omputing for E nterprises & S ervices, H arbin I nstitute of T echnology 战德臣 哈尔滨工业大学教授.博士生导师黑龙江省教学名师教育部大学计算机课程教学指导委员会委员

战德臣教授数据库的规范性设计需要分析数据库Table中的属性在取值方面有什么依存关系?数据库设计过程中应遵循什么样的原则 数据库设计理论 ?数据依赖理论 ?关系范式理论 ?模式分解理论BCNF 3NF 2NF 1NF 4NF 5NF 函数依赖部分函数依赖/完全函数依赖传递函数依赖 多值依赖 联结依赖如何避免数据库的一致性问题—数据库的规范性设计无损连接分解保持依赖分解

战德臣教授基本内容 1. 关系的第1NF和第2NF 2. 关系的第3NF和Boyce-Codd NF 3. 多值依赖及其公理定理 4. 关系的第4NF 重点与难点 ●一组概念:1NF, 2NF, 3NF, BCNF, 4NF;多值依赖 ●熟练应用数据库设计的规范化形式,判断数据库设计的正确性及可 能存在的问题

关系的第1范式和第2范式 Research Center on I ntelligent C omputing for E nterprises & S ervices, H arbin I nstitute of T echnology 战德臣 哈尔滨工业大学教授.博士生导师黑龙江省教学名师教育部大学计算机课程教学指导委员会委员

第六章 信息系统与数据库

第六章信息系统与数据库 一、选择题 .以下列出了计算机信息系统抽象结构层次,其中的数据库管理系统和数据库。.属于业务逻辑层 属于资源管理层 属于应用表现层 不在以上所列层次中 . 以下列出了计算机信息系统抽象结构的个层次,在系统中为实现相关业务功能(包括流程、规则、策略等)而编制的程序代码属于其中的。 基础设施层 业务逻辑层 资源管理层 应用表现层 . 以下列出了计算机信息系统抽象结构的个层次,系统中的硬件、系统软件和网络属于其中的。 .基础设施层 .业务逻辑层 .资源管理层 .应用表现层 . 以下列出了计算机信息系统抽象结构层次,在系统中可实现分类查询的表单和展示查询结果的表格窗口。 属于业务逻辑层 属于资源管理层 属于应用表现层 不在以上所列层次中 . 以下关于语言的说法中,错误的是 的一个基本表就是一个数据库 语言支持三级体系结构 .一个基本表可以跨多个存储文件存放 的一个二维表可以是基本表,也可以是视图 . 信息系统采用模式时,其“查询请求”和“查询结果”的“应答”发生在之间。浏览器和服务器 浏览器和数据库服务器 服务器和数据库服务器 任意两层 . 关系数据库的查询操作由个基本运算组合而成,其中不包括。 连接 选择 投影 比较 . 信息系统采用的模式,实质上是中间增加了的模式。 服务器 浏览器

数据库服务器 文件服务器 . 在信息系统的模式中,是之间的标准接口。 服务器与数据库服务器 浏览器与数据库服务器 浏览器与服务器 客户机与服务器 . 计算机信息系统中的三层模式是指。 应用层、传输层、网络互链层 应用程序层、支持系统层、数据库层 浏览器层、服务器层、服务器层 客户机层、网络层、网页层 . 是,用户可以直接将语句送给。 一组对数据库访问的标准 数据库查询语言标准 数据库应用开发工具标准 数据库安全标准 . 所谓“数据库访问”,就是用户根据使用要求对存储在数据库中的数据进行操作。它要求。 .用户与数据库可以不在同一计算机上而通过网络访问数据库;被查询的数据可以存储在多台计算机的多个不同数据库中 .用户与数据库必须在同一计算机上;被查询的数据存储在计算机的多个不同数据库中 .用户与数据库可以不在同一计算机上而通过网络访问数据库;但被查询的数据必须存储同一台计算机的多个不同数据库中 .用户与数据库必须在同一计算机上;被查询的数据存储在同一台计算机的指定数据库中 是,用户可以直接将语句送给。 .一组对数据库访问的标准 .数据库查询语言标准 . 数据库应用开发工具标准 .数据库安全标准 . 查询语句:,,, ,, ===‘男’; 涉及的和三个表。和表之间和和表之间分别通过公共属性 作连接操作。 . 在模式的网络数据库体系结构中,应用程序都放在上。 浏览器 数据库服务器 服务器 客户机 . 语言提供了语句进行数据库查询,其查询结果总是一个。

数据库基础与应用形考作业答案

数据库基础与应用形考作业参考答案 作业1: 一、单选:ABCDBACBB 二、判断:√√√√╳√√╳╳√ 三、填空:(1-36)依赖于、文件管理数据库、文件管理数据库、 局部全局、主属性非主属性、多多、1 多、型值、元组属 性、关系定义 DBMS、继承封装多态、DBA 数据库设计员应 用程序设计员终端用户、外模式与模式模式与内模式、定义/ 操作/控制自动建立、关系数据结构关系运算关系完整性规 则、单值重复、侯选码属性的、主非主、空主码、7 3 2、选择 2、S >< II学生号 (X))、II课程号(X)与C 、X←→Y 决 定因素、非平凡完全、学号系主任、 X→Y X→Z 分解性、X 侯选码、2、3、第一不可再分、数据冗余操纵异常、第 一 2 、第二二、第三、BC 主属性 作业2: 一、填空:(1-21)视图基本表、CREATE SCHEMA DROP SCHEMA、列级表级、列级表级、建立修改删除、V ALUES SELECT、表建立、按需要安全、不影响直接影响、SELECT FROM WHERE、GROUP BY ORDER BY 、需求分析概 念设计、数据流图数据字典需求说明书、需求分析ER图、商品销售收款、全局模式外模式、1对1 1对多、设计 要求功能完善操作方便、客房表住宿、娱乐费表催补款表、

客房表客房空闲表 二、写功能 1.从商品库中查询出每一种商品的商品代号、分类名、数量和品牌 等信息。 2.从商品库中查询出所有商品的不同产地的总数。 3.从教学库中查询出每门课程被选修的学生数。 4.从教学库中查询出学生号为@S1的学生和学生号为@S2的学生所 选修的共同课程的课程号。 5.从教学库中查询出所有已被学生选修的课程。 6.从教学库中查询出最多选修了2门课程(含未选任何课程)的全 部学生。 7.从教学库中查询出每个学生的选课的全部情况,并依次按学生号 和成绩排序。 8.从教学库中查询出选修了姓名为@a的学生全部选课的所有学生。 三、写命令 1. Select * from 商品表1 where 数量between 10 to 20 2. Select 分类名,sum(数量) as 总数量 From 商品表1

数据库与信息系统实验

目录 实验一数据库表的创建 (1) 实验二数据库表的查询 (7) 实验三数据库模型设计 (12) 实验四数据库设计 (15)

实验一数据库表的创建 1)启动SQL Server2008, “SQL Server Manange ment Studio” 2)单击链接(C) 打开“SQL Server Manange ment Studio”窗口,并在左边的目录树结构中选择“数据库”文件夹。 3) 单击右键,选择“新建数据库”命令,打开“新建数据库” 对话框,在“数据库名称”框内输入名称“教学管理系统”,注意数据文件和日志文件的属性设置

4) 单击“确定”按钮,完成“教学管理系统”数据库的创建。 5)在左边的目录树中展开“数据库”下刚才创建的“教学管理系统” 文件夹,然后在“表”对象上单击右键,选择“新建表”,右边窗格中显示SQL Server 2008的表设计器。 学生学号char(7) 学生身份证号char(18) 学生姓名char(10) 学生性别char(2) 学生移动电话char(11) 学生来自的城市char(10) 学生主修专业char(20) 学生院系char(20) 学生累计修满的学分int

6)设置主键 在表设计器中选择“学生学号”,右击,选择“设置主键”,得到下图,主键设置成功 7)展开表右击dbo.Student,选择编辑前200行,输入以下数据 再新建查询输入语句 select*from student 得到结果: 8)修改表可以按照 展开表右击dbo.Student,选择编辑前200行,改第一行数据 S060101 ******19880526*** 王东民男135***11 杭州计算机信息学院160 改为: S060101 ******19880526*** 黄星星男135***11 随州电子信息信息学院160

数据库基础与应用形成作业答案

《数据库基础与应用》形成性作业 第一次作业 一、单项选择题 1、域是实体中相应属性的(A)。 A、取值范围 B、值 C、名称 D、描述 2、把保存关系定义的关系称为对应数据库的(B)。 A、一般关系 B、元关系 C、特定关系 D、正常关系 3、在一个关系R中,若存在X→Y和X→Z,则存在X→(Y,Z),称此为函数依赖的(C)规则。 A、传递性 B、分解性 C、合并性 D、增广性 4、设一个关系为(R(A、B、C、D、E、F),它的最小函数依赖集为FD={A→B,A→C,D→E,D→F},则该关系的候选码为(D)。 A、(A,B) B、(A,C) C、(A,E) D、(A,D) 5、设D1,D2和D3域的基数分别为2,3,4,则D1*D2*D3的元组数为(B)。 A、9 B、24 C、10 D、20 6、若一个关系为R(学生号,姓名,性别,年龄),则(A)适合作为该关系的主码。 A、学生号 B、姓名 C、性别 D、年龄 7、设一个集合A={3,4,5,6,7},集合B={1,3,5,7,9},则A和B的并集中包含有(C)个元素。 A、10 B、8 C、7 D、6 8、在一个关系R中,若存在X→(Y,Z),则也隐含存在X→Y和X→Z,称此为函数依赖的(B)规则。 A、传递性 B、分解性 C、合并性 D、增广性 9、若一个关系的任何非主属性都不部分依赖于任何候选码,则称该关系最高达到了(B)范式。 A、第一 B、第二 C、第三 D、BC 二、是非题 1、在文件管理阶段,文件之间是相互联系的,在数据库管理阶段,文件之间是相互独立的。(错) 2、分布式数据库系统既支持客户局部应用,又支持客户的全局应用。(对)

数据库系统讲义 (1)

数据库系统原理 第一节数据库系统概述 数据管理技术经历了人工管理、文件系统和数据库系统三个发展阶段。 一、数据库基本概念 1.数据(Data)是数据库系统中存储的基本对象,是描述事物的符号记录。包括文字、图形、图像、流媒体信息等。 2.数据库(DB)是存放数据的仓库,是长期存放在计算机内的、有组织的、可共享的数据集合。数据库中的数据按一定的数据模型组织、描述和存储,具有较高的数据独立性和扩展性,可被用户所共享。 3.数据库管理系统(DBMS)是位于用户和操作系统之间的数据管理软件,如Oracle、DB2.Access等。其功能包括:数据定义功能、数据操纵功能、数据库的运行管理、数据库的建立和维护。 4.数据库系统(DBS)是指计算机系统中引入数据库后的系统,由数据库、数据库管理系统、应用系统、数据库管理员、数据库用户构成。 【要点】 1.数据、数据库、数据库管理系统和数据库系统的基本概念和英文缩写。 2.DBMS的功能:数据定义功能(DDL)、数据操纵功能(DML)、数据库的运行管理、数据库的建立和维护。 3.DBS由数据库、数据库管理系统、应用系统、数据库管理员、数据库用户构成。 4.数据库技术主要解决数据共享的问题,DBMS是系统软件。 【例题·单选题】(2010年×省信用社招聘考试真题)下面关于数据库管理系统和操作系统之间关系描述正确的是()。 A.操作系统可以调用数据库管理系统 B.互不调用 C.数据库管理系统可以调用操作系统 D.可以相互调用 『正确答案』C 『答案解析』硬件和操作系统是数据库管理系统的技术资源,数据库管理系统可以调用操作系统。二、数据库系统的特点

数据库系统安全性分析与实现

数据库系统安全性分析与实现 (刘中胜信息系统项目管理师,高级项目经理) 摘要:随着信息技术的不断发展,各行企业都不同程度地实现了信息化,因而信息系统的应用非常普及,作为信息系统的重要组成部分---数据库系统也就成为重中之重。数据库系统在运行过程中,会受到软件、硬件、人为和自然灾害等各种因素的影响,这些因素不但会破坏数据的机密性、完整性、可用性,造成数据损坏或丢失,而且会影响数据库系统的正常运行,甚至导致数据库系统的崩溃,因此,数据库系统的安全性问题变得尤为突出,不断面临巨大的、新的挑战。本文将从数据库系统的安全属性及安全技术进行分析,探讨实现数据库系统的高安全性策略。 关键字:数据库系统;数据库技术;安全性;安全策略 随着信息技术的不断发展,各行企业都不同程度地实现了信息化,因而信息系统的应用非常普及,作为信息系统的重要组成部分---数据库系统也就成为重中之重。数据库系统在运行过程中,会受到软件缺陷和故障、硬件损坏和故障,人为非法访问和误操作,以及自然灾害等各种因素的影响,这些因素不但影响数据的安全,而且会影响数据库系统的正常运行,甚至导致数据库系统的崩溃,因此,数据库系统的安全性问题变得尤为突出,不断面临巨大的、新的挑战。如何保证数据的安全,如何保证数据库系统正常安全地运行,是我们在实现企业信息化建设过程中必须认真考虑的问题。下面将从数据库系统的安全属性出发,分析构建数据库系统的安全技术,并阐述实现数据库系统高安全性的策略。 一、数据库系统的安全属性分析 对数据库系统安全属性的分析,是实现数据库安全策略的一个重要环节,是一个数据库系统采用恰当安全策略的前提。数据库系统的安全属性涉及多个方面,从总体上来讲,包括机密性、完整性、可用性、可控性和可审查性等属性。 (1)机密性:防止数据被非法窃取、调用或存取而泄密。数据只能被其相应的合法用户访问或调用。 (2)完整性:防止非法用户对数据进行添加、修改和删除,同时也防止合法用户越权访问对未被授权的数据进行添加、修改和删除,并且能够判断数据是否被修改。

医院信息系统数据库安全性分析及措施

医院信息系统数据库安全性分析及措施医院信息系统数据库安全性分析及措施 余大勇① ①四二一医院信息科,510000,广东省广州市新港中路468号 摘 要要 数据库系统已经渗透到医疗行业的各个方面,数据库系统的安全问题也时时在威胁医院业务正常的运行与发展。数据安全问题主要有几方面:硬件、系统软件出错,人为错误,计算机病毒,自然灾害等。通过对现数据库系统安全进行分析,统计了本医院数据库意外停机的原因。针对这些原因,提出了数据库安全措施,包括双机策略、磁盘备份策略、数据库容灾策略、数据库备份策略。这些措施对提高医院信息系统数据库安全提供比较可靠的保障。 关键词关键词 医院信息系统 数据库安全 双机备份; 1 1 引言 引言 随着计算机技术的发展,医院信息已成为医疗系统日常活动中十分重要的一个组成部分,医院信息系统的可靠性、安全性、数据的完整性越来越引起广泛的重视。与此同时,数据库系统的安全问题也正在威胁医院信息系统的正常运行。目前,数据安全问题主要有几方面:硬件、系统软件出错,人为错误,计算机病毒,自然灾害等。数据库的数据安全受到严峻的挑战。数据库安全问题已是影响业务安全、健康、高速发展的一大隐患。 2 2 数据丢失的原因数据丢失的原因 根据医院HIS数据丢失的情况,总结数据丢失原因主要是因为数据库系统停机造成的。一般来说,信息管理系统要求24小时不停机,可靠性要求高,不仅不允许出现系统故障后丢失数据,而且要求故障在几分钟甚至几秒之内迅速恢复[1]。 而数据库系统停机可以分为:计划内停机和意外(非计划内)停机。 意外停机主要包括:系统错误:电源突然断电或者服务器磁盘突然损坏或者操作系统突然崩溃 [2];数据逻辑错误及自然灾害:发生在数据的逻辑错误;自然灾害,如火灾、地震、台风、暴雨等;人为错误:人为误删除某一张表或人为不小心删除某些数据等;系统管理员在日常维护中误删除了某个数据文件。 计划内停机包括:系统维护:增加硬件或系统升级;数据维护:表都重新定义或索引重建或更改表结构等。 对医院信息系统意外停机进行了150次的统计,统计结果见表1。 表1 意外停机统计表 意外停机原因 次数 所占百分比

数据库基础与应用(带答案)

B.

C. 元组 D. 基数 5. 在Access 数据库中,任何事物都被称为分值:2 A. 方法 B. 对象 C. 属性 D. 事件 6.Access 数据库类型是分值:2 8. Access 2 A. 必须包含构成Access 数据库的七类不同的对象

B. 至少应包括三个以上不同类型的对象 C. 可以不包含任何对象 D. 每个对象必须作为单独的文件存放在Windows操作系统中 9. 在Access 中,空数据库是指分值:2 A. 数据库中数据是空的 B. 没有基本表的数据库 C. 没有窗体、报表的数据库 D. 没有任何数据库对象的数据库 10. 若使打开的数据库文件能为网上其他用户共享,但只能浏览数据,要选择打开数据库文件的方式为分值:2 A. 常规打开 B. 以只读方式打开 以独占方式打开 D. 以独占只读方式打开 B. C. 使用用户级安全机制 D. 设置访问数据库的权限

12. 表“设计”视图窗口包括两个区域:字段输入区和分值:2 A. 格式输入区 B. 数据输入区 C. 字段属性区 D. 页输入区 13. 输入掩码是给字段输入的数据时设置的分值:2 A. 初值 B. 当前值 C. 输出格式 14. 子表的概念是相对主表而言的,它是嵌在__ 中的表。分值:2 A. 从表 C. 子表 D. 大表 15. 在Access中表和数据库的关系是分值:2 A. 一个数据库可以包含多个表 B. 一个表只能包含两个数据库 C. 一个表可以包含多个数据库 D. 一个数据库只能包含一个表

16. 在Access的数据类型中,不能建立索引的数据类型是分值:2 A. 文本型 B. 备注型 C. OLE 对象 D. 超链接 17. 设置主关键字是在_ 中实现的。分值:2 A. 表设计视图 B. 表的数据表视图 C. 查询设计视图 D. 报表的设计视图 18. 假设规定某个日期型字段的取值范围是2008年1月1日到2009年1月 1 日,则可设置该字段的有效性规则为分值:2 A. Between #1/1/2008# And #1/1/2009# B. Between "1/1/2008" And "1/1/2009" C. Between *1/1/2008* And *1/1/2009* D. Between [2008 年1月1日] And [2009 年 1 月1 日] 19. ___________________________________________ Access 数据库系统 提供四种查询向导,分别是_______________________ 、交叉表查询向导、

数据库管理系统设计报告

数据库原理课程设计报告学生学籍管理系统 学生学号: 学生姓名: 所在学院: 专业年级: 年月日

前言 随着信息技术的飞速发展,信息化的大环境给各成人高校提出了实现校际互联,国际互联,实现静态资源共享,动态信息发布的要求; 信息化对学生个人提出了驾驭和掌握最新信息技术的素质要求;信息技术提供了对教学进行重大革新的新手段;信息化也为提高教学质量,提高管理水平,工作效率创造了有效途径. 校园网信息系统建设的重要性越来越为成人高校所重视. 利用计算机支持教学高效率,完成教学管理的日常事务,是适应现代教学制度要求、推动教学管理走向科学化、规范化的必要条件;而教学管理是一项琐碎、复杂而又十分细致的工作,工资计算、发放、核算的工作量很大,不允许出错,如果实行手工操作,每月须手工填制大量的表格,这就会耗费工作人员大量的时间和精力,计算机进行教学管理工作,不仅能够保证各项准确无误、快速输出,而且还可以利用计算机对有关教学的各种信息进行统计,同时计算机具有手工管理所无法比拟的优点. 例如:检索迅速、查找方便、可靠性高、存储量大、保密性好、寿命长、成本低等。这些优点能够极大地提高员工工资管理的效率,也是教学的科学化、正规化管理,与世界接轨的件。 在软件开发的过程中,随着面向对象程序设计和数据库系统的成熟,数计成为软件开发的核心,程序的设计要服从数据,因此教学管理系统的数据库设计尤其重要。这里主要介绍教学管理系统的数据库方面的设计,从需求分析到数据库的运行与维护都进行详细的叙述。

目录 前言 (2) 1.需求分析 (4) 1.1需求分析的任务 (4) 1.2需求分析的工程 (4) 1.3数据字典 (5) 2.概念结构设计 (6) 2.1E-R图设计方法及关键技术 (6) 2.2学生学籍管理E-R图 (7) 3.逻辑结构设计 (8) 4.数据库实施 (9) 4.1建表 (9) 4.2 SQL语句查增删改操作 (10) 4.3建立条件查询 (12) 4.4窗体的建立 (13) 4.5登陆、查询操作 (16) 4.6增删改操作 (16) 5.数据库运行与维护 (17) 5.1数据库的运行 (17) 5.2数据库的维护 (17) 6.总结 (18)

数据库系统基础教程第八章答案

Section 1 Exercise 8.1.1 a) CREATE VIEW RichExec AS SELECT * FROM MovieExec WHERE netWorth >= 10000000; b) CREATE VIEW StudioPres (name, address, cert#) AS SELECT https://www.wendangku.net/doc/b815744097.html,, MovieExec.address, MovieExec.cert# FROM MovieExec, Studio WHERE MovieExec.cert# = Studio.presC#; c) CREATE VIEW ExecutiveStar (name, address, gender, birthdate, cert#, netWorth) AS SELECT https://www.wendangku.net/doc/b815744097.html,, star.address, star.gender, star.birthdate, exec.cert#, https://www.wendangku.net/doc/b815744097.html,Worth FROM MovieStar star, MovieExec exec WHERE https://www.wendangku.net/doc/b815744097.html, = https://www.wendangku.net/doc/b815744097.html, AND star.address = exec.address; Exercise 8.1.2 a) SELECT name from ExecutiveStar WHERE gender = ‘f’; b) SELECT https://www.wendangku.net/doc/b815744097.html, from RichExec, StudioPres where https://www.wendangku.net/doc/b815744097.html, = https://www.wendangku.net/doc/b815744097.html,; c) SELECT https://www.wendangku.net/doc/b815744097.html, from ExecutiveStar, StudioPres WHERE https://www.wendangku.net/doc/b815744097.html,Worth >= 50000000 AND StudioPres.cert# = RichExec.cert#; Section 2 Exercise 8.2.1 The views RichExec and StudioPres are updatable; however, the StudioPres view needs to be created with a subquery. CREATE VIEW StudioPres (name, address, cert#) AS SELECT https://www.wendangku.net/doc/b815744097.html,, MovieExec.address, MovieExec.cert# FROM MovieExec WHERE MovieExec.cert# IN (SELECT presCt# from Studio); Exercise 8.2.2 a) Yes, the view is updatable. b)

数据库系统安全、技术操作规程

数据库系统安全、技术操作规程 一.数据库系统概述 在OVATION系统中,RDBMS核心是Ovation Power Tool数据库,由多种分布式数据库支持的主(master)数据库组成。 Ovation系统中许多信息,包括系统配置、控制算法信息和过程点数据库存储在Ovation 数据库中。Ovation数据库提供了结合和产生系统中大量的原始数据的能力,并可以用来创建其他的信息。所有设计工具和用户接口把数据存储在Ovation数据库中,然后把信息传送到控制系统中。Ovation数据库允许应用软件和控制系统通过第三方SQL(结构化查询语言)工具方便的访问数据。 主数据库中信息分成两个主要部分:用户级和系统级。 用户级由下列一组表组成(可以进行所有SQL的读访问): 点表-表示点的用户级别特性。它们通过导入程序、点建立器和控制建立器来增加。 控制表-表示系统的控制信息,由控制建立器操作。 配置表-表示系统的配置。通过导入程序、Admin Tool和I/O建立器来增加。 参数表-表示Ovation系统内容、硬件模件参数信息,Ovation记录类型信息,并在数据库创建时增加。 基线表-用于捕捉用户级别表内容的基线。 Ovation数据库以Oracle7为基础, Ovation通过网络进行连接,Oracle把存放在不同计算机上的数据结合起来存放在一个逻辑数据库中,并由非控制器网络节点进行访问。

二.数据库信息的存取 2-1. 数据库初始化定义工具(DBID) Power Tool数据库可以通过Power Tool单元支持建立数据库,同时也可以执行大量数据输入和导入功能,将数据存放到Power Tool主数据库中。 为方便初始化Power Tool数据库总体,创建数据库初始化定义工具(DBID)。如Ovation 点建立器,DBID提供了一个图形化用户接口,用于创建、删除和修改点数据。DBID通过允许用户直接修改点表中数据,支持大批量数据输入和全局性编辑/替换功能。 DBID建立在Microsoft Access95数据库产品及其它数据检测程序基础上。DBID同Ovation点建立器程序非常相似,同样包含了定义的窗体及系统中硬件配置及输入和编辑点数据。 数据可以手工输入或者从许多其它源文件,如DBASE或电子数据表格文件中导入,但是根据外部数据结构可能要求一些自定义转换。一旦信息输入到DBID并导入到主数据库中,在点对点基础上通过点建立器进行修改。大批量数据修改可通过将数据从主数据库中导出来完成,然后再把这些数据存回到DBID数据库中。一旦修改完成,文件可重新导入到主数据库中。 DBID生成一个可以导入到Ovation数据库中的文本文件。 2-2. 数据的导入功能(ptdbimp) 导入文件由DBID工具生成后,可使用Power Tool的导入功能(ptdbimp)把数据存入到主数据库中,这与Power Tool导出功能(ptdbexp)配合使用。 导入过程的三个用途: 初始化创建的数据库 修改一个已存在的数据库 恢复数据库为一个可知状态 注意ptdbimp用于生成一个主数据库的导出文件(使用ptdbexp),并且把数据存回到DBID工具中这是重要的。若有必要,可进行大批量更改或添加。一旦完成,DBID可以生成一个导入到主数据库的文本文件。 Ptdmimp程序存放在$WDPF_HOME/db/bin目录下,为使用ptdbimp,在shelltool窗口中运行下列命令: $WDPF_HOME/db/bin> ptdbimp ptadmin [] ptadmin=表明使用主数据库导入。若这个程序运行分布式数据库,则用local替代ptadmin。Filename=导入的文件名 Options=-h =帮助 -n =只添加新点 -c =即使有一个错也继续 数据导入到主数据库后,数据必须传送到控制器和原点站中。这个功能由Drop Loader 完成。 2-3.1. 数据的导入格式 导入文件格式如下,导入文件的每行包含一个动作状态。 OBJECT=“” ACTION=“ ...

相关文档
相关文档 最新文档