To establish the tablespace and the user's steps:
- User
- Create:Create user username identified by "password";
- Authorization:Grant create session to user name;
- Grant create table to user name;
- Grant create tablespace to user name;
- Grant Create view to user name;
Steps to establish a tablespace and User: User creation: Create user username identified by "password"; authorization: Grant create session to username; Grant CREATE table to user name; Grant create tablespace to user name; Grant CREATE view to user name;
-
- establishes a tablespace (typically a table space and an index space of n stored data):
- create tablespace table space name
- datafile < Span class= "string" > path (to build the path first) \***.dbf ' size *m
- tempfile ' Path \***.dbf ' size *m
- autoextend on --auto-grow
- --there are also some commands to define the size, see the need for
- default storage (
- initial 100k,
- NEXT&NBSP;100K,&NBSP;&NBSP;
-
Tablespace establishes table space (typically a table space with n stored data and an index space): Create tablespace tablespace name datafile ' path (to build the path first) \***.dbf ' size *mtempfile ' path \***.dbf ' Size *mautoextend on-auto-grow-there are also some defined-size commands to see the default storage (initial 100K, next 100k,);
- Example: creating a table space
- Create Tablespace Demospace
- DataFile ' e:/oracle_tablespaces/demospace_tbspace.dbf '
- Size 1500M
- Autoextend on next 5M maxsize 3000M;
- Delete Table space
- Drop tablespace demospace including contents and datafiles
Example: Creating table spaces Create tablespace demospace datafile ' e:/oracle_tablespaces/demospace_tbspace.dbf ' size 1500M autoextend on Next 5M maxsize 3000M; Delete table space drop tablespace demospace including contents and datafiles
- User Rights
- To grant a user permission to use the tablespace:
- Alter user username quota Unlimited on table space;
- or alter user username quota *m on table space;
User Rights grant users permission to use tablespace: Alter user username quota unlimited on table space, or alter user username quota *m on table space;
Complete Example:
- --Table space
- CREATE tablespace SDT
- DataFile ' F:\tablespace\demo ' size 800M
- EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
- --Index Table space
- CREATE tablespace Sdt_index
- DataFile ' F:\tablespace\demo ' size 512M
- EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
- --2. Build Users
- Create User demo identified by demo
- Default Tablespace demo;
- --3. Empowering
- 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;
--Table space Create tablespace sdtdatafile ' F:\tablespace\demo ' size 800M EXTENT MANAGEMENT LOCAL SEGMENT space MANAGEMENT AU to; --Index tablespace create tablespace sdt_indexdatafile ' F:\tablespace\demo ' size 512M EXTENT MANAGEMENT LOCAL SEGMENT Space MANAGEMENT AUTO; --2. Create user demo identified by demo default Tablespace demo; --3. Empowering Grant Connect,resource to demo;grant create any sequence to demo;grant create any table to demo;grant delete any tab Le to demo;grant Insert no 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 and export commands
- IP Export mode: Exp demo/[email protected]:1521/orcl file=f:/f.dmp full=y
- Exp Demo/[email protected] file=f:/f.dmp full=y
- Imp demo/[email protected] file=f:/f.dmp full=y ignore=y
Oracle establishes tablespaces and users