Wednesday, 10 December 2014

SAR linux utility

Linux SAR - System Activity Report:
Monitoring how host is performing using sar command is best way check in case of any performance issue
It help give all report regarding.

  • RAM
  • Swap
  • Buffer/Cache
  • Run Queue
  • CPU
  • Network


1) RAM Usage
sar -r 5
2) Swap Usage
sar -S 5
3) Swap in swap out
sar -W 5
4) Buffer activity
sar -b 5
5) Load queue
sar -q 5
6) Load by CPU
sar -u 5
6) Network Traffic
sar -n DEV 5
DEV for eth0 and bond0 
other option TCP - Traffic





Sunday, 30 November 2014

Force plan to use Oracle

Forces a query to run using the same plan it had used on a previous tuning attempt to improve the query's performance.
 
The coe_xfr_sql_profile.sql  script generates another script that, in turn, contains the commands to create a manual custom SQL Profile out of a known plan that resides in RAM (library cache) or from the AWR dba_hist_sqlplan table. 



sqlt-coe_xfr_sql_profilesql -Useful tool in sqlt



Refer below  source code link for this fix:


http://kerryosborne.oracle-guy.com/scripts/coe.sql


Useful Oracle SQL's

--Run time Session logon and all logon since last reboot.
-------------------------------------------------------------
set lin 180
select
   rpad(c.name||':',11)||rpad(' current logons='||
   (to_number(b.sessions_current)),20)||'cumulative logons='||
   rpad(substr(a.value,1,10),10)||'highwater mark= '||
   b.sessions_highwater ||'   avg logon per_day= ' ||round(to_number(rpad(substr(a.value,1,10),10))/(sysdate-d.STARTUP_TIME))
   ||' Startup_date= '||d.STARTUP_TIME Information
from
   v$sysstat a,
   v$license b,
   v$database c,
   v$instance d
where
   a.name = 'logons cumulative'
/
set lin 180


---Another running Sql
set lin 10000
col sid for 999999999
col serial# for  9999999999
col osuer for a20
col SQL_TEXT for a70 wrap
col osuser for a10
col status for a10
--select sid,serial#, status, osuser,b.EXECUTIONS,b.DISK_READS, b.SQL_TEXT from v$session a,  v$sqlarea b
--where a.SQL_ADDRESS=b.ADDRESS
--and b.HASH_VALUE = a.SQL_HASH_VALUE
select sid,serial#, status, osuser,b.EXECUTIONS,b.DISK_READS, b.SQL_TEXT from v$session a,  v$sql b
where a.SQL_ADDRESS=b.ADDRESS
and b.HASH_VALUE = a.SQL_HASH_VALUE
order by 6 desc,5 desc
/


COLUMN name FORMAT A20;
col value for 999999999999
set lin 10000

--CLEAR SCREEN;
PROMPT DATABASE BUFFER CACHE STATISTICS:
SELECT
    SUM(DECODE(name, 'physical reads',value,0)) AS misses,
    SUM(DECODE(name, 'db block gets',value,0)) +
    SUM(DECODE(name, 'consistent gets',value,0)) AS hits,
    ROUND(100*(1-SUM(DECODE(name, 'physical reads',value,0))/
     (SUM(DECODE(name, 'db block gets',value,0)) +
    SUM(DECODE(name, 'consistent gets',value,0))) ),2) AS "HIT RATIO"
  FROM v$sysstat
 WHERE name IN
 ('db block gets','consistent gets','physical reads');
PROMPT  DICTIONARY CACHE STATISTICS:
SELECT SUM(getmisses) AS misses,
   SUM(gets) AS "HITS (EXECUTIONS)",
   ROUND(100*(1-(SUM(getmisses)/SUM(gets))),2) AS hit_ratio
  FROM v$rowcache;
PROMPT  LIBRARY CACHE STATISTICS:
SELECT SUM(reloads) AS misses,
   SUM(pins) AS "HITS (EXECUTIONS)",
   ROUND(100*(1-(SUM(reloads)/SUM(pins))),2) AS hit_ratio
  FROM v$librarycache;
