Windows Server 2008下ORACLE 10G 10204 重建数据库

目录

1. 系统信息

2. 安装虚拟机

3. 安装创建数据库

4. 源数据库操作

5. 新数据库操作

 

 

1. 系统信息

序号

角色

操作系统

版本

内存

磁盘

防火墙

IP地址

1

源数据库

Windows Server

2008 R2

2G

40G

关闭

192.168.230.132

2

新数据库

Windows Server

2008 R2

2G

40G

关闭

192.168.230.133

 

 

2. 安装虚拟机

参考http://blog.itpub.net/28536251/viewspace-1455381/安装Windows系统。

 

 

3. 安装创建数据库

分别在2个虚拟机上面安装创建数据库。

运行安装程序。

clip_image002

由于只是测试,选择基本安装。

clip_image004

clip_image006

clip_image008

clip_image010

clip_image012

clip_image014

clip_image016

clip_image018

clip_image020

 

 

4. 源数据库操作

确认数据库运行在非归档模式,且没有RMAN备份。

创建用户,表空间及数据文件,并创建一张表,插入2行数据。

C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Sat Sep 12 12:01:56 2015

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

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

SQL> select status from v$instance;

STATUS

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

OPEN

SQL> archive log list;

Database log mode No Archive Mode

Automatic archival Disabled

Archive destination USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence 1

Current log sequence 2

SQL> create tablespace AppGov datafile 'C:\oracle\product\10.2.0\oradata\orcl\Ap

pGov_oradata.DBF' size 10M autoextend on;

Tablespace created.

SQL> create user CM identified by CM default tablespace AppGov;

User created.

SQL> grant resource, connect, dba, create view to CM;

Grant succeeded.

SQL> conn CM/CM

Connected.

SQL> create table test(id number,name varchar2(10));

Table created.

SQL> insert into test values(1,'aa');

1 row created.

SQL> insert into test values(2,'bb');

1 row created.

SQL> select * from test;

ID NAME

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

1 aa

2 bb

SQL> commit;

Commit complete.

模拟掉电故障。

SQL> conn sys/password as sysdba;

Connected.

SQL> shutdown abort;

ORACLE instance shut down.

 

 

5. 新数据库操作

源数据库如果出现问题,先保留现场,不去操作,将所有数据文件,日志文件,控制文件等拷贝到新建数据库的对应目录,最好是相同的目录结构,并覆盖源文件。

先关闭新数据库。

C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Sat Sep 12 12:20:06 2015

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

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

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

拷贝数据后启动数据库。

C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Sat Sep 12 13:09:03 2015

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 612368384 bytes

Fixed Size 2067656 bytes

Variable Size 167772984 bytes

Database Buffers 436207616 bytes

Redo Buffers 6320128 bytes

Database mounted.

Database opened.

SQL> conn CM/CM

Connected.

SQL> select * from test;

ID NAME

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

1 aa

2 bb

启动数据库正常,数据还在。

 

 

 

如果拷贝文件的位置与源数据库不一致,则需要重建控制文件。

C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Sat Sep 12 13:13:21 2015

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 612368384 bytes

Fixed Size 2067656 bytes

Variable Size 167772984 bytes

Database Buffers 436207616 bytes

Redo Buffers 6320128 bytes

ORA-00205: error in identifying control file, check alert log for more info

启动报识别控制文件错误,查看告警日志:

ORA-00202: control file: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL01.CTL'

ORA-27041: unable to open file

OSD-04002: unable to open file

O/S-Error: (OS 3) 系统找不到指定的路径。

先修改参数文件中控制文件的新的位置:

SQL> startup nomount;

ORACLE instance started.

Total System Global Area 612368384 bytes

Fixed Size 2067656 bytes

Variable Size 167772984 bytes

Database Buffers 436207616 bytes

Redo Buffers 6320128 bytes

SQL> create pfile='C:\oracle\product\10.2.0\db_1\database\pfile.ora' from spfile;

File created.

orcl.__db_cache_size=436207616

orcl.__java_pool_size=4194304

orcl.__large_pool_size=4194304

orcl.__shared_pool_size=159383552

