An example of a complete creation of tablespace by oracle
I've been messing around with oracle for a while. Because the project is often used, some basic functions still need to be grasped to facilitate the docking and maintenance of the usual project, seeking truth from facts, the above picture said, today record an example of oracle 11g to create a complete tablespace
1. Landing
Su-oracel
Sqlplus / as sysdba
two。 Create a user
Create user testuser identified by testuser123
3. Modify the password
Alter user testuser identified by testuser123456
4. View the tablespace where the user is located
Select username,default_tablespace from dba_users
Set linesize 300
Set pagesize 30
Col USERNAME format a20
5. Create a new tablespace
Select file_name, tablespace_name from dba_data_files; view the directory location of the tablespace
Create tablespace testuser logging datafile'/ opt/oracle/oradata/orcl/orcl_data.dbf' size 50m autoextend on next 50m maxsize 2048m extent management local
6. Assign the newly created tablespace to the user
Alter user testuser default tablespace testuser
7. Assign login permissions to the user
Grant create session,create table,create view,create sequence,unlimited tablespace to testuser
Select * from all_users
Select * from dba_sys_privs
SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE = 'TESTUSER'; # check what permissions the user has
8. New user login test
Conn testuser/testuser123456
Select * from session_privs; # View the permissions of the current user
9. Create a tabl
Create table testnew_IME (id int primary key,name varchar2 (10)) segment creation immediate
Select table_name from user_tables where rownum