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