oracle綜合實(shí)驗(yàn)報(bào)告_第1頁(yè)
oracle綜合實(shí)驗(yàn)報(bào)告_第2頁(yè)
oracle綜合實(shí)驗(yàn)報(bào)告_第3頁(yè)
免費(fèi)預(yù)覽已結(jié)束,剩余5頁(yè)可下載查看

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、.華北科技學(xué)院計(jì)算機(jī)學(xué)院綜合性實(shí)驗(yàn)實(shí)驗(yàn)報(bào)告課程名稱(chēng)網(wǎng)絡(luò)數(shù)據(jù)庫(kù)實(shí)驗(yàn)學(xué)期2017至2018學(xué)年第一學(xué)期實(shí)驗(yàn)題目 :圖書(shū)借閱系統(tǒng)數(shù)據(jù)庫(kù)設(shè)計(jì)實(shí)驗(yàn)地點(diǎn) :信息樓大軟實(shí)驗(yàn)時(shí)間 :2017-11-22班級(jí)學(xué)號(hào)學(xué)生姓名成績(jī)?cè)u(píng)定:1、工作量:2、難易度:A(),B(),C(),D(),F( )A(),B(),C(),D(),F( )3、答辯情況:基本操作:代碼理解:4、報(bào)告規(guī)范度:5、學(xué)習(xí)態(tài)度:A(),B(), C(),D(),F( )A(),B(), C(),D(),F( )A(),B(),C(),D(),F( )A(),B(),C(),D(),F( )總評(píng)成績(jī) :指導(dǎo)教師 :孫改平計(jì)算機(jī)學(xué)院制0 / 7.一

2、、實(shí)驗(yàn)?zāi)康耐ㄟ^(guò)該實(shí)驗(yàn)把數(shù)據(jù)庫(kù)的理論知識(shí)(數(shù)據(jù)庫(kù)和數(shù)據(jù)表的設(shè)計(jì)理論、視圖、索引、存儲(chǔ)過(guò)程、觸發(fā)器、數(shù)據(jù)庫(kù)備份、數(shù)據(jù)庫(kù)安全等)應(yīng)用到具體的綜合實(shí)例中,達(dá)到數(shù)據(jù)庫(kù)知識(shí)整合的目的。完成學(xué)生成績(jī)管圖書(shū)借閱理系統(tǒng)基本功能設(shè)計(jì),提高學(xué)生的分析問(wèn)題、解決問(wèn)題的能力。二、設(shè)備與環(huán)境硬件:多媒體計(jì)算機(jī)軟件: WindowsXP 以上的操作系統(tǒng)、 Oracle 10g 數(shù)據(jù)庫(kù)管理系統(tǒng)三、實(shí)驗(yàn)內(nèi)容及實(shí)驗(yàn)結(jié)果1.數(shù)據(jù)庫(kù)設(shè)計(jì)設(shè)計(jì)思想(1) 用戶身份用戶、管理員。(2) 圖書(shū)管理模塊對(duì)圖書(shū)進(jìn)行添加、查詢、修改、刪除、添加。(3) 副本信息模塊對(duì)圖書(shū)的副本信息進(jìn)行添加、修改、刪除。(4) 用戶管理模塊對(duì)用戶進(jìn)行添加、刪除、修

3、改。2數(shù)據(jù)表設(shè)計(jì)設(shè)計(jì)思想Books 表字段數(shù)據(jù)類(lèi)型數(shù)據(jù)長(zhǎng)能否為空中文名備注度ISBNChar20否圖書(shū)編碼主碼TitleChar30是書(shū)名PubnameChar30是出版者名AuthorChar30是作者名AuthornoNumber30是作者號(hào)ZNCodeNumber30是中南分校碼Copies 表字段數(shù)據(jù)類(lèi)型數(shù)據(jù)長(zhǎng)度能否為空中文名備注CopyNoNumber10否副本編號(hào)主碼ISBNChar20是圖書(shū)編碼Authors表1 / 7.字段數(shù)據(jù)類(lèi)型數(shù)據(jù)長(zhǎng)度能否為空中文名備注AuthorNoNumber10否作者號(hào)主碼AuthorNameChar20是作者名Categories表字段數(shù)據(jù)類(lèi)型數(shù)據(jù)

4、長(zhǎng)度能否為空中文名備注ZNCodeNumber20否中南分校碼主碼CateNameChar20是目錄名Writers表字段數(shù)據(jù)類(lèi)型數(shù)據(jù)長(zhǎng)度能否為空中文名備注ISBNChar20否書(shū)編碼主碼AuthorNoNumber20否作者號(hào)主碼Publishers 表字段數(shù)據(jù)類(lèi)型數(shù)據(jù)長(zhǎng)度能否為空中文名備注PubNameChar30否出版者名主碼AddressChar50是地址Users 表字段數(shù)據(jù)類(lèi)型數(shù)據(jù)長(zhǎng)度能否為空中文名備注UsersNoNumber12否用戶編號(hào)主碼UserNameChar20否用戶名UserPwdChar20否用戶密碼QuanxianNumber20否權(quán)限BirthdayDate否用

