首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

Oracle 10g数据库闪回之后如何样noresetlogs打开数据库(二)

2012-09-04 
Oracle 10g数据库闪回之后怎么样noresetlogs打开数据库(二)此方法采用重建控制文件:详见测试过程,具体过程

Oracle 10g数据库闪回之后怎么样noresetlogs打开数据库(二)
此方法采用重建控制文件:详见测试过程,具体过程不解释
[ora10g@xe2 lank]$ 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                
[ora10g@xe2 lank]$ cp redo01.log redo01.log.bak                                                                                                          
[ora10g@xe2 lank]$ cp redo02.log redo02.log.bak                                              
[ora10g@xe2 lank]$ cp redo03.log redo03.log.bak                                              
[ora10g@xe2 lank]$ cp control01.ctl control01.ctl.bak                                        
[ora10g@xe2 lank]$                                                                           
[ora10g@xe2 lank]$                                                                           
[ora10g@xe2 lank]$                                                                           
[ora10g@xe2 lank]$                                                                           
[ora10g@xe2 lank]$ 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                
[ora10g@xe2 lank]$ cp control01.ctl.bak control01.ctl                                        
cp control01.ctl.bak control02.ctl                                                           
cp control01.ctl.bak control03.ctl                                                           
cp redo01.log.bak redo01.log                                                                 
[ora10g@xe2 lank]$ cp control01.ctl.bak control02.ctl                                        
cp redo02.log.bak redo02.log                                                                 
cp redo03.log.bak redo03.log                                                                 
[ora10g@xe2 lank]$ cp control01.ctl.bak control03.ctl                                        
[ora10g@xe2 lank]$ cp redo01.log.bak redo01.log                                              
[ora10g@xe2 lank]$ cp redo02.log.bak redo02.log                                              
[ora10g@xe2 lank]$ cp redo03.log.bak redo03.log                                              
[ora10g@xe2 lank]$                                                                           
[ora10g@xe2 lank]$                                                                           
[ora10g@xe2 lank]$                                                                           
[ora10g@xe2 lank]$                                                                           
[ora10g@xe2 lank]$                                                                           
[ora10g@xe2 lank]$ 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;                                                                    
                                                                                             

热点排行