Oracle establishes tablespaces and users
Steps to establish a tablespace and User: Create user username identified by "password"; authorization: Grant create session to username; Grant CREATE table to username; Grant create tablespace to username; Grant CREATE view to username;
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-self-active growth-some other defined-size commands that require default storage (initial 100K, next 100k,);
Example: Creating a tablespace 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 grant users permission to use tablespace: Alter user username quota unlimited on table space, or alter user username quota *m on table space;
Complete sample:
--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 Export command IP Export method: Exp demo/[email PROTECTED]:1521/ORCL file=f:/f.dmp full=yexp demo/[email protected] File=f:/f.dmp Full=yimp Demo/[email protected] file=f:/f.dmp full=y ignore=y