PROMPT SORTING STATISTICS:
col VALUE for 9999999999999999
SELECT name, value
  FROM v$sysstat
 WHERE name IN ('sorts (memory)', 'sorts (disk)');




set lin 1000
col "Command Type" for a20
select CTYP "Command Type", OBJ "Name", 0 - EXEM   "Number of Executions" , GETS "Buffer Gets" ,
ROWP "Rows Processed" from (select distinct EXEM, CTYP, OBJ, GETS, ROWP
from ( select decode (S.COMMAND_TYPE ,  2, 'Insert into ' ,  3,'Select from ',  6, 'Update  of  ' ,  7, 'Delete from ' ,
26,'Lock    of  ') CTYP , O.OWNER || '.' || O.NAME    OBJ , sum(0 - S.EXECUTIONS)
EXEM  , sum(S.BUFFER_GETS) GETS  , sum(S.ROWS_PROCESSED) ROWP from V$SQL  S ,
V$OBJECT_DEPENDENCY D , V$DB_OBJECT_CACHE   O
where S.COMMAND_TYPE in (2,3,6,7,26)
and D.FROM_ADDRESS = S.ADDRESS and D.TO_OWNER = O.OWNER
and D.TO_NAME= O.NAME   and O.TYPE = 'TABLE'
--and O.OWNER NOT IN ('SYS','SYSTEM')
---and O.OWNER = upper('&user_name')
group by S.COMMAND_TYPE , O.OWNER  , O.NAME )  )
where ROWNUM <= 25
;
set lin 80


--- Sql cost with sql_id
set lin 1000
col c1 heading SQL|ID
col c2 heading Cost format 9,999,999
col c3 heading 'SQL Text' format a200 wrap
select p.sql_id c1,
       p.COST  c2,
       p.cpu_cost ,
       p.time,
       to_char(s.sql_text) c3
 from
    dba_hist_sql_plan p,
    dba_hist_sqltext s
where p.id=0
and p.sql_id = s.sql_id
and p.cost is not null
and p.sql_id = trim('&sql_id')
order by p.cost desc
/


col c1 heading SQL|ID
col c2 heading Cost format 9,999,999
col c3 heading 'SQL Text' format a200

set lin 10000
select sql_id , round((elapsed_time/1000000)/decode(nvl(executions,0),0,1,executions),5) avg_etime,  
   child_number, executions execs, CPU_TIME,ELAPSED_TIME, to_char(s.sql_text),
   buffer_gets/decode(nvl(executions,0),0,1,executions) avg_lio,
   sql_text, LAST_ACTIVE_TIME,SQL_PROFILE,PARSING_SCHEMA_NAME ,ROWS_PROCESSED , LAST_LOAD_TIME
   , disk_reads
from v$sql s
where sql_id = trim('&sql_id');
set lin 100

SET LINESIZE 145
SET PAGESIZE 9999

COLUMN sid                     FORMAT 999            HEADING 'SID'
COLUMN oracle_username         FORMAT a12            HEADING 'Oracle User'     JUSTIFY right
COLUMN os_username             FORMAT a9             HEADING 'O/S User'        JUSTIFY right
COLUMN session_program         FORMAT a18            HEADING 'Session Program' TRUNC
COLUMN session_machine         FORMAT a18             HEADING 'Machine'         JUSTIFY right TRUNC
COLUMN session_pga_memory      FORMAT 9,999,999,999  HEADING 'PGA Memory'
COLUMN session_pga_memory_max  FORMAT 9,999,999,999  HEADING 'PGA Memory Max'
COLUMN session_uga_memory      FORMAT 9,999,999,999  HEADING 'UGA Memory'
COLUMN session_uga_memory_max  FORMAT 9,999,999,999  HEADING 'UGA Memory MAX'

