oracle常用命令

--清除垃圾信息

  1. PURGE recyclebin; 

--查詢垃圾信息

  1. SELECT t.object_name,t.type ,t.original_name FROM user_recyclebin t; 

--刪除表

  1. drop table example; 

--徹底刪除表不進入Recycle

  1. drop table example purge; 

--創建表

  1. CREATE TABLE admin( 
  2. id VARCHAR(40) NOT NULL PRIMARY KEY
  3. user_name VARCHAR(255), 
  4. user_passwd VARCHAR(255), 
  5. user_level VARCHAR(50) 
  6. ); 

--查詢表

  1. select a.id,a.user_name,a.user_passwd,a.user_level from admin a; 

--創建空間

  1. create tablespace shop datafile '/u01/app/oracle/oradata/shop/shop.dbf' size 50M default storage (initial 500K Next 500K minextents 1 maxextents unlimited pctincrease 0); 

--Oracle創建用戶權限
--創建用戶

  1. create user shopname identified by shoppasswd default tablespace shop; 

--授權

  1. grant resource,connect,dba to shopname; 

--刪除表空間

  1. drop tablespace shop including contents and datafiles; 

--刪除用戶

  1. drop user shopname cascade 

--查詢所有用戶

  1. select username from dba_users; 

--授予DBA權限

  1. grant dba to shopname; 

--授予不限制的表空間

  1. grant unlimited tablespace to shopname; 

--授予查詢任何表

  1. grant select any table to shopname; 

--授予 查詢 任何字典

  1. grant select any dictionary to shopname; 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章