To understand the Oracle architecture, you must first understand two basic concepts: databases and instances.
I. Databases
A database is a collection of data. Whether the database adopts a relational structure or an object-oriented structure, the oracle database stores the data in the data file. Internally, the logical ing of database structure data to files enables separate storage of different data. These logical partitions are called tablespaces.
Table space and file introduction:
1. tablespace
A table space is the logical division of a database. Each database has at least one table space, called a system tablespace ). A tablespace can belong to only one database. Each tablespace is composed of one or more files on the same disk. These files are called data files.
Table space features:
1) control database data disk allocation;
2) restrict the disk space that users can use in the tablespace;
3) tablespaces have the online, offline, readonly, and readwrite attributes;
Modify the properties of a tablespace:
SQL> altertablespace tablespace name attribute;
Query the table space status:
SQL> selecttablespace_name, statusfromdba_tablespaces;
Note: The system, undo, and temp tablespace cannot be set as the offline attribute.
4) backup and recovery of some databases;
5) The tablespace is expanded by data files. The tablespace size is equal to the sum of the data files that constitute the tablespace.
Query the ing between a table space and a data file:
SQL> selecttablespace_name, bytes, file_namefromdba_data_files;
Table space-based operations:
1) query the user's default tablespace:
SQL> selectusername, default_tablespacefromdba_users;
2) query the table and the tablespace that stores the table:
SQL> selecttable_name, tablespace_namefromuser_tables;
3) modify the user's default tablespace:
SQL> alteruserusernamedefaulttablespacetablespace_name;
4) move data from one tablespace to another:
SQL> altertabletable_namemovetablespacetablespace_name;
2. Data Files
Each tablespace is composed of one or more files on the same disk. These files are called data files ),
The data file can only belong to one tablespace. After the data file is created, the size can be changed. To create a new tablespace, you need to create a new
Data file. Once a data file is added to a tablespace, it cannot be moved from the tablespace or be associated with other tablespaces.
Three types of files required by the database are datafile, controlfile, and redologfile. Other files prameterfile, passwordfile, and archivedlogfiles are not required by the database. They are only auxiliary databases.
View the physical file composition of the database:
1) view data files: SQL> select * fromv $ datafile;
2) view the control file: SQL> select * fromv $ controlfile;
3) view the log file: SQL> select * fromv $ logfile.
| [Content navigation] |
| Page 1: Database |
Page 1: Instances |