SELECT
    s.sid                sid
  , lpad(s.username,12)  oracle_username
  , lpad(s.osuser,9)     os_username
  , s.program            session_program
  , lpad(s.machine,8)    session_machine
  , (select ss.value from v$sesstat ss, v$statname sn
     where ss.sid = s.sid and 
           sn.statistic# = ss.statistic# and
           sn.name = 'session pga memory')        session_pga_memory
  , (select ss.value from v$sesstat ss, v$statname sn
     where ss.sid = s.sid and 
           sn.statistic# = ss.statistic# and
           sn.name = 'session pga memory max')    session_pga_memory_max
  , (select ss.value from v$sesstat ss, v$statname sn
     where ss.sid = s.sid and 
           sn.statistic# = ss.statistic# and
           sn.name = 'session uga memory')        session_uga_memory
  , (select ss.value from v$sesstat ss, v$statname sn
     where ss.sid = s.sid and 
           sn.statistic# = ss.statistic# and
           sn.name = 'session uga memory max')    session_uga_memory_max
FROM 
    v$session  s
ORDER BY session_pga_memory DESC
/

PRO Object list
break on report
compute sum of NO_OF_SEGS on report
compute sum of MB on report
col TEMP_TBS for a7
col DEFAULT_TABLESPACE for a10
col profile for a15
select profile, USERNAME,  count(*)NO_OF_SEGS ,sum(b.bytes)/1024/1024 MB, DEFAULT_TABLESPACE,TEMPORARY_TABLESPACE TEMP_TBS ,CREATED  
,ACCOUNT_STATUS from dba_users a, dba_segments b
where a.username=b.owner(+)
group by USERNAME,DEFAULT_TABLESPACE,TEMPORARY_TABLESPACE,CREATED,ACCOUNT_STATUS,profile
order by created,NO_OF_SEGS desc,mb desc
/
set line 80

Saturday, 12 April 2014

PITR -Point in time Recovery example.


RMAN> BACKUP DATABASE PLUS ARCHIVELOG;

DILIP@orcl> create table recotest as select * from tab;
Table created.
DILIP@orcl>select count(1) from recotest;
         COUNT(1)
