Powered By Blogger

Wednesday, January 26, 2011

Workaround Queries(11g) While Monitoring

------------------------ check session information -----------------------

select * form v$fixed_table;
select * from v$session where osuser='501200I127';
select * from v$sysstat
select * from v$session_longops where sid in (130,138)
select * from v$session where osuser='50120C1008';
select * from v$session where type!= 'BACKGROUND';
select 'alter system kill session ' '''' sid ',' serial#'''' ' immediate;' as script from v$session where osuser='501200I127';
select * from v$session where sid in (147);
alter system kill session '138,8217' immediate;

-------------find which session is using a particular object --

select * from v$access where object like 'RPT_TREASURY_REPORT_FILTERS%';

---------- enable trace for a particular session ------

exec DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(53 ,5083,true);

---------- find the trace files for a session -------

select b.username, c.value '\' lower(d.value) '_ora_'
to_char(a.spid, 'fm00000') '.trc' "TRACE_FILE"
from v$process a, v$session b, v$parameter c, v$parameter d
where a.addr = b.paddr and c.name = 'user_dump_dest'
and d.name = 'db_name' and b.username is not null and b.sid=53;
alter system kill session '191,19465' immediate;

----------------- find the undo space usage in UNDO tablespace for a database ---------------------------

select sum(decode(status,'EXPIRED',bytes,0))/sum(bytes) EXPIRED_PERCENT,
sum(decode(status,'UNEXPIRED',bytes,0))/sum(bytes) UNEXPIRED_PERCENT,
sum(decode(status,'ACTIVE',bytes,0))/sum(bytes) ACTIVE_PERCENT
from dba_undo_extents;

--------------------- find the Database components features usage ----------------------------------

select * from DBA_FEATURE_USAGE_STATISTICS;

------------------------ find current running query using OS process id -----------------

SELECT s.sid, s.serial#, q.SQL_TEXT ,s.username,
s.osuser, s.machine, s.program, s.logon_time, s.status,
p.program, p.spid
FROM v$session s, v$process p,v$sqltext q
WHERE s.paddr = p.addr and q.address = s.sql_address
AND q.hash_value = s.sql_hash_value AND p.spid = 22737;
---------- 1 row

SELECT s.sid,s.osuser,q.SQL_FULLTEXT
FROM v$session s, v$process p,v$sqlarea q
WHERE s.paddr = p.addr and s.sql_address= q.address AND p.spid = 24510;

exec dbms_stats.GATHER_TABLE_STATS('STARREP','DISCOUNT_FACTOR_DATA');

--------------------- find the OS process id -----------------------

SELECT s.saddr, s.sid, s.serial#, s.username,
s.osuser, s.machine, s.program, s.logon_time, s.status,
p.program, p.spid
FROM v$session s, v$process p
WHERE s.paddr = p.addr
AND s.sid IN (488);

SELECT p.program, p.spid, s.saddr, s.sid, s.serial#, s.username,
s.osuser, s.machine, s.program, s.logon_time, s.status
FROM v$session s, v$process p
WHERE s.paddr = p.addr
AND s.sid IN (39, 24);

--------- cpu usage information ---------

select a.sid, a.value cpu_usage, a.value/b.value cpu_bycall from v$sesstat a, v$sesstat b
where a.sid=b.sid and a.statistic#=12 and b.statistic#=6
and a.value>0 and b.value>0 order by a.value desc;

-------------------------- find the top session ------------------

Select sid,username,round(100 * total_user_io/total_io,2) tot_io_pct
from (select
b.sid sid,nvl(b.username,p.name) username,sum(value) total_user_io
from
sys.v_$statname c,
sys.v_$sesstat a,
sys.v_$session b,
sys.v_$bgprocess p
where a.statistic#=c.statistic# and
p.paddr (+) = b.paddr and b.sid=a.sid and
c.name in ('physical reads',
'physical writes',
'physical writes direct',
'physical reads direct',
'physical writes direct (lob)',
'physical reads direct (lob)')
group by b.sid, nvl(b.username,p.name)),
(select sum(value) total_io from
sys.v_$statname c,
sys.v_$sesstat a
where a.statistic#=c.statistic# and
c.name in ('physical reads',
'physical writes',
'physical writes direct',
'physical reads direct',
'physical writes direct (lob)',
'physical reads direct (lob)'))
order by 3 desc;

-------------------- find the blocking sessions --------------------------

select s1.username '@' s1.machine
' ( SID=' s1.sid ' ) is blocking '
s2.username '@' s2.machine ' ( SID=' s2.sid ' ) ' AS blocking_status
from v$lock l1, v$session s1, v$lock l2, v$session s2
where s1.sid=l1.sid and s2.sid=l2.sid
and l1.BLOCK=1 and l2.request > 0
and l1.id1 = l2.id1
and l2.id2 = l2.id2;
SELECT sid, serial#, blocking_session_status, blocking_session
FROM v$session WHERE blocking_session IS NOT NULL;

------------- identify locked object ----------------------------

select object_name from dba_objects where object_id = 88519;
select * from v$lock;

--------------- SQL run time monitor -----------------------------

select * from v$sql_monitor where sid = 344;

---------------- find top SQL queries ------------------------------

SELECT SQL_TEXT,X.CPU_TIME FROM DBA_HIST_SQLTEXT DHST,
(SELECT DHSS.SQL_ID SQL_ID,SUM(DHSS.CPU_TIME_DELTA) CPU_TIME
FROM DBA_HIST_SQLSTAT DHSS
WHERE DHSS.SNAP_ID IN(SELECT SNAP_ID FROM DBA_HIST_SNAPSHOT
WHERE BEGIN_INTERVAL_TIME>=TO_DATE('09/01/2008','MM/DD/YYYY')
AND END_INTERVAL_TIME<=TO_DATE('09/09/2008','MM/DD/YYYY'))
GROUP BY DHSS.SQL_ID) X WHERE X.SQL_ID=DHST.SQL_ID ORDER BY X.CPU_TIME DESC;

