When the database is running, the tablespace status is online. At this time, the tablespace cannot be backed up. During the backup, the database is still writing data to the tablespace data files. If the data files are backed up at this time, the backup data files are not uniform and cannot be used for recovery.
To back up the data file of a tablespace, you must first make the tablespace in the backup State. At this time, the database cannot write data to the data file and the backup data file can be consistent, before the application can be restored.
SQL> select * from V $ tablespace;
TS # name Inc
-------------------------------------------
0 system Yes
1 undotbs1 Yes
2 temp Yes
3 indx Yes
4 tools Yes
5 Users Yes
7 SP Yes
You have selected 7 rows.
To back up data, you must:
SQL> alter tablespace users begin backup;
The tablespace has been changed.
In this case, when querying:
SQL> select * from V $ backup;
File # status change # Time
------------------------------------------------
1 not active 0
2 not active 0
3 not active 0
4 not active 0
5 active 675944-11-06
6 not active 0
You have selected 6 rows. If the status is active, the backup is in progress.
The preceding table space on the 5 th is the users table space.
Then, copy the file using the file copy command of the operating system.
Finally:
SQL> alter tablespace users end backup;
The tablespace has been changed.
SQL> select * from V $ backup;
File # status change # Time
------------------------------------------------
1 not active 0
2 not active 0
3 not active 0
4 not active 0
5 not active 675944 month-11 month-06
6 not active 0
You have selected 6 rows.
That is, the tablespace data file is backed up.