A brief introduction to Oracle table space management and user management
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.
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!

Oracle software simplifies business processes through database management, ERP, CRM and data analysis capabilities. 1) OracleERPCloud automates financial, human resources and other processes; 2) OracleCXCloud manages customer interactions and provides personalized services; 3) OracleAnalyticsCloud supports data analysis and decision-making.

Oracle's software suite includes database management, ERP, CRM, etc., helps enterprises optimize operations, improve efficiency, and reduce costs. 1. OracleDatabase manages data, 2. OracleERPCloud handles finance, human resources and supply chain, 3. Use OracleSCMCloud to optimize supply chain management, 4. Ensure data flow and consistency through APIs and integration tools.

The main difference between MySQL and Oracle is licenses, features, and advantages. 1. License: MySQL provides a GPL license for free use, and Oracle adopts a proprietary license, which is expensive. 2. Function: MySQL has simple functions and is suitable for web applications and small and medium-sized enterprises. Oracle has powerful functions and is suitable for large-scale data and complex businesses. 3. Advantages: MySQL is open source free, suitable for startups, and Oracle is reliable in performance, suitable for large enterprises.

MySQL and Oracle have significant differences in performance, cost and usage scenarios. 1) Performance: Oracle performs better in complex queries and high concurrency environments. 2) Cost: MySQL is open source, low cost, suitable for small and medium-sized projects; Oracle is commercialized, high cost, suitable for large enterprises. 3) Usage scenarios: MySQL is suitable for web applications and small and medium-sized enterprises, and Oracle is suitable for complex enterprise-level applications. When choosing, you need to weigh the specific needs.

Oracle software can improve performance in a variety of ways. 1) Optimize SQL queries and reduce data transmission; 2) Appropriately manage indexes to balance query speed and maintenance costs; 3) Reasonably configure memory, optimize SGA and PGA; 4) Reduce I/O operations and use appropriate storage devices.

Oracle is so important in the enterprise software and cloud computing sectors because of its comprehensive solutions and strong technical support. 1) Oracle provides a wide range of product lines from database management to ERP, 2) its cloud computing services such as OracleCloudPlatform and Infrastructure help enterprises achieve digital transformation, 3) Oracle database stability and performance and seamless integration of cloud services improve enterprise efficiency.

MySQL and Oracle have their own advantages and disadvantages, and comprehensive considerations should be taken into account when choosing: 1. MySQL is suitable for lightweight and easy-to-use needs, suitable for web applications and small and medium-sized enterprises; 2. Oracle is suitable for powerful functions and high reliability needs, suitable for large enterprises and complex business systems.

MySQL uses GPL and commercial licenses for small and open source projects; Oracle uses commercial licenses for enterprises that require high performance. MySQL's GPL license is free, and commercial licenses require payment; Oracle license fees are calculated based on processors or users, and the cost is relatively high.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version
Recommended: Win version, supports code prompts!
