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 also access and use other schemas in addition to the default schema. 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 OceanBase Database in Oracle mode.
| Object type | Description |
|---|---|
| Table | A table is the most basic data storage unit in the database. Data in a table is organized by rows and columns. |
| View | A view is a virtual table whose content is defined by a query. Like a real table, a view contains a series of columns and rows with names. However, a view does not exist in the database as a collection of stored data values. 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 split in this way is called a partitioned table. Like an Oracle database, OceanBase Database supports only horizontal partitioning, and each partition of a table contains some records. Partitions can be classified into hash partitions, range partitions, and list partitions based on the mapping relationship between row data and partitions. Each partition can be divided into several subpartitions from different dimensions. For example, you can create multiple hash partitions for a transaction table based on user IDs. You can further divide each hash partition into multiple range subpartitions 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. OceanBase Database in Oracle mode 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, for example, tables, views, and sequences. Notice Synonyms are not supported for procedural language (PL) objects such as stored procedures and packages. |
| Trigger | A trigger is a set of stored procedures that are automatically called by the system when a specified event occurs. In contrast to normal stored procedures, triggers can be enabled or disabled and cannot be explicitly called. |
| PL object (PL subprogram and package) | PL stands for procedural language. It is an extension of SQL. PL incorporates characteristics of programming languages on the basis of 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. |