1 row selected.
DILIP@orcl>
TO_CHAR(SYSDATE,'DD-
1 row selected.
DILIP@orcl> drop table recotest;
Table dropped.
DILIP@orcl>
RMAN> backup archivelog all;
Starting backup at 13-apr-2014 01:58:49
C:\app\Dilip\product\11.1.0\db_1\dbs>rman auxiliary / target sys/orcl@orcl

C:\app\Dilip\product\11.1.0\db_1\dbs>rman auxiliary / target sys/orcl@orcl
Recovery Manager: Release 11.1.0.6.0 - Production on Sun Apr 13 02:04:39 2014
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
connected to target database: ORCL (DBID=1218380266)
RMAN> run
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET until clause
Starting Duplicate Db at 13-APR-14
contents of Memory Script:
executing command: SET until clause
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 13-APR-14
channel ORA_AUX_DISK_1: starting datafile backup set restore
contents of Memory Script:
datafile 2 switched to datafile copy
contents of Memory Script:
executing command: SET until clause
Starting recover at 13-APR-14
starting media recovery
archived log for thread 1 with sequence 67 is already on disk as file C:\APP\DILIP\ORADATA\ORCLARCH\ARC00067_0784393201.001
contents of Memory Script:
database dismounted
connected to auxiliary database (not started)
Total System Global Area     150667264 bytes
Fixed Size                     1331740 bytes
contents of Memory Script:
executing command: SET NEWNAME
renamed tempfile 1 to C:\APP\DILIP\ORADATA\clone1\TEMP01.DBF in control file
cataloged datafile copy
cataloged datafile copy
cataloged datafile copy
cataloged datafile copy
cataloged datafile copy
cataloged datafile copy
cataloged datafile copy
datafile 2 switched to datafile copy
contents of Memory Script:
database opened
RMAN>
RMAN>
DILIP@clone1> select count(1) from recotest;
         COUNT(1)
1 row selected.





-----------------
              126


DILIP@orcl> select to_char(sysdate,'dd-mon-yyyy hh24:mi:ss') from dual;

--------------------
13-apr-2014 00:37:26    <--- need this date for point in time recovery







run
{
set newname for datafile 1 to 'C:\APP\DILIP\ORADATA\clone1\SYSTEM01.DBF';
set newname for datafile 2 to 'C:\APP\DILIP\ORADATA\clone1\SYSAUX01.DBF';
set newname for datafile 3 to 'C:\APP\DILIP\ORADATA\clone1\UNDOTBS01.DBF';
set newname for datafile 4 to 'C:\APP\DILIP\ORADATA\clone1\USERS01.DBF';
set newname for datafile 5 to 'C:\APP\DILIP\ORADATA\clone1\EXAMPLE01.DBF';
set newname for datafile 6 to 'C:\APP\DILIP\ORADATA\clone1\INDX01.DBF';
set newname for datafile 7 to 'C:\APP\DILIP\ORADATA\clone1\DILIP01.DBF';
set newname for datafile 8 to 'C:\APP\DILIP\ORADATA\clone1\FLS_TEST01.DBF';
set newname for tempfile 1 to 'C:\APP\DILIP\ORADATA\clone1\TEMP01.DBF';
set until time "to_date('13-apr-2014 00:37:26', 'dd-mon-yyyy hh24:mi:ss')";
DUPLICATE TARGET DATABASE TO clone1
LOGFILE
  GROUP 1 ('C:\APP\DILIP\ORADATA\clone1\t_log1.f')  SIZE 10m,
  GROUP 2 ('C:\APP\DILIP\ORADATA\clone1\t_log2.f') SIZE 10m;
}




connected to auxiliary database: CLONE1 (not mounted)

2> {
3> set newname for datafile 1 to 'C:\APP\DILIP\ORADATA\clone1\SYSTEM01.DBF';
4> set newname for datafile 2 to 'C:\APP\DILIP\ORADATA\clone1\SYSAUX01.DBF';
5> set newname for datafile 3 to 'C:\APP\DILIP\ORADATA\clone1\UNDOTBS01.DBF';
6> set newname for datafile 4 to 'C:\APP\DILIP\ORADATA\clone1\USERS01.DBF';
7> set newname for datafile 5 to 'C:\APP\DILIP\ORADATA\clone1\EXAMPLE01.DBF';
8> set newname for datafile 6 to 'C:\APP\DILIP\ORADATA\clone1\INDX01.DBF';
9> set newname for datafile 7 to 'C:\APP\DILIP\ORADATA\clone1\DILIP01.DBF';
10> set newname for datafile 8 to 'C:\APP\DILIP\ORADATA\clone1\FLS_TEST01.DBF';
11> set newname for tempfile 1 to 'C:\APP\DILIP\ORADATA\clone1\TEMP01.DBF';
12> set until time "to_date('13-apr-2014 00:37:26', 'dd-mon-yyyy hh24:mi:ss')";
13> DUPLICATE TARGET DATABASE TO clone1
14> LOGFILE
15>   GROUP 1 ('C:\APP\DILIP\ORADATA\clone1\t_log1.f')  SIZE 10m,
16>   GROUP 2 ('C:\APP\DILIP\ORADATA\clone1\t_log2.f') SIZE 10m;
17> }

using target database control file instead of recovery catalog










allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=97 device type=DISK
allocated channel: ORA_AUX_DISK_2
channel ORA_AUX_DISK_2: SID=96 device type=DISK
allocated channel: ORA_AUX_DISK_3
channel ORA_AUX_DISK_3: SID=95 device type=DISK

{
   set until scn  5084622;
   set newname for datafile  1 to
 "C:\APP\DILIP\ORADATA\CLONE1\SYSTEM01.DBF";
   set newname for datafile  2 to
 "C:\APP\DILIP\ORADATA\CLONE1\SYSAUX01.DBF";
   set newname for datafile  3 to
 "C:\APP\DILIP\ORADATA\CLONE1\UNDOTBS01.DBF";
   set newname for datafile  4 to
 "C:\APP\DILIP\ORADATA\CLONE1\USERS01.DBF";
   set newname for datafile  5 to
 "C:\APP\DILIP\ORADATA\CLONE1\EXAMPLE01.DBF";
   set newname for datafile  6 to
 "C:\APP\DILIP\ORADATA\CLONE1\INDX01.DBF";
   set newname for datafile  7 to
 "C:\APP\DILIP\ORADATA\CLONE1\DILIP01.DBF";
   set newname for datafile  8 to
 "C:\APP\DILIP\ORADATA\CLONE1\FLS_TEST01.DBF";
   restore
   clone database
   ;
}
executing Memory Script










using channel ORA_AUX_DISK_1
using channel ORA_AUX_DISK_2
using channel ORA_AUX_DISK_3

channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to C:\APP\DILIP\ORADATA\CLONE1\USERS01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00007 to C:\APP\DILIP\ORADATA\CLONE1\DILIP01.DBF
channel ORA_AUX_DISK_1: reading from backup piece C:\APP\DILIP\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2014_04_12\O1_MF_NNNDF_TAG20140412T232823_9NLZPFND_.BKP
channel ORA_AUX_DISK_2: starting datafile backup set restore
channel ORA_AUX_DISK_2: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_2: restoring datafile 00002 to C:\APP\DILIP\ORADATA\CLONE1\SYSAUX01.DBF
channel ORA_AUX_DISK_2: restoring datafile 00003 to C:\APP\DILIP\ORADATA\CLONE1\UNDOTBS01.DBF
channel ORA_AUX_DISK_2: restoring datafile 00008 to C:\APP\DILIP\ORADATA\CLONE1\FLS_TEST01.DBF
channel ORA_AUX_DISK_2: reading from backup piece C:\APP\DILIP\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2014_04_12\O1_MF_NNNDF_TAG20140412T232823_9NLZTGDZ_.BKP
channel ORA_AUX_DISK_3: starting datafile backup set restore
channel ORA_AUX_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_3: restoring datafile 00001 to C:\APP\DILIP\ORADATA\CLONE1\SYSTEM01.DBF
channel ORA_AUX_DISK_3: restoring datafile 00005 to C:\APP\DILIP\ORADATA\CLONE1\EXAMPLE01.DBF
channel ORA_AUX_DISK_3: restoring datafile 00006 to C:\APP\DILIP\ORADATA\CLONE1\INDX01.DBF
channel ORA_AUX_DISK_3: reading from backup piece C:\APP\DILIP\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2014_04_12\O1_MF_NNNDF_TAG20140412T232823_9NLZSLMH_.BKP
channel ORA_AUX_DISK_2: piece handle=C:\APP\DILIP\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2014_04_12\O1_MF_NNNDF_TAG20140412T232823_9NLZTGDZ_.BKP tag=TAG20140412T232823
channel ORA_AUX_DISK_2: restored backup piece 1
channel ORA_AUX_DISK_2: restore complete, elapsed time: 00:02:55
channel ORA_AUX_DISK_3: piece handle=C:\APP\DILIP\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2014_04_12\O1_MF_NNNDF_TAG20140412T232823_9NLZSLMH_.BKP tag=TAG20140412T232823
channel ORA_AUX_DISK_3: restored backup piece 1
channel ORA_AUX_DISK_3: restore complete, elapsed time: 00:03:15
channel ORA_AUX_DISK_1: piece handle=C:\APP\DILIP\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2014_04_12\O1_MF_NNNDF_TAG20140412T232823_9NLZPFND_.BKP tag=TAG20140412T232823
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:04:25
Finished restore at 13-APR-14
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONE1" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP  1 ( 'C:\APP\DILIP\ORADATA\clone1\t_log1.f' ) SIZE 10 M ,
  GROUP  2 ( 'C:\APP\DILIP\ORADATA\clone1\t_log2.f' ) SIZE 10 M
 DATAFILE
  'C:\APP\DILIP\ORADATA\CLONE1\SYSTEM01.DBF'
 CHARACTER SET WE8MSWIN1252

{
   switch clone datafile all;
}
executing Memory Script

input datafile copy RECID=1 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\UNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\USERS01.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\EXAMPLE01.DBF
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\INDX01.DBF
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\DILIP01.DBF
datafile 8 switched to datafile copy
input datafile copy RECID=7 STAMP=844740625 file name=C:\APP\DILIP\ORADATA\CLONE1\FLS_TEST01.DBF

{
   set until time  "to_date('13-apr-2014 00:37:26', 'dd-mon-yyyy hh24:mi:ss')";
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script


using channel ORA_AUX_DISK_1
using channel ORA_AUX_DISK_2
using channel ORA_AUX_DISK_3


archived log for thread 1 with sequence 68 is already on disk as file C:\APP\DILIP\ORADATA\ORCLARCH\ARC00068_0784393201.001
archived log file name=C:\APP\DILIP\ORADATA\ORCLARCH\ARC00067_0784393201.001 thread=1 sequence=67
archived log file name=C:\APP\DILIP\ORADATA\ORCLARCH\ARC00068_0784393201.001 thread=1 sequence=68
media recovery complete, elapsed time: 00:00:07
Finished recover at 13-APR-14

{
   shutdown clone immediate;
   startup clone nomount ;
}
executing Memory Script

Oracle instance shut down

Oracle instance started


Variable Size                 92278244 bytes
Database Buffers              50331648 bytes
Redo Buffers                   6725632 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONE1" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP  1 ( 'C:\APP\DILIP\ORADATA\clone1\t_log1.f' ) SIZE 10 M ,
  GROUP  2 ( 'C:\APP\DILIP\ORADATA\clone1\t_log2.f' ) SIZE 10 M
 DATAFILE
  'C:\APP\DILIP\ORADATA\CLONE1\SYSTEM01.DBF'
 CHARACTER SET WE8MSWIN1252

{
   set newname for tempfile  1 to
 "C:\APP\DILIP\ORADATA\clone1\TEMP01.DBF";
   switch clone tempfile all;
   catalog clone datafilecopy  "C:\APP\DILIP\ORADATA\CLONE1\SYSAUX01.DBF";
   catalog clone datafilecopy  "C:\APP\DILIP\ORADATA\CLONE1\UNDOTBS01.DBF";
   catalog clone datafilecopy  "C:\APP\DILIP\ORADATA\CLONE1\USERS01.DBF";
   catalog clone datafilecopy  "C:\APP\DILIP\ORADATA\CLONE1\EXAMPLE01.DBF";
   catalog clone datafilecopy  "C:\APP\DILIP\ORADATA\CLONE1\INDX01.DBF";
   catalog clone datafilecopy  "C:\APP\DILIP\ORADATA\CLONE1\DILIP01.DBF";
   catalog clone datafilecopy  "C:\APP\DILIP\ORADATA\CLONE1\FLS_TEST01.DBF";
   switch clone datafile all;
}
executing Memory Script



datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\SYSAUX01.DBF RECID=1 STAMP=844740669

datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\UNDOTBS01.DBF RECID=2 STAMP=844740670

datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\USERS01.DBF RECID=3 STAMP=844740671

datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\EXAMPLE01.DBF RECID=4 STAMP=844740672

datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\INDX01.DBF RECID=5 STAMP=844740674

datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\DILIP01.DBF RECID=6 STAMP=844740675

datafile copy file name=C:\APP\DILIP\ORADATA\CLONE1\FLS_TEST01.DBF RECID=7 STAMP=844740676

input datafile copy RECID=1 STAMP=844740669 file name=C:\APP\DILIP\ORADATA\CLONE1\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=844740670 file name=C:\APP\DILIP\ORADATA\CLONE1\UNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=844740671 file name=C:\APP\DILIP\ORADATA\CLONE1\USERS01.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=844740672 file name=C:\APP\DILIP\ORADATA\CLONE1\EXAMPLE01.DBF
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=844740674 file name=C:\APP\DILIP\ORADATA\CLONE1\INDX01.DBF
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=844740675 file name=C:\APP\DILIP\ORADATA\CLONE1\DILIP01.DBF
datafile 8 switched to datafile copy
input datafile copy RECID=7 STAMP=844740676 file name=C:\APP\DILIP\ORADATA\CLONE1\FLS_TEST01.DBF

{
   Alter clone database open resetlogs;
}
executing Memory Script

Finished Duplicate Db at 13-APR-14




-----------------
              126