關於我

我的相片
用心思考、保持熱情,把工作上的經驗作分享與紀錄。希望能夠跟大家一起不斷的成長~

刪除oracle user,tablespace,role 等資料

下方以各user,tablespace,role為例,請參考.. 1.步驟1先刪除user cascade的用途為,一併刪除該user相關的資料! 所以會將該user擁有之table一併刪除!
drop user invoice cascade;
drop user exchange cascade;
drop user his cascade;
drop user einvoiceaccount cascade;
drop user einvoicereader cascade;
2.步驟2刪除tablespace 刪除user後,會將其擁有之table,view,procduce..等也一併刪除, 所以現在的tablespace理論上是一個空的表空間
drop tablespace invoice;
drop tablespace exchange;
drop tablespace his;
3.步驟3刪除特殊建立之role..等,如aspnet provider會建立的role!
drop ROLE ORA_ASPNET_MEM_BASICACCESS;
drop ROLE ORA_ASPNET_MEM_FULLACCESS;
drop ROLE ORA_ASPNET_MEM_REPORTACCESS;
drop ROLE ORA_ASPNET_PERS_BASICACCESS;
drop ROLE ORA_ASPNET_PERS_FULLACCES;
drop ROLE ORA_ASPNET_PERS_REPORTACCESS;
drop ROLE ORA_ASPNET_PROF_BASICACCESS;
drop ROLE ORA_ASPNET_PROF_FULLACCESS;
drop ROLE ORA_ASPNET_PROF_REPORTACCESS;
drop ROLE ORA_ASPNET_ROLES_BASICACCESS;
drop ROLE ORA_ASPNET_ROLES_FULLACCESS;
drop ROLE ORA_ASPNET_ROLES_REPORTACCESS;
drop ROLE ORA_ASPNET_SESSN_FULLACCESS;
drop ROLE ORA_ASPNET_SMAP_FULLACCESS;
drop ROLE ORA_ASPNET_WEVNT_FULLACCESS;
此資料庫只有建立自訂的tablespace 並建立user對應新建立之tablespace, 並無對應到其他原有tablespace, 因此只要刪除此兩部份,即可乾淨的環原未新增前狀態! 較特殊的是role 因為有用oracle for aspnet provider, 所以變會建立對應之role 所以也要一併刪除!

沒有留言:

張貼留言