---
title: "Oracle 10g数据库闪回之后怎么样noresetlogs打开数据库(二)"
author: "itspace"
date: "2011-10-13T13:09:36Z"
tags: []
categories: ["数据库"]
slug: "oracle-10g-noresetlogs"
draft: false
lastmod: "2011-10-13T13:09:36Z"
id: 1194424
url: "https://dbzone.iteye.com/blog/1194424"
---

此方法采用重建控制文件：详见测试过程，具体过程不解释
$ sqlplus "/as sysdba"                                                       
                                                                                              
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Oct 13 13:13:11 2011                         
                                                                                              
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.                                       
                                                                                              
Connected to an idle instance.                                                                
                                                                                              
SQL> startup mount                                                                            
ORACLE instance started.                                                                      
                                                                                              
Total System Global Area 1069547520 bytes                                                     
Fixed Size                  2101704 bytes                                                     
Variable Size             276827704 bytes                                                     
Database Buffers          784334848 bytes                                                     
Redo Buffers                6283264 bytes                                                     
Database mounted.                                                                             
SQL> create restore point dd guarantee flashback database;                                    
                                                                                              
Restore point created.                                                                        
                                                                                              
SQL> shutdown immediate                                                                       
ORA-01109: database not open                                                                  
                                                                                              
                                                                                              
Database dismounted.                                                                          
ORACLE instance shut down.                                                                    
SQL> exit                                                                                     
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options                 
$ cp redo01.log redo01.log.bak                                                                                                           
$ cp redo02.log redo02.log.bak                                               
$ cp redo03.log redo03.log.bak                                               
$ cp control01.ctl control01.ctl.bak                                         
$                                                                            
$                                                                            
$                                                                            
$                                                                            
$ sqlplus "/as sysdba"                                                       
                                                                                              
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Oct 13 13:13:52 2011                         
                                                                                              
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.                                       
                                                                                              
Connected to an idle instance.                                                                
                                                                                              
SQL> startup                                                                                  
ORACLE instance started.                                                                      
                                                                                              
Total System Global Area 1069547520 bytes                                                     
Fixed Size                  2101704 bytes                                                     
Variable Size             276827704 bytes                                                     
Database Buffers          784334848 bytes                                                     
Redo Buffers                6283264 bytes                                                     
Database mounted.                                                                             
Database opened.                                                                              
SQL> alter system switch logfile;                                                             
                                                                                              
System altered.                                                                               
                                                                                              
SQL> /                                                                                        
                                                                                              
System altered.                                                                               
                                                                                              
SQL> /                                                                                        
                                                                                              
System altered.                                                                               
                                                                                              
SQL> /                                                                                        
                                                                                              
System altered.                                                                               
                                                                                              
SQL> /                                                                                        
                                                                                              
System altered.                                                                               
                                                                                              
SQL> shutdown immediate                                                                       
Database closed.                                                                              
Database dismounted.                                                                          
ORACLE instance shut down.                                                                    
SQL> startup mount                                                                            
ORACLE instance started.                                                                      
                                                                                              
Total System Global Area 1069547520 bytes                                                     
Fixed Size                  2101704 bytes                                                     
Variable Size             276827704 bytes                                                     
Database Buffers          784334848 bytes                                                     
Redo Buffers                6283264 bytes                                                     
Database mounted.                                                                             
SQL> flashback database to restore point dd;                                                  
                                                                                              
Flashback complete.                                                                           
                                                                                              
