使用recovery catalog查看數據庫過去的定義

咱們平時經過report schema看到的是當前數據庫的定義信息,sql

若是使用 recovery catalog的狀況下,咱們能夠看到數據庫之前的數據結構的信息數據庫

好比:數據結構

1.增長表空間前的狀況:oracle

[oracle@dbserver ~]$ rman target / catalog rman/rman@192.168.133.1:1521/orclapp

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Aug 29 11:41:49 2018spa

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.server

connected to target database: SZTECH1 (DBID=3253410194)blog

connected to recovery catalog databaseget

RMAN> report schema;it

Report of database schema for database with db_unique_name SZTECH1

List of Permanent Datafiles

===========================

File Size(MB) Tablespace RB segs Datafile Name

---- -------- -------------------- ------- ------------------------

1 740 SYSTEM YES /u01/app/oracle/oradata/sztech1/system01.dbf

2 570 SYSAUX NO /u01/app/oracle/oradata/sztech1/sysaux01.dbf

3 105 UNDOTBS1 YES /u01/app/oracle/oradata/sztech1/undotbs01.dbf

4 303 USERS NO /u01/app/oracle/oradata/sztech1/user01.dbf

5 330 EXAMPLE NO /u01/app/oracle/oradata/sztech1/example01.dbf

List of Temporary Files

=======================

File Size(MB) Tablespace Maxsize(MB) Tempfile Name

---- -------- -------------------- ----------- --------------------

1 29 TEMP 32767 /u01/app/oracle/oradata/sztech1/temp01.dbf

2.加一個表空間,ts_test

能夠記錄這個時間爲:2018-08-29 12:08:47

[oracle@dbserver ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Wed Aug 29 12:08:47 2018

Copyright (c) 1982, 2013, Oracle. All rights reserved.

SQL> conn / as sysdba

Connected.

SQL> create tablespace ts_test datafile '/u01/app/oracle/oradata/sztech1/ts_test01.dbf' size 10m;

Tablespace created.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

3.使用report schema,看到當前的表空間狀況,包含新增長的表空間ts_test

[oracle@dbserver ~]$ rman target / catalog rman/rman@192.168.133.1:1521/orcl

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Aug 29 12:09:17 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: SZTECH1 (DBID=3253410194)

connected to recovery catalog database

RMAN> report schema ;

Report of database schema for database with db_unique_name SZTECH1

List of Permanent Datafiles

===========================

File Size(MB) Tablespace RB segs Datafile Name

---- -------- -------------------- ------- ------------------------

1 740 SYSTEM YES /u01/app/oracle/oradata/sztech1/system01.dbf

2 570 SYSAUX NO /u01/app/oracle/oradata/sztech1/sysaux01.dbf

3 105 UNDOTBS1 YES /u01/app/oracle/oradata/sztech1/undotbs01.dbf

4 303 USERS NO /u01/app/oracle/oradata/sztech1/user01.dbf

5 330 EXAMPLE NO /u01/app/oracle/oradata/sztech1/example01.dbf

6 10 TS_TEST NO /u01/app/oracle/oradata/sztech1/ts_test01.dbf

List of Temporary Files

=======================

File Size(MB) Tablespace Maxsize(MB) Tempfile Name

---- -------- -------------------- ----------- --------------------

1 29 TEMP 32767 /u01/app/oracle/oradata/sztech1/temp01.dbf

4. 使用建立新表空間以前的時間查詢:

RMAN> report schema at time "to_date('2018-08-29 12:08:47','yyyy-mm-dd hh24:mi:ss')";

Report of database schema for database with db_unique_name SZTECH1

List of Permanent Datafiles

===========================

File Size(MB) Tablespace RB segs Datafile Name

---- -------- -------------------- ------- ------------------------

1 740 SYSTEM YES /u01/app/oracle/oradata/sztech1/system01.dbf

2 570 SYSAUX NO /u01/app/oracle/oradata/sztech1/sysaux01.dbf

3 105 UNDOTBS1 YES /u01/app/oracle/oradata/sztech1/undotbs01.dbf

4 303 USERS NO /u01/app/oracle/oradata/sztech1/user01.dbf

5 330 EXAMPLE NO /u01/app/oracle/oradata/sztech1/example01.dbf

List of Temporary Files

=======================

File Size(MB) Tablespace Maxsize(MB) Tempfile Name

---- -------- -------------------- ----------- --------------------

1 29 TEMP 32767 /u01/app/oracle/oradata/sztech1/temp01.dbf

這個時候,咱們發現,新表空間不見了。

5. 固然,這個功能只能使用了 recovery catalog的狀況下,才能夠 。

[oracle@dbserver ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Aug 29 12:37:12 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: SZTECH1 (DBID=3253410194)

RMAN> report schema at time "to_date('2018-08-29 12:08:47','yyyy-mm-dd hh24:mi:ss')";

using target database control file instead of recovery catalog

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of report command at 08/29/2018 12:37:18

RMAN-06137: must have recovery catalog for REPORT SCHEMA AT TIME

 

相關文章
相關標籤/搜索