




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、oracle log數(shù)據(jù)庫中,當(dāng)在數(shù)據(jù)庫中創(chuàng)建用戶時(shí),基于應(yīng)用性能和管理方面的 考慮,最好為不同的用戶創(chuàng)建獨(dú)立的表空間。那么創(chuàng)建表空間的步驟是怎樣實(shí) 現(xiàn)的呢?木文我們主要就介紹了這一部分內(nèi)容,接下來就讓我們一起來了解一下 這部分內(nèi)容吧。1. 創(chuàng)建表空間不論是lnux環(huán)境,還是wndows環(huán)境,都耍首先創(chuàng)建好表空間的存放路徑,根據(jù) 自己的情況修改。女u:/opt/orac 1 e/oradata/cocis 或d: orac 1 eoradatacoci s,若事先不創(chuàng)建該目錄路徑,則在創(chuàng)建表空間的時(shí)候 會(huì)出錯(cuò)。通過pl/sql登錄到oracle數(shù)據(jù)庫上,然后執(zhí)行菜單:文件/新建/命令窗口,打
2、開一個(gè)命令窗口然后在該命令窗口中執(zhí)行腳本創(chuàng)建和刪除表空間。創(chuàng)建表空間1. sql>create tablespace histdb datafile d:oracleproduct10 2. ooradataorclhistdb. dbf' size 200m autoextend on next10m maxsizc unlimited;2. sql>alter database datafile j d:oracleproductl0.2.0oradat aorclhistdb. dbf' autoextend on;1) datafile:表空間數(shù)據(jù)文件存放路
3、徑2) size:起初設(shè)置為200m3) uniform:指定區(qū)尺寸為128k,如不指定,區(qū)尺寸默認(rèn)為64k4) 空間名稱histdb與 數(shù)據(jù)文件名稱histdb. dbf不要求相同,可隨意命名.5) autoextend on/off表示啟動(dòng)/停止自動(dòng)擴(kuò)展表空間6) alter database datafile 'd:oracleproduct10. 2. 0oradataorclhistdb. dbf resize 500m; /手動(dòng) 修改數(shù)據(jù)文件大小為500m刪除表空間1. drop tablespace histdb including contents and datafi
4、les;表空間已創(chuàng)建。2. 為應(yīng)用創(chuàng)建用戶創(chuàng)建用戶的同時(shí),為用戶指定缺省的永久表空間和臨時(shí)表空間。1. sql> create user cocis identified by cocis2. 2 default tablespace cocis3. 3 temporary tablespace temp;4. 用戶已創(chuàng)建。5. sql> sclcct uscrnanic, dcfauit tablcspace, tcmporary tablespace6. 2 from dba_users7. 3 where username二'cocis'8. username
5、 default_tablespace temporary_tablespace9. 10. cocis cocis temp11. sql> select username, user_id, password, default_tablespace, temp orary_tablespace12.2 from dba users13. 3 where user name 二'coc1s,;14. username user_id password temporary_tablespace15. 16. cocis 61 e031f623c0f15d34 cocis3. 權(quán)限
6、的授予1. sql> grant connect,resource to cocis;2. 授權(quán)成功。注釋:當(dāng)用戶創(chuàng)建z后,一般只需要授予connect和resource這兩個(gè)角色即可。 若要單獨(dú)進(jìn)行授權(quán),則需執(zhí)行單獨(dú)的授權(quán)命令,如grant create table to cocis; 等。如果要授予sysdba的權(quán)限給用戶則用如下命令:1. sql grant sysdba to cocis;2. 3. sql> revoke uniimited tablespace from cocis;4. 撤銷成功。5. sql> alter user cocis quota un
7、iimited on cocis;6. 用戶已更改。注釋:為了更嚴(yán)謹(jǐn)?shù)墓芾?,可以回收用戶的unlimited tablespace權(quán)限,然后 對(duì)用戶的空間限額進(jìn)行單獨(dú)授權(quán)。關(guān)于oracle 10g創(chuàng)建表空間的完整步驟就介紹到這里了,如果您想了解更多關(guān) 于oracle數(shù)據(jù)庫的知識(shí),可以看一下這里的文章:hllp:/dalabase. 51clo. com/oracle/,相信_(tái)定可以帶給您收獲的!oraclelog手動(dòng)創(chuàng)建表空間,用戶,和授權(quán)o:啟動(dòng)數(shù)據(jù)庫服務(wù),并用特權(quán)用戶登錄重啟相應(yīng)的服務(wù)net stop oracleservicetestdbnet start oraclcscrvicctc
8、stdbnet stop oraclcoradblog home 1tnslistonerorcllistener -這是我的 那個(gè)監(jiān)聽服務(wù)名稱nel start orac1eoradb1og home1tnslistenerorclltstener保存成 restartservice. bat, 運(yùn)行它。運(yùn)行結(jié)果:c:documents and settingsadministrator>d:/restartservice.batc:documents and settingsadministrator>net stop oracleservicetestdboracleserv
9、icetestdb服務(wù)正在停止oracleservicetestdb服務(wù)已成功停止。c:documents and scttingsadministrator>net start oracleservicetestdboracleservicetestdb 服務(wù)正在啟動(dòng).oracleservicetestdb服務(wù)己經(jīng)啟動(dòng)成功。c:documents and settings'administrator>netstoporac1eoradb10g_home1tnslistenerorcllistenerorac 1 coradb 1 og_home 1 tnsli stcnc
10、rorcllistener 服務(wù)正在停止.oracleoradblog_homeltnslistenerorclllstener 服務(wù)已成功停止。c:documents and settingsadministrator>net startoracleoradb1oghome1tnslistenerorclltstenerorac 1 eoradb 1 ogjiome 1 tnsli stenerorclltstener 服務(wù)已經(jīng)啟動(dòng)成功。 用特權(quán)用戶登錄:c:documents and settingsadniinisti'atoi'>sqlplus /nolog
11、:47 2011sql*plus: release 10. 2. 0. 1. 0 - production on 星期日 2 刀 13 23:0copyright (c) 1982, 2005, oracle. all rights reserved.sql> conn / as sysdba;已連接到空閑例程。sql> startup pfile=d:/inittestdb.oraoracle例程已經(jīng)啟動(dòng)。total system global areafixed sizevariable sizedatabase buffersredo buffers數(shù)據(jù)庫裝載完畢。數(shù)據(jù)庫己經(jīng)
12、打開。sql>184549376 bytes1247972 bytes125830428 bytes50331648 bytes7139328 bytesok,已連接,并啟動(dòng)數(shù)據(jù)庫,現(xiàn)在開始干活1:創(chuàng)建用戶表空間sql> create tablespace testdb datafile'd:/orac1e/product/10. 2. 0/oradata/testdb/testdbol. dbf' size 100m;表空間己創(chuàng)建。sql> alter tablespace tcstdb add datafile'd:/oracle/product/
13、10. 2. 0/oradata/testdb/testdb02. dbf' size 50m autoextend on next 10m maxsize 100m;表空間已更改。再為表空間増加數(shù)據(jù)文件sql> alter database datafile'd:/oracle/product/10. 2. 0/oradata/testdb/testdb02.dbf, resize 60m;- 注意這里是al ter database數(shù)據(jù)庫已更改。修改數(shù)據(jù)文件的大小sql> create temporary tablespace testdbtemp tempfi
14、le'd:/orac1e/product/10. 2. 0/oradata/testdb/lestdbtempol. dbf, size 50m;表空間已創(chuàng)建。創(chuàng)建臨時(shí)表空間2:創(chuàng)建用戶并授權(quán)sql> create user chh identified by chh2 default tablespace testdb3 temporary tablespace tcstdbtcmp;user created.sql> grant connect, sysdba to chh;grant succeeded.sql>3:用該用戶登錄,并創(chuàng)建表sql> conn chh/chh;已連接。sql> create table test (a varchar2 (10);表已創(chuàng)建。s
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 贈(zèng)與汽車收回協(xié)議書
- led屏幕安裝協(xié)議書
- 車禍糾紛解決協(xié)議書
- 財(cái)務(wù)成本管理與邏輯思維的交融試題及答案
- 數(shù)據(jù)庫高可用性設(shè)計(jì)試題及答案
- 護(hù)理法律考試題目及答案
- 計(jì)算機(jī)二級(jí)Msoffice考試復(fù)習(xí)思路試題及答案
- 培養(yǎng)能力的計(jì)算機(jī)二級(jí)公共試題及答案
- Delphi語言基礎(chǔ)訓(xùn)練題試題及答案
- 工會(huì)法律測(cè)試題及答案
- 西南交11春學(xué)期《模擬電子技術(shù)A》離線作業(yè)
- 施工單位平安工地考核評(píng)價(jià)表(標(biāo)準(zhǔn))
- 建筑材料分類整理
- 人民幣發(fā)展史-課件(PPT演示)
- 經(jīng)歷是流經(jīng)裙邊的水
- 工作票培訓(xùn)-課件
- 骨科疾病的康復(fù)課件
- 三氯乙醛 氯醛MSDS危險(xiǎn)化學(xué)品安全技術(shù)說明書
- 合作社貸款申請(qǐng)書范文(優(yōu)選十三篇)
- 產(chǎn)品平臺(tái)與CBB技術(shù)管理課件
- 學(xué)院學(xué)生紀(jì)律處分登記表
評(píng)論
0/150
提交評(píng)論