Table of Contents
1. Oracle table space
2. Oracle user rights management
3. View user and permission information
Home Database Oracle A brief introduction to Oracle table space management and user management

A brief introduction to Oracle table space management and user management

Sep 08, 2022 pm 05:49 PM
oracle

This article brings you relevant knowledge about Oracle. It mainly talks about the introduction of Oracle table space management and user management. Table space is an important component of the logical deconstruction of Oracle database. Table space It can store various application objects, such as tables, indexes, etc. If you are interested, please take a look. I hope it will be helpful to everyone.

A brief introduction to Oracle table space management and user management

Recommended tutorial: "Oracle Video Tutorial"

1. Oracle table space

The table space is Oracle An important component of database logical deconstruction, table space can store various application objects, such as tables, indexes, etc. Each tablespace consists of one or more data files.

1.1: Classification of table spaces

Table spaces can be divided into three categories

Category Description
Permanent table space Generally saves data of tables, views, procedures, indexes, etc. Oracle will install some permanent table spaces by default, such as: SYSTEM, USERS, etc.
Temporary table spaces are only used to save data of short-term activities in the system, such as Sorting data, etc.
Undo table space is used to help roll back uncommitted transaction data. Committed data cannot be recovered here.

1.2: Purpose of table space

(1) Allocate different table spaces to different users and different schema objects Allocate different table spaces to facilitate the operation of user data and the management of schema objects.

(2) Different data files can be created on different disks, which is helpful for managing disk space, improving I/O performance, and backing up and restoring data.

1.3: Create table space

Create table space, the syntax is as follows.

 CREATE TABLESPACE tbs1  					 --表空间名称
 DATAFILE 'E:\TeachCase\OracleDB\tbs1.DBF'   -- 数据文件存放的位置
 SIZE 1M									 -- 初始大小
 AUTOEXTEND ON;								 -- 自动增长(开,关的话就是 OFF)

1.4: Delete table space

Drop TABLESPACE tbs1 --表空间名称;

Note: When the table space is not DROPed, it cannot be deleted from the disk, only if it is executed The data file can be deleted only after issuing the DROP TABLESPACE command, otherwise Oracle will not be able to execute it.

2. Oracle user rights management

When creating a new database, Oracle will create some default database users, such as Sys, System and Scott.
2.1: Sys
The Sys user is a super user in Oracle. All data dictionaries and views in the database are stored in the SYS schema. The Sys user is mainly used to maintain system information and manage instances. Sys users can only log in to the system with the SYSOPER or SYSDBA role.
2.2: System
The System user is the default system administrator in Oracle and has DBA authority. This user owns the internal tables and views used by Oracle management tools. The System user cannot log in to the system with the SYSOPER or SYSDBA role and can only log in in the default mode.
2.3: Scott
The Scott user is a demonstration user of the Oracle database and is generally created during database installation. Scott user mode contains 3 demonstration tables, one of which is the Emp table. Use the USERS tablespace to store schema objects.
2.4: Create a custom user
Normally, for security reasons, different access permissions need to be set for different data tables. At this point, you need to create different users.
A newly created user must go through the following steps to access and operate the database:

First step: Create user

CREATE USER accp			-- 指定用户名
IDENTIFIED BY accp			-- 指定登录密码
DEFAULT TABLESPACE tbs1		-- 指定默认表空间,如果不指定将用SYSTEM表空间作为默认表空间
TEMPORARY TABLESPACE TEMP;		-- 指定临时表空间(可选)

Second step: Assign roles

GRANT CONNECT TO accp		-- CONNECT角色将允许用户连接数据库
GRANT RESOURCE TO accp		-- RESOURCE角色允许用户使用数据库中的空间

Step 3: Grant operation permissions

GRANT CREATE SEQUENCE TO accp	-- 允许用户创建序列
GRANT SELECT ON EMP TO accp	    -- 赋予用户查询 EMP 表的权限(从scott用户授权给accp用户)
GRANT ALL ON EMP TO accp;		-- 赋予操作表的所有权限

In this way, the user will be successfully created. There are some extended operations below.

Modify password

ALTER USER accp			-- 指定修改的用户名
IDENTIFIED BY aptech		-- 指定新密码

Delete user

DROP USER accp [CASCADE];		
-- 当该用户下有任何的模式对象(表,试图)时,必须加 CASCADE,否则不能删除用户

