oracle考题教学提纲
oracle10g期末考试复习提纲

Oracle数据库结构:扬理结构、内存结构、逻辑结构3.ORACLE数据库物理结构包括哪几类文件,主要作用参数文件、控制文件(CTL)、日志文件(LOG)、数据丈件(DBF)参数文件:1)实例和数据库的配置参数表。
设置内存中的SGA (系统全局区)大小、指定数据库控制文件名称及路径,定艾各种操作参数等。
2)将初始化参数永久保存在服务器磁盘上。
3)!4)只在建立数据库或启动实例吋才被访问。
5)是一个可编辑的殳本文件,在修改该文件之前必须关闭实例。
控制文件:1)至少有一个控制文件,建议两个或两个以上2)通过控制文件保持数据库完整性以及决定恢复数扌居时使用哪些重做日志。
数据库名称及唯一标识数据库的创建时间数据丈件的名称、位置及大小J重做日志文件的名称.位置及大小表空间名称检查点信息、日志序列号等数据库恢复所需的同步信息。
数据文件:用于存放所有的数据库数扌居.如表、索引等。
1)一个数据文件只与一个数据库相联系;数据丈件大小是动态可以改变的;数据文件结合在一起形成表空间。
2)有两种类型的数据:用户数扌居和系统数損3)用户数据:用于应用软件的数据,带有应用软件的所有信息。
是用户存放在数据库中的信息。
4)系统数据:用来管理用户数扌居和Oracle数据库本身的数据。
※日志文件:※重做日志文件:用于记录数抿库的修改操作,可用于数扌居库的恢复。
两个或两个以上日志文件,用于镜像。
£件的配置和大小会影响性能,重做日志与数据文件分开存放。
莹做日志文件组以循环方式进行写操作。
ARCHIVELOG (归档)当所有日志组都写满之后,又回到第一组之前,该组中原有数据写入归档日志,存入磁盘。
备份吋必选。
可自动归档重做日志文件。
是非活动重做日志的备份。
]数据库只有处于ArchiveLog模式时才会生成归档日志,并且每次日志切换都会生成归档日志。
执行介质恢复(例如数据文件意外去失),則必须要用到归档日志。
N0ARCHIVEL0G (非归档)通常默认都为非归档模式。
Oracle 考试试题(带答案)

a) b) c) d) 参考答案
OracleHOME_NAMETNSListener OracleServiceSID OracleHOME_NAMEAgent OracleHOME_NAMEHTTPServer
B
9) 在 Oracle 中创建用户时,若未提及 DEFAULT TABLESPACE 关键字,则 Oracle 就将()表空间分配 给用户作为默认表空间。。
DATEPART EXTRACT TO_CHAR TRUNC
bc
5) 在Oracle中,有一个教师表teacher的结构如下: ID NUMBER(5) NAME VARCHAR2(25) EMAIL VARCHAR2(50) 下面哪个语句显示没有Email地址的教师姓名()。
a) b) c) d) 参考答案
a) b) c) d) 参考答案
OracleHOME_NAMETNSListener OracleServiceSID OracleHOME_NAMEAgent OracleHOME_NAMEHTTPServer
a
8) 在Windows操作系统中,Oracle的()服务是使用 iSQL*Plus必须的。
A
12) 在Oracle中,下面用于限制分组函数的返回值的子句是 ()。
a) WHERE b) HAVING c) ORDER BY d) 无法限定分组函数的返回值
参考答案 b
13) 在Oracle中,有一个名为seq的序列对象,以下语句能返 回序列值但不会引起序列值增加的是()。
a) b) c) d) 参考答案
%NOTFOUND %FOUND %ROWTYPE %ISOPEN %ROWCOUNT
c
15) 在Oracle中,当控制一个显式游标时,下面哪种命令包 含INTO子句()。
Oracle复习题及答案

郑州大学软件技术学院《Oracle》课程2009-2010学年第一学期期末试题(A)(适用专业:08信管、Java、.NET专业考试时间:120分钟)单选:1 Oracle 10g中的g表示(C)。
A 网络B 数据库C 网格计算D 版本2 Oracle 10g的管理工具中,(B)是一个非常重要的、在服务器端和客户端都可以使用的工具。
主要功能有:输入、运行和调试SQL语句、PL/SQL块。
A OUIB SQL*PLUSC OEMD DBCA3 Oracle数据库的例程由( D )组成。
A SGA和PGAB SGA和数据库C 数据库和后台进程D SGA(系统全局区)和后台进程4 Oracle进程结构中完成更新控制文件与数据文件,使其同步并触发DBWR进程,使其将脏缓存块写入数据文件中的进程是(C)。
A 用户进程B 服务进程C 后台进程CKPTD 后台进程DBWR5某用户想查看自己所能看到的表信息,那么应该看( D )视图。
A v$tablesB dba_tablesC all_tablesD user_tables6 可以在Oracle服务器的安装目录的(C)文件中查看Oracle的各种端口的使用情况。
A spfile.oraB initorcl.oraC portlist.iniD tnsname.ora7相对于Oracle数据库的作用,类似于Windows操作系统中注册表的作用。
这类数据库文件是( D ):A 参数文件B 数据文件C 重做日志文件D 控制文件8 Oracle的逻辑存储结构中由大到小的顺序是(B):A 表空间、区、段、块B 表空间、段、区、块C 表空间、块、段、区D 段、区、表空间、块9 下列哪种表空间可以被设置为脱机状态(B)。
A 系统表空间B 用户表空间C 临时表空间D 撤销表空间10 读下段程序:SQL> select * from v$log;GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STA TUS -------------------- ---------- ---------- ---------- --- -----------1 1 29 1 NO INACTIVE2 1 30 1 NO CURRENT3 1 28 1 NO INACTIVESQL> alter system switch logfile;系统已更改。
Oracle期末考试试题及答案教学提纲

