I. Offline status
The database is put offline to maintain the database. The main maintenance work includes:
1. Move data files when the database is open
2. Restore a tablespace or data file when the database is open
3. Perform offline backup of table space
4. When a part of the database cannot be accessed and other parts can be accessed normally
Note: When a tablespace is set to offline or online again, Oracle records this event in the data dictionary and control file. It is also recorded in the alarm file.
The following table spaces cannot be taken offline:
1. Default temporary tablespace
2. System tablespace
3. The tablespace with active recovery/rollback segments on it
Offline command: Alter tablespace ygmd1 offline;
Online command: Alter tablespace ygmd1 online;
View the SQL statement of the data file corresponding to the tablespace:
Select T. TS #, T. name as tablespace_name, D. file # As fileid, D. name as file_name from V $ tablespace T, V $ datafile D where T. TS # = D. TS #
Two data dictionaries, V $ tablespace and V $ datafile, are used. The data dictionary comes from the information in the control file and is a dynamic data dictionary view.
In fact, the dba_data_files static data dictionary stores the corresponding information of the tablespace and data files.
Select tablespace_name, file_name from dba_data_files;
Ii. Read-Only status