Practical Online backup tablespace

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.