Database objects, also known as schema objects, belong to a schema. A schema is a collection of database objects. A user has a default schema, and the schema name is the same as the username. A user can access and use the schemas of other users. When a user accesses an object in a schema, the system automatically adds the default schema name to the object name if the schema to which the object belongs is not specified.
The following table describes the database objects that are supported by the Oracle mode of OceanBase Database.
| Object type | Description |
|---|---|
| Table | The most basic storage unit in a database. A table is organized into rows and columns. |
| View | A view is a virtual table whose elements are defined by a query. Like a true table, a view consists of a set of named columns and data rows. However, a view does not exist as a stored set of data values in a database. Row and column data can freely define the table referenced by a query for the view, and is dynamically generated when the view is referenced. |
| Index | An index is a structure to sort data in one or more columns of a database table in a specific order. It enables you to quickly access specific information in the database table. For example, an index enables you to quickly search for a specified employee by last name, which is more efficient than searching all rows in a table. |
| Partition | OceanBase Database can split the data of a table into different groups based on some rules. Data in the same group is stored in the same physical area. A table whose data is split into different groups is called a partitioned table. Tables in OceanBase Database are horizontally partitioned. Each partition contains some data rows. A table can be partitioned by specified partitioning methods such as hash partitioning, range partitioning, and list partitioning based on the mapping relationships between data and partitions. Each partition can be divided into several subpartitions from different dimensions. For example, you can partition the transaction table into several hash partitions based on the user IDs. Then, you can partition each hash partition into several range partitions based on the transaction time. |
| Sequence | A sequence is a serial number generator that can automatically generate serial numbers. A serial number is a set of numeric values at equal intervals. Each sequence object instance can generate a data sequence. This ensures that all generated data is different in either a standalone or multi-host environment. Sequences provide a variety of options to meet your requirements in different scenarios, while ensuring that all data is distinct. For example, a sequence ensures that data is incrementally generated in chronological order to prevent a significant difference between data. Higher requirements for sequences result in higher performance costs for the database. |
| Synonym | A synonym is an alias for a database object. It is used to simplify and enhance the security of access to a schema object. The Oracle mode of OceanBase Database translates a synonym into the name of the corresponding schema object. Similar to views, synonyms do not consume storage space, and only the synonym definitions are stored in the data dictionary. The database administrator can define synonyms for most database objects in the database, such as tables, views, and sequences.
|
| Trigger | A trigger is a special stored procedure that is automatically called in response to a specific event. Unlike a regular stored procedure that is explicitly run, a trigger can be enabled and disabled but cannot be explicitly run. |
| PL object (PL subprogram and package) | PL stands for procedural language. It is an extension to SQL. PL incorporates characteristics of programming languages based on SQL statements, organizes data operations and query statements in PL code, and implements complex features by using logic judgment and loops. The basic unit of the PL source program is block, which consists of declarations and statements. Variables and constants can be declared in internal classes and used in expressions. A PL program package consists of PL types, variables, constants, subprograms, cursors, and exceptions that are logically relevant. |