orcl.__streams_pool_size=0

*.audit_file_dest='C:\oracle\product\10.2.0\admin\orcl\adump'

*.background_dump_dest='C:\oracle\product\10.2.0\admin\orcl\bdump'

*.compatible='10.2.0.3.0'

*.control_files='C:\orcl\control01.ctl','C:\orcl\control02.ctl','C:\orcl\control03.ctl'

*.core_dump_dest='C:\oracle\product\10.2.0\admin\orcl\cdump'

*.db_block_size=8192

*.db_domain=''

*.db_file_multiblock_read_count=16

*.db_name='orcl'

*.db_recovery_file_dest='C:\oracle\product\10.2.0\flash_recovery_area'

*.db_recovery_file_dest_size=2147483648

*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'

*.job_queue_processes=10

*.open_cursors=300

*.pga_aggregate_target=203423744

*.processes=150

*.remote_login_passwordfile='EXCLUSIVE'

*.sga_target=612368384

*.undo_management='AUTO'

*.undo_tablespace='UNDOTBS1'

*.user_dump_dest='C:\oracle\product\10.2.0\admin\orcl\udump'

然后使用该参数文件启动。

SQL> startup mount pfile='C:\oracle\product\10.2.0\db_1\database\pfile.ora';

ORACLE instance started.

Total System Global Area 612368384 bytes

Fixed Size 2067656 bytes

Variable Size 167772984 bytes

Database Buffers 436207616 bytes

Redo Buffers 6320128 bytes

Database mounted.

SQL> alter database open;

alter database open

*

ERROR at line 1:

ORA-01157: cannot identify/lock data file 1 - see DBWR trace file

ORA-01110: data file 1: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF'

提示数据文件1识别错误。需要重建控制文件,指定相关文件的位置了。

先生成控制文件重建脚本

SQL> alter database backup controlfile to trace as 'C:\orcl\control001.trc';

Database altered.

脚本内容分为noretlogs和resetlogs两种情况,具体如下:

-- The following are current System-scope REDO Log Archival related

-- parameters and can be included in the database initialization file.

--

-- LOG_ARCHIVE_DEST=''

-- LOG_ARCHIVE_DUPLEX_DEST=''

--

-- LOG_ARCHIVE_FORMAT=ARC%S_%R.%T

--

-- DB_UNIQUE_NAME="orcl"

--

-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'

-- LOG_ARCHIVE_MAX_PROCESSES=2

-- STANDBY_FILE_MANAGEMENT=MANUAL

-- STANDBY_ARCHIVE_DEST=%ORACLE_HOME%\RDBMS

-- FAL_CLIENT=''

-- FAL_SERVER=''

--

-- LOG_ARCHIVE_DEST_10='LOCATION=USE_DB_RECOVERY_FILE_DEST'

-- LOG_ARCHIVE_DEST_10='OPTIONAL REOPEN=300 NODELAY'

-- LOG_ARCHIVE_DEST_10='ARCH NOAFFIRM NOEXPEDITE NOVERIFY SYNC'

-- LOG_ARCHIVE_DEST_10='REGISTER NOALTERNATE NODEPENDENCY'

-- LOG_ARCHIVE_DEST_10='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'

-- LOG_ARCHIVE_DEST_10='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'

-- LOG_ARCHIVE_DEST_STATE_10=ENABLE

--

-- Below are two sets of SQL statements, each of which creates a new

-- control file and uses it to open the database. The first set opens

-- the database with the NORESETLOGS option and should be used only if

-- the current versions of all online logs are available. The second

-- set opens the database with the RESETLOGS option and should be used

-- if online logs are unavailable.

-- The appropriate set of statements can be copied from the trace into

-- a script file, edited as necessary, and executed when there is a

-- need to re-create the control file.

--

-- Set #1. NORESETLOGS case

--

-- The following commands will create a new control file and use it

-- to open the database.

-- Data used by Recovery Manager will be lost.

-- Additional logs may be required for media recovery of offline

-- Use this only if the current versions of all online logs are

-- available.

-- After mounting the created controlfile, the following SQL

-- statement will place the database in the appropriate

