Oracle creates tablespaces and users

Oracle creates tablespaces and users                  

    Steps to create tablespaces and users:  
    user  
    Create: 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  
    Create a table space (usually build N table spaces for storing data and an index space):  
    create tablespace tablespace name  
    datafile ' path (must be built first)\***.dbf ' size *M  
    tempfile 'path\***.dbf' size *M  
    autoextend on -- automatic growth  
    --There are also some commands to define the size, depending on the needs  
     default storage(  
     initial 100K,  
     next 100k,  
    );  

 

    User rights  
    Grant the user permission to use the tablespace:  
    alter user username quota unlimited on tablespace;  
    or alter user username quota *M on tablespace;  

 

    --tablespace  
    CREATE TABLESPACE sdt  
    DATAFILE 'F:\tablespace\demo' size 800M  
             EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;   
    --index tablespace  
    CREATE TABLESPACE sdt_Index  
    DATAFILE 'F:\tablespace\demo' size 512M           
             EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;       
      
    --2. Create a user  
    create user demo identified by demo   
    default tablespace demo;  
       
    --3. Empowerment  
    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 and export commands     
    ip export method: exp demo/[email protected]: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  

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326780344&siteId=291194637
Recommended