What are the oracle objects?
Oracle objects include: 1. Table; 2. Index; 3. Cluster; 4. View; 5. Synonym; 6. Sequence; 7. Process ( Procedure) and function; 8. Triggers; 9. Constraints, etc.
The operating environment of this tutorial: Windows 7 system, Oracle 11g version, Dell G3 computer.
What are Oracle’s database objects:
The function of the database is to organize, manage and store various database objects. The objects in the database are the basis for our data management. This article will review some basic knowledge of database objects to give us a clearer understanding of these Oracle database objects.
1. Table:
When we operate the database, most of it is done by operating tables. Table is a logical concept and the basic unit for database organization and management of data.
Tables can be divided into relational tables and object tables. Relational tables include heap tables, index-organized tables, and external tables. What we commonly use is a heap table.
The segments corresponding to the heap table are stored in the form of a heap structure, and the stored data is logically out of order.
The corresponding relationship between tables and segments is as follows
For non-partitioned tables, one table corresponds to one segment;
For partitioned tables, one partition corresponds to one segment;
For tables with sub-partitions, one sub-partition corresponds to one segment;
Other database objects are similar to this
1.1 Table partition
Table partition (Partition), According to the user's data situation and business needs, the data in the table is stored in multiple segments from one segment to facilitate the management and maintenance of user data and improve the performance of query operations. Of course, there are also some shortcomings. If used improperly, some performance problems will occur; applying partition tables requires more experience and more comprehensive considerations, which also puts forward higher requirements for developers.
When to apply partitioning:
The first thing to consider is the amount of data. Partitioning is necessary only if the amount of data is large enough. Partitioning is not necessary for a small amount of data. Oracle officially recommends that when the storage space occupied by the table exceeds 2GB, you can consider partitioning the table. Generally speaking, try to avoid partitioning, and there must be a good reason for partitioning.
If the current non-partitioned table has affected the user's management and maintenance of data, partitioning can be considered.
Whether the user's query and operation performance can be improved after partitioning.
Regarding how to partition, we will continue to analyze it in the following articles.
2. Index:
The index is a logical object built on the table. Indexes can improve the efficiency of table data access and query, and play a great role in performance optimization. The index is also associated with one or more segments, and the final storage location of the index is also a segment. Different types of indexes have different storage logical structures, such as B-tree, Bitmap, etc.
Indexes are optional for tables, and creating appropriate indexes is the top priority of database optimization. However, indexes can improve query efficiency, but also reduce the efficiency of DML operations. Only when the two are taken into consideration will better performance be achieved.
Regarding index database optimization solutions, most of them are to avoid index failure, optimize the order of index use, etc. Indexes such as B* tree index and bitmap index will be discussed in detail in subsequent articles.
3. Cluster:
A cluster is a database object that contains data from one or more tables. The included tables All have one or more columns in common, these columns are called cluster key columns.
Creating a cluster requires corresponding permissions and is rarely used in development. Clusters can be divided into index clusters and hash clusters. The difference is that when searching for data, the former uses the index on the cluster key column, while the latter uses the hash value of the cluster key column. Which type to use depends on the usage scenario.
4. View (View) & Materialized View (Materialized View):
View is a virtual defined logical object, mainly used To simplify business logic and facilitate development and maintenance, the view does not contain any data, and its data is based on other objects corresponding to the view.
The view can provide some operations of adding, deleting, modifying and checking, and at the same time it has a certain degree of security. It can block some columns and is more flexible to use. But there will be some impact on performance.
Materialized views, compared to views, materialized views can actually store data and correspond to related segments like tables.
Materialized views can be used for summary, calculation and other services. At the same time, additions, deletions, modifications, and searches can also be performed under certain conditions, and indexes can also be established.
5. Synonym:
The synonym is also a virtual logical object and does not store any data. Essentially it is an alias for other data objects. At the same time, the permissions of synonyms can be assigned to different users as a way of security management.
6. Sequence:
The sequence does not store any data, and the user can obtain a series of ordered values through the sequence.
When defining a sequence, you can define the sequence name, ascending and descending order, step size, etc. If the load concurrency is high, the growth of the sequence will affect the overall performance.
7. Procedure & Function:
Procedures and functions are virtual logical objects and do not store data. The main function is to use database-encoded calls to perform a series of tasks.
Processes and functions are objects in the database, consisting of a set of SQL or some other PL statements. A unit written to solve a specific problem.
The difference is that the function has a return value. Except for this, the procedure and the function are the same in other aspects.
8. Trigger:
The trigger is also a logical object of the database and does not store data. Mainly through database coding, a set of commands are executed when the event is automatically triggered.
The execution process is automatic. When an event triggers relevant conditions, it will be executed.
9. Constraint:
Constraints are logical objects in the database, and their functions are determined through some internal or automatic logic. Implement inspection and restriction of data to make it comply with certain rules or standards. This enables the regularization and standardization of data.
Common constraints include
Primary key constraint
Unique constraint
- ## Non-null constraints
- Foreign key constraints
- Custom constraints (check constraints)
Oracle Tutorial"
The above is the detailed content of What are the oracle objects?. For more information, please follow other related articles on the PHP Chinese website!

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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



To query the Oracle tablespace size, follow the following steps: Determine the tablespace name by running the query: SELECT tablespace_name FROM dba_tablespaces; Query the tablespace size by running the query: SELECT sum(bytes) AS total_size, sum(bytes_free) AS available_space, sum(bytes) - sum(bytes_free) AS used_space FROM dba_data_files WHERE tablespace_

There are three ways to view instance names in Oracle: use the "sqlplus" and "select instance_name from v$instance;" commands on the command line. Use the "show instance_name;" command in SQL*Plus. Check environment variables (ORACLE_SID on Linux) through the operating system's Task Manager, Oracle Enterprise Manager, or through the operating system.

Oracle View Encryption allows you to encrypt data in the view, thereby enhancing the security of sensitive information. The steps include: 1) creating the master encryption key (MEk); 2) creating an encrypted view, specifying the view and MEk to be encrypted; 3) authorizing users to access the encrypted view. How encrypted views work: When a user querys for an encrypted view, Oracle uses MEk to decrypt data, ensuring that only authorized users can access readable data.

Uninstall method for Oracle installation failure: Close Oracle service, delete Oracle program files and registry keys, uninstall Oracle environment variables, and restart the computer. If the uninstall fails, you can uninstall manually using the Oracle Universal Uninstall Tool.

Deleting all data in Oracle requires the following steps: 1. Establish a connection; 2. Disable foreign key constraints; 3. Delete table data; 4. Submit transactions; 5. Enable foreign key constraints (optional). Be sure to back up the database before execution to prevent data loss.

To create a user in Oracle, follow these steps: Create a new user using the CREATE USER statement. Grant the necessary permissions using the GRANT statement. Optional: Use the RESOURCE statement to set the quota. Configure other options such as default roles and temporary tablespaces.

Oracle Invalid numeric errors may be caused by data type mismatch, numeric overflow, data conversion errors, or data corruption. Troubleshooting steps include checking data types, detecting digital overflows, checking data conversions, checking data corruption, and exploring other possible solutions such as configuring the NLS_NUMERIC_CHARACTERS parameter and enabling data verification logging.

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.