-- protection mode:

-- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE

STARTUP NOMOUNT

CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS NOARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 100

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG' SIZE 50M,

GROUP 2 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02.LOG' SIZE 50M,

GROUP 3 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO03.LOG' SIZE 50M

-- STANDBY LOGFILE

DATAFILE

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\APPGOV_ORADATA.DBF'

CHARACTER SET AL32UTF8

;

-- Commands to re-create incarnation table

-- Below log names MUST be changed to existing filenames on

-- disk. Any one log file from each branch can be used to

-- re-create incarnation records.

-- ALTER DATABASE REGISTER LOGFILE 'C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2015_09_12\O1_MF_1_1_%U_.ARC';

-- ALTER DATABASE REGISTER LOGFILE 'C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2015_09_12\O1_MF_1_1_%U_.ARC';

-- Recovery is required if any of the datafiles are restored backups,

-- or if the last shutdown was not normal or immediate.

RECOVER DATABASE

-- Database can now be opened normally.

ALTER DATABASE OPEN;

-- Commands to add tempfiles to temporary tablespaces.

-- Online tempfiles have complete space information.

-- Other tempfiles may require adjustment.

ALTER TABLESPACE TEMP ADD TEMPFILE 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEMP01.DBF' REUSE;

-- End of tempfile additions.

--

-- Set #2. RESETLOGS case

--

-- The following commands will create a new control file and use it

-- to open the database.

-- Data used by Recovery Manager will be lost.

-- The contents of online logs will be lost and all backups will

-- be invalidated. Use this only if online logs are damaged.

-- After mounting the created controlfile, the following SQL

-- statement will place the database in the appropriate

-- protection mode:

-- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE

STARTUP NOMOUNT

CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS NOARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 100

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG' SIZE 50M,

GROUP 2 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02.LOG' SIZE 50M,

GROUP 3 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO03.LOG' SIZE 50M

-- STANDBY LOGFILE

DATAFILE

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\APPGOV_ORADATA.DBF'

CHARACTER SET AL32UTF8

;

-- Commands to re-create incarnation table

-- Below log names MUST be changed to existing filenames on

-- disk. Any one log file from each branch can be used to

-- re-create incarnation records.

-- ALTER DATABASE REGISTER LOGFILE 'C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2015_09_12\O1_MF_1_1_%U_.ARC';

-- ALTER DATABASE REGISTER LOGFILE 'C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2015_09_12\O1_MF_1_1_%U_.ARC';

-- Recovery is required if any of the datafiles are restored backups,

-- or if the last shutdown was not normal or immediate.

RECOVER DATABASE USING BACKUP CONTROLFILE

-- Database can now be opened zeroing the online logs.

ALTER DATABASE OPEN RESETLOGS;

-- Commands to add tempfiles to temporary tablespaces.

-- Online tempfiles have complete space information.

-- Other tempfiles may require adjustment.

ALTER TABLESPACE TEMP ADD TEMPFILE 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEMP01.DBF' REUSE;

-- End of tempfile additions.

--

如果联机重做日志文件可用,则使用noresetlogs;

如果联机重做日志文件损坏,则使用resetlogs。

此处先使用noretlogs创建控制文件,并根据路径调整脚本,具体如下:

CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS NOARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 100

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 'C:\ORCL\REDO01.LOG' SIZE 50M,

GROUP 2 'C:\ORCL\REDO02.LOG' SIZE 50M,

GROUP 3 'C:\ORCL\REDO03.LOG' SIZE 50M

DATAFILE

'C:\ORCL\SYSTEM01.DBF',

'C:\ORCL\UNDOTBS01.DBF',

'C:\ORCL\SYSAUX01.DBF',

'C:\ORCL\USERS01.DBF',

'C:\ORCL\EXAMPLE01.DBF',

'C:\ORCL\APPGOV_ORADATA.DBF'

CHARACTER SET AL32UTF8

;

具体操作如下:

SQL> startup nomount pfile='C:\oracle\product\10.2.0\db_1\database\pfile.ora';

ORACLE instance started.

Total System Global Area 612368384 bytes

Fixed Size 2067656 bytes

