- 相關(guān)推薦
oracle數(shù)據(jù)庫(kù)基本語(yǔ)句
甲骨文公司,全稱(chēng)甲骨文股份有限公司(甲骨文軟件系統(tǒng)有限公司),是全球最大的企業(yè)級(jí)軟件公司,總部位于美國(guó)加利福尼亞州的紅木灘。下面是小編整理的關(guān)于oracle數(shù)據(jù)庫(kù)基本語(yǔ)句,歡迎大家參考!
1.登陸SPL*PLUS
[username/password] [@server] as [sysdba|sysoper]
eg. system/password or connect sys/password as sysdba
2.查看登錄用戶(hù)
show user
dba_users
desc dba_users//展示表結(jié)構(gòu)
select username from dba_users;
3.解鎖用戶(hù)
alter user username account unlock
4.表空間
數(shù)據(jù)庫(kù)--->表空間--->數(shù)據(jù)文件
表空間分類(lèi):
永久表空間: 表、視圖,永久保存
臨時(shí)表空間: 操作當(dāng)中的過(guò)程,過(guò)程結(jié)束即被釋放
UNDO表空間: 保存事務(wù)所修改數(shù)據(jù)的舊址,就是被修改之前的數(shù)據(jù),用于回滾
5.創(chuàng)建表空間
create [temporary] tablespace tablespace_name tempfile|datafile 'xx.dbf' size xx
永久表空間
create tablespace test1_tablespace
datafile 'testlfile.dbf' size 10m;
臨時(shí)表空間
create temporary temptest1_tablespace
tempfile 'tempfile1.dbf' size 10m;
改變表空間狀態(tài)
alter tablespace tablespacename offline|online;聯(lián)機(jī)||脫機(jī)
alter tablespace tablespacename read only|read write;
6.增加/刪除數(shù)據(jù)文件
增加
alter tablespace tablespace_name add datafile 'xx.dbf' size xx;
刪除
alter tablespace tablespace_name drop datafile 'xx.dbf';
7.表
(1)基本存儲(chǔ)結(jié)構(gòu)
(2)二維結(jié)構(gòu)
(3)行和列
8.數(shù)據(jù)類(lèi)型
字符型
char(n) n<=2000 補(bǔ)充為n位
nchar(n) n<=1000
varchar2(n) n<=4000
nvarchar2(n)n<=2000
數(shù)值型
number(p,s) p有效數(shù)字,s小數(shù)點(diǎn)后的位數(shù)
float(n)
日期型
data
timestamp
其他類(lèi)型
blob 4GB二進(jìn)制
clob 4GB字符串
9.管理表
創(chuàng)建表
create table table_name
(
colimn_name datatype, ...
)
【oracle數(shù)據(jù)庫(kù)基本語(yǔ)句】相關(guān)文章:
Oracle數(shù)據(jù)庫(kù)基本知識(shí)08-12
Oracle數(shù)據(jù)庫(kù)基礎(chǔ)知識(shí):SELECT語(yǔ)句10-07
Oracle數(shù)據(jù)庫(kù)SQLPLUS介紹07-16
學(xué)習(xí)Oracle數(shù)據(jù)庫(kù)技巧攻略06-09
Oracle數(shù)據(jù)庫(kù)知識(shí)點(diǎn):SQLPLUS介紹07-16
2016最新Oracle數(shù)據(jù)庫(kù)導(dǎo)入導(dǎo)出命令總結(jié)07-16
Oracle數(shù)據(jù)庫(kù)中表的四種連接方式07-26
Oracle數(shù)據(jù)庫(kù)無(wú)響應(yīng)故障處理方式08-17
Oracle發(fā)展歷程08-25