Oracle create tablespace and user code tutorial, oracle build code tutorial
Oracle creates tablespaces and users
Step for creating a tablespace and a user: create user username identified by "password"; Authorize: grant create session to username; grant create table to username; grant create tablespace to username; grant create view to user name;
Create a tablespace (generally, create N tablespaces for storing data and an index space): create tablespace name datafile path (you must first create a path )\***. dbf 'size * M tempfile' path \***. dbf 'size * M autoextend on -- Automatic growth -- there are also some commands that define the size. You need to use default storage (initial 100 K, next 100 k ,);
Example: create a tablespace create tablespace DEMOSPACE datafile 'e:/oracle_tablespaces/demospace_tbspace.dbf' size 1500 M autoextend on next 5 M maxsize 3000 M; delete a tablespace drop tablespace DEMOSPACE including contents and datafiles
User permission: alter user Username quota unlimited on tablespace; or alter user Username quota * M on tablespace;
Complete example:
-- Create tablespace sdt DATAFILE 'f: \ tablespace \ demo' size 800 m extent management local segment space management auto; -- index tablespace create tablespace sdt_Index DATAFILE 'f: \ tablespace \ demo' size 512 m extent management local segment space management auto; -- 2. create user demo identified by demo default tablespace std; -- 3. grant connect, resource to demo; grant create any sequence to demo; grant create any table to demo; grant delete any table to demo; grant insert any table to demo; grant select any table to demo; grant unlimited tablespace to demo; grant execute any procedure to demo; grant update any table to demo; grant create any view to demo;
-- Import Export command ip export method: exp demo/demo@127.0.0.1: 1521/orcl file = f:/f. dmp full = y exp demo/demo @ orcl file = f:/f. dmp full = y imp demo/demo @ orcl file = f:/f. dmp full = y ignore = y