------------------------ resources used by a session --------------

select s.osuser osuser,s.serial# serial,se.sid,n.name,max(se.value) maxmem
from v$sesstat se,v$statname n,v$session s
where n.statistic# = se.statistic#
and n.name in ('session pga memory','session pga memory max',
'session uga memory','session uga memory max')
and s.sid=se.sid
group by s.osuser, s.serial#, se.sid, n.name
order by 2;

--- check local session

select a.name,b.value from v$statname a ,v$mystat b where a.statistic#=b.statistic# and b.sid in (474,475,477,478,481,494,499) ;

-------------------check number of cursors opened -----------------------------------------------------

select sum(a.value) total_cur, avg(a.value) avg_cur, max(a.value) max_cur,s.username, s.machine
from v$sesstat a,v$statname b, v$session s
where a.statistic# = b.statistic# and s.sid=a.sid and b.name = 'opened cursors current'
group by s.username, s.machine order by 1 desc;

How to recover the deleted mails in outlook

>> Click Start,
>> Click Run, type regedit, and then click OK.
>> Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange\Client\Options
>> Right-click the Options subkey, point to New, and then click DWORD Value.
>> Type DumpsterAlwaysOn for the DWORD name, and then press ENTER.
>> Double-click DumpsterAlwaysOn. In the Value data box, type 1, and then click OK.
>> Quit Registry Editor.

To enable hard-deleted items recovery in Outlook follow these steps:

>> Open Registry Editor.
>> In Registry Editor, navigate to the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange\Client\Options
>> Create the following value (DWORD):
DumpsterAlwaysOn
and give it a value of 1.

Note: As always, before making changes to your registry you should always make sure you have a valid backup. In cases where you're supposed to delete or modify keys or values from the registry it is possible to first export that key or value(s) to a .REG file before performing the changes.

>> Close Registry Editor, re-open Outlook for settings to take place.
>> After you add this value, the Recover Deleted Items option becomes available for the Sent Items folder, the Drafts folder, the Outbox folder, and the Inbox folder.
>> You can recover deleted items from these folders.
/images/ol_recover_del6.gif/images/ol_recover_del6.gif
>> As you can clearly see, the Inbox has the Recover Deleted Items option enabled, and so does each and every folder in the user's mailbox.

Statspack Report scheduling based on the Requirment timings

The below steps are to schedule the statspack collection to run on the specific timings. ie it runs in the weeksdays apart from monday by the interval 3 hours, and from sunday 12 pm to monday 12 pm it runs every 1 hour (ie during the peak time).


STEP 1: Remove the existing statspack job schedule:
EXECUTE DBMS_JOB.REMOVE(1);

STEP 2 : Function that will return the date to the job:

create or replace function statspack_schedule
return date
as
N_date date;
begin
select case
when ( to_char(dt,'dy') = 'sun' and to_char(dt,'hh24:mi')>'12:00')
or ( to_char(dt,'dy') = 'mon' and to_char(dt,'hh24:mi')<'12:00') then d1 else d2 end into N_date from ( select sysdate dt , trunc(sysdate, 'hh24') +1/24 d1 , trunc(sysdate, 'hh24') +3/24 d2 from dual ); return N_date; end; /

STEP 3: statspack Job scheduling :

BEGIN
DBMS_JOB.isubmit (
job => 1,
what => 'statspack.snap;',
next_date => sysdate,
interval => '( select statspack_schedule from dual )');
COMMIT;
END;
/

STEP 4: Purge the old data with the retention of 1 month (Manually do this activity every month):

CONNECT perfstat/perfstat
@?\rdbms\admin\sppurge.sql
(specified the snap id with retention of 1 month)
to identified the begining and end snap id:
select snap_id, snap_level "level", to_char(snap_time,' dd/mm/YYYY HH24:mi:ss') snap_date from stats$snapshot
where snap_timeorder by 1;

Tuesday, January 18, 2011

Components still show 9.2.0.1 version after Applying 9.2.0.7 patchset also

There is an issue while applying patchset 9.2.0.7 on 9.2.0.1. Please see the below steps and explanation for more information.

Step 1 : I installed 9.2.0.1 software on a windows xp professional machine for testing purpose. But no database was created at the time.

Step 2 : And later i applied 9.2.0.7 patch on that 9.2.0.1 software, the patch installation went fine without any issues or errors.

Step 3 : And after the sucessfull patch insallation i created a database using DBCA. it was sucessfull.

Step 4 : I connected the database as sys user and checked the version using V$VERSION view. it displayed

SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.7.0 - ProductionPL/SQL Release 9.2.0.7.0 - ProductionCORE 9.2.0.7.0 ProductionTNS for 32-bit Windows: Version 9.2.0.7.0 - ProductionNLSRTL Version 9.2.0.7.0 - Production

Step 5: As a precautionary measure i thought of checking the components version from
dba_registry and it showed the old version that is 9.2.0.1. Please see below

SQL> select comp_name,version from dba_registry;
COMP_NAME VERSION
-------------------------------------------------- ---------------------------
Oracle9i Catalog Views 9.2.0.1.0
Oracle9i Packages and Types 9.2.0.1.0
Oracle Workspace Manager 9.2.0.1.0
JServer JAVA Virtual Machine 9.2.0.1.0
Oracle XDK for Java 9.2.0.1.0
Oracle9i Java Packages 9.2.0.1.0
Oracle interMedia 9.2.0.1.0
Spatial 9.2.0.1.0
Oracle Text 9.2.0.1.0
Oracle XML Database 9.2.0.1.0
Oracle Ultra Search 9.2.0.1.0
Oracle Data Mining 9.2.0.1.0
OLAP Analytic Workspace 9.2.0.1.0
Oracle OLAP API 9.2.0.1.0
OLAP Catalog 9.2.0.1.0
15 rows selected.

