Not fully recovered
RAC Modify Archive Mode
Sql> select Log_mode from V$database;
Log_mode
------------
Noarchivelog
[Email protected] ~]$ srvctl stop database-d Zhaoja
[Email protected] ~]$ export ORACLE_SID=ZHAOJA1
[Email protected] ~]$ Sqlplus/as SYSDBA
Sql*plus:release 10.2.0.4.0-production on Sat 20 17:46:06 2014
Copyright (c) 1982, Oracle. All rights Reserved.
Connected to an idle instance.
sql> startup Mount;
ORACLE instance started.
Total System Global area 1610612736 bytes
Fixed Size 2280840 bytes
Variable Size 416100984 bytes
Database buffers 1157627904 bytes
Redo buffers 34603008 bytes
Database mounted.
sql> ALTER DATABASE Archivelog;
Database altered.
sql> ALTER DATABASE open;
Database altered.
sql> archive log list;
Database Log Mode Archive mode
Automatic Archival Enabled
Archive Destination Use_db_recovery_file_dest
Oldest online log sequence 2
Next Log sequence to archive 3
Current Log Sequence 3
sql> shutdown Immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
Sql> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0-64bit Production
With the partitioning, Real application Clusters, OLAP, Data Mining
and Real Application Testing options
[Email protected] ~]$ srvctl start database-d Zhaoja
See if the archive is on two nodes.
sql> archive log list;
1. Make full backup
Control file Automatic Backup Open
Rman> CONFIGURE controlfile autobackup on;
New RMAN configuration parameters:
CONFIGURE Controlfile autobackup on;
New RMAN configuration parameters is successfully stored
Sql> select name from V$archived_log;
[[email protected] ~]$ Rman target/
Recovery manager:release 10.2.0.4.0-production on Sat 20 18:26:52 2014
Copyright (c) 1982, Oracle. All rights reserved.
Connected to target Database:zhaoja (dbid=3729713493)
rman> backup Database;
2. View a list of deleted files, including data files, online logs, control files
Sql>
Select name from V$controlfile
Union
Select name from V$datafile
Union
Select member name from V$logfile;
NAME
--------------------------------------------------------------------------------
+data/zhaoja/controlfile/current.283.866833499
+data/zhaoja/datafile/sysaux.296.866833451
+data/zhaoja/datafile/system.256.866833451
+data/zhaoja/datafile/undotbs1.301.866833451
+data/zhaoja/datafile/undotbs2.289.866833523
+data/zhaoja/datafile/users.303.866833451
+data/zhaoja/onlinelog/group_1.299.866833501
+data/zhaoja/onlinelog/group_2.300.866833501
+data/zhaoja/onlinelog/group_3.304.866833561
+data/zhaoja/onlinelog/group_4.305.866833561
Rows selected.
3. Close two instances
sql> shutdown abort;
ORACLE instance shut down.
4. Delete data files, online logs, control files
[Email protected] ~]$ export ORACLE_SID=+ASM2
[Email protected] ~]$ asmcmd-p
Asmcmd [+] > CD +data/
Asmcmd [+data] > ls
rac/
test/
zhaoja/
Asmcmd [+data] > CD Zhaoja
Asmcmd [+data/zhaoja] > ls
controlfile/
datafile/
onlinelog/
parameterfile/
tempfile/
Spfilezhaoja.ora
Asmcmd [+data/zhaoja] > CD controlfile
Asmcmd [+data/zhaoja/controlfile] > ls
current.283.866833499
Asmcmd [+data/zhaoja/controlfile] > RM current.283.866833499
Asmcmd [+data/zhaoja/controlfile] > CD +data/zhaoja/datafile
Asmcmd [+data/zhaoja/datafile] > ls
sysaux.296.866833451
system.256.866833451
UNDOTBS1.301.866833451
UNDOTBS2.289.866833523
users.303.866833451
Asmcmd [+data/zhaoja/datafile] > RM *
You may delete multiple files and/or directories.
Is you sure? (y/n) Y
Asmcmd [+data/zhaoja] > CD onlinelog
Asmcmd [+data/zhaoja/onlinelog] > ls
group_1.303.866830489
group_2.301.866830489
group_3.296.866830551
group_4.256.866830551
Asmcmd [+data/zhaoja/onlinelog] > RM *
You may delete multiple files and/or directories.
Is you sure? (y/n) Y
5. First restore the control file from the automatic backup and execute it on an instance:
[Email protected] admin]$ Sqlplus/as SYSDBA
sql> startup Nomount;
ORACLE instance started.
Total System Global area 1610612736 bytes
Fixed Size 2280840 bytes
Variable Size 416100984 bytes
Database buffers 1157627904 bytes
Redo buffers 34603008 bytes
6. Recover control files from Rman backup
Rman> Set dbid=3729716506
Executing Command:set DBID
rman> restore controlfile from Autobackup;
Starting restore at 20-dec-14
Using target database control file instead of recovery catalog
Allocated Channel:ora_disk_1
Channel ora_disk_1:sid=11 INSTANCE=ZHAOJA1 Devtype=disk
Channel ora_disk_1:looking for Autobackup on day:20141220
Channel Ora_disk_1:autobackup found:c-3729716506-20141220-00
Channel Ora_disk_1:control file Restore from Autobackup complete
Output filename=+data/zhaoja/controlfile/current.305.866835965
Finished restore at 20-dec-14
7. Mount Database
rman> SQL ' ALTER DATABASE mount ';
SQL Statement:alter Database mount
Released Channel:ora_disk_1
8. Recover Data files
rman> Restore Database;
9. View the archive log records in the control file
Sql> select name from V$archived_log;
sql> Recover database using Backup controlfile until cancel;
Rman>
Run {
Set until SCN 617834;
Restore database;
Recover database;
}
Open a database in resetlogs mode
Rman>
SQL ' ALTER DATABASE open resetlogs ';
Open another instance
Srvctl Start database-d Zhaoja
Srvctl Status database-d Zhaoja
RAC not fully recovered