create
tablespace chen1
datafile 'E:\app\chendabing\oradata\test\chen1.dbf'
size 100m
autoextend on next 50m maxsize 20480m
extent management local
/css
建立表空間 sql
ORA-01031:權限不足的問題
在 腳本更新時,報錯:ORA-01031: 權限不足。
grant connect,resource,dba to cssy;
賦權DBA以後,還有這個錯誤。
執行 grant all privileges to cssy
賦予任何主機訪問數據的權限,問題獲得瞭解決。oracle
--刪除空的表空間,可是不包含物理文件
drop tablespace tablespace_name;
--刪除非空表空間,可是不包含物理文件
drop tablespace tablespace_name including contents;
--刪除空表空間,包含物理文件
drop tablespace tablespace_name including datafiles;
--刪除非空表空間,包含物理文件
drop tablespace tablespace_name including contents and datafiles;
--若是其餘表空間中的表有外鍵等約束關聯到了本表空間中的表的字段,就要加上CASCADE CONSTRAINTS
drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;app
sqlplus sys/oracle as sysdba; 登陸DBA用戶spa
建立表空間 create tablespace chen datafile 'F:\app\Administrator\oradata\luckChen\chen.dbf' size 100m autoextend on next 50m maxsize 20480m extent management local
/table
一、查詢表的數目:select count(*) from tabs
二、查詢用戶擁有哪些表:select * from tabs
三、SELECT * FROM ALL_TABLES WHERE OWNER='用戶名'; ----要求是管理員用戶
4.select table_name from user_tables; 查看當前用戶因此的表經常使用test
--刪除空的表空間,可是不包含物理文件
drop tablespace tablespace_name;
--刪除非空表空間,可是不包含物理文件
drop tablespace tablespace_name including contents;
--刪除空表空間,包含物理文件
drop tablespace tablespace_name including datafiles;
--刪除非空表空間,包含物理文件
drop tablespace tablespace_name including contents and datafiles;
--若是其餘表空間中的表有外鍵等約束關聯到了本表空間中的表的字段,就要加上CASCADE CONSTRAINTS
drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;登錄