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

How to create tablespaces in oracle

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

It is believed that many inexperienced people have no idea about how to create tablespaces in oracle. Therefore, this paper summarizes the causes and solutions of the problems. Through this article, I hope you can solve this problem.

The specific process of creating a database user:

1. If you have already built a database called 'NewDB''

At this point, the NewDB directory already exists in the D:appAdministratororadata directory (Note: my Oracle11g is installed on disk D, if your Oracle is installed in another directory, then your new database directory is in the *: appAdministratororadata directory).

two。 Create a temporary tablespace before creating a user. If not, the default temporary tablespace is temp.

SQL > CREATE TEMPORARY TABLESPACE DB_TEMP

TEMPFILE'Dapplication Administrator oradataNewDBBackTEMP.DBF'

SIZE 32M

AUTOEXTEND ON

NEXT 32M MASIZE UNLIMITED

EXTENT MANAGEMENT LOCAL

3. Create a data tablespace before creating a user. If not, the default persistent tablespace is system.

SQL > CREATE TABLESPACE DB_DATA

LOGGING

DATAFILE'Dazo Administrator oradataNewDBMS DATA.DBF'

SIZE 32M

AUTOEXTEND ON

NEXT 32M MAXSIZE UNLIMITED

EXTENT MANAGEMENT LOCAL

Among them, 'DB_DATA'' and 'DB_TEMP'' are your custom data tablespace names and temporary tablespace names, which you can choose arbitrarily; 'size administrators adat NewDBMS DATA.DBF' is the location where the data file is stored, and the DB_DATA.DBF' file name is also arbitrary; and 'DBF 32M' is to specify the size of the data file, that is, the size of the tablespace.

4. Now that you have built a tablespace named 'DB_DATA', you can create users:

SQL > CREATE USER NEWUSER IDENTIFIED BY BD123

ACCOUNT UNLOCK

DEFAULT TABLESPACE DB_DATA

TEMPORARY TABLESPACE DB_TEMP

The default tablespace 'DEFAULT TABLESPACE' uses the tablespace name created above: DB_DATA.

The temporary tablespace 'TEMPORARY TABLESPACE' uses the temporary tablespace name created above: DB_TEMP.

5. Then authorize the newly created user:

SQL > GRANT CONNECT,RESOURCE TO NEWUSER;-- means to grant connect,resource permissions to news users

SQL > GRANT DBA TO NEWUSER;-- means that dba permissions are granted to NEWUSER users

Authorization successful.

The database user has been created, and now you can use that user to create the data table!

Summary: the creation of users is generally divided into four steps:

Step 1: create a temporary tablespace

Step 2: create a data tablespace

Step 3: create a user and develop a tablespace

Step 4: grant permissions to users

After reading the above, have you mastered how to create tablespaces in oracle? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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