Variable Size 167772984 bytes

Database Buffers 436207616 bytes

Redo Buffers 6320128 bytes

SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS NOARCHIVELOG

2 MAXLOGFILES 16

3 MAXLOGMEMBERS 3

4 MAXDATAFILES 100

5 MAXINSTANCES 8

6 MAXLOGHISTORY 292

7 LOGFILE

8 GROUP 1 'C:\orcl\REDO01.LOG' SIZE 50M,

9 GROUP 2 'C:\orcl\REDO02.LOG' SIZE 50M,

10 GROUP 3 'C:\orcl\REDO03.LOG' SIZE 50M

11 DATAFILE

12 'C:\orcl\SYSTEM01.DBF',

13 'C:\orcl\UNDOTBS01.DBF',

14 'C:\orcl\SYSAUX01.DBF',

15 'C:\orcl\USERS01.DBF',

16 'C:\orcl\EXAMPLE01.DBF',

17 'C:\orcl\APPGOV_ORADATA.DBF'

18 CHARACTER SET AL32UTF8

19 ;

Control file created.

SQL> recover database;

ORA-00283: recovery session canceled due to errors

ORA-00264: no recovery required

SQL> alter database open;

Database altered.

SQL> alter tablespace temp add tempfile 'C:\orcl\TEMP01.DBF' reuse;

Tablespace altered.

SQL> select * from CM.test;

ID NAME

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

1 aa

2 bb

打开数据库正常,数据也ok。

 

 

再使用retlogs创建控制文件,并根据路径调整脚本,具体如下:

CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS NOARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 100

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 'C:\orcl\REDO01.LOG' SIZE 50M,

GROUP 2 'C:\orcl\REDO02.LOG' SIZE 50M,

GROUP 3 'C:\orcl\REDO03.LOG' SIZE 50M

DATAFILE

'C:\orcl\SYSTEM01.DBF',

'C:\orcl\UNDOTBS01.DBF',

'C:\orcl\SYSAUX01.DBF',

'C:\orcl\USERS01.DBF',

'C:\orcl\EXAMPLE01.DBF',

'C:\orcl\APPGOV_ORADATA.DBF'

CHARACTER SET AL32UTF8

;

具体操作如下:

SQL> startup nomount pfile='C:\oracle\product\10.2.0\db_1\database\pfile.ora';

ORACLE instance started.

Total System Global Area 612368384 bytes

Fixed Size 2067656 bytes

Variable Size 167772984 bytes

Database Buffers 436207616 bytes

Redo Buffers 6320128 bytes

SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS NOARCHIVELOG

2 MAXLOGFILES 16

3 MAXLOGMEMBERS 3

4 MAXDATAFILES 100

5 MAXINSTANCES 8

6 MAXLOGHISTORY 292

7 LOGFILE

8 GROUP 1 'C:\orcl\REDO01.LOG' SIZE 50M,

9 GROUP 2 'C:\orcl\REDO02.LOG' SIZE 50M,

10 GROUP 3 'C:\orcl\REDO03.LOG' SIZE 50M

11 DATAFILE

12 'C:\orcl\SYSTEM01.DBF',

13 'C:\orcl\UNDOTBS01.DBF',

14 'C:\orcl\SYSAUX01.DBF',

15 'C:\orcl\USERS01.DBF',

16 'C:\orcl\EXAMPLE01.DBF',

17 'C:\orcl\APPGOV_ORADATA.DBF'

18 CHARACTER SET AL32UTF8

19 ;

Control file created.

查看系统检查点SCN(存储在控制文件中):

SQL> select checkpoint_change# from v$database;

CHECKPOINT_CHANGE#

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

0

查看数据文件检查点SCN(存储在控制文件中):

SQL> select name,checkpoint_change# from v$datafile;

NAME CHECKPOINT_CHANGE#

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

C:\ORCL\SYSTEM01.DBF 661835

C:\ORCL\UNDOTBS01.DBF 661835

C:\ORCL\SYSAUX01.DBF 661835

C:\ORCL\USERS01.DBF 661835

C:\ORCL\EXAMPLE01.DBF 661835

