Documente Academic
Documente Profesional
Documente Cultură
============================================================
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 146472960 bytes
Fixed Size 1335080 bytes
Variable Size 92274904 bytes
Database Buffers 50331648 bytes
Redo Buffers 2531328 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/home/app/oracle/oradata/orcl/bak0.dbf'
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 146472960 bytes
Fixed Size 1335080 bytes
Variable Size 92274904 bytes
Database Buffers 50331648 bytes
Redo Buffers 2531328 bytes
Database mounted.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter database open resetlogs;
Database altered.
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 1
SQL>
Note:
Now the case is if the db is in noarchve mode and u dont take the backup of redo
logs, now if any of the datafile deleted u can restore and recover the database
because ur redologs has not been deleted.no backup taken for redo as well
Case B)
Now what i have done , taken backup at log sequence 19 with OS command that mean
s backup contains everything and log19 also. Now i have just deleted log seq19
that is redlog current no 2 from OS level.
Mount the Database restore all files from OS command only , no resetlogs require
d. Db started from log19 only.
CASE C)
========
Nice control file scenario with Inconsitent version.
-----------------------------------------------------
Scenario is suppose u want to multiplex ur control files now what you have done
you have you have already two control files :
[oracle@rman home]$ cd /home/app/oracle/oradata/orcl/
-rw-r----- 1 oracle oracle 9748480 Sep 26 22:52 control03.ctl
-rw-r----- 1 oracle oracle 9748480 Sep 26 22:52 control01.ctl
[oracle@rman orcl]$
Now you want to multiplex this in /home/ directory , now what u have done u just
copy the control01.ctl file without shutting down the database to /home/ direct
ory and u just nomount ur database and start in restrict mode :
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 146472960 bytes
Fixed Size 1335080 bytes
Variable Size 92274904 bytes
Database Buffers 50331648 bytes
Redo Buffers 2531328 bytes
ORA-00214: control file '/home/control03.ctl' version 1099 inconsistent with
file '/home/app/oracle/oradata/orcl/control01.ctl' version 1086
Opps u got the inconsitent Ora-00214 error . Now what u want to do is just ollow
the below steps :
Shutdown ur database
copy the file from oradata location to home location and rename it
startup nomount
SQL> alter system set control_files='/home/app/oracle/oradata/orcl/control03.ctl
','/home/app/oracle/oradata/orcl/control01.ctl','/home/control02.ctl' scope=spfi
le;
System altered.
CASE D
=======
How to restore a NOARCHIVELOG database (ORA-01139: RESETLOGS option only valid a
fter an incomplete database recovery) using current control file
created one dir old in orcl location only ,Now what i have done i just moved all
the log,ctl,dbf file to old dir :
/home/app/oracle/oradata/orcl/old/
Instance is still running here.
SQL> !ps -ef|grep smon
oracle 7898 1 0 23:01 ? 00:00:00 ora_smon_orcl
oracle 8316 8110 0 23:12 pts/1 00:00:00 /bin/bash -c ps -ef|grep smon
oracle 8318 8316 0 23:12 pts/1 00:00:00 grep smon
SQL>
Now what i have done just restore the control files from old dir to original loc
ation , now ur original location contains only control files:
[oracle@rman orcl]$ ls -lrt
total 1269644
drwxrwxr-x 2 oracle oracle 4096 Sep 26 23:24 old
-rw-rw---- 1 oracle oracle 10493952 Sep 26 23:26 bak0.dbf
-rw-rw---- 1 oracle oracle 5251072 Sep 26 23:26 users01.dbf
-rw-rw---- 1 oracle oracle 47194112 Sep 26 23:26 undotbs01.dbf
-rw-rw---- 1 oracle oracle 503324672 Sep 26 23:28 sysaux01.dbf
-rw-rw---- 1 oracle oracle 713039872 Sep 26 23:28 system01.dbf
-rw-r----- 1 oracle oracle 9748480 Sep 26 23:28 control03.ctl
-rw-r----- 1 oracle oracle 9748480 Sep 26 23:28 control01.ctl
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery
CASE E
=======
How to restore a NOARCHIVELOG database using a backup controlfile
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select controlfile_type from V$DATABASE; 4
2
SQL> select controlfile_type from V$DATABASE;
CONTROL
-------
BACKUP
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Pr
oduction
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@rman ~]$
[oracle@rman ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Sat Sep 26 23:56:50 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1419165592, not open)
RMAN> restore database;
Starting restore at 26-SEP-15
Starting implicit crosscheck backup at 26-SEP-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
Crosschecked 3 objects
Finished implicit crosscheck backup at 26-SEP-15
Starting implicit crosscheck copy at 26-SEP-15
using channel ORA_DISK_1
Finished implicit crosscheck copy at 26-SEP-15
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /home/app/oracle/flash_recovery_area/ORCL/autobackup/2015_09_26/o1_mf
_s_891474657_c0h4mhcl_.bkp
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /home/app/oracle/oradata/orcl/sy
stem01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /home/app/oracle/oradata/orcl/sy
saux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /home/app/oracle/oradata/orcl/un
dotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /home/app/oracle/oradata/orcl/us
ers01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /home/app/oracle/oradata/orcl/ba
k0.dbf
channel ORA_DISK_1: reading from backup piece /home/BKPCASES/db_891474737_10_p1
channel ORA_DISK_1: piece handle=/home/BKPCASES/db_891474737_10_p1 tag=TAG201509
26T235216
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:05
Finished restore at 26-SEP-15
RMAN> alter database open resetlogs;
database opened
RMAN> exit
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select name,open_mode from v$database;
NAME OPEN_MODE
--------- --------------------
ORCL READ WRITE