1.假设当前用户是SCOTT用户以普通用户登录,口令为tiger,请写出该用户以管理员身份登录的命令
________________________________________;
2.假设用户SCOTT以管理员身份登录,现需创建用户Lisa,口令是Lisa,请写出相应的命令___________________________________________;
考生信息栏
系专业级班级姓名学号
装订线
一、选择题:(本题共20个小题,每小题2分,共40分)
1当Oracle服务器启动时,下列哪种文件不是必须的( )。
A.数据文件B.控制文件C.日志文件D.归档日志文件
2.在Oracle中,一个用户拥有的所有数据库对象统称为( )。
A.数据库B.模式C.表空间D.实例
9.下列哪个语句可以在SQL*Plus中直接调用一个过程( )。
A.RETURNB.CALLC.SETD.EXEC
10.如果服务器进程无法在数据缓冲区中找到空闲块,为添加从数据文件中读出的数据块,则系统会启动如下哪一个进程( )
A.CKPTB. DBWRC.LGWRD. SMON
11.下列哪一个锁模式不属于Oracle( )。
A.SAVEB.SPOOLC.GETD.INPUT
17.为了去除结果集中重复的行,可在SELECT语句中使用下列哪个关键字( )。
A.ALLB.DISTINCTC.SPOOLD.HAVING
18.关于模式的描述下列哪一项不正确( )。
A.表或索引等模式对象一定属于某一个模式
B.在Oracle数据库中,模式与数据库用户是一一对应的
oracle数据库复习提纲及其答案详解

oracle数据库复习提纲及其答案详解Oracle数据库复习提纲一、Oracle10g简介1、Oracle10g一共有哪几个版本?Oracle数据库10g标准版1,Oracle数据库10g标准版,Oracle数据库10g企业版,Oracle数据库10g个人版.2、 Oracle10g中的g是什么含义?Oracle 10g的g就代表grid computing。
3、理解Oracle数据库中的方案、数据块、区间、段、表、表空间之间的关系。
Oracle 数据库的逻辑结构包括方案(schema)对象、数据块(data block)、区间(extent)、段(segment)和表空间(tablespace)等。
数据库由若干个表空间组成,表空间由表组成,表由段组成,段由区间组成,区间则由数据块组成4、标准数据块大小由初始参数(DB_BLOCK_SIZE)指定。
5、理解数据库、表空间、数据文件之间的关系。
每个表空间由一个或多个数据文件组成。
数据文件用于在物理上存储表空间中所有逻辑结构的数据。
表空间中数据文件的大小之和就是表空间的存储容量(图中系统表空间存储容量为2MB,用户表空间的存储容量为4MB)。
数据库中表空间的存储容量之和就是数据库的存储容量。
6、叙述Oracle数据库的物理结构。
(每个Oracle数据库都由3类文件组成:数据文件、日志文件、控制文件,……)Oracle数据库有一个或多个物理的数据文件。
数据库的数据文件包含全部数据库数据。
逻辑数据物理地存储在数据文件中。
数据文件有下列特征:一个数据文件仅与一个数据库联系。
当数据库容量越界时,数据文件能够自动扩展。
一个或多个数据文件组成一个表空间。
每个数据库有两个或多个日志文件组,日志文件组用于收集数据库日志。
日志的主要功能是记录对数据所作的修改,所有对数据库作的全部修改记录在日志中。
每个Oracle数据库有一个控制文件,记录数据库的物理结构。
控制文件包含数据库名、数据库数据文件和日志文件的名字、位置和数据库建立日期等信息。
oracle考试试题及答案.doc