So its a problem. So we have to manualy upgrade the components by running scripts which is mentioned in the README file which came with the patch.

So i ran the scripts by connecting as a SYS user to the database as below

sqlplus sys/******* as sysdba
SQL> Shutdown immediate
SQL> startup migrate
SQL> @C:\oracle\rdbms\admin\catpatch.sql

after the sucessfull execution of the above script executed the second script as mentioned in the README file.

SQL>Shutdown immediate
SQL> startup
SQL>@C:\oracle\rdbms\admin\utlrp.sql

after the sucessfull execution of both the scripts again i checked the components version and found that everything is fine, Please see below.


SQL> select comp_name,version from dba_registry;
COMP_NAME VERSION
-------------------------------------------------- ---------------------------
Oracle9i Catalog Views 9.2.0.7.0
Oracle9i Packages and Types 9.2.0.7.0
Oracle Workspace Manager 9.2.0.1.0
JServer JAVA Virtual Machine 9.2.0.7.0
Oracle XDK for Java 9.2.0.9.0
Oracle9i Java Packages 9.2.0.7.0
Oracle interMedia 9.2.0.7.0
Spatial 9.2.0.7.0
Oracle Text 9.2.0.7.0
Oracle XML Database 9.2.0.7.0
Oracle Ultra Search 9.2.0.7.0
Oracle Data Mining 9.2.0.7.0
OLAP Analytic Workspace 9.2.0.7.0
Oracle OLAP API 9.2.0.7.0
OLAP Catalog 9.2.0.7.0
15 rows selected.

Thanks ..
Navaneeth

Tuesday, December 7, 2010

Database Charachter set change from WE8MSWIN1252 to utf8

The case is we have a database with characterset WE8MSWIN1252, we need to migrate the schemas to different database which has different characterset.
What we did is we ran CSSCAN utility against the source database to check whether the characterset migration is possible or not.
step 1:
CSSCAN
'SYS/********@SourceDB as sysdba' user=schemaname fromchar=WE8MSWIN1252 TOCHAR=utf8 log=D:\CSS_SCAN_DETAILS\Schemaname_log
Step 2:
The above command will create three output files
1.Err output file.
2.Log file.
3.Text file
like Schemaname_log.err,schemaname_log.txt.schemaname_log.log
The text file contains the below output.

Database Scan Summary Report
Time Started : 2010-08-03 18:52:44
Time Completed: 2010-08-03 18:53:16
Process ID Time Started Time Completed
---------- -------------------- --------------------
1 2010-08-03 18:53:14 2010-08-03 18:53:15
---------- -------------------- --------------------
[Database Size]
Tablespace Used Free Total Expansion
------------------------- --------------- --------------- --------------- ---------------
SYSTEM 1,062.25M 7.75M 1,070.00M .00K
UNDOTBS1 17.94M 7,822.06M 7,840.00M .00K
SYSAUX 749.38M 50.63M 800.00M .00K
TEMP .00K .00K .00K .00K
USERS 2,392.50M 147.50M 2,540.00M .00K
EMP 28.88M 271.13M 300.00M .00K
EMPTEST 79.75M 220.25M 300.00M .00K
EMPPROD 78.00M 222.00M 300.00M .00K
------------------------- --------------- --------------- --------------- ---------------
Total 26,868.00M 19,685.06M 46,553.06M .00K
[Database Scan Parameters]
Parameter Value
------------------------------ ------------------------------------------------
CSSCAN Version v2.1
Instance Name dbdatabase
Database Version 10.2.0.4.0
Scan type User tables
User name TRAN
Scan CHAR data? YES
Database character set WE8MSWIN1252
FROMCHAR WE8MSWIN1252
TOCHAR utf8
Scan NCHAR data? NO
Array fetch buffer size 1024000
Number of processes 1
Capture convertible data? NO
------------------------------ ------------------------------------------------
[Scan Summary]
Some character type application data are not convertible to the new character set
[Data Dictionary Conversion Summary]
Datatype Changeless Convertible Truncation Lossy
--------------------- ---------------- ---------------- ---------------- ----------------
VARCHAR2 0 0 0 0
CHAR 0 0 0 0
LONG 0 0 0 0
CLOB 0 0 0 0
VARRAY 0 0 0 0
--------------------- ---------------- ---------------- ---------------- ----------------
Total 0 0 0 0
Total in percentage 0.000% 0.000% 0.000% 0.000%

[Application Data Conversion Summary]
Datatype Changeless Convertible Truncation Lossy
--------------------- ---------------- ---------------- ---------------- ----------------
VARCHAR2 4,499 29 2 0
CHAR 0 0 0 0
LONG 0 0 0 0
CLOB 0 0 0 0
VARRAY 0 0 0 0
--------------------- ---------------- ---------------- ---------------- ----------------
Total 4,499 29 2 0
Total in percentage 99.316% 0.640% 0.044% 0.000%
[Distribution of Convertible, Truncated and Lossy Data by Table]
USER.TABLE Convertible Truncation Lossy
-------------------------------------------------- ---------------- ---------------- ----------------
TRAN.TBL_FILE_STORAGE 2 1 0
TRAN.TBL_TASK_DETAILS 3 0 0
TRAN.TBL_TASK_DOCUMENTS 1 1 0
TRAN.TBL_TRANSLATIONS 22 0 0
TRAN.TBL_USER_MASTER 1 0 0
-------------------------------------------------- ---------------- ---------------- ----------------
[Distribution of Convertible, Truncated and Lossy Data by Column]
USER.TABLECOLUMN Convertible Truncation Lossy
-------------------------------------------------- ---------------- ---------------- ----------------
TRAN.TBL_FILE_STORAGEFIST_FILE_NAME 2 1 0
TRAN.TBL_TASK_DETAILSTADE_CUSTOMER_NAME 1 0 0
TRAN.TBL_TASK_DETAILSTADE_END_CUSTOMER_NA 1 0 0
TRAN.TBL_TASK_DETAILSTADE_INVOICE_SEND_TO 1 0 0
TRAN.TBL_TASK_DOCUMENTSTADO_SOURCE_FILENA 1 1 0
TRAN.TBL_TRANSLATIONSTRAN_VALUE 22 0 0
TRAN.TBL_USER_MASTERUSMA_PASSWORD 1 0 0
-------------------------------------------------- ---------------- ---------------- ----------------
[Indexes to be Rebuilt]
USER.INDEX on USER.TABLE(COLUMN)
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------


The error output file will contain the tables list that wich we need to work on when doing the migration like below
Database Scan Individual Exception Report
[Database Scan Parameters]
Parameter Value
------------------------------ ------------------------------------------------
CSSCAN Version v2.1
Instance Name dbdatabase
Database Version 10.2.0.4.0
Scan type User tables
User name TRAN
Scan CHAR data? YES
Database character set WE8MSWIN1252
FROMCHAR WE8MSWIN1252
TOCHAR utf8
Scan NCHAR data? NO
Array fetch buffer size 1024000
Number of processes 1
Capture convertible data? NO
------------------------------ ------------------------------------------------
[Data Dictionary individual exceptions]

[Application data individual exceptions]
User : TRAN
Table : TBL_FILE_STORAGE
Column: FIST_FILE_NAME
Type : VARCHAR2(50)
Number of Exceptions : 1
Max Post Conversion Data Size: 51
ROWID Exception Type Size Cell Data(first 30 bytes)
------------------ ------------------ ----- ------------------------------
AAAY62AAVAAAAHWAAU exceed column size 51 P3-FRA2028FR -ContrĂ´le des DE
------------------ ------------------ ----- ------------------------------
User : TRAN
Table : TBL_TASK_DOCUMENTS
Column: TADO_SOURCE_FILENAME
Type : VARCHAR2(50)
Number of Exceptions : 1
Max Post Conversion Data Size: 51
ROWID Exception Type Size Cell Data(first 30 bytes)
------------------ ------------------ ----- ------------------------------
AAAY64AAVAAAAJuAAF exceed column size 51 P3-FRA2028FR -ContrĂ´le des DE
------------------ ------------------ ----- ------------------------------

The logfile will contain the below output
Character Set Scanner v2.1 : Release 10.2.0.3.0 - Production on Tue Aug 3 18:52:43 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Enumerating tables to scan...
. process 1 scanning TRAN.TBL_EMAIL_LOG[AAAY6wAAVAAAAGhAAA]
. process 1 scanning TRAN.TBL_ROLE_ACCESS[AAAY5JAAVAAAAIZAAA]
. process 1 scanning TRAN.TBL_TASK_STATUS[AAAY5UAAVAAAAJ5AAA]
. process 1 scanning TRAN.TBL_SYSTEM_VARIABLES[AAAY5MAAVAAAAIxAAA]
. process 1 scanning TRAN.TBL_USER_MASTER[AAAY5gAAVAAAALZAAA]
. process 1 scanning TRAN.TBL_TRANSLATION_CODES[AAAY5aAAVAAAAKpAAA]
. process 1 scanning TRAN.TBL_TASK_DETAILS[AAAY5PAAVAAAAJJAAA]
. process 1 scanning TRAN.TBL_TASK_DOCUMENTS[AAAY64AAVAAAAJpAAA]
. process 1 scanning TRAN.TBL_TRANSLATIONS[AAAY5XAAVAAAAKRAAA]
. process 1 scanning TRAN.TBL_USER_ROLES[AAAY5nAAVAAAANZAAA]
. process 1 scanning TRAN.TBL_FORMAT_CODES[AAAZiFAAkAAAAAZAAA]
. process 1 scanning TRAN.TBL_LIST_DETAILS[AAAY5DAAVAAAAHpAAA]
. process 1 scanning TRAN.TBL_LIST_MASTER[AAAY5GAAVAAAAIBAAA]
. process 1 scanning TRAN.TBL_FILE_STORAGE[AAAY62AAVAAAAHRAAA]
Creating Database Scan Summary Report...
Creating Individual Exception Report...
Scanner terminated successfully.


From the above reports,the error file says we need to alter the column of the couple of the tables for the migration to be sucessfull.
So based on the report we altered the column size according to the report and did the migration sucessfully.

Table level recovery using RMAN by restoring in a different server

The below scenario describes that a table has been accedentialy dropped from a database and recovering using the RMAN backup by restoring only the specific datafiles that are related to that specific Schema in a new different server and taking the export of the dropped table and importing into the production server.
in production server:
SQL> drop table TBL_RESULT_MAIN;
Table dropped.

SQL> select table_name,tablespace_name from user_tables;
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
T_REPORTCONFIG_PEEARS TS_COMET_SPC
T_MENU_PEEARS TS_COMET_SPC
MICROSOFTDTPROPERTIES TS_COMET_SPC
T_ADDL_SPEC TS_COMET_SPC
T_CORR_MP TS_COMET_SPC
T_CUSTOMER TS_COMET_SPC
T_CUSTOMER_TYPES TS_COMET_SPC
T_DEPARTMENT TS_COMET_SPC
T_ERROR TS_COMET_SPC
T_FILE_ACESS TS_COMET_SPC
T_GENERAL_MP TS_COMET_SPC
T_GENERAL_SPEC TS_COMET_SPC
T_LINES TS_COMET_SPC
T_LINE_ITEMS TS_COMET_SPC
T_MAIN TS_COMET_SPC
T_MENUS TS_COMET_SPC
T_MP_LOOKUP TS_COMET_SPC
T_REPORTCONFIG TS_COMET_SPC
T_REPORT_SEL_MP TS_COMET_SPC
T_REPORT_SRF TS_COMET_SPC
T_RESDUP_MAIN TS_COMET_SPC
T_RESDUP_MP TS_COMET_SPC
T_RESULT_CORR_MP TS_COMET_SPC
T_RESULT_MP TS_COMET_SPC
T_ROLES TS_COMET_SPC
T_SPEC_CHANGE TS_COMET_SPC
T_TESTPRG_HIST TS_COMET_SPC
T_TEST_PRG TS_COMET_SPC
T_USER TS_COMET_SPC
T_USERS_CPR TS_COMET_SPC
30 rows selected.

1* select file#,name from v$datafile
SQL> /
FILE# NAME
---------- --------------------------------------------------------------------------------------
1 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\SYSTEM01.DBF
2 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\UNDOTBS01.DBF
3 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\SYSAUX01.DBF
4 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\UNDOTBS02.DBF
5 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\USERS01.DBF
6 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\PHASER01.DBF
7 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\RMSUSR01.DBF
8 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\COMET01.DBF
9 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\COMET02.DBF
10 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\COMET03.DBF
11 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\COMET04.DBF
12 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\EDITOR_TBS01.DBF
13 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\SCADA_TBS01.DBF
14 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\LCS_TBS_01
15 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\PE_TRACE01.DBF
16 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\HDK_TBS_01.DBF
17 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\INDX_PHASE_01.DBF
18 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\INDX_EDITOR_01.DBF
19 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\INDX_COMET_01.DBF
20 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\AUTOCALPF.DBF
21 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\AUTOCALPF_INDEX.DBF


SQL> select * from v$tablespace;
TS# NAME INC BIG FLA ENC
---------- ------------------------------ --- --- --- ---
0 SYSTEM YES NO YES
1 UNDOTBS1 YES NO YES
2 SYSAUX YES NO YES
15 INDX_PHASE YES NO YES
4 UNDOTBS2 YES NO YES
5 USERS YES NO YES
6 TS_PHASER YES NO YES
7 TS_RMSUSR YES NO YES
8 TS_COMET_SPC YES NO YES
9 EDITOR_TBS01 YES NO YES
10 SCADA_TBS YES NO YES
11 LCS_TBS_01 YES NO YES
12 PE_TRACE YES NO YES
13 HDK_TBS_01 YES NO YES
14 TEMP1 NO NO YES
16 INDX_EDITOR YES NO YES
17 INDX_COMET YES NO YES
20 AUTOCALPF YES NO YES
21 AUTOCALPF_INDEX YES NO YES
3 TEMP NO NO YES

Move the backup files to the test server in the same location where the RMAN has taken backup and start restoring as below.In this case the test server already has a dummy database. So we are restoring in it.
in test server:
>RMAN target 'sys/******* as sysdba'
RMAN> run
2> {
3> shutdown immediate;
4> startup nomount;
5> restore controlfile from 'D:\ADB_BACKUP\ADB_CTRL_7KKLTCPL_20090805';
6> startup mount;
7> }

RMAN> catalog start with 'D:\ADB_backup\ADB';
searching for all files that match the pattern D:\ADB_backup\ADB
List of Files Unknown to the Database
=====================================
File Name: D:\ADB_BACKUP\ADB_ARCH_7FKLT9F1_1_1_20090805
File Name: D:\ADB_BACKUP\ADB_ARCH_7GKLTABC_1_1_20090805
File Name: D:\ADB_BACKUP\ADB_ARCH_7HKLTBE3_1_1_20090805
File Name: D:\ADB_BACKUP\ADB_ARCH_7IKLTCN8_1_1_20090805
File Name: D:\ADB_BACKUP\ADB_CTRL_7KKLTCPL_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7CKLSQ4D_2_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7CKLSQ4D_3_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7CKLSQ4D_4_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7CKLSQ4D_5_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7DKLSQ4E_1_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7DKLSQ4E_2_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7DKLSQ4E_3_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7DKLSQ4E_4_1_20090805
Do you really want to catalog the above files (enter YES or NO)? y
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: D:\ADB_BACKUP\ADB_ARCH_7FKLT9F1_1_1_20090805
File Name: D:\ADB_BACKUP\ADB_ARCH_7GKLTABC_1_1_20090805
File Name: D:\ADB_BACKUP\ADB_ARCH_7HKLTBE3_1_1_20090805
File Name: D:\ADB_BACKUP\ADB_ARCH_7IKLTCN8_1_1_20090805
File Name: D:\ADB_BACKUP\ADB_CTRL_7KKLTCPL_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7CKLSQ4D_2_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7CKLSQ4D_3_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7CKLSQ4D_4_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7CKLSQ4D_5_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7DKLSQ4E_1_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7DKLSQ4E_2_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7DKLSQ4E_3_1_20090805
File Name: D:\ADB_BACKUP\ADB_DATA_7DKLSQ4E_4_1_20090805

RMAN> run
2> {
3> shutdown immediate;
4> startup mount;
5> restore datafile 1,2,3,4,6;
6> }
using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 1291845632 bytes
Fixed Size 1292276 bytes
Variable Size 494929932 bytes
Database Buffers 788529152 bytes
Redo Buffers 7094272 bytes
Starting restore at 05-OCT-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=268 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\UNDOTBS01.DBF
restoring datafile 00006 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\PHASER01.DBF
channel ORA_DISK_1: reading from backup piece D:\ADB_BACKUP\ADB_DATA_7DKLSQ4E_1_1_20090805
channel ORA_DISK_1: restored backup piece 1
piece handle=D:\ADB_BACKUP\ADB_DATA_7DKLSQ4E_1_1_20090805 tag=TAG20090805T003004
channel ORA_DISK_1: restore complete, elapsed time: 00:23:06
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\SYSTEM01.DBF
restoring datafile 00003 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\SYSAUX01.DBF
restoring datafile 00004 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ADB\UNDOTBS02.DBF
channel ORA_DISK_1: reading from backup piece D:\ADB_BACKUP\ADB_DATA_7CKLSQ4D_1_1_20090805
channel ORA_DISK_1: restored backup piece 1
piece handle=D:\ADB_BACKUP\ADB_DATA_7CKLSQ4D_1_1_20090805 tag=TAG20090805T003004
channel ORA_DISK_1: restore complete, elapsed time: 00:19:56
Finished restore at 05-OCT-09
sql>conn sys/****** as sysdba
SQL> alter database datafile 5 offline drop;
Database altered.
SQL> alter database datafile 7 offline drop;
Database altered.
SQL>
SQL> alter database datafile 8 offline drop;
Database altered.
SQL>
SQL> alter database datafile 9 offline drop;
Database altered.
SQL>
SQL> alter database datafile 10 offline drop;
Database altered.
SQL>
SQL> alter database datafile 11 offline drop;
Database altered.
SQL>
SQL> alter database datafile 12 offline drop;
Database altered.
SQL>
SQL> alter database datafile 13 offline drop;
Database altered.
SQL>
SQL> alter database datafile 14 offline drop;
Database altered.
SQL>
SQL> alter database datafile 15 offline drop;
Database altered.
SQL>
SQL> alter database datafile 16 offline drop;
Database altered.
SQL>
SQL> alter database datafile 17 offline drop;
Database altered.
SQL>
SQL> alter database datafile 18 offline drop;
Database altered.
SQL>
SQL> alter database datafile 19 offline drop;
Database altered.
SQL>
SQL> alter database datafile 20 offline drop;
Database altered.
SQL>
SQL> alter database datafile 21 offline drop;
Database altered.
SQL>
RMAN> recover database until sequence 64;
Starting recover at 05-OCT-09
using channel ORA_DISK_1
starting media recovery
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00001_0695490270.001 thread=1 sequence=1
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00001_0695490270.002 thread=2 sequence=1
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00002_0695490270.001 thread=1 sequence=2
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00003_0695490270.001 thread=1 sequence=3
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00002_0695490270.002 thread=2 sequence=2
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00004_0695490270.001 thread=1 sequence=4
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00005_0695490270.001 thread=1 sequence=5
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00006_0695490270.001 thread=1 sequence=6
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00003_0695490270.002 thread=2 sequence=3
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00007_0695490270.001 thread=1 sequence=7
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00008_0695490270.001 thread=1 sequence=8
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00009_0695490270.001 thread=1 sequence=9
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00004_0695490270.002 thread=2 sequence=4
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00010_0695490270.001 thread=1 sequence=10
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00011_0695490270.001 thread=1 sequence=11
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00012_0695490270.001 thread=1 sequence=12
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00005_0695490270.002 thread=2 sequence=5
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00013_0695490270.001 thread=1 sequence=13
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00014_0695490270.001 thread=1 sequence=14
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00015_0695490270.001 thread=1 sequence=15
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00006_0695490270.002 thread=2 sequence=6
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00016_0695490270.001 thread=1 sequence=16
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00017_0695490270.001 thread=1 sequence=17
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00018_0695490270.001 thread=1 sequence=18
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00007_0695490270.002 thread=2 sequence=7
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00019_0695490270.001 thread=1 sequence=19
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00020_0695490270.001 thread=1 sequence=20
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00008_0695490270.002 thread=2 sequence=8
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00021_0695490270.001 thread=1 sequence=21
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00022_0695490270.001 thread=1 sequence=22
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00009_0695490270.002 thread=2 sequence=9
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00023_0695490270.001 thread=1 sequence=23
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00024_0695490270.001 thread=1 sequence=24
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00025_0695490270.001 thread=1 sequence=25
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00010_0695490270.002 thread=2 sequence=10
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00026_0695490270.001 thread=1 sequence=26
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00027_0695490270.001 thread=1 sequence=27
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00028_0695490270.001 thread=1 sequence=28
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00011_0695490270.002 thread=2 sequence=11
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00029_0695490270.001 thread=1 sequence=29
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00030_0695490270.001 thread=1 sequence=30
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00031_0695490270.001 thread=1 sequence=31
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00012_0695490270.002 thread=2 sequence=12
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00032_0695490270.001 thread=1 sequence=32
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00033_0695490270.001 thread=1 sequence=33
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00034_0695490270.001 thread=1 sequence=34
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00013_0695490270.002 thread=2 sequence=13
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00035_0695490270.001 thread=1 sequence=35
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00036_0695490270.001 thread=1 sequence=36
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00037_0695490270.001 thread=1 sequence=37
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00014_0695490270.002 thread=2 sequence=14
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00038_0695490270.001 thread=1 sequence=38
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00039_0695490270.001 thread=1 sequence=39
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00040_0695490270.001 thread=1 sequence=40
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00015_0695490270.002 thread=2 sequence=15
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00041_0695490270.001 thread=1 sequence=41
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00042_0695490270.001 thread=1 sequence=42
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00043_0695490270.001 thread=1 sequence=43
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00016_0695490270.002 thread=2 sequence=16
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00044_0695490270.001 thread=1 sequence=44
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00045_0695490270.001 thread=1 sequence=45
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00046_0695490270.001 thread=1 sequence=46
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00017_0695490270.002 thread=2 sequence=17
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00047_0695490270.001 thread=1 sequence=47
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00048_0695490270.001 thread=1 sequence=48
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00049_0695490270.001 thread=1 sequence=49
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00018_0695490270.002 thread=2 sequence=18
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00050_0695490270.001 thread=1 sequence=50
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00051_0695490270.001 thread=1 sequence=51
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00052_0695490270.001 thread=1 sequence=52
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00019_0695490270.002 thread=2 sequence=19
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00053_0695490270.001 thread=1 sequence=53
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00054_0695490270.001 thread=1 sequence=54
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00055_0695490270.001 thread=1 sequence=55
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00020_0695490270.002 thread=2 sequence=20
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00056_0695490270.001 thread=1 sequence=56
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00057_0695490270.001 thread=1 sequence=57
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00058_0695490270.001 thread=1 sequence=58
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00021_0695490270.002 thread=2 sequence=21
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00059_0695490270.001 thread=1 sequence=59
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00060_0695490270.001 thread=1 sequence=60
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00061_0695490270.001 thread=1 sequence=61
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00022_0695490270.002 thread=2 sequence=22
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00062_0695490270.001 thread=1 sequence=62
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ARCH\ARC00063_0695490270.001 thread=1 sequence=63
unable to find archive log
archive log thread=1 sequence=64
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 10/05/2009 18:49:07
RMAN-06054: media recovery requesting unknown log: thread 1 seq 64 lowscn 294192954

RMAN> alter database open resetlogs;
database opened

SQL> conn phase/phase
Connected.
SQL>
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
DPS2003 TABLE
DROPLET TABLE
FMNREPAIR TABLE
FMNREPAIRNEW TABLE
FMNVALUE TABLE
FMNVALUENEW TABLE
TSTAMM TABLE
TVOREINSTELLUNG TABLE
T_DEFECTCODE TABLE
T_PASSWORD TABLE
T_PHASING_RESULT TABLE
T_SPEC TABLE
T_TESTPROGRAM TABLE
A VIEW
V_SPEC VIEW
44 rows selected.
C:\Documents and Settings\q4ban>exp phase/***** file='E:\test\TBL_PHASING_RESULT.dmp' statistics=none buffer=314572800
=TBL_PHASING_RESULT
Export: Release 10.2.0.3.0 - Production on Mon Oct 5 18:55:18 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table TBL_PHASING_RESULT 2250433 rows exported
Export terminated successfully without warnings.
C:\Documents and Settings\q4ban>

After this transfer the dump file to the production server and import the table.

OS upgradation and Production DB Recovered (size 320 Gigs)

Implemented steps
Scenario is
The server OS has been upgraded from Windows 2000 standard edition to Windows 2003 standard edition, Oracle 10.2.0.3 is installed in C: drive where the OS has been installed.
Apart from this we have additional D: drive and E: drive mounted in the server.
Note: All the database files are present in the D: drive and E: drive.
Client wants to upgrade the OS in this server, So what he did is he removed the mounted drives (D: and F:) and upgraded the OS to Windows 2003 standard edition.
And after installing the OS Ms 2003 he again remounted the drive, since both the OS versions has the same filesystem no need of formating the remounted drives.
So all the Datafiles were present in the drives as it was before.
Before this, Additionally to be in safer side :
  1. We had the rman backup of Database and Spfile and controlfile.
  2. We also had a backup of control file by trace(ie: in text format).
  3. We also had a backup of updated spfile and pfile in text format.
So in this case what we did is,
Step 1 : We installed the Oracle 10.2.0.1 version in C: drive.
Step 2 : Apply patch 10.2.0.3 to the 10.2.0.1 software home in C: drive.
While patching we got an error as below

Workaround is to go to services.msc and stop the Distributed Transaction Coordinator services and retry.
After that it worked like charm. !
Step 3: After Applying the patch, Manually create the Oracle ADUMP,BDUMP,CDUMP,PFILE,DPDUMP folders in the “C:\oracle\admin\shat8\ “ location and copy the pfile (which we have a backup already) to the pfile directory in Oracle location “ c:\oracle\admin\shat8\pfile\ “.

Note:before going to step 4 update the pfile according to the changes in the new installation if any.

Step 4: Go to command prompt and create the service using ORADIM utility by using the upated backup pfile which we already taken.
C:\> Oradim –new –sid shat8 –pfile ‘c:\oracle\admin\shat8\pfile\init.ora’
Step 5: Create password file using orapwd like ORADIM.
C:\> set ORACLE_SID=shat8
C:\> orapwd file= password= entries=
Step 6: Since we have all the data files in the mounted drive itself don’t need to restore the datafiles from Rman Backup.

But Client has mistakenly remounted drives with different Drive letters (D: drive as E: drive <> E: drive as F: drive). So as per the Database controlfile records most of the datafiles are in E: drive and some of the datafiles are present in F: drive.
So what we did is we recreated the controlfile with the trace (text ) backup which we have already taken by updating the script with the changes (ie D: drive as E: drive and E: drive as F: drive) as below

C:\>Set Oracle_sid=shat8
C:\>Set Oracle_home=c:\oracle\product\10.2.0\db_1\
C:\>Cd %ORACLE_HOME%
C:\oracle\product\10.2.0\db_1\>sqlplus sys/****** as sysdba

///
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "SHAT8" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 10278
LOGFILE
GROUP 1 'E:\ORACLE10G\SHAT8\ADMIN\REDO01A.LOG' SIZE 100M,
GROUP 2 'E:\ORACLE10G\SHAT8\ADMIN\REDO02A.LOG' SIZE 100M,
GROUP 3 'E:\ORACLE10G\SHAT8\ADMIN\REDO03A.LOG' SIZE 100M,
GROUP 4 'E:\ORACLE10G\SHAT8\ADMIN\REDO04A.LOG' SIZE 100M
-- STANDBY LOGFILE
DATAFILE
'F:\ORACLE10G\SHAT8\ORADATA\SYSTEM01.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\UNDOTBS01.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\SYSAUX01.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\USERS01.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_BACH_A_01.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_BACH_A_01.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2005.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2006.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2007_Q1.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2007_Q2.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2007_Q3.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2007_Q4.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2008_Q1.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2008_Q2.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2008_Q3.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2008_Q4.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2005.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2006.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2007_Q1.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2007_Q2.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2007_Q3.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2007_Q4.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2008_Q1.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2008_Q2.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2008_Q3.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2008_Q4.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2005.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_BACH_DE_01.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2006.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2007_Q1.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2007_Q2.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_DE\INDX_BACH_DE_01.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2007_Q3.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2008_Q1.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2007_Q4.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2008_Q2.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_DE\INDX_DE_DATA_FY2005.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2008_Q3.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2008_Q4.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_DE\INDX_DE_DATA_FY2006.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_DE\INDX_DE_DATA_FY2007_Q1.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_DE\INDX_DE_DATA_FY2008_Q1.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_DE\INDX_DE_DATA_FY2007_Q2.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_DE\INDX_DE_DATA_FY2008_Q2.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_DE\INDX_DE_DATA_FY2007_Q3.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_DE\INDX_DE_DATA_FY2008_Q3.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_DE\INDX_DE_DATA_FY2007_Q4.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_DE\INDX_DE_DATA_FY2008_Q4.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\UNDOTBS02.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_DE\INDX_BACH_DE_02.DBF',
'F:\ORACLE\ORADATA\STAT\TS_DE_DATA_FY2009_Q1.ORA',
'F:\ORACLE\ORADATA\STAT\TS_DE_DATA_FY2009_Q2.ORA',
'F:\ORACLE\ORADATA\STAT\TS_DE_DATA_FY2009_Q3.ORA',
'F:\ORACLE\ORADATA\STAT\TS_DE_DATA_FY2009_Q4.ORA',
'F:\ORACLE\ORADATA\STAT\INDX_DE_DATA_FY2009_Q1.ORA',
'F:\ORACLE\ORADATA\STAT\INDX_DE_DATA_FY2009_Q2.ORA',
'F:\ORACLE\ORADATA\STAT\INDX_DE_DATA_FY2009_Q3.ORA',
'F:\ORACLE\ORADATA\STAT\INDX_DE_DATA_FY2009_Q4.ORA',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2009_Q1.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2009_Q2.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2009_Q3.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2009_Q4.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2010_Q1.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2010_Q2.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2010_Q3.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\TS_A_DATA_FY2010_Q4.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2009_Q1.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2009_Q2.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2009_Q3.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2009_Q4.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2010_Q1.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2010_Q2.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2010_Q3.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_A\INDX_A_DATA_FY2010_Q4.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2010_Q1.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2010_Q2.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2010_Q3.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\TS_DE_DATA_FY2010_Q4.DBF',
'E:\ORACLE10G\SHAT8\INDEX\BACH_DE\INDX_BACH_DE_03.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\BACH_DE04.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\INDX_BACH_A02.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_A\INDX_BACH_A03.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\INDX_DE_FY2008_Q3.DBF',
'F:\ORACLE10G\SHAT8\ORADATA\BACH_DE\INDX_DE_DATA_FY2008_Q2.DBF'
CHARACTER SET JA16SJIS
;

////
Step 7: Recover the database as mentioned in the controlfile trace
File. This step is followed as per the comment in the controlfile trace as below.

-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.

RECOVER DATABASE
-- All logs need archiving and a log switch is needed.

ALTER SYSTEM ARCHIVE LOG ALL;

Step 8: Open the database and add the temp file as below.
ALTER DATABASE OPEN;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.

ALTER TABLESPACE TEMP ADD TEMPFILE 'E:\ORACLE10G\SHAT8\ORADATA\TEMP01.ORA'
SIZE 10000M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP ADD TEMPFILE 'E:\ORACLE10G\SHAT8\ORADATA\TEMP027.DBF'
SIZE 4000M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP ADD TEMPFILE 'E:\ORACLE10G\SHAT8\ORADATA\TEMP026.DBF'
SIZE 4000M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP ADD TEMPFILE 'E:\ORACLE10G\SHAT8\ORADATA\TEMP025.DBF'
SIZE 4000M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP ADD TEMPFILE 'E:\ORACLE10G\SHAT8\ORADATA\TEMP024.DBF'
SIZE 2000M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP ADD TEMPFILE 'E:\ORACLE10G\SHAT8\ORADATA\TEMP023.DBF'
SIZE 2000M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP ADD TEMPFILE 'E:\ORACLE10G\SHAT8\ORADATA\TEMP022.DBF'
SIZE 2000M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP ADD TEMPFILE 'E:\ORACLE10G\SHAT8\ORADATA\TEMP021.DBF'
SIZE 2000M REUSE AUTOEXTEND OFF;
-- End of tempfile additions.

Step 9: create spfile from pfile=’c:\oracle\admin\shat8\pfile\init.ora’;
Step 10: Shutdown immediate
Step 11: Startup
Step 12: Now configure the listener using NETCA and NETMGR utility and configure the database with the listener and test from a client machine.

Finally check the components, number of datafiles,status of datafiles and check the archive log by switching the redo logs and do other basic checks.