SQL> CLEAR SCREEN;
#建立庫表
SQL> START E:\SQL.SQL;
18 ;
表已建立。
SQL> select table_name,tablespace_name from user_tables;
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
TB_MTBasicInfo DBDATAFILESPACE
#擁有資料表空間DBDATAFILESPACE
SQL> select tablespace_name from user_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
DBDATAFILESPACE
DBINDEXSPACE
已選擇7行。
#登陸使用者名稱:DBMATERIALOWNER
SQL> select username from user_users;
USERNAME
------------------------------
DBMATERIALOWNER
#DBA身份
SQL> select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
DBMATERIALOWNER DBA NO YES NO
#表對象卻不存在
SQL> desc TB_MTBasicInfo;
ERROR:
ORA-04043: 對象 TB_MTBasicInfo 不存在
SQL> desc DBDATAFILESPACE.TB_MTBasicInfo;
ERROR:
ORA-04043: 對象 DBDATAFILESPACE.TB_MTBasicInfo 不存在
E:\SQL.SQL的內容:
CREATE TABLE "DBMATERIALOWNER"."TB_MTBasicInfo" (
"MT_ID" NUMBER(10,0),
"MT_CODE" VARCHAR2(50 BYTE) not null,
"MT_DESC" VARCHAR2(600 BYTE) not null,
"MT_5497_CODE" NVARCHAR2(50) not null,
"MT_5497_DESC" NVARCHAR2(150),
"MT_PROD_CODE" NVARCHAR2(50),
"MT_PROD_DESC" NVARCHAR2(150),
"MT_SPEC_APPR" NVARCHAR2(100),
"MT_BATCH_NO" NVARCHAR2(50),
"MT_TYPE_CODE" NVARCHAR2(50) not null,
"MT_TYPE_DESC" NVARCHAR2(150) not null,
CONSTRAINT TB_MTBasicInfo PRIMARY KEY
(
MT_ID
)
)
原來命令列裡建表如果是帶引號的,那麼在使用的時候也要帶引號,如果命令如下:
desc “DBDATAFILESPACE”.“TB_MTBasicInfo”
就不會有任何問題了。
帶引號的時候,大小寫是敏感的