Oracle Service Description

OracleServiceORA9				-- 启动数据库,必须启动
OracleOraHome90TNSListener		-- 启动服务器的监听程序,从外部客户端连接数据库所必须
OracleOraHome90HTTPServer		-- 启动Oracle HTTP服务器,从网络服务数据库所必须,如用iSQL*plus访问数据库

3. View user and permission information

1. View all users:

select * from dba_user;
select * from all_users;
select * from user_users;

2. View user system permissions:

select * from dba_sys_privs;
select * from all_sys_privs;
select * from user_sys_privs;

3. View user object permissions:

select * from dba_tab_privs;
select * from all_tab_privs;
select * from user_tab_privs;

4. View all roles:

select * from dba_roles;

5. View the roles owned by the user:

select * from dba_role_privs;
select * from user_role_privs;

6. View the current user’s default table space

select username,default_tablespace from user_users;

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of A brief introduction to Oracle table space management and user management. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to uninstall MySQL and clean residual files How to uninstall MySQL and clean residual files Apr 29, 2025 pm 04:03 PM

To safely and thoroughly uninstall MySQL and clean all residual files, follow the following steps: 1. Stop MySQL service; 2. Uninstall MySQL packages; 3. Clean configuration files and data directories; 4. Verify that the uninstallation is thorough.

Oracle's Role in the Business World Oracle's Role in the Business World Apr 23, 2025 am 12:01 AM

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

MongoDB vs. Oracle: Understanding Key Differences MongoDB vs. Oracle: Understanding Key Differences Apr 16, 2025 am 12:01 AM

MongoDB is suitable for handling large-scale unstructured data, and Oracle is suitable for enterprise-level applications that require transaction consistency. 1.MongoDB provides flexibility and high performance, suitable for processing user behavior data. 2. Oracle is known for its stability and powerful functions and is suitable for financial systems. 3.MongoDB uses document models, and Oracle uses relational models. 4.MongoDB is suitable for social media applications, while Oracle is suitable for enterprise-level applications.

What steps are required to configure CentOS in HDFS What steps are required to configure CentOS in HDFS Apr 14, 2025 pm 06:42 PM

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

MongoDB vs. Oracle: Choosing the Right Database for Your Needs MongoDB vs. Oracle: Choosing the Right Database for Your Needs Apr 22, 2025 am 12:10 AM

MongoDB is suitable for unstructured data and high scalability requirements, while Oracle is suitable for scenarios that require strict data consistency. 1.MongoDB flexibly stores data in different structures, suitable for social media and the Internet of Things. 2. Oracle structured data model ensures data integrity and is suitable for financial transactions. 3.MongoDB scales horizontally through shards, and Oracle scales vertically through RAC. 4.MongoDB has low maintenance costs, while Oracle has high maintenance costs but is fully supported.

How to configure the database connection of weblogic on centos How to configure the database connection of weblogic on centos Apr 14, 2025 pm 02:06 PM

Configuring WebLogic database connection on a CentOS system requires the following steps: JDK installation and environment configuration: Make sure that the server has installed a JDK that is compatible with the WebLogic version (for example, WebLogic14.1.1 usually requires JDK8). Correctly set JAVA_HOME, CLASSPATH and PATH environment variables. WebLogic installation and decompression: Download the WebLogic installation package for CentOS system from the official Oracle website and unzip it to the specified directory. WebLogic user and directory creation: Create a dedicated WebLogic user account and set a security password

Centos options after stopping maintenance Centos options after stopping maintenance Apr 14, 2025 pm 08:51 PM

CentOS has been discontinued, alternatives include: 1. Rocky Linux (best compatibility); 2. AlmaLinux (compatible with CentOS); 3. Ubuntu Server (configuration required); 4. Red Hat Enterprise Linux (commercial version, paid license); 5. Oracle Linux (compatible with CentOS and RHEL). When migrating, considerations are: compatibility, availability, support, cost, and community support.

Can vscode run kotlin Can vscode run kotlin Apr 15, 2025 pm 06:57 PM

Running Kotlin in VS Code requires the following environment configuration: Java Development Kit (JDK) and Kotlin compiler Kotlin-related plugins (such as Kotlin Language and Kotlin Extension for VS Code) create Kotlin files and run code for testing to ensure successful environment configuration

See all articles