-
數據類型: 1、字符型:char(n<=2000),nchar(n<=1000),n是長度; varchar2(n<=4000),nvarchar2(n<=2000); 2、數值型:number(p,s)p是有效數字,s小數點后的位數; float(n)表示二進制數; 3、日期型:date,范圍為:公元前4712年1月1日到公園9999年12月31日; timestamp,時間戳,可以精確到秒; 4、其他類型:blob存取形式為二進制類數據; clob存取形式為字符串類數據。查看全部
-
表:基本存儲單位,二位結構,即行(記錄)和列(域和字段) 約定:1.每一列的數據必須具有相同數據類型; 2.列名唯一; 3.沒一行數據的唯一性。查看全部
-
系統管理員用戶查看的數據字典:dba_tablespaces 普通用戶查看的數據字典:user_tablespaces 查看數據字典:desc dba_tablespaces/user_tablespaces 查看表空間名字:select tablespace_name from dba_tablespaces/user_tablespaces system表空間:存儲system的表、視圖、存儲過程等(系統表空間) sysaux:example的輔助表空間 example:事例表空間 undotbs1:存儲撤銷信息 temp:存儲sql語句處理的表和索引信息(臨時表空間) users:存儲數據庫用戶創建的數據庫對象 dba_users:系統用戶 user_users:普通用戶 dba_users下:查看默認/臨時表空間:select default_tablespace,temporary_tablespace from dba_users where username='STSTEM'; 設置用戶的默認/臨時表空間:alter user username default/temporary tablespace tablespace_name查看全部
-
創建表空間:create tablespace test1_tablespace datafile 'test1file.dbf' size 10m; 創建臨時表空間:create temporary tablespace temptest1_tablespace tempfile 'tempfile1.dbf' size 10m; 查看:select file_name frome dba_data_files where tablespace_name='TEST1_TABLESPACE';查看全部
-
永久表空間:存放數據庫永久的數據(表,視圖等); 臨時表空間:存放數據庫操作中中間執行的過程,執行結束后釋放掉; undo表空間:存儲數據被修改前的數據。查看全部
-
scott用戶解鎖(啟用):alter user scott account unlock; 登陸scott用戶:connect scott/tiger查看全部
-
查看登錄用戶:show user(sql plus中的命令不用分號結尾,但sql語句需要用分號結尾) 數據字典dba_users是數據庫提供的表,用于查看數據庫的信息。 查看數據字典:desc dba_users 查看用戶:select username from dba_users;查看全部
-
連接語句:connect username/password as sysdba查看全部
-
用戶:system/sys; sysman;scott(tiger) 登陸:username/password @server as sysdba|sysoper查看全部
-
刪除表空間:drop tablespace tablespace_name [including contents] 只刪除表空間而不刪除數據文件,要刪除數據文件加上including contents查看全部
-
添加數據文件:alter tablespace tablespace_name add datafile 'xx.dbf' size 10m; 刪除數據文件:alter tablespace tablespace_name drop datafile 'filename.dbf'; 查看:select file_name from dba_data_files where tablespace_name='xx.dbf';查看全部
-
每一列數據必須具有相同的數據類型 列名唯一 每一行數據的唯一性查看全部
-
刪除表空間 DROP TABLESPACE tablespace_name [INCLUDING CONTENTS] --[INCLUDING CONTENTS]刪除表空間的同時刪除數據文件查看全部
-
修改表空間中的數據文件 一、增加數據文件 alter tablespace tablespace_name add datafile 'xx.dbf' size xx; select file_name from dba_data_files where tablespace_name='表空間名稱' 二、刪除數據文件 alter tablespace tablespace_name drop datafile 'xx.dbf'查看全部
-
alter tablespace test1_space online/offline(改變表空間狀態);(永久表空間) select status from dba_tablespaces where tablespace_name=“TEST1_TABLESPACE”(查詢表空間的狀態) alter tablespace test1_tablespace read only;(設置表空間為只讀狀態) select status from dba_tablespaces where tablespace_name="TEST1_TABLESPACE"(查詢即為read only 默認聯機狀態就是讀寫狀態_查看全部
舉報
0/150
提交
取消