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

Oracle methods for creating tablespaces, creating users, and authorizing

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

Share

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

This article mainly introduces "the method of creating tablespaces, creating users and authorizing by Oracle". In daily operation, I believe many people have doubts about the methods of creating tablespaces, creating users and authorizing by Oracle. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts of "Oracle creates tablespaces, creates users and authorizes users". Next, please follow the editor to study!

After Oracle is installed, there is a default database, and in addition to this default database, we can also create our own database.

For beginners, to avoid hassle, use the 'Database Configuration Assistant' wizard to create the database.

After you create a database, you cannot immediately create a table in the database. You must first create a user of the database and specify a tablespace for that user.

Relationship: a large data is divided into several tablespaces, create several users and then specify the corresponding tablespaces and authorize them, so that users can operate their own resources independently, after each user logs in, create new tables in their own tablespaces and other objects that do not interfere with each other.

Here is the 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 BYBD123

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.

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

At this point, the study on "Oracle's way to create tablespaces, create users, and authorize" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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