Create a tablespace user in Oracle (Code tutorial) and create a tablespace in oracle
I. tablespace
Temporary tablespace
Example of creating a temporary tablespace
Create temporary tablespace duke_temp/* TEMPORARY tablespace name: duke_temp */tempfile 'C: \ oracle \ TABLESPACE \ duke_temp.dbf'/* tablespace path */size 50 m/* Initial space size: 50 M */autoextend ON/* enable auto scaling */NEXT 50 m/* space full expansion 50 M at a time */maxsize 6G/* space final size 6G, the unlimited size can be set to unlimited */extent management local;
Tablespace
Example of creating a tablespace
Create tablespace duke_data/* Temporary tablespace name: duke_temp */datafile 'C: \ oracle \ TABLESPACE \ duke_data.dbf'/* tablespace path */size 50 m/* Initial TABLESPACE size: 50 M */autoextend ON/* enable auto scaling */NEXT 50 m/* after the tablespace is full, the final size of the last extended 50 M */maxsize 10G/* space is 10 Gb, the unlimited size can be set to unlimited */logging extent management local;
Ii. Users
Create a user and specify a tablespace
Create user duke/* USER name */identified by duke/* password */default tablespace duke_data/* TABLESPACE */temporary tablespace duke_temp/* temporary tablespace */
Grant and revoke permissions to users
A new user cannot log on directly. You must grant the required permissions to the new user before logging on to oracle. Generally, we grant the user the built-in role permissions of two systems, connect and resource.
The connect role allows users to log on. The resource role allows users to develop programs, such as creating tables and triggers. The authorization command is as follows:
Grant connect, resource to duke/* User name */