(学习笔记)Oracle表空间相关基本命令
1.對(duì)用戶(hù)解鎖加鎖:
語(yǔ)法——“alter user [用戶(hù)名] account [unlock / lock]”
例子:alter user scott account unlock;?
unlock表示解鎖,locak表示鎖定
2.創(chuàng)建永久或臨時(shí)表空間:
語(yǔ)法——“create [temporary / null] tablespace 表空間名字 [tempfile / datafile] ' 表空間物理文件名.dbf ' size 文件大小M”
永久表空間例子:create tablespace test_tablespace datafile 'test_tablespace.dbf' size 10M;
臨時(shí)表空間例子:create temporary tablespace test_temp_tablespace tempfile 'test_temp_tablespace.dbf' size 10M;
臨時(shí)表空間需要在tablespace前面加上temporary
3.更改表空間的狀態(tài):
聯(lián)機(jī)狀態(tài):語(yǔ)法——“alter tablespace 表空間名字 [offline / online]”
offline表示設(shè)置為脫機(jī),online表示為聯(lián)機(jī),默認(rèn)值
讀寫(xiě)狀態(tài):語(yǔ)法——“alter tablespace 表空間的名字 [read only / read write]‘??
read only表示為只讀狀態(tài),read write表示為讀寫(xiě)狀態(tài),默認(rèn)值
只能在聯(lián)機(jī)狀態(tài)下更改讀寫(xiě)狀態(tài)
4.向表空間添加刪除數(shù)據(jù)文件:
添加:語(yǔ)法——” alter tablespace 表空間的名字 add datafile ' 數(shù)據(jù)文件的名字.dbf ' size 文件大小M?“
刪除:語(yǔ)法——” alter tablespace 表空間名字 drop datafile ' 數(shù)據(jù)文件的名字.dbf ' “
創(chuàng)建表空間時(shí)生成的第一個(gè)數(shù)據(jù)文件不能刪除
5.刪除表空間
語(yǔ)法——” drop tablespace 表空間名字 [including contents and datafiles / null] “
加上including contents and datafiles 表示同時(shí)刪除此表空間下的所有數(shù)據(jù)文件,不加表示只刪除表空間,保留數(shù)據(jù)文件
轉(zhuǎn)載于:https://www.cnblogs.com/yemingqianduzou/p/9335622.html
與50位技術(shù)專(zhuān)家面對(duì)面20年技術(shù)見(jiàn)證,附贈(zèng)技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的(学习笔记)Oracle表空间相关基本命令的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 试题 前缀和
- 下一篇: 【PyCharm疑问】在pycharm中