5、戶生日EmailChar30是用戶的郵箱TelChar20是用戶的聯(lián)系電話AddressChar20是籍貫具體實(shí)現(xiàn)表空間的創(chuàng)建create tablespace dataloggingdatafile 'D:Oracleproduct10.2.0oradatalibrarydata01.dbf'size 50mreuse autoextend off;數(shù)據(jù)表.數(shù)據(jù)表的創(chuàng)建(1)創(chuàng)建 Books 表create table Books(isbn char(20) not null primary key,title char(30),pubname char(30),author

6、 char(30),2 / 7.authorno number(30),zncode number(30);( 2)創(chuàng)建 Copies 表create table copies(copyno number(10) not null primary key, isbn char(20), constraint fk_copyno foreign key(isbn) references Books(isbn);( 3)創(chuàng)建 Authors 表create table Authors(authorno number(10) not null primary key,authorname char(

7、20);( 4)創(chuàng)建 Categories 表create table Categories(zncode number(20)not null primary key,catename char(20);( 5)創(chuàng)建 Writers 表create table Writers(isbn char(20)not null,authorno number(20)not null,constraint pk_writers primary key(isbn,authorno);( 6)創(chuàng)建 Publishers 表create table Publishers(pubname char(30)no

8、t null primary key,address char(50);( 7)創(chuàng)建 Users 表create table Users(UserName char(20) not null,UserPwd char(20) not null,UserNo number(12) primary key,Birth date not null,Quanxian number(20),Email char(30),TEL char(20),Address char(20);3視圖設(shè)計(jì)3 / 7.設(shè)計(jì)思想(1)創(chuàng)建視圖“ cx_books” , 查看圖書(shū)的圖書(shū)編碼,書(shū)名,出版社名,中南分校編碼,作者

9、名,作者號(hào)。(2)創(chuàng)建視圖“ cx_zj ”,各用戶只能查找作家出版社的圖書(shū)名稱(chēng),作者,副本編號(hào)。(3)創(chuàng)建視圖“ cx_ anni ”,查看作者為安妮寶貝所有的圖書(shū)信息的視圖。具體實(shí)現(xiàn)( 1) create or replace view cx_booksasselect ISBN,Title,PubName,ZNCode,author,authorno from Books;(2)create or replace view cx_zjasselect title,author,copynofrom Books,Copieswhere Copies.isbn=Books.isbn and

10、PubName='作家出版社 '(3)create or replace view cx_anniasselect * from Books whereauthor='安妮寶貝 '查看視圖:select * from cx_books;select * from cx_zj;select * from cx_anni;4索引設(shè)計(jì)設(shè)計(jì)思想( 1)在 Books 表中的書(shū)名創(chuàng)建索引。(2)為 Users 表的姓名創(chuàng)建索引。具體實(shí)現(xiàn)( 1) create index Books_title_idx on Books(title);( 2) create index U

11、sers_username_idx on Users(username);4 / 7.5存儲(chǔ)過(guò)程和函數(shù)設(shè)計(jì)設(shè)計(jì)思想添加書(shū)籍信息的存儲(chǔ)過(guò)程BooksAdd具體實(shí)現(xiàn)create or replace procedure BooksAdd(isbn in char,title in char,pubname in char,author in char,authorno in char,zncode in char)asbegininsert into Booksvalues(isbn,title,pubname,author,authorno,zncode);end BooksAdd;執(zhí)行過(guò)程:e

12、xecute BooksAdd('Booo1','遮天 ','辰東 ','未來(lái)出版社 ',11,11);6觸發(fā)器及包設(shè)計(jì)設(shè)計(jì)思想刪除 Books 書(shū)籍信息表中的一條記錄, 刪除記錄 isbn 的字段值在 Copies 副本信息表中對(duì)應(yīng)的記錄具體實(shí)現(xiàn)create or replace trigger BooksDelete after delete on Books for each rowbegindelete from Copieswhere isbn=:OLD.isbn;end BooksDelete;7數(shù)據(jù)庫(kù)安全設(shè)計(jì)設(shè)計(jì)思想

13、授予圖書(shū)管理員和讀者不同的權(quán)限,方便管理具體實(shí)現(xiàn)5 / 7.(執(zhí)行結(jié)果的分析,以及報(bào)錯(cuò)時(shí)對(duì)錯(cuò)誤的分析)創(chuàng)建用戶create user reader identified by reader;create user manager identified by manager;授予:grant all to manager;grant select on books to reader;grant select on publishers to reader;grant select on authors to reader;grant select on copies to reader;grant select on writers to reader;grant select on cat

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論