By default when we wish to restore the spfile,controlfile from autobackup RMAN looks for the default for autobackup at the location $ORACLE_HOME/dbs in UNIX and $ORACLE_HOME/database for Windows.
As a result when using rman when we use the command restore spfile from autobackup we get error RMAN-06172
hence to avoid the error during autobackup we specify the parameters values db_recovery_file_dest and db_name while restoring the auto backup as shown
RMAN> restore spfile from autobackup db_recovery_file_dest=’c:\oracle\flash_recovery_area’ db_name=’orcl’;
C:\WINDOWS>rman target / nocatalog
Recovery Manager: Release 10.2.0.1.0 – Production on Sun Jun 25 13:09:52 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database (not started)
RMAN>startup nomount;
startup failed:
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file ‘C:\oracle\product\10.2.0\db_1\dbs\spfileorcl.ora’
ORA-27041: unable to open file OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified. starting Oracle instance without parameter file for retrival of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 1247852 bytes
Variable Size 54527380 bytes
Database Buffers 100663296 bytes
Redo Buffers 2945024 bytes
RMAN> restore spfile from autobackup db_recovery_file_dest=’C:\oracle\flash_recovery_area’
db_name=’orcl’;
Starting restore at 25-JUN-06 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=36 devtype=DISK recovery area destination: C:\oracle\flash_recovery_area database name (or database unique name) used for search: ORCL
channel ORA_DISK_1: autobackup found in the recovery area channel ORA_DISK_1:autobackup found:C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\AUTOBACKUP\2006_06_25\O1_MF_S_593780697_29XQL0C7_.BKP
channel ORA_DISK_1: SPFILE restore from autobackup complete Finished restore at 25-JUN-06
Tnsnames.ora is a file which is used by oracle client to connect to oracle server.As we know when if we want to connect to oracle database from remote machine we enter into sqlplus using connect identifire as shown
C:\>sqlplus
SQL*Plus: Release 10.2.0.1 – Production on Wed Mar 21 15:28:03 2007
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Enter user-name: scott/tiger@orcl
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production
With the Partitioning, OLAP and Data Mining options
This connect identifier i.e orcl in above example is resolved by sqlplus client by looking at tnsnames.ora file which is placed at the following location $ORACLE_HOME/network/admin however it can be placed at any given location and it’s path can be set in $TNS_ADMIN environment variable for unix systems.The tnsnames.ora provides the network resolution for connect identifier used by sqlplus clients and application servers.
TNSNAMES.ora contains entries as shown
TNSNAMES.ORA:
=============
V805.US.ORACLE.COM =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = DAN.US.ORACLE.COM)
(PORT = 1521)
)
(
CONNECT_DATA = (SID=ORCL))
)
LISTENER.ORA:
=============
LISTENER=
(ADDRESS_LIST=
(ADDRESS=
(PROTOCOL= TCP)
(HOST = DAN.US.ORACLE.COM)
(PORT= 1521)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl.oracle.com)
(SID_NAME = ORCL)
)
)
As shown above the entries in TNSNAMES correspond listener entries at the server side.Address_list and Address in tnsnames.ora specifies the address of the listener which listens to incoming client requests for the given database.Also the connect_data specifies the service name i.e Sid of the databse specified at the server.