Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

An example of a complete creation of tablespace by oracle

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report