Oracle create tablespace, user, assign permission statement

log in with sysdba  

--create tablespace
create tablespace tablespace name
logging
datafile 'E:\app\sinohuarui\oradata\orcl\filename.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;



E:\app\sinohuarui\oradata\orcl is the path to install oracle, it must exist
 
--Create user and allocate tablespace
create user username identified by password
default tablespace tablespace name
temporary tablespace temp;

Create hello account and password and assign hello tablespace name

 
--authorization
grant connect,resource,dba to username;


Delete users and tablespaces
//Delete users and objects owned by users
drop user
username  cascade;

//Delete the tablespace and tablespace files (note: if you create a tablespace with double quotes, you must also bring it when you delete it)
DROP TABLESPACE  "stu_new"  INCLUDING CONTENTS AND DATAFILES;
Premise: Before deleting a tablespace, you must After confirming that the tablespace is not used by other users, delete
drop tablespace  zfmi  including contents and datafiles cascade onstraints;
//including contents Delete the contents of the tablespace, if there is content in the tablespace before deleting the tablespace, but this parameter is not added , the tablespace cannot be deleted, so habitually add this parameter
//including datafiles to delete the data files
in the tablespace//cascade constraints and delete the foreign key reference of the table in the tablespace

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325730469&siteId=291194637