C:\ORCL\APPGOV_ORADATA.DBF 661835

6 rows selected.

启动SCN(存储在数据文件头)

SQL> select name,checkpoint_change# from v$datafile_header;

NAME CHECKPOINT_CHANGE#

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

C:\ORCL\SYSTEM01.DBF 661835

C:\ORCL\UNDOTBS01.DBF 661835

C:\ORCL\SYSAUX01.DBF 661835

C:\ORCL\USERS01.DBF 661835

C:\ORCL\EXAMPLE01.DBF 661835

C:\ORCL\APPGOV_ORADATA.DBF 661835

6 rows selected.

终止SCN(存储在控制文件中):

SQL> select name,last_change# from v$datafile;

NAME LAST_CHANGE#

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

C:\ORCL\SYSTEM01.DBF

C:\ORCL\UNDOTBS01.DBF

C:\ORCL\SYSAUX01.DBF

C:\ORCL\USERS01.DBF

C:\ORCL\EXAMPLE01.DBF

C:\ORCL\APPGOV_ORADATA.DBF

6 rows selected.

可以看到系统检查点SCN不等于数据文件检查点SCN,需要进行恢复。

SQL> RECOVER DATABASE USING BACKUP CONTROLFILE

ORA-00279: change 661835 generated at 09/12/2015 13:48:58 needed for thread 1

ORA-00289: suggestion :

C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2015_09_12\O1_MF_1_

4_%U_.ARC

ORA-00280: change 661835 for thread 1 is in sequence #4

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

cancel

Media recovery cancelled.

SQL> alter database open resetlogs;

alter database open resetlogs

*

ERROR at line 1:

ORA-01113: file 1 needs media recovery

ORA-01110: data file 1: 'C:\ORCL\SYSTEM01.DBF'

SQL> recover database using backup controlfile;

ORA-00279: change 661835 generated at 09/12/2015 13:48:58 needed for thread 1

ORA-00289: suggestion :

C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2015_09_12\O1_MF_1_

4_%U_.ARC

ORA-00280: change 661835 for thread 1 is in sequence #4

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

C:\orcl\REDO01.log

Log applied.

Media recovery complete.

以上说明是需要一个归档日志文件进行恢复,但是源数据库没有运行在归档模式,没有归档文件,只能使用联机日志文件进行恢复,我这里使用第一个联机日志文件恢复成功,如果不行,依次使用现有的联机日志文件进行测试恢复,成功为止。

SQL> alter database open resetlogs;

Database altered.

SQL> select * from CM.test;

ID NAME

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

1 aa

2 bb

SQL> select checkpoint_change# from v$database;

CHECKPOINT_CHANGE#

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

661838

SQL> select name,checkpoint_change# from v$datafile;

NAME CHECKPOINT_CHANGE#

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

C:\ORCL\SYSTEM01.DBF 661838

C:\ORCL\UNDOTBS01.DBF 661838

C:\ORCL\SYSAUX01.DBF 661838

C:\ORCL\USERS01.DBF 661838

C:\ORCL\EXAMPLE01.DBF 661838

C:\ORCL\APPGOV_ORADATA.DBF 661838

6 rows selected.

SQL> select name,checkpoint_change# from v$datafile_header;

NAME CHECKPOINT_CHANGE#

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

C:\ORCL\SYSTEM01.DBF 661838

C:\ORCL\UNDOTBS01.DBF 661838

C:\ORCL\SYSAUX01.DBF 661838

C:\ORCL\USERS01.DBF 661838

C:\ORCL\EXAMPLE01.DBF 661838

C:\ORCL\APPGOV_ORADATA.DBF 661838

6 rows selected.

SQL> select name,last_change# from v$datafile;

NAME LAST_CHANGE#

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

C:\ORCL\SYSTEM01.DBF

C:\ORCL\UNDOTBS01.DBF

C:\ORCL\SYSAUX01.DBF

C:\ORCL\USERS01.DBF

C:\ORCL\EXAMPLE01.DBF

C:\ORCL\APPGOV_ORADATA.DBF

6 rows selected.

SCN一致了。


请使用浏览器的分享功能分享到微信等