oracle考试试题及答案Questions one by one, fill in the blanks (4 points per question exergy a total of 20 points)1,database management technology has gone through three stages: manual management, file system and database system2,database three level data structure is external mode, mode, internal model3,the Oracle database SGA database buffer by exergy exergy exergy redo log buffer shared pool.4,in the Oracle database integrity constraints exergy types are Primay key constraints・ Foreign key Unique constraint exergyCheck not need exergy exergy constraint constraint constraintDeclare cursor open the cursor cursor exergy exergy exergy extraction in PL/SQL, including 5 close myCursor cursor operationTwo, the true or false questions in every day 2 points 20 points total exergy rateThe basic objects stored in the database is 1, the data rate in T2, the database system is the core of DBMS in the T rate The characteristics of relationship between the 3 and the operation is set in the operating rate of T4,five basic operations in relational algebra, and is the difference,selection, projection, connection in the F rate5,Oracle process is the server process in the F rate6,the oraclet system SGA process server and all users in the process of sharing rate T7,the Oracle database system in the data block size in the T operation of the rate system8,Oracle database system exergy start database and the first step is to start a database instance in the T rateThe cursor 9, PL/SQL data can be changed in the F rate10, the database concept model is mainly used in database conceptual structure design in the F rateThree, use the title in the match each 7 points 35 points total exergy rateLogical independence and physical independence in 1, what is the database system data in the programDBMSProvides a two layer mapping mechanism in external mode threemode structureSchema, image, and modeInternal schema image・ The twoThe layer mapping mechanism guarantees the logicalindependence and physical independence of data in the database system・External modeThe schema image defines the correspondence between the external schema of the different users in the database and the logical schema of the database・When the database schema changes such as a relational database system to increase exergy change with the new relati on ship, the relationship between attribute data types can exergyExternal mode adjustmentThe relationship between image mode exergy guarantee a constant user oriented mode of each. The application is based on the data of the model prepared by the exergyWhich application is not required to ensure the independence of the logicof exergy exergy data and application of logical data independence・PatternThe internal schema image defines the global logical structure of the data in the database and the physical storage organization of those data in the systemCorrespondence・When changing the physical storage of data structures in the database when the internal model changes such as the definition and selection of a storage structure can adjust theThe constant so that the external schema of database system and individual applications do not have to change the database schema in the schema mapping relationship / hold mode・This will ensure that the physical data independence and the independence of the physical data between applications or databases ・2, the relational algebra equi jo ins difference is not a natural connection without contact yesterdayAnswer when the operator connected conditions included in the use of 〃二〃this connection is called equivalent connection. Connection operation General in the two table between for can also be in a table does nothave its own connection between connection operation such as from the ・Answer・The equivalent connections and self connections belong to the internal connection query3, what is the database database design is generally divided into what stage from1)Exergy databaseDatabaseIn according to the data structure to organize, store and manage data warehouse・2)Requirement design conceptual designlogic design physical designImplementation, operation and maintenanceFourBrief descriptionOracleComposition of exergy logical databaseA table space, segment, data blockFiveWell, try any one example of using method from cursorA exergyCreate tableCreate table test(Name char (30),Age char (40),Subject char (20),ID numeric (10))insert dataInsert, into, test, values (' hehe,,' haha,,‘ hh', 4)Define variablesDeclare @name char (30)Declare @age char (40)Declare ©subject char (20)Declare @id numericCreate a CursorDeclare himml cursorFor, select, [name], age, subject, ID, from, test open Open hiininlUse cursors to scroll throughFetch, himml, into, @name, @age, @subject, @id 一一Be careful@@FETCH_STATUS yesSQL SERVERInside variables andORACLEThe@@sqlstatusDiffer・While (@@FETCH_STATUS 二0)BeginPrintPrint @namePrint @agePrint ©subjectPrint @idFetch, hiininl, into, @name, @age,@subject, @idEndClose the cursor rate close the cursor result set in its entirety instead of exergyClose hiimnlClose the cursor cursor rate release the memory in and let the cursor name can be used again exergyDeallocate hiimnl five with employee tablesEMP (empno, ename, age, Sal, Tel, deptno), in which empno -------- name ------ n ame age - number of exergy exergy exergy exergy oftel ---- electric sal ------- age wagewordDeptno ----- Department number・Please program at SQL*PLUS in the morning following the following requirements・In every day 3 points total of 15 points in the 1 exergy rate, home telephone staff information query. In the SQL>SELECT FROM EMP WHERE Tel NOT * NULL; in the 2, query wages in 500 to 800 yuan betweenthe employee information in SQL>SELECT * FROM EMP WHERE BETWEEN 500 AND 800: in 3, according to the age in creasing order display employee nu mber, name, age, salary in the SQL>SELECT empno, ename, age, Sal FROM EMP ORDER BY age ASC; SQL>SELEC, 4As the average wage in the Department of SQL>SELECT AVG DOI (SAL) FROM EMP WHERE deptno二'D_01' ; in the 5, find the department number D OI over 40 years of age and wage of 400 yuan in the list of employees in the SQL>SELECT ename FROM EMP WHERE deptno二'D_01' AND age>40 A7D.An examination question twoTwo, fill in the blanks (each 2 points 30 points total exergy) please fill in the correct answers in the blanks every day. No fill and no "11.1.data model is usually composed of three elements of the data structure, data operation and data __________ constraint _・2.database systems, all types of user requests for database operations (data definition, query, update, and various controls) are made up ofA complex software to complete the exergy this software called DBMS3.in the SQL SELECT statement in the query to remove duplicate records of exergy exergy in the query results should be used —DISTINCT_・Key word・ 4. the use of SQL language SELECT statement for the query packet in the packet if he hoped to get rid of not meet the conditions should beUse the HAVING clause.5.relational database data manipulation language (DML) includes two types of operation in their search and update _■6.in relational database design in the database design is divided into requirement analysis, concept design, logic design, physical design, applicationProgram coding, debugging operation, database operation and maintenance in six stages・What stage of database design is the design relational schema?Exergy ____ task logic design ____7.operations can be divided into _ relational algebra _relational calculus and _______ two categories・The relationship between the 8. INF _ non _ main function to eliminate the dependence on the key attribute in the paradigm after grade to 2NF. 2NFThe relationship between — eliminate non main attributes on the keys of the transfer function can be _ dependent upon his paradigm level increased to 3NF.The three level structure of the 9. database through the concept of the pattern / image within the pattern to ensure ________________ independenee in the physical model of concept mapping / byAs in the ― logic _ independence guarantee.10.the meaning of SQL is _ structured query language _________ ・11.DBMS usually provide the authorization function to control permissions in the data of different users to access the database in its purpose is to numberAccording to the _____ security database・Three, short answer questions (6 points each item in a total of 24 points)Safety protection function 1. database provides four aspects which try to explain their meaning of exergyExergy security database is a rate caused by use of database protection prevent 订legal data leakage, change or damage・ SQL Server 2000The security mechanism consists of four layersThe first layer included operating system loginSecond layer server security management exergy exergySQL ServerLoginSpecial accountSAThird layer database security management database exergyexergy accessDatabase userFourth layer database objects in safety management of exergyexergy exergy database object tables and views in accessDatabase user gets roles2. the referential integrity rules in the purpose of it in the test example donburi・3. to Oracle DBMS for the SQL relational database language support is given in the case of grade three logic schematic 1) SQLLanguage support relational database three level logic structure consists of the outer layer and a memory, the concept of as shown in fig・・2)The concept of recording layer corresponds to the conceptual model is the basic table・The basic table is a table that itself actually exists ・A basic table is a it not by other forms of export table・ The basic table is usedCREATE TABLEStatement built・3)In the outer as seen by the user can be the basic table can also be view can also be the basic table view. A view is a virtual tableIt is composed of one or several basic forms of export table it does not exist in the physical memory directly on the table・ View is usedCREATE SQL VIEWlanguageSentence established.4)In the inner each basic table with a file storage is said by a group of the same type of stored records to indicate the value・DBAYou can manipulate physical storage files.4., briefly describe the DBMS database security control function, including what are the commonly used means?A database management system for data control function data securitycontrol function in order to ensure the safety and reliability of the data within the database to preventThe use of illegal cause data leakage and damage the data that avoid being peeped, tampering or ruining exergy data integrity control refers to the function of insuranceThe data card in the database correctly and effectively and to prevent the compatibility error data is not the semantic input or output.Four, database design (15 points)Suppose there is a relationship between the 1. to record each person,s identity card number, name and work unit・ Also contains every one of his / her childrenThe identity card number, name and place of birth and the he / she has every car brands and models・The real world from known facts thatSome people may have several cars but these cars may be the same type but may also is not the same type of exergySome people do not have the car if someone has the car included his every car has a car includedSome people may have several children but there are some people without children. The relationship model of the preliminary design of the are as followsR (identity cards, the name of the work unit of the C identity cards, the name of the C C was born in the car the model)The 〃C C〃identity cards, the name C was born "are the child,s identity card number, name and place of birth・Please send this pat tern into the pattern of the relationship between BCNF to determine the relationship between the main key. 7 points in a exergy exergy, the citizen identity cards in the name of the work unitThe type of car car exergy the identity card number inThe child identity cards, the exergy of C C C was born in the name of the identity card number in a certain school library2.assumptions to establish a database to save the readers, books and readers of record. In order to build theWe need to design a good database design from the conceptual model is shown and then the figure - the conceptual model intoa relational model・ pleaseDesign fTom La - map・The reader has readers attribute number, name, age, address and unit.Attributes of each book are ISBN, title, author and publisher・Each book for each reader borrowed date and should also have out of date ・ 8 points in exergyA reader reader the name address the exergy number in the unitThe author of the book ISBN Title Exergy in the press・The number of readers to borrow the books ISBN exergy date the date should be in five, calculation (the title 3 items within a total of 16 points)Clients with a commercial relational database the three basic table the table structure is as followsTable Article (commodity goods, the price of the stock in the commodity name)Table Customer (customer clients, the clients name the sex the age the phone)Orderitem order form (the number of the dients, the purchase price of goods number the date)Note that the answer to will give the answers written provisions of the local exergy answer requirements must be clearly not allowed to change the included writing programAnd optionally add sub queries・1.please create a GM_VIEW view of the retrieval clients using SQL language dients, clients and ordering goodsName, amount and date・(the number is equal to the purchase price * amount) 6 points in exergyCREAT VIEW GM_VIEW (clients, the clients name the commodity name the amount of the number of date) * AS SELECT _ clients, clients in a brand name in the purchase price in the amount of as in the date of FROM Artcle, Customer,OrderItemWHERE Customer・clients, =OrderItem・clients, and Article・commodity No.二OrderItem・ Article No. 2. please use the SQL language of female clients buy goods number, commodity name and the total number of out ・ 6 exergy rateSELECT _OrderItem・,commodity number AS, commodity number, Order Item ・ commodity name, AS commodity name, SUM (Order Item ・ quantity)The total quantity of AS is FROM, Orderitem, Artcle, Customer, WHERE _Artcle・,commodity number 二Orderitem・,commodity number AND, OrderItem・,commodity number 二Customer・, commodity number ANDCustomer・=,GROUP BY OrderItem・female gender in commodity trade name No.3.please use the SQL language ALTER TABEL command of a field in a field called the origin will increase the number of goods to table ArticleAccording to the type of the CHAR in the length of 30 in the rate of 4 points exergy command is as followsChar ALTER TABEL —Article ADD (30) — originItem 31, fill in the blanks (each 2 points in a total of 20 points)The SELECT statement for grouping query 1, using the SQL language in the packet will not meet if you want to remove the conditions should beUsing —HAVING..・ _ clause・In 2, in the design of relational database in database design is divided into requirement analysis, concept design, logic design, physical design, should beProgram coding, debugging run, database operation and maintenance in six stages・ What stage of database design is the design relational schema?The task of exergy _ logic designRelational operations in relational algebra and 3, including the selection, projection, __________ connection and division.4,the relationship model of entity integrity in referential integrity in user-defined integrity of three types of integrity・5,two yuan for entity set between A and B between the set in mapping base set must be one of the following four1. , one to one, contact2., one to many con tacts, more than3. to one, contact more than4., many pairs of contacts6,PL/SQL cursor the two types of explicit and implicit cursor cursor ・Two, single choice (3 points per item in a total of 15 points)1, in a relational database management system will create the view in the database three layer structure belongs to (A)A.external modeB. storage modeC. intra schemaD. conceptual schemaThe general characteristics of the 2, in the world of things in reality in the information world is called (A)A. entityB. entity keyThe C・ property D・ key 3 Relationship Model S J P SJP in the S in is students J curriculum P is ranking・ Each student takes in each courseThe performance has a certain rank each course ranking only one student in the column and No. The relationship model belongs to exergy (C)A, 2NF, B, 3NF, C, BCNF, D, 4NF4,the company has a department of a num bet of departments and employees each staff only belongs to a department can have a number of staffThe type of contact from staff to department is (C)A.many to many,B. , one to one,C., one to many, one toD., one to many5,the logical independence of data refers to (A)The concept of A. mode change external mode and not the applicationB.concept mode change mode notIn the C. mode concept mode not changeD. mode change external mode and not the applicationThe correct statement, query on wildcards in the 6. part (D)A・"匚 B・"represents a number of characters _〃can represent zero or more charactersC.〃—〃can not 〃%〃to use D・represents a characterThree, Jane answer1,the referential integrity rules purpose it donburi test example・2,Briefly describe the architecture features of Oracle database system1)contains at least one SYSTEM table space, and the DDL language2)various spatial data dictionary informationThe data stored in the table space, table space exergy is reflected in the form of multiple data files・3,what is the logic of program data independence and physical independence from 4, the DBMS of the database security control functionsincluding what means?5. Sketch the main steps of database conceptual design. (1)Data abstract conceptual model in the design of local exergy (2)The concept of local mode integrated into the global conceptual schema in(3) review 6, what is the function from the rollback segment7,cold and heat Be if eng explain back up different points and advantages from each of the 3 SCG in S#, model C#, grade, S# in the No.C for students course No. grade Exergy for a studentExamination results for a certain course・The average score were going to query the average score over 80 points in the course of the query resultsAccording to the average scores in ascending order average the same number in descending order according to the curriculum・ Write the SQL query・A Select C# AVG analysis (grade), From SCGGroup by C#Having AVG (grade) >80Order by 2, C# desc。
Oracle复习题及答案

Oracle复习题及答案考试复习题⼀、填空1、oracle数据库中的数据⽂件的扩展名是什么?.dbf2、控制⽂件的扩展名是什么?.ctl3、刚建⽴完成数据库,在第⼀次使⽤OMS之前需要建⽴? 资料档案库4、在SQL*plus中,输⼊⼀⾏语句之后,在语句结尾处要写? 分号( ; )5、在ORACLE中,程序块分为命名程序块、匿名程序块。
⼆、概念:1、什么是DBA?答:DBA是英⽂Data Base Administrator的缩写,也就是数据库管理员。
2、SQL语⾔的主要特点是什么?答:SQL语句的特点主要有:①综合统⼀;②⾼度⾮过程化;③⾯向集合的操作⽅式;④以同⼀种语法提供两种操作⽅式;⑤语⾔简洁,易学易⽤。
3、简单介绍⼏种当前流⾏的关系数据库系统?答:Oracle,MySql,MsSql,DB2,Sybase.4、从硬件⾓度指出提⾼ORACLE运⾏速度的⽅法?答:加⼤内存,加⼤硬盘缓存。
5、简单介绍ORACLE的物理结构?答:物理结构:在oracle中四类⽂件数据⽂件.dbf ⽇志⽂件.log 控制⽂件.ctl 配置⽂件.ora6、介绍⽇志的种类,各种⽇志的运⾏机制,各有什么优缺点?答:⽇志可分为:归档模式和不归档模式两种。
归档模式运⾏机制是:重复写数据,当⽂件写满重新备份再写、恢复强、占空间。
特点是:缺点占地⽅优点恢复能⼒强。
⾮归档模式的运⾏机制是:不备份,恢复能⼒有限。
特点是:缺点占空间⼩优点恢复能⼒差。
7、写出序列在实际操作中的作⽤。
答:序列(sequence)是多个⽤户能够在此产⽣唯⼀整数的数据库对象,可以⽤序列⾃动产⽣主键值。
序列是⼀个连续数字⽣成器。
序列通过提供唯⼀数值的顺序来简化程序设计⼯作。
8、写出⼀个SQL语句,语句当中需要使⽤到“同义词”。
答:Select * from system.table1 t1,system.table2 t2 where /doc/628cf3d776eeaeaad1f33070.html=/doc/628cf3d776eeaeaad1f33070.html ;9、写出⼀个数据字典的应⽤(所有⽤户:all_users)答:select * from all_users;10、写出数据库默认的两个⽤户的名称和密码答:⽤户名:system 密码:manager⽤户名:sys 密码:change_on_install;11、在⽤OMS/OEM建⽴数据库时,什么情况下使⽤“数据仓库”类型,什么情况使⽤“事务处理”类型?答:当数据库必须处理⼤量的复杂查询,这些复杂查询将涉及到数据库中⼤量的表和记录,并且⼤部分查询都是只读的时候,使⽤“数据仓库”类型。
Oracle期末考试试题及答案

10.如果服务器进程无法在数据缓冲区中找到空闲块,为添加从数据文件中读出的数据块,则系统会启动如下哪一个进程( )
A.CKPTB. DBWRC.LGWRD. SMON
11.下列哪一个锁模式不属于Oracle( )。
A.死锁B.排他锁C.行级共享锁D.共享锁
ALTER TABLE Class
________________________;
10.假设用户Lisa用Lisa以普通用户身份登录到系统,现需创建一个UPDATE语句来修改本用户下ARTISTS表中的数据,并且把每一行的T_ID值都改成15,应该使用的SQL语句是________________________ ;
四、编程题(本大题共2小题,每题10分,共20分)
1.(5空,每空2分,共10分)
(1)SELECTempno,sal
FROM employee
WHEREempno BETWEEN 7300 AND 7600;
(2) OPEN cursor_sal
(3) INTO v_empno,v_sal
(4)COMMIT;
END;
(2)假设用户已登录SQL Plus系统,处于“SQL>_”命令提示符下,现需执行存储
过程Rise_sal,请写出命令:_______⑤___________
2.创建一个函数get_sal,用于实现对表Emp(如下图)给定一个员工号(Empno),
通过函数获取该雇员的工资值,请完成以下程序。
1.__________是具有名称的一组相关权限的组合。
2.一个表空间物理上对应一个或多个__________文件。
3.标准的SQL语言语句类型可以分为:__________、数据操纵语句(DML)和__________。
Oracle考试(全)答案

O racle SQL开发基础一、填空题共3题题号: 1 本题分数:2.00 分SELECT TO_CHAR(ADD_MONTHS(TO_DATE(‘20081210’,’YYYYMMDD’),5)+2,’YYYYMMDD’) FROM DUAL;的运行结果是_____20090512______________。
题号: 2 本题分数:2.00 分在ORACLE中,用于事务提交和回滚的SQL语句分别是_________commit______和_______rollback_________。
题号: 3 本题分数:6.00 分数据库按物理上结构必须由数据文件、控制文件和重做日志组成。
二、单选题共30题题号: 4 本题分数:2.00 分Select语句的执行顺序是()(1)select (2)from (3)where (4)group by (5)having (6)order byA、123456B、234561C、234516D、124563题号: 5 本题分数:2.00 分查询语句SELECT SUBSTR(‘Hello World’,4,5) FROM DUAL;返回结果,正确的是A、loWorB、WorldC、lloWoD、lo WoD题号: 6 本题分数:2.00 分哪个活动将导致自动回滚()A、GRANTB、CREATEC、系统崩溃D、从SQL*Plus退出SQL语句分类Select查询语句DML语句(数据操作语言)Insert / Update / Delete / MergeDDL语句(数据定义语言)Create / Alter / Drop / TruncateDCL语句(数据控制语言)Grant / Revoke事务控制语句Commit / Rollback / Savepoint题号: 7 本题分数:2.00 分数据库中有两张表,employees(雇员表),departments(部门表),表结构为课程中试验案例, 如果想要获得全部雇员的信息,不管这个雇员是否被分配了部门,以下答案正确的是A、SELECT last_name,department_name FROM employees JOIN departments(+)B、SELECT last_name,department_name FROM employees(+) JOIN departmentsC、SELECT last_name, department_name FROM employees e RIGHT JOIN departments d ON (e.department_id =d.department_id)D、SELECT last_name, department_name FROM employees e LEFT JOIN departments d ON (e.department_id =d.department_id)题号: 8 本分数:2.00 分关于Listener的描述正确的是()A、监听、接收客户端连接请求B、防止黑客入侵C、验证连接数据库用户的身份。
ORACLE11g精彩试题问题详解(陈冬亮)

实用标准文档大全目录第一章 Oracle 11g 介绍 (2)第二章 ORACLE 11g 的体系结构 (4)第三章 ORACLE 11g 的数据库管理 (8)第四章 ORACLE 11g 的表空间管理 (10)第五章 ORACLE 11g 的表管理 (13)第六章 ORACLE 11g 的数据查询 (18)第七章 ORACLE 数据的基本操作 (23)第八章索引 (28)第九章视图 (33)第十章 PL/SQL基础 (37)第十一章存储过程与函数 (43)第十二章触发器 (48)第十三章游标 (51)第十四章安全管理 (54)第十五章数据库备份与恢复 (57)第一章 Oracle 11g 介绍一、选择题1.在数据库系统中,将满足以下两个条件的基本层次联系集合称为层次模型:( B )。
①有一个结点无双亲②其它结点无双亲③有且仅有一个结点无双亲④其它结点有且仅有一个双亲⑤允许其它结点有多个双亲A.①和② B.③和④C.③和⑤ D.②和⑤2.下列有关数据库的描述,正确的是( C )A.数据库是一个DBF文件B.数据库是一个关系C.数据库是一个结构化的数据集合D.数据库是一组文件3.根据关系数据基于的数据模型——关系模型的特征判断下列正确的一项:( B )A.只存在一对多的实体关系,以图形方式来表示。
B.以二维表格结构来保存数据,在关系表中不允许有重复行存在。
C.能体现一对多、多对多的关系,但不能体现一对一的关系。
D.关系模型数据库是数据库发展的最初阶段。
4.Oracle 11g 是基于( A )的A.关系型B.文件系统C.层次型D.网络型5. 用二维表结构表达实体集的模型是( D )A.概念模型 B.层次模型C.网状模型 D.关系模型6.下列四项中说法不正确的是( C )A.数据库减少了数据冗余B.数据库中的数据可以共享C.数据库避免了一切数据的重复D.数据库具有较高的数据独立性7.下列四项中,不属于关系数据库特点的是( D )A.数据冗余小B.数据独立性高C.数据共享性好D.多用户访问下面系统中不属于关系数据库管理系统的是( C )A. OracleB. MS SQL ServerC. IMSD. DB29. MS SQL Server是( D )A. 数据库B. 数据库系统C. 数据处理系统D. 数据库管理系统二、填空题1.在数据库系统中管理数据的软件称为___数据库管理系统________。
oracle考试试题及答案[1]上课讲义
![oracle考试试题及答案[1]上课讲义](https://img.taocdn.com/s3/m/637f558d58fb770bf78a55de.png)
o r a c l e考试试题及答案[1]试题一一、填空题(每小题4分,共20分)1、数据库管理技术经历了人工管理、文件系统、数据库系统三个阶段2、数据库三级数据结构是外模式、模式、内模式3、Oracle数据库中,SGA由数据库缓冲区,重做日志缓冲区,共享池组成4、在Oracle数据库中,完正性约束类型有Primay key约束。
Foreign key约束,Unique约束,check约束,not need约束5、PL/SQL中游标操作包括声明游标,打开游标,提取游标,关闭游标二、正误判断题(每小题2分,共20分)1、数据库中存储的基本对象是数据(T)2、数据库系统的核心是DBMS(T)3、关系操作的特点是集合操作(T)4、关系代数中五种基本运算是并、差、选择、投影、连接(F)5、Oracle进程就是服务器进程(F)6、oraclet系统中SGA所有用户进程和服务器进程所共享(T)7、oracle数据库系统中数据块的大小与操作系统有关(T)8、oracle数据库系统中,启动数据库和第一步是启动一个数据库实例(T)9、PL/SQL中游标的数据是可以改变的(F)10、数据库概念模型主要用于数据库概念结构设计(F)三、简答题(每小题7分,共35分)1、何谓数据与程序的逻辑独立性和物理独立性?2、试述关系代数中等值连接与自然连接的区别与联系?3、何谓数据库,数据库设计一般分为哪些阶段?4、简述Oracle逻辑数据库的组成?5、试任举一例说明游标的使用方法?五、设有雇员表emp(empno,ename,age,sal,tel,deptno),其中:empno-----编号,name------姓名,age -------年齡,sal-----工资,tel-----电话deptno-----部门号。
请按下列要求分别晨SQL*PLUS下编程。
(每小题3分,共15分)•1、查询家有电话的职工信息。
SQL>SELECT * FROM emp WHERE tel NOT NULL;•2、查询工资在500至800元之间的雇员信息SQL>SELECT * FROM emp WHERE BETWEEN 500 AND 800;•3、按年龄递增顺序显示雇员编号、姓名、年龄、工资SQL>SELECT empno,ename,age,sal FROM emp ORDER BY age ASC;•4、求部门号为D_01的平均工资SQL>SELECT AVG(sal) FROM emp WHERE deptno='D_01';•5、查找部门号为D_01的40岁以上而工资在400元以下的雇员名单。
Oracle考试题讲解

Oracle考试题讲解Oracle 考试题⼀:单选题(每题1.5分,共60分)1.学⽣信息表StudentInfo如下所⽰:学号姓名所在省市0001 李辉北京0002 张明上海0003 王⼩⽟北京0004 李淑华湖南0005 赵静上海┆┆┆查询所有学⽣来⾃于哪⼏个省市使⽤的语句为()。
(选择⼀项)A) Select unique 所在省市 from StudentInfoB) Select 所在省市 from StudentInfoC) Select only 所在省市 from StudentInfoD) Select distinct 所在省市 from StudentInfo2. 公司需要管理员⼯档案,你创建了2个表:员⼯表employees和部门表departments。
以下是两表的部分内容。
employees编号姓名年龄部门编号1 王涛 25 12 张⼒ 24 13 李明 30 24 ⾼嘉 24 3Departments编号部门名称1 ⼈⼒资源部2 技术部3 销售部下列那列适合作为外键()。
(选择⼀项)A) Employees中的编号B) Employees中的部门编号C) departments中的编号D) 以上都适合3. 你使⽤以下T-SQL语句创建了⼀个视图v_emp和⼀个表students,create view v_emp as select * from emp where deptno=10;create table students(id number(5),stuname varchar2(10))请问这两个语句是:()。
(选择⼀项)A) DDL(数据定义语⾔)B) DML(数据操纵语⾔)C) DCL(数据控制语⾔)D) DQL (数据查询语⾔)4.当SQL登录帐户被授权为数据库⽤户后,要查询数据库中的表,还需要对其赋予select 权限,实现赋权的T-SQL语⾔属于()。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
1.下面对数据库文件的叙述中,正确的是CA、一个表空间只能对应一个人数据库文件B、一个数据文件可以对应多个表空间C、一个表空间可以对应多个数据库文件D、数据库文件存储了数据库中的所的日志信息2.下面对数据库逻辑存储结构叙述中,正确的是__AB__A、一个数据库实例由多个表空间组成B、一个人段由多个区组成C、一个人区由多个段组成D、一个人块由多个区组成3.下面哪种后台进程用于将数据缓冲区中的数据写入数据文件?__B__A、LGWRB、DBWnC、CKPTD、ARCn4.系统全局区包括下面那些区域?__ACD__A、java池B、软件代码区C、数据缓冲区D、日志缓冲区5.解析后的sql语句会缓存到下面的SGA哪个区域中?_C___A、java池B、大型池C、共享池D、数据缓冲区1.在SQL*Plus中链接数据库时,可以使用CONNECT命令。
下面的4个选项中,哪几个命令是正确的?其中,用户名为scott,密码为tiger,数据库名为orcl。
____D________A.CONNECT scott/tiger;B.CONNECT tiger /scott;C.CONN scott/tiger as sysdba;D.CONN scott/tiger@orcl as sysdba;2.执行语句SAVE scott_emp_query.sql APPEND,执行结果表示_____C_____。
A.如果scott_emp_query.sql文件不存在,则出现错误B.如果scott_emp_query.sql文件已经存在,则出现错误C.将缓冲区中的内容追加到scott_emp_query.sql文件中,如果该文件不存在,会创建该文件D.将缓冲区中的内容替换掉 scott_emp_query.sql文件的内容,如果该文件不存在,会创建该文件3.使用SQL*Plus中的____B_______,可以将文件中的内容检索到缓冲区,并且不执行。
A.SAVE命令B.GET命令C.START命令D.SPOOL命令4.下面是有关变量的描述,请问哪些描述是正确的?_____C__________A.临时变量是指仅在某个SQL语句中有效的变量B.临时变量实在某个会话期间有效的变量C.已定义变量是指明确定义,其生命期至显式地删除、重新定义或退出SQL*Plus为止D.已定义的变量是不能被删除的5.如果希望控制列的显式格式,那么可以使用下面的____D____________命令A.SHOWB.DEFINEC.SPOOLD.COLUMN一、选择题:1.存储数据123.45,可以使用下面哪种数据类型?____AD________A.NUMBERB.NUMBER(5)C.NUMBER(5,3)D.NUMBER(5,2)2.如果某列定义了UNIQUE约束,则____AD________A.该列不允许出现重复值。
B.该列不允许出现NULL值。
C.该列内允许出现一个NULL值。
D.该列允许出现多个NULL值。
3.为定义一个CHECK约束,希望该约束能对表中已存储的数据,以及以后向表中添加或修改的数据都进行检查,则应该将该约束设置为如下哪种状态?____A________A.ENABLE VALIDATEB.ENABLE NOVALIDATEC.DISABLE VALIDATED.DISABLE NOVALIDATE4.使用如下语句创建一个视图:CREATE VIEW test_view ASSELECT stu.studname,stu.stuage+1 newage,cla.clanameFROM student stu LEFT JOIN class cla ON stu.claid=cla.claid;请问test_view视图中那些列是可更新的?____A________A.stunameB.stuname、newageC.stuname、clanameD.stuname、newage、claname5.如果创建一个序列,用于为表的主键列生成主键值,则创建该序列时不应该指定以下哪种参数?___D_________A.MAXVALUE 1000B.MINVALUE 10C.CACHE 10D.CYCLE6.如果在创建序列时指定其CACHE参数值为10,当序列的当前值为5时,数据库突然关闭,再次运行数据库后,序列将从以下哪个值开始?__C________A.5B.6C.11D.161.下面对日志文件及其成员叙述正确的是 B 。
A.日志文件组中可以没有日志成员B.日志文件组中的日志成员大小一致C.在创建日志文件组时,其日志成员可以是已经存在的日志文件D.在创建日志文件组时,如果日志成员已经存在,则使用REUSE关键字就一定可以成功替换该文件2.当日志文件组处于哪种情况时,无法清空该日志文件组? CA.ACTIVEB.INACTIVEC.CURRENTD.UNUSED3.下面哪条语句用于切换日志文件组? BA.ALTER DATABASE SWITCH LOGFILE;B.ALTER SYSTEM SWITCH LOGFILE;C.ALTER STSTEM ARCHIVELOG;D.ALTER DATABASE ARCHIVELOG;4.删除日志文件组5种的日志文件E:\orcl\datafile\redo05.log,其中正确的语句是 C 。
A.ALTER DATABASE DROP LOGFIL’E:\orcl\datafile\redo05.log’;B.ALTER DATABASE DROP LOGFILE GROUP 5’E:\orcl\datafile\redo05.log’;C.ALTER DATABASE DROP KOGFILE MEMBER’E:\orcl\datafile\redo05.log’;D.ALTER GROUP 5DROP LOGFILE’E:\orcl\datafile\redo05.log’;5.修改系统中的参数值时,如果只修改服务器参数文件中的设置,则SCOPE选项的值应该为A 。
A.SPFILEB.MEMORYC.BOTHD.以上都不对1.查询scott用户的emp表中的总记录数,可以使用下列哪个语句?BDA.SELECT MAX(empno) FROM scott.emp;B.SELECT COUNT(empno) FROM scott.emp;C.SELECT COUNT(comm) FROM scott.emp;D.SELECT COUNT(*) FROM scott.emp;2.为了取出结果集中的重复行,可以再SELECT语句中使用下列哪个关键字?BA.ALLB.DISTINCTC.UPDATED.MERGE3.在SELECT语句中,HAVING子句的作用是。
BA.查询结果的分组条件B.组的筛选条件C.限定返回的行的判断条件D.对结果集进行排序4.下列哪个聚合函数可以把一个列中的所有值相加求和?DA.MAX函数B.MIN函数C.COUNT函数D.SUM函数5.如果要统计表中有多少行记录,应该使用下列哪个聚合函数?CA.SUM函数B.AVG函数C.COUNT函数D.MAX函数1.下面哪些语句在执行时不会返回错误信息,而显示检索结果? BDA.SELECT empno , ename FROM scott.emp WHERE deptno = ( SELECT deptno FROM scott.dept WHERE dname NOT IN (‘SALES’) );B.SELECT empno , ename FROM scott.emp WHERE deptno = ( SELECT deptno FROM scott.dept WHERE dname IN (‘SALES’) ) ;C.SELECT empno , e.deptno , dname FROM scott.emp e , scott.dept d ;D.SELECT empno , deptno, dname FROM scott.emp , scott.dept ;2.使用关键字进行子查询时, D 关键字只注重子查询是否返回行。
如果子查询返回一个或多个行,那么将返回真,否则为假。
A.INB. ANYC. ALLD. EXISTS3.使用简单链接查询两个表,其中一个表有5行记录,另一个表有28行记录。
如果未使用WHERE子句,则将返回多少行? DA. 33B. 23C. 28D. 1404. C 为具有相同名称的列字段进行记录匹配,不必指定任何同等链接条件。
A.等值连接B. 不等连接C. 自然连接D. 交叉连接5.SQL/92标准可以使用USING关键字来简化连接查询,但是只有在查询满足下面的 AB 条件时,才能使用USING关键字来简化。
A.查询必须是等值连接B.等值连接中的列必须具有相同的名称和数据类型C.FROM子句应当包括所有的表名1如果在连接查询时使用了两个表中相同的多个列,那么就可以再USING子句中指定多个列名. 下面哪些是合法的变量名?A. _number01B. number01C. number-01D. number2. 使用下列哪条语句可以正确地声明一个常量?A. name CONSTANT VARCHAR2(8);B. name VARCHAR2(8) :=’CANDY’;C. name VARCHAR2(8) DEFAULT ‘CANDY’;D. name CONSTANT VARCHAR2(8) :=’CANDY’;3. 有如下PL/SQL程序块:SQL> DECLARE2 a NUMBER := 10 ;3 b NUMBER := 0 ;4 BEGIN5 IF a > 2 THEN6 b :=1;7 ELSIF a > 4 THEN8 b := 2 ;9 ELSE10 b := 3 ;11 END IF ;12 DBMS_OUTPUT.PUT_LINE (b) ;13 END ;执行上述PL/SQL块后的输出结果为A. 0B. 1C. 2D. 34. 有如下PL/SQL程序块:SQL> DECLARE2 i BINARY_INTEGER := 1 ;3 BEGIN ;4 WHILE i >= 1 ;5 LOOP6 i := i + 1 ;7 DBMS_OUTPUT.PUT_LINE (i) ;8 END LOOP ;9 END ;执行上述PL/SQL 块,结果为A. 输出从1开始,每次递增1的数B. 输出从2开始,每次递增1的数C. 输出2D. 该循环将陷入死循环5. 使用游标的什么属性可以获取SELECT语句当前检索到的行数?A. %FOUNDB. %NOTFOUNDC. %ISOPEND. %ROWCOUNT6. 下列不属于IF条件语句中的关键字是A. ELSEIFB. ELSE IFC. OTHERSD. THEN1. B2. D3. B4. D5. D6. ABC12.6 习题1.如果某个用户仅仅具有scott.emp表上的SELECT和UPDATE权限,则下面对该用户所能执行的操作叙述正确的是___D________。