A solution to view table space utilization failure after mistakenly deleting LV

Source: Internet
Author: User
Tags dba

Phenomenon: mistakenly delete lv after viewing table space utilization failure, see Alert log, found the following error:

Errors in FILE/HOME/ORACLE/ADMIN/ZHJPORT/BDUMP/ZHJPORT1_DBW0_2871436.TRC:

Ora-01186:file Bayi Failed verification tests

Ora-01157:cannot identify/lock data file 81-see DBWR trace file

Ora-01110:data file Bayi: '/dev/rpat_bas_1 '

1. Try rebuilding LV to see if you can recover

Mklv-t o-y pat_bas_1 Oradatavg 1

Mklv-t o-y pat_bas_2 Oradatavg 1

Chown ORACLE:DBA Pat_bas_1

Chown ORACLE:DBA pat_bas_2

Chown ORACLE:DBA Rpat_bas_1

Chown ORACLE:DBA rpat_bas_2

Found fault still

2, check rpat_bas_1, rpat_bas_2 data files belong to which table space

Select Status,tablespace_name,checkpoint_change#,name from V$datafile_header;

STATUS

Tablespace_name

checkpoint_change#

NAME

ONLINE

Pat_1

3177311020

/dev/rpat_1

ONLINE

Pat_10

3177311020

/dev/rpat_10

ONLINE

0

/dev/rpat_bas_1

ONLINE

0

/dev/rpat_bas_2

3, the implementation of Rpat_bas_1, rpat_bas_2 data files offline:

ALTER DATABASE datafile '/dev/rpat_bas_1 ' OFFLINE DROP;

ALTER DATABASE datafile '/dev/rpat_bas_2 ' OFFLINE DROP;

STATUS

Tablespace_name

checkpoint_change#

NAME

ONLINE

Pat_1

3177311020

/dev/rpat_1

ONLINE

Pat_10

3177311020

/dev/rpat_10

OFFLINE

0

/dev/rpat_bas_1

OFFLINE

0

/dev/rpat_bas_2

4. Table space utilization can already be viewed at this time

--Table Space query

Select a.tablespace_name, A.total | | ' M ' Total_space, (a.total-b.free) | | ' M ' Used_space, To_char (a.total-b.free)/a.total * 100, ' 99.99 ') | | '% ' Pct_free

From

(Select tablespace_name, Sum (Bytes)/1024/1024 total from Dba_data_files Group by Tablespace_name) A,

(Select tablespace_name, Sum (Bytes)/1024/1024 free from Dba_free_space Group by Tablespace_name) b where a.tablespace_ Name = B.tablespace_name

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.