SQL> shutdown immediate                                                                       
ORA-01109: database not open                                                                  
                                                                                              
                                                                                              
Database dismounted.                                                                          
ORACLE instance shut down.                                                                    
SQL> exit                                                                                     
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options                 
$ cp control01.ctl.bak control01.ctl                                         
cp control01.ctl.bak control02.ctl                                                            
cp control01.ctl.bak control03.ctl                                                            
cp redo01.log.bak redo01.log                                                                  
$ cp control01.ctl.bak control02.ctl                                         
cp redo02.log.bak redo02.log                                                                  
cp redo03.log.bak redo03.log                                                                  
$ cp control01.ctl.bak control03.ctl                                         
$ cp redo01.log.bak redo01.log                                               
$ cp redo02.log.bak redo02.log                                               
$ cp redo03.log.bak redo03.log                                               
$                                                                            
$                                                                            
$                                                                            
$                                                                            
$                                                                            
$ sqlplus "/as sysdba"                                                       
                                                                                              
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Oct 13 13:16:38 2011                         
                                                                                              
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.                                       
                                                                                              
Connected to an idle instance.                                                                
                                                                                              
SQL> startup mount                                                                            
ORACLE instance started.                                                                      
                                                                                              
Total System Global Area 1069547520 bytes                                                     
Fixed Size                  2101704 bytes                                                     
Variable Size             276827704 bytes                                                     
Database Buffers          784334848 bytes                                                     
Redo Buffers                6283264 bytes                                                     
Database mounted.                                                                             
SQL> drop restore point dd;                                                                   
                                                                                              
Restore point dropped.                                                                        
                                                                                              
SQL> select file#,to_char(checkpoint_change#) from v$datafile_header;                         
                                                                                              
     FILE# TO_CHAR(CHECKPOINT_CHANGE#)                                                        
---------- ----------------------------------------                                           
         1 10999733119326                                                                     
         2 10999733119326                                                                     
         3 10999733119326                                                                     
         4 10999733119326                                                                     
                                                                                              
SQL> select file#,to_char(checkpoint_change#) from v$datafile;                                
                                                                                              
     FILE# TO_CHAR(CHECKPOINT_CHANGE#)                                                        
---------- ----------------------------------------                                           
         1 10999733119326                                                                     
         2 10999733119326                                                                     
         3 10999733119326                                                                     
         4 10999733119326                                                                     
                                                                                              
SQL> alter database backup controlfile to trace;                                              
                                                                                              
Database altered.                                                                             
                                                                                              
SQL> shutdown immediate                                                                       
startup nomount                                                                               
ORA-01109: database not open                                                                  
                                                                                              
                                                                                              
Database dismounted.                                                                          
ORACLE instance shut down.                                                                    
SQL> ORACLE instance started.                                                                 
                                                                                              
Total System Global Area 1069547520 bytes                                                     
Fixed Size                  2101704 bytes                                                     
Variable Size             276827704 bytes                                                     
Database Buffers          784334848 bytes                                                     
Redo Buffers                6283264 bytes                                                     
SQL> CREATE CONTROLFILE REUSE DATABASE "LANK" NORESETLOGS  ARCHIVELOG                         
  2      MAXLOGFILES 16                                                                       
  3      MAXLOGMEMBERS 3                                                                      
  4      MAXDATAFILES 100                                                                     
  5      MAXINSTANCES 8                                                                       
  6      MAXLOGHISTORY 292                                                                    
  7  LOGFILE                                                                                  
  8    GROUP 1 '/lank/db/lank/redo01.log'  SIZE 50M,                                          
  9    GROUP 2 '/lank/db/lank/redo02.log'  SIZE 50M,                                          
 10    GROUP 3 '/lank/db/lank/redo03.log'  SIZE 50M                                           
 11  -- STANDBY LOGFILE                                                                       
 12  DATAFILE                                                                                 
 13    '/lank/db/lank/system01.dbf',                                                          
 14    '/lank/db/lank/undotbs01.dbf',                                                         
 15    '/lank/db/lank/sysaux01.dbf',                                                          
 16    '/lank/db/lank/users01.dbf'                                                            
 17  CHARACTER SET WE8ISO8859P1                                                               
 18  ;                                                                                        
                                                                                              
Control file created.                                                                         
                                                                                              
SQL> alter database open;