Oracle-user-managed backup (2)

Source: Internet
Author: User

Oracle-user-managed backup (ii) I. What will happen if the host is shut down abnormally when the tablespace is in backup mode? Open the first session window, Log On As A sys user, and place the tablespace users in backup mode. SQL> alter tablespace users begin backup; Tablespace altered. open the second session window, Log On As A sys user, and run the shutdown abort command to simulate power failure. SQL> shutdown abort; ORACLE instance shut down. Restart In the first session window. SQL> startupORACLE instance started. total System Global Area 146472960 bytesFixed Size 1335080 bytesVariable Size 92274904 bytesDatabase Buffers 50331648 bytesRedo Buffers 2531328 bytesDatabase mounted. ORA-10873: file 4 needs to be either taken out of backup mode or mediarecoveredORA-01110: data file 4: '/u01/oradata/wilson/users01.dbf' you can see that the database cannot be opened, only in the mount state; solution: SQL> select * from v $ backup; (v $ bac Kup can see which files are in the backup status) FILE # status change # TIME ---------- hour --------- 1 unknown error 2794785 23-AUG-13 2 unknown error 2794785 23-AUG-13 3 unknown error 2794785 23-AUG-13 4 ACTIVE 2805598 23-AUG-13 5 not active 2794785 23-AUG-13 6 not active 2794785 23-aug-7 not active 2794785 23-AUG-13 8 not active 2794785 23-AUG-13 9 not active 2794785 23-AUG-13 10 not active 2794785 23-AUG-13 11 not active 2794785 23-AUG-1311 rows selected. you can see that file 4 is active and is in the backup State. To enable it properly, you must disable the backup state. SQL> alter database end backup; Database altered. in this way, the backup status of all tablespaces can be disabled. You can also use alter database datafile 4 end backup; then view the view to see that all files are not in the backup state; SQL> select * from v $ backup; FILE # status change # TIME ---------- ------------------ ----------- 1 not active 2794785 23-AUG-13 2 not active 2794785 23-AUG-13 3 not active 2794785 23-AUG-13 4 not active 2805598 23-AUG-13 5 not active 2794785 23-AUG-13 6 not active 2794785 23-AUG-13 7 not active 2794785 23-AUG-13 8 NOT ACTIV E 2794785 23-AUG-13 9 not active 2794785 23-AUG-13 10 not active 2794785 23-AUG-13 11 not active 2794785 23-AUG-1311 rows selected. open the database, SQL> alter Database open; database altered. II. in the read-only tablespace backup, replace the example Tablespace with the read-only tablespace. SQL> alter Tablespace example read only; tablespace altered. then use! Copy the cp command to another place, but the problem is that when you change example to a read-only tablespace, the control file has changed, so you need to back up the control file! 1. Read-Only tablespace only needs to be backed up once, because it cannot be modified. 2. Do I have to back up the read-only tablespace to a readable and writable tablespace? You do not need to back up the archive log file, but it is best to back up the file. 3. Backup is required when the control file changes. 3. When a large amount of data is imported or exported, place the database under nologging, so as not to generate redo log information as much as possible to improve performance. After the operation is complete, back up the data. 4. DBverify 1. it can be used to check whether the block of the data file is damaged, whether the data file is in the online or off status or the backup data file, the block of online redo log files and control files cannot be checked. In the operating system, enter dbv to view the relevant parameters. [oracle @ oracle11g ~] $ DbvDBVERIFY: Release 11.2.0.1.0-Production on Fri Aug 23 12:32:17 2013 Copyright (c) 1982,200 9, Oracle and/or its affiliates. all rights reserved. keyword Description (Default) ------------ ------------------ -------------------- FILE File to Verify (NONE) START Start Block (First Block of File) END End Block (Last Block of File) BLOCKSIZE Logical Block Size (8192) LOGFILE Output Log (NONE) FEEDBACK Display Progress (0) PARFILE Parameter File (NONE) USERID Username/Password (NONE) SEGMENT_ID Segment ID (tsn. relfile. block) (NONE) HIGH_SCN Highest Block SCN To Verify (NONE) (scn_wrap.scn_base OR scn) Check the data file system01.dbf. feedback = 100 indicates that each 100 data blocks will be checked To a point; by default, the check starts from a block and ends with the last one. You can use logfile to store the check result information in a file. For example, [oracle @ oracle11g wilson] $ dbv file = system01.dbf feedback = 100 DBVERIFY: Release 11.2.0.1.0-Production on Fri Aug 23 12:37:43 2013 Copyright (c) 1982,200 9, oracle and/or its affiliates. all rights reserved. DBVERIFY-Verification starting: FILE =/u01/oradata/wilson/system01.dbf .............................. ........................................ ........................................ ..... ........................................ ...... DBVERIFY-Verification completeTotal Pages Examined: 97280 Total Pages Processed (Data): 66872 Total Pages Failing (Data): 0 Total Pages Processed (Index): 12537 Total Pages Failing (Index ): 0 Total Pages Processed (Other): 3343 Total Pages Processed (Seg): 1 Total Pages Failing (Seg): 0 Total Pages Empty: 14528 Total Pages Marked success upt: 0 Total Pages Influx: 0 Total Pages Encrypted: 0 Highest block SCN: 2828302 (0.2828302) 2. It can also be used to check a table or index of a data file. In User p1, there is a table fruit, SQL> select * from p1.fruit; NAME ------------------------------ two apple finds the Segment ID (tsn) in table sys_dba_segs. relfile. the value of block); SQL> select segment_name, tablespace_id, header_file, header_block from sys_dba_segs where owner = 'p1 '; SEGMENT_NAME TABLESPACE_ID HEADER_FILE HEADER_BLOCK --------------- ---------------------------------- FRUIT 4 4 810 then in the operating system, use the value to find a table. [Oracle @ oracle11g ~] $ Dbv userid = p1/p1_12345 segment_id = 4.4.810DBVERIFY: Release 11.2.0.1.0-Production on Fri Aug 23 13:25:50 2013 Copyright (c) 1982,200 9, Oracle and/or its affiliates. all rights reserved. DBVERIFY-Verification starting: SEGMENT_ID = 4.810dbverify-Verification completeTotal Pages Examined: 8 Total Pages Processed (Data): 5 Total Pages Failing (Data): 0 Total Pages Processed (Index ): 0 Total Pages Failing (Index): 0 Total Pages Processed (Other): 2 Total Pages Processed (Seg): 1 Total Pages Failing (Seg): 0 Total Pages Empty: 0 Total Pages Marked previous upt: 0 Total Pages Influx: 0 Total Pages Encrypted: 0 Highest block SCN: 2798211 (0.2798211)
 

Related Article

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.