Get the App
SLTechnology News&Howtos  ›  Database  › 

An example of a complete creation of tablespace by oracle

Shulou Source: shulou.com Published: 2022-06-01 13:08:55 10月03日 Update

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

Tags: User space permissions project assignment login example seeking truth from facts figure above location function foundation fact password object location time directory or seek truth Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Information NVidia Xiaomi Shulou Technology