Anda di halaman 1dari 204

MORE THAN 100 REAL TIME SCENARIOS WITH SOLVED ANSWERS

A HANDBOOK FOR DBAS

Published by ORACLE DBA TRAINEES TEAM

VERSION 1.0
NOV 2009
FOREWORD

This handbook contains some real time scenarios Oracle DBAs face in their
daily work. All questions in the book are fully solved. The book intends to
provide a quick reference to various queries and views which would be useful
in the daily work of a DBA.
ACKNOWLEDGEMENTS

We would like to express our sincere gratitude to all who have helped us in
bringing up this handbook.

Firstly, we would like to thank the AMEX-IM/CDM team for their valuable
support and encouragement.

We would like to thank Mr.Anup Krishnan, Portfolio Director, IM-CDM


Team, Mr.Padmanabha Reddy, Mr Ramesh.M, Mr.Dipak Laha, Mr.Vijay
Venkatesh and Mr.Suresh Karthik.

And last but not the least, a wholehearted thanks to our mentor,
Mr.Magudapathi.S, who with his constant support and guidance drove this
initiative into a success.

1.ora arch
2.storage structures
3.user admin
4.oracle utili
5.Backup rec
6.RMAN
7.v$
8query tuning
9AWR
TABLE OF CONTENTS
1 ORACLE ARCHITECTURE

1. CHECK WHETHER THE INSTANCES


RMANCAT,DONSDMP,DONSRCP IS UP OR NOT.

ANS:

APDWD506:NONE:[/USR/APP/ORACLE]> ps –aef | grep pmon

ORACLE 848028 1 0 JUN 11 - 0:24 ORA_PMON_DONSDMP


ORACLE 954504 1 0 JUN 11 - 0:24 ORA_PMON_RMANCAT
ORACLE 1085656 1 0 19:01:28 - 0:03 ORA_PMON_DONSRCP
ORACLE 1200218 1249384 0 01:40:51 PTS/8 0:00 GREP PMON

ORA_PMON_DONSDMP, ORA_PMON_RMANCAT, ORA_PMON_DONSRCP


shows that all these instances are up.

2. CHECK WHETHER THE DATABASE RMANCAT IS UP OR NOT.

ANS:

sql> select instance_name, status from v$instance;

INSTANCE_NAME STATUS
------------------------------------------
RMANCAT OPEN

(OR)

sql> select open_mode from v$database;

OPEN_MODE
----------
READ WRITE

Read write mode specifies RMANCAT is UP

3. IDENTIFY THE LOCATION OF PFILE,SPFILE,CONTROLFILE,LOG MEMBER


FOR RMANCAT.
ANS:

(A)
$ find / -name initRMANCAT.ora.

apdwd506:RMANCAT:[/usr/app/oracle/product/10.2.0/dbs]> ls

afiedt.buf lkDONSRCP
alert_DONSRCP.log lkRMANCAT
cd ls
hc_DONSDMP.dat orapwDONSDMP
hc_DONSRCP.dat orapwDONSRCP
hc_RMANCAT.dat orapwDONSRCP.bkp
init.ora orapwRMANCAT
initDONSDMP.ora orapwsid
initDONSDMP2.ora snapcf_DONSDMP.f
initDONSRCP.ora snapcf_DONSRCP.f
initDONSRCP.ora_bkpaug8 spfileDONSDMP.ora
initRMANCAT.ora spfileDONSDMP.ora.old
init_DONSDMP_jul29_bkp.ora spfileDONSRCP.ora.old
initdw.ora spfileRMANCAT.ora
lkDONSDMP sqlnet.log

Here default location of pfile is initRMANCAT.ora

The alertlog can give the non default location of pfile and spfile.

(B)

This can be displayed only when database is running on spfile.

sql> sho parameter spfile

NAME TYPE VALUE


----------------------------------- ---------------------------------------------------------------

SPFILE STRING /USR/APP/ORACLE/PRODUCT/10.2.0


/DBS/SPFILERMANCAT1.ORA

(C)
sql> show parameter control file

NAME TYPE VALUE


------------------------------------ ----------- ---------------------------------------------------------------------------------
CONTROL_FILE_RECORD_KEEP_TIME INTEGER 7
CONTROL_FILES STRING /TEST/RMANCAT/DBFILES/ORA_CONT
ROL1, /TEST/RMANCAT/DBFILES/OR
A_CONTROL2

(OR)

sql> select name from v$controlfile;


NAME
--------------------------------------------------------------------------------
/TEST/RMANCAT/DBFILES/ORA_CONTROL1
/TEST/RMANCAT/DBFILES/ORA_CONTROL2
(D)

sql> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

1 1 40 20971520 2 NO INACTIVE 555884 13-JUN-09

2 1 41 20971520 2 NO INACTIVE 556452 13-JUN-09

3 1 42 20971520 2 NO CURRENT 556588 13-JUN-09

(OR)

sql> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/TEST/RMANCAT/DBFILES/REDO1_1A
/TEST/RMANCAT/DBFILES/REDO1_1B
/TEST/RMANCAT/DBFILES/REDO1_2A
/TEST/RMANCAT/DBFILES/REDO1_2B

4. IDENTIFY WHETHER THE DATABASE RMANCAT IS SETUP IN ARCHIVE


LOG MODE.

ANS:

sql> select log_mode from v$database;

LOG_MODE
---------------------
NOARCHIVELOG

(OR)

sql> archive log list

DATABASE LOG MODE NO ARCHIVE MODE


AUTOMATIC ARCHIVAL DISABLED
ARCHIVE DESTINATION /USR/APP/ORACLE/PRODUCT/10.2.0/DBS/ARCH
OLDEST ONLINE LOG SEQUENCE 41
CURRENT LOG SEQUENCE 43

(OR)

NOTE:
Sql> select archiver from v$instance;

Archiver column has only one value i.e FAILED irrespective of the database in Archive or
Noarchivelog mode. Hence this query can not be used to fetch required information.

5. IDENTIFY SIZE OF THE SGA AND FIND WHETHER THE AUTO MEMORY
TUNING IS ENABLED.
ANS:

(A)
Sql> select * from v$sga;

NAME VALUE
-------------------- ----------------------------
FIXED SIZE 2071008
VARIABLE SIZE 113247776
DATABASE BUFFERS 8388608
REDO BUFFERS 6316032

(OR)

Sql> select component, current_size from v$sga_dynamic_components;

COMPONENT CURRENT_SIZE
-------------------------------------------------------------------------------------
SHARED POOL 88080384
LARGE POOL 0
JAVA POOL 25165824
STREAMS POOL 0
DEFAULT BUFFER CACHE 0
KEEP BUFFER CACHE 0
RECYCLE BUFFER CACHE 0
DEFAULT 2K BUFFER CACHE 0
DEFAULT 4K BUFFER CACHE 0
DEFAULT 8K BUFFER CACHE 0
DEFAULT 16K BUFFER CACHE 0
DEFAULT 32K BUFFER CACHE 0
ASM BUFFER CACHE 0
13 rows selected.

(B)

Sql> sho parameter sga;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
LOCK_SGA BOOLEAN FALSE
PRE_PAGE_SGA BOOLEAN FALSE
SGA_MAX_SIZE BIG INTEGER 124M
SGA_TARGET BIG INTEGER 0

Since the SGA_TARGET value is zero, so AUTO MEMORY TUNING is not enabled.

6. IDENTIFY ALL THE BACKGROUND PROCESS FOR THE INSTANCE.


ANS:

apdwd506:RMANCAT:[/usr/app/oracle]> ps -ef |grep RMANCAT

ORACLE 614566 1 0 JUN 11 - 0:03 ORA_MMON_RMANCAT


ORACLE 635070 1 0 JUN 11 - 0:51 ORA_MMNL_RMANCAT
ORACLE 733420 1 0 JUN 11 - 0:00 ORACLERMANCAT (DESCRIPTION=(LOCAL=YES)(A
DDRESS=(PROTOCOL=BEQ)))
ORACLE 745602 1 0 JUN 11 - 0:01 ORA_MMAN_RMANCAT
ORACLE 815244 1 0 JUN 11 - 0:00 ORA_RECO_RMANCAT
ORACLE 933894 1 0 JUN 11 - 0:07 ORA_CKPT_RMANCAT
ORACLE 942302 1 0 JUN 11 - 0:00 ORA_PSP0_RMANCAT
ORACLE 946400 1 0 JUN 11 - 0:07 ORA_SMON_RMANCAT
ORACLE 950354 1 0 JUN 11 - 0:00 ORACLERMANCAT (DESCRIPTION=(LOCAL=YES)(A
DDRESS=(PROTOCOL=BEQ)))
ORACLE 954504 1 0 JUN 11 - 0:24 ORA_PMON_RMANCAT
ORACLE 958630 1 0 JUN 11 - 0:00 ORA_QMNC_RMANCAT
ORACLE 970850 1 0 JUN 11 - 0:00 ORACLERMANCAT (DESCRIPTION=(LOCAL=YES)(A
DDRESS=(PROTOCOL=BEQ)))
ORACLE 983256 1 0 JUN 11 - 0:00 ORA_Q001_RMANCAT
ORACLE 1003622 1 0 21:31:41 - 0:11 ORA_CJQ0_RMANCAT
ORACLE 1007772 802994 0 01:46:58 - 0:00 ORACLERMANCAT
(DESCRIPTION=(LOCAL=YES)(A DDRESS=(PROTOCOL=BEQ)))
ORACLE 1028268 1 0 JUN 11 - 0:02 ORA_DBW0_RMANCAT
ORACLE 1040570 1 0 07:18:54 - 0:00 ORACLERMANCAT (DESCRIPTION=(LOCAL=YES)(A
DDRESS=(PROTOCOL=BEQ)))
ORACLE 1044694 1 0 JUN 11 - 0:00 ORA_Q000_RMANCAT
ORACLE 1064984 1 0 JUN 11 - 0:02 ORA_LGWR_RMANCAT
ORACLE 1089632 757786 0 07:49:45 - 0:00 ORACLERMANCAT
ORACLE 1216614 1220722 0 23:11:36 - 0:00 ORACLERMANCAT
(DESCRIPTION=(LOCAL=YES)(A DDRESS=(PROTOCOL=BEQ)))
ORACLE 1261762 1093800 0 01:38:20 - 0:00 ORACLERMANCAT
(DESCRIPTION=(LOCAL=YES)(A DDRESS=(PROTOCOL=BEQ)))
ORACLE 1273984 1228906 0 01:42:24 - 0:00 ORACLERMANCAT
(DESCRIPTION=(LOCAL=YES)(A DDRESS=(PROTOCOL=BEQ)))
ORACLE 1282180 974868 0 01:46:56 - 0:00 ORACLERMANCAT
(DESCRIPTION=(LOCAL=YES)(A DDRESS=(PROTOCOL=BEQ)))
ORACLE 1290384 1249384 0 01:57:51 PTS/8 0:00 GREP -I RMANCAT
ORACLE 1310874 1278130 0 01:56:57 PTS/15 0:00 CAT ALERT_RMANCAT.LOG
ORACLE 1319062 819426 0 01:57:28 - 0:00 ORACLERMANCAT
(DESCRIPTION=(LOCAL=YES)(A DDRESS=(PROTOCOL=BEQ)))

7. IDENTIFY THE SIZE OF DB BUFFER CACHE,LARGE POOL,SHARED POOL


FOR RMANCAT.
ANS:

sql> sho parameter db_cache_size;

NAME TYPE VALUE


------------------------------------ ----------- ----------------------------
DB_CACHE_SIZE BIG INTEGER 0

sql> sho parameter db_block_buffers;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
DB_BLOCK_BUFFERS INTEGER 1024

sql> select * from v$sga;

NAME VALUE
-------------------- ---------------------
FIXED SIZE 2071008 ------------ > BACKGROUD PROCESSES
VARIABLE SIZE 113247776 ------------ > SHARED+LARGE+JAVA POOL
DATABASE BUFFERS 8388608 ------------ > DATABASE BUFFER CACHE
REDO BUFFERS 6316032

sql> select component, current_size from v$sga_dynamic_components;

COMPONENT CURRENT_SIZE
-------------------------------------------------------------------------------------
SHARED POOL 88080384
LARGE POOL 0
JAVA POOL 25165824
STREAMS POOL 0
DEFAULT BUFFER CACHE 0
KEEP BUFFER CACHE 0
RECYCLE BUFFER CACHE 0
DEFAULT 2K BUFFER CACHE 0
DEFAULT 4K BUFFER CACHE 0
DEFAULT 8K BUFFER CACHE 0
DEFAULT 16K BUFFER CACHE 0
DEFAULT 32K BUFFER CACHE 0
ASM BUFFER CACHE 0
13 rows selected.

8. FORCE A CHECKPOINT MANUALLY

ANS:

sql> alter system switch logfile;

System altered.
sql> alter system checkpoint;

System altered.

apdwd506:rmancat:[/usr/app/oracle]> ps -ef |grep ckpt

oracle 913416 1 0 jun 11 - 0:10 ora_ckpt_donsdmp


oracle 933894 1 0 jun 11 - 0:07 ora_ckpt_rmancat
oracle 966722 1 0 19:01:28 - 0:01 ora_ckpt_donsrcp
oracle 1425626 1306850 0 02:49:04 pts/12 0:00 grep ckpt

9. DO A LOG SWITCH.

ANS:

sql> select group#, status from v$log;

GROUP# STATUS
---------- --------------------
1 INACTIVE
2 INACTIVE
3 CURRENT

sql> alter system switch logfile;

System altered.

sql> select group#, status from v$log;

GROUP# STATUS
---------- ----------------
1 CURRENT
2 INACTIVE
3 ACTIVE

10. CHECK WHETHER THE DATABASE IS RUNNING ON SPFILE. IF YES


IDENTIFY THE LOCATION OF SPFILE.

ANS:

SQL> select isspecified, count(*) from v$spparameter group by isspecified;

ISSPEC COUNT(*)
------ ---------------------
FALSE 259
If NO true values, database has started from pfile and not from spfile.

SQL> select name, value from v$parameter where name = 'spfile';

NAME VALUE
--------------------------------------------------------------------------------
spfile

SQL> show parameter spfile ;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
spfile string

The above two queries will display the spfile location if it is being used by the database only.

11. CREATE SPFILE FROM PFILE AND STARTUP THE DATABASE USING
SPFILE

ANS:

Sql> create spfile from pfile;

File created.

At the next startup only, the database uses the new spfile.

Sql> startup

NB: If the database is running on SPFILE already, then the above operation is not possible.

12. CREATE PFILE FROM SPFILE TO A NON DEFAULT LOCATION.

ANS:

Sql>create pfile='/ora/dogrc1p/backup01/oradata/rmancat1/pfile/initrmancat1_01.ora' from spfile;

File created.

13. CHECK THE ALERT LOG FOR ANY ERRORS.

ANS:

spdwd606:RMANCAT1:[/test/rmancat1/dbfiles/admin/RMANCAT1/bdump]>vi
alert_RMANCAT1.log
drop tablespace JR_LOCAL_TS including contents and datafiles
Sat Jun 13 03:19:07 2009
ORA-959 signalled during: drop tablespace JR_LOCAL_TS including contents and datafiles...

14. CHECK IF THERE ARE ANY OS ERRORS RELATED TO ORACLE.

ANS:

spdwd506:RMANCAT1:[/test/rmancat1/dbfiles/admin/RMANCAT1/cdump]>ls
TOTAL 0

No OS related errors are found in cdump.

15. CHECK OUT WHETHER THE PRARAMETER PROCESSES IS MODIFIABLE


WITHOUT STARTUP. ALTER THE NUMBER OF PROCESSES IN THE SPFILE
CHANGES FOR THE CURRENT SESSION AND MAKE IT PERSISTENT ACROSS
STARTUPS.
ANS:

A)

Sql> select name, isinstance_modifiable, issys_modifiable from v$parameter where name='processes';

NAME ISINS
--------------------------------------------------
PROCESSES FALSE

False indicates the parameter is static, therefore cannot be altered without startup.

B)

Sql> alter system set processes=180 scope=both;

system altered.

16. CHECK OUT WHETHER THE PRARAMETER SESSIONS IS MODIFIABLE


WITHOUT STARTUP.ALTER THE NUMBER OF SESSIONS IN THE SPFILE AND
THE CHANGES TO BE TAKEN PLACE ONLY AFTER NEXT STARTUP

ANS:

Sql> select isses_modifiable, issys_modifiable from v$parameter where name='sessions';

ISSES ISSYS_MOD
----- – ------------------------
FALSE FALSE

Sql> alter system set sessions=200 scope =spfile;

System altered.
17. ALTER THE SGAMAXSIZE IMMEDIATELY FOR THE CURRENT SESSION
AND PERSISTENT ACROSS STARTUPS

ANS:

SQL> select name, issys_modifiable from v$parameter where name='sga_max_size';

NAME ISSYS_MOD
----------------------------------------------------
sga_max_size FALSE

The FALSE value indicates that this initialization parameter cannot be modified.

18. FIND THE CURRENT DATA_BLOCK_SIZE AND FIND OUT WHETHER THAT
IS THE DEFAULT ONE.
ANS:

Sql> select name, value, isdefault from v$parameter where name='db_block_size';

NAME VALUE ISDEFAULT

--------------------------------------------------------------------------
db_block_size 8192 FALSE

Size can also be found from the following query.

Sql> sho parameter db_block_size

NAME TYPE VALUE


------------------------------------ ----------- -----------
DB_BLOCK_SIZE INTEGER 8192

19. VIEW THE INFORMATION IN THE CONTROL FILE.

ANS:

Sql> alter database backup controlfile to trace;

Database altered.

apdwd506:RMANCAT:[/test/rmancat/dbfiles/admin/RMANCAT/udump]>vi rmancat_ora_1396826.trc

Dump file /test/rmancat/dbfiles/admin/RMANCAT/udump/rmancat_ora_1396826.trc


Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
ORACLE_HOME = /usr/app/oracle/product/10.2.0
System name: AIX
Node name: apdwd506
Release: 2
Version: 5
Machine: 0004DF5ED700
Instance name: RMANCAT
Redo thread mounted by this instance: 1
Oracle process number: 35
Unix process pid: 1396826, image: oracle@apdwd506 (TNS V1-V3)

*** SERVICE NAME:(SYS$USERS) 2009-06-13 03:55:20.485


*** SESSION ID:(25.129) 2009-06-13 03:55:20.485
*** 2009-06-13 03:55:20.485
-- The following are current System-scope REDO Log Archival related
-- parameters and can be included in the database initialization file.
--
-- LOG_ARCHIVE_DEST=''
-- LOG_ARCHIVE_DUPLEX_DEST=''
--
-- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf
--
-- DB_UNIQUE_NAME="RMANCAT"
--
-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'
-- LOG_ARCHIVE_MAX_PROCESSES=2
-- STANDBY_FILE_MANAGEMENT=MANUAL
-- STANDBY_ARCHIVE_DEST=?/dbs/arch
-- FAL_CLIENT=''
-- FAL_SERVER=''
---- LOG_ARCHIVE_DEST_1='LOCATION=/usr/app/oracle/product/10.2.0/dbs/arch'
-- LOG_ARCHIVE_DEST_1='MANDATORY NOREOPEN NODELAY'
-- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM EXPEDITE NOVERIFY SYNC'
-- LOG_ARCHIVE_DEST_1='NOREGISTER NOALTERNATE NODEPENDENCY'
-- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED
NODB_UNIQUE_NAME'
-- LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'
-- LOG_ARCHIVE_DEST_STATE_1=ENABLE
--
-- Below are two sets of SQL statements, each of which creates a new
-- control file and uses it to open the database. The first set opens
"rmancat_ora_1396826.trc" 191 lines, 7353 characters

20. FIND OUT THE NUMBER OF LOG GROUPS FOR THE DATABASE AND THE
NUMBER OF MEMBERS FOR EACH GROUP.

ANS:

Sql> select group#, members from v$log;

GROUP# MEMBERS
---------- ---------------------
1 2
2 2
3 2

21. FIND OUT HOW MANY CONTROL FILES ARE THERE FOR THE DATABASE
AND THEIR LOCATIONS.

ANS:

Sql> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/TEST/RMANCAT/DBFILES/ORA_CONTROL1
/TEST/RMANCAT/DBFILES/ORA_CONTROL2

(OR)

sql> show parameter control file

NAME TYPE VALUE


------------------------------------ ----------- ---------------------------------------------------------------------------------------
CONTROL_FILE_RECORD_KEEP_TIME INTEGER 7
CONTROL_FILES STRING /TEST/RMANCAT/DBFILES/ORA_CONT
ROL1, /TEST/RMANCAT/DBFILES/OR
A_CONTROL2
22. FIND OUT THE ARCHIVE LOG LOCATION IF ANY.

ANS:

Sql> select destination from v$archive_dest;

DESTINATION
--------------------------------------------------------------------------------
/USR/APP/ORACLE/PRODUCT/10.2.0/DBS/ARCH


10 rows selected.

(OR)

Sql> archive log list


Database log mode Archive Mode
Automatic archival Enabled
Archive destination /usr/app/oracle/product/10.2.0/archive1/
Oldest online log sequence 14
Next log sequence to archive 16
Current log sequence 17
23. DESCRIBE V$PRAMETER VIEW AND UNDERSTAND EACH OF THE
COLUMN IN THAT.
ANS:

Sql> desc v$parameter;

NAME NULL? TYPE


----------------------------------------- -------- ----------------------------
NUM NUMBER
NAME VARCHAR2(80)
TYPE NUMBER
VALUE VARCHAR2(512)
DISPLAY_VALUE VARCHAR2(512)
ISDEFAULT VARCHAR2(9)
ISSES_MODIFIABLE VARCHAR2(5)
ISSYS_MODIFIABLE VARCHAR2(9)
ISINSTANCE_MODIFIABLE VARCHAR2(5)
ISMODIFIED VARCHAR2(10)
ISADJUSTED VARCHAR2(5)
ISDEPRECATED VARCHAR2(5)
DESCRIPTION VARCHAR2(255)
UPDATE_COMMENT VARCHAR2(255)
HASH NUMBER

DESCRIPTION

NUM NUMBER Parameter number


NAME VARCHAR2(80) Name of the parameter
TYPE NUMBER Parameter type:
1 - Boolean
2 - String
3 - Integer
4 - Parameter file
5 - Reserved
6 - Big integer
VALUE VARCHAR2(512) Parameter value for the session (if modified within the session);
otherwise, the instance-wide parameter value
DISPLAY_VALUE VARCHAR2(512) Parameter value in a user-friendly format. For example, if the
VALUE column shows the value 262144 for a big integer
parameter, then the DISPLAY_VALUE column will show the
value 256K.
ISDEFAULT VARCHAR2(9) Indicates whether the parameter is set to the default value
(TRUE) or the parameter value was specified in the parameter
file (FALSE)
ISSES_MODIFIABLE VARCHAR2(5) Indicates whether the parameter can be changed with ALTER
SESSION (TRUE) or not (FALSE)
ISSYS_MODIFIABLE VARCHAR2(9) Indicates whether the parameter can be changed with ALTER
SYSTEM and when the change takes effect:
IMMEDIATE - Parameter can be changed with ALTER
SYSTEM regardless of the type of parameter file used to start
the instance. The change takes effect immediately.
DEFERRED - Parameter can be changed with ALTER
SYSTEM regardless of the type of parameter file used to start
the instance. The change takes effect in subsequent sessions.
FALSE - Parameter cannot be changed with ALTER SYSTEM
unless a server parameter file was used to start the instance. The
change takes effect in subsequent instances.
ISINSTANCE_MODIFIABLE VARCHAR2(5) For parameters that can be changed with ALTER SYSTEm,
indicates whether the value of the parameter can be different for
every instance (TRUE) or whether the parameter must have the
same value for all Real Application Clusters instances (FALSE).
If the ISSYS_MODIFIABLE column is FALSE, then this
column is always FALSE.
ISMODIFIED VARCHAR2(10) Indicates whether the parameter has been modified after
instance startup:
MODIFIED - Parameter has been modified with ALTER
SESSION
SYSTEM_MOD - Parameter has been modified with ALTER
SYSTEM (which causes all the currently logged in sessions'
values to be modified)
FALSE - Parameter has not been modified after instance startup
ISADJUSTED VARCHAR2(5) Indicates whether Oracle adjusted the input value to a more
suitable value (for example, the parameter value should be
prime, but the user input a non-prime number, so Oracle
adjusted the value to the next prime number)
ISDEPRECATED VARCHAR2(5) Indicates whether the parameter has been deprecated (TRUE) or
not (FALSE)
DESCRIPTION VARCHAR2(255) Description of the parameter
UPDATE_COMMENT VARCHAR2(255) Comments associated with the most recent update
HASH NUMBER Hash value for the parameter name
2 ORACLE STORAGE STRUCTURES

1. FIND OUT ALL THE TABLESPACES PRESENT IN THE DATABASE.

ANS:

Sql> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
UNDO1
SYSAUX
TEMP
JR_LOCAL_TS1
5 rows selected.
(OR)

Sql> select name from v$tablespace;

NAME
------------------------------
SYSTEM
UNDO1
SYSAUX
TEMP
JR_LOCAL_TS1

5 rows selected.

2. FIND OUT ALL THE DATAFILES FOR THE TABLESPACE AND ITS PATH
ANS:

Sql> select file_name, tablespace_name from dba_data_files;

FILE_NAME TABLESPACE_NAME
--------------------------------------------------------------------------------------------------------
/TEST/RMANCAT/DBFILES/SYSTEM_01 SYSTEM
/TEST/RMANCAT/DBFILES/SYSTEM_02 SYSTEM
/TEST/RMANCAT/DBFILES/UNDO1_01 UNDO1
/TEST/RMANCAT/DBFILES/SYSAUX.DBF SYSAUX

19 rows selected.
3) FIND OUT ALL THE DIFFERENT SEGMENT TYPES IN THE DATABASE
ANS:

Sql> select distinct object_type from dba_objects;

OBJECT_TYPE
-------------------
INDEX
JOB CLASS
CONTEXT
TYPE BODY
PROCEDURE
RESOURCE PLAN
RULE
SCHEDULE
TABLE PARTITION
WINDOW
WINDOW GROUP

OBJECT_TYPE
-------------------
TABLE
TYPE
VIEW
LIBRARY
FUNCTION
TRIGGER
PROGRAM
CLUSTER
SYNONYM
PACKAGE BODY
QUEUE

OBJECT_TYPE
-------------------
CONSUMER GROUP
EVALUATION CONTEXT
RULE SET
DIRECTORY
UNDEFINED
OPERATOR
SEQUENCE
LOB
PACKAGE
JOB
INDEX PARTITION

OBJECT_TYPE
-------------------
LOB PARTITION
34 ROWS SELECTED.

4) CREATE A LOCALLY MANAGED TABLESPACE LOCAL_TS WITH


PCT_INCREASE 20,EXTENT ALLOCATION AUTO AND SIZE 100 MB
ANS:

Sql> create tablespace local_ts_pp datafile '/test/rmancat/dbfiles/local_ts_pp.dbf' size 100m autoextend


on maxsize 100m default storage (initial 20m pctincrease 20);

Tablespace created.

5) ADD A DATAFILE TO THIS TABLESPACE. DATAFILE SIZE TO BE 50 MB

ANS:

Sql> alter tablespace local_ts_pp add datafile '/test/rmancat/dbfiles/local_ts_pp_01.dbf' size 50m;

Tablespace altered.

6) CREATE A BIG FILE TABLESPACE


ANS:

Sql> create bigfile tablespace tbs_pp datafile '/test/rmancat/dbfiles/tbs_pp.dbf' size 100m;

Tablespace created.

7) TAKE THE TABLESPACE LOCAL_TS OFFLINE/ONLINE


ANS:

Sql> alter tablespace local_ts_pp offline;

Tablespace altered.

Sql> select tablespace_name, status from dba_tablespaces where tablespace_name='LOCAL_TS_PP';

TABLESPACE_NAME STATUS
------------------------------ ---------------------------
LOCAL_TS_PP OFFLINE

Sql> alter tablespace local_ts_pp online;

Tablespace altered.

Sql> select tablespace_name,status from dba_tablespaces where tablespace_name='LOCAL_TS_PP';

TABLESPACE_NAME STATUS
------------------------------ ---------
LOCAL_TS_PP ONLINE
8) PUT THE TABLESPACE IN BACKUP MODE
ANS:

Sql> alter tablespace local_ts_pp begin backup;

Tablespace altered.

9) CREATE A TEMPORARY TABLESPACE


ANS:

Sql> create temporary tablespace temp_pp tempfile '/test/rmancat/dbfiles/temp_pp' size 10M;

Tablespace created.

10) CHECK HOW THE EXTENT MANAGEMENT IS HAPPENING FOR THE


SYSTEM TABLESPACE
ANS:

Sql> select tablespace_name, extent_management from dba_tablespaces where


tablespace_name='SYSTEM';

TABLESPACE_NAME EXTENT_MAN
------------------------------ ---------------------------------------
SYSTEM LOCAL

11) REDUCE THE DATAFILE SIZE TO BE 30 MB


ANS:

Sql> alter database datafile '/test/rmancat/dbfiles/tbs_pp.dbf' resize 30M;

Database altered.

Sql>select file_name, bytes/1024/1024 from dba_data_files where file_name =


'/test/rmancat/dbfiles/tbs_pp.dbf';

FILE_NAME BYTES/1024/1024
---------------------------------------------------------------------------------------------------
/TEST/RMANCAT/DBFILES/TBS_PP.DBF 30

12) INCREASE THE DATAFILE SIZE TO 75 MB


ANS:

Sql>alter database datafile '/test/rmancat/dbfiles/tbs_pp.dbf' resize 75M;

Database altered.

Sql>select file_name, bytes/1024/1024 from dba_data_files where file_name =


'/test/rmancat/dbfiles/tbs_pp.dbf';
FILE_NAME BYTES/1024/1024
------------------------------------------------------------------------------------------
/TEST/RMANCAT/DBFILES/TBS_PP.DBF 75

13) DROP THE DATAFILE

ANS:

Sql> alter tablespace users01 drop datafile '/ora/dogrc1p/backup01/oradata/rmancat1/dbfiles/test.dbf';

Tablespace altered.

14) CREATE A TABLE PROJECT WITH FOLLOWING COLUMNS IN THE


TABLESPACE LOCAL_TS

ID NOT NULL NUMBER


PROJCLASS NOT NULL VARCHAR2(8)
DESCRIPTION NOT NULL VARCHAR2(40)
SHORTDESC NOT NULL VARCHAR2(15)
DATABASE2 VARCHAR2(15)
BURDENCODE VARCHAR2(8)
APPLYBLABOR NOT NULL NUMBER(1)
APPLYBMATERIALS NOT NULL NUMBER(1)
APPLYBEQUIPMENT NOT NULL NUMBER(1)
APPLYBEXPENSES NOT NULL NUMBER(1)
OVERHEADCODE VARCHAR2(8)
APPLYOLABOR NOT NULL NUMBER(1)
APPLYOMATERIALS NOT NULL NUMBER(1)
APPLYOEQUIPMENT NOT NULL NUMBER(1)
APPLYOEXPENSES NOT NULL NUMBER(1)

ANS:

Sql> create table project_pp (id number not null,


projclass varchar2(8) not null,
description varchar2(40) not null,
shortdesc varchar2(15) not null,
database2 varchar2(15),
burdencode varchar2(8),
applyblabor number(1) not null,
applybmaterials number(1) not null,
applybequipment number(1) not null,
applybexpenses number(1) not null,
overheadcode varchar2(8),
applyolabor number(1) not null,
applyomaterials number(1) not null,
applyoequipment number(1) not null,
applyoexpenses number(1) not null) tablespace local_ts_pp;

Table created.

Sql> desc project_pp;

NAME NULL? TYPE


----------------------------------------- -------- ----------------------------
ID NOT NULL NUMBER
PROJCLASS NOT NULL VARCHAR2(8)
DESCRIPTION NOT NULL VARCHAR2(40)
SHORTDESC NOT NULL VARCHAR2(15)
DATABASE2 VARCHAR2(15)
BURDENCODE VARCHAR2(8)
APPLYBLABOR NOT NULL NUMBER(1)
APPLYBMATERIALS NOT NULL NUMBER(1)
APPLYBEQUIPMENT NOT NULL NUMBER(1)
APPLYBEXPENSES NOT NULL NUMBER(1)
OVERHEADCODE VARCHAR2(8)
APPLYOLABOR NOT NULL NUMBER(1)
APPLYOMATERIALS NOT NULL NUMBER(1)
APPLYOEQUIPMENT NOT NULL NUMBER(1)
APPLYOEXPENSES NOT NULL NUMBER(1)

Sql> select table_name, tablespace_name from dba_tables where table_name ='PROJECT_PP';

TABLE_NAME TABLESPACE_NAME
------------------------------ ----------------------------------
PROJECT_PP LOCAL_TS_PP

15) CREATE THE FOLLOWING TABLE AUDIT WITH CLOB IN A BIG FILE
TABLESPACE

ID NOT NULL NUMBER


SESSION_ID NOT NULL NUMBER
NAME NOT NULL VARCHAR2(80)
VALUE CLOB
CREATED_DATE NOT NULL DATE
CREATED_BY NOT NULL NUMBER
LAST_UPDATED_DATE NOT NULL DATE
LAST_UPDATED_BY NOT NULL NUMBER

ANS:

Sql> create table audit_pp


(id number not null,
Session_id number not null,
Name varchar2(80) not null,
Value clob,
Created_date date not null,
Created_by number not null,
Last_updated_date date not null,
Last_updated_by number not null) tablespace tbs_pp;

Table created.

Sql> desc audit_pp

NAME NULL? TYPE


----------------------------------------- -------- ----------------------------
ID NOT NULL NUMBER
SESSION_ID NOT NULL NUMBER
NAME NOT NULL VARCHAR2(80)
VALUE CLOB
CREATED_DATE NOT NULL DATE
CREATED_BY NOT NULL NUMBER
LAST_UPDATED_DATE NOT NULL DATE
LAST_UPDATED_BY NOT NULL NUMBER

16) CREATE PRIMARY KEY ON TABLE PROJECT ON THE COLUMN ID. CREATE
FOREIGN KEY ON ID COLUMN IN AUDIT TABLE REFERRING TO PROJECT
ANS:

(A)

Sql> alter table project_pp add constraint pro_pk_pp primary key(id);

Table altered.

(B)

Sql> alter table audit_pp add constraint aud_fk_pp foreign key(id) references project_pp(id);

Table altered.

17) DROP THE COLUMN DESCRIPTION IN TABLE PROJECT AND ALTER THE
TABLE AUDIT TO MODIFY THE COLUMN LAST_UPDATED_DATE AS
LAST_UPDATED_TIMESTAMP, WITH DEFAULT VALUE AS CURRENT
TIMESTAMP

ANS:

(A)

Sql> alter table project_pp drop column description;

Table altered.

(B)
Sql> alter table newaudit_pp rename column last_updated_date to last_updated_timestamp;

Table altered.

Sql> alter table newaudit_pp modify (last_updated_timestamp default systimestamp);

Table altered

18) RENAME THE TABLE AUDIT AS NEWAUDIT AND CHECK OUT THE
FOREIGN KEY ON NEWAUDIT IS STILL IN VALID CONDITION

ANS:

(A)

Sql> alter table audit_pp rename to newaudit_pp;

Table altered.

Sql> desc newaudit_pp;

NAME NULL? TYPE


----------------------------------------- -------- ----------------------------
ID NOT NULL NUMBER
SESSION_ID NOT NULL NUMBER
NAME NOT NULL VARCHAR2(80)
VALUE CLOB
CREATED_DATE NOT NULL DATE
CREATED_BY NOT NULL NUMBER
LAST_UPDATED_DATE NOT NULL DATE
LAST_UPDATED_BY NOT NULL NUMBER

(B)

Sql>select constraint_name, constraint_type, table_name, status, invalid from dba_constraints where


constraint_name='aud_fk_pp';

CONSTRAINT_NAME C TABLE_NAME STATUS INVALID


------------------------------ - ------------------------------ -------- ------------------------------
AUD_FK_PP R NEWAUDIT_PP ENABLED

19) CREATE A TEMPORARY TABLE WHICH HAS GOT SAME COLUMNS AS


AUDIT IN QUESTION 15

ANS:

Sql> create global temporary table temp_aud_pp as select * from audit_pp;

Table created.
Sql> desc temp_aud_pp
NAME NULL? TYPE
----------------------------------------- -------- ----------------------------
ID NOT NULL NUMBER
SESSION_ID NOT NULL NUMBER
NAME NOT NULL VARCHAR2(80)
VALUE CLOB
CREATED_DATE NOT NULL DATE
CREATED_BY NOT NULL NUMBER
LAST_UPDATED_TIMESTAMP NOT NULL DATE
LAST_UPDATED_BY NOT NULL NUMBER

20) CREATE AN UNIQUE INDEX ON COLUMN AUDIT(ID). CONCATENATED


INDEX ON PROJECT (PROJCLASS, DESCRIPTION, SHORTDESC)

ANS:

(A)

Sql> create unique index idx_aud_id on audit_pp(id);

Index created.

(B)

WE HAVE DELETED THE DESCRIPTIOPN COLUMN FROM THE TABLE SO CREATING ONCE
AGAIN.

Sql> alter table project_pp add(description varchar2(40) not null);

Table altered.

Sql> desc project_pp

NAME NULL? TYPE


----------------------------------------- -------- ----------------------------
ID NOT NULL NUMBER
PROJCLASS NOT NULL VARCHAR2(8)
SHORTDESC NOT NULL VARCHAR2(15)
DATABASE2 VARCHAR2(15)
BURDENCODE VARCHAR2(8)
APPLYBLABOR NOT NULL NUMBER(1)
APPLYBMATERIALS NOT NULL NUMBER(1)
APPLYBEQUIPMENT NOT NULL NUMBER(1)
APPLYBEXPENSES NOT NULL NUMBER(1)
OVERHEADCODE VARCHAR2(8)
APPLYOLABOR NOT NULL NUMBER(1)
APPLYOMATERIALS NOT NULL NUMBER(1)
APPLYOEQUIPMENT NOT NULL NUMBER(1)
APPLYOEXPENSES NOT NULL NUMBER(1)
DESCRIPTION NOT NULL VARCHAR2(40)

Sql> create index idx_pro_3 on project_pp (projclass, description, shortdesc);

Index created.

21) CREATE A INDEX ON PROJECT(OVERHEADCODE).

ANS:

Sql> create index idx_proj_pp on project_pp(overheadcode);

Index created.

22) FIND OUT ALL THE INDEXES CREATED ON THE TABLE PROJECT.

ANS:

Sql> select owner,index_name,table_name from dba_indexes where table_name ='project_pp';

OWNER INDEX_NAME TABLE_NAME


-------------------------- ---------------------------------------------------------------------
MAGU PRO_PK_PP PROJECT_PP
MAGU IDX_PRO_3 PROJECT_PP
MAGU IDX_PROJ_PP PROJECT_PP

23) CREATE A VIEW SAMPLE ON THE TABLES PROJECT, ADUIT MATCHED BY


COLUMN ID, CONTAINING THE FOLLOWING COLUMNS

ID NOT NULL NUMBER


PROJCLASS NOT NULL VARCHAR2(8)
DESCRIPTION NOT NULL VARCHAR2(40)
SHORTDESC NOT NULL VARCHAR2(15)
DATABASE2 VARCHAR2(15)
BURDENCODE VARCHAR2(8)
SESSION_ID NOT NULL NUMBER
NAME NOT NULL VARCHAR2(80)
LAST_UPDATED_DATE NOT NULL DATE
LAST_UPDATED_BY NOT NULL NUMBER

ANS:

Sql> create or replace view sample_pp


As select p.id,projclass, shortdesc,
Database2,burdencode,session_id,name,
Last_updated_timestamp,last_updated_by
From project_pp p,audit_pp a
Where p.id=a.id;

View created.

24) CREATE VIEW TEST WHICH DOES A SELECT ON THE TABLE AUDIT AND
DOES A GROUP BY COLUMN CREATED_DATE.

ANS:

Sql> create view test_pp as select count(*) col1,created_date from audit_pp group by created_date;

View created.

Sql> desc test_pp

NAME NULL? TYPE


----------------------------------------- -------- ----------------------------
COL1 NUMBER
CREATED_DATE NOT NULL DATE

25) TRY TO INSERT INTO THE VIEW SAMPLE AND TEST.

ANS:

Sql> insert into sample_pp values(001,'a','new','rmancat1','a12',57,'magu','21-may-09',3);

INSERT INTO SAMPLE_PP VALUES(001,'A','NEW','RMANCAT1','A12',57,'MAGU','21-MAY-


09',3)
*
ERROR AT LINE 1:
ORA-01776: CANNOT MODIFY MORE THAN ONE BASE TABLE THROUGH A JOIN VIEW

(B)

Sql> insert into test_pp values(1,sysdate);


Insert into test_pp values(1,sysdate)
*
ERROR AT LINE 1:
ORA-01733: VIRTUAL COLUMN NOT ALLOWED HERE

26) CREATE A SEQUENCE ID_SEQ THAT STARTS FROM 1 AND HAS GOT A
MAXIMUM VALUE 1000000 WHICH INCREMENTS BY 5.

ANS:

Sql> create sequence seq_pp


2 start with 1
3 maxvalue 1000000
4 increment by 5;
Sequence created.

27) FIND OUT THE NEXT VALUE, PREVIOUS VALUE AND CURRENT VALUE OF
ID_SEQ.

ANS:

Sql> select seq_pp.nextval from dual;

NEXTVAL
-------------------
1

Sql> select seq_pp.currval from dual;

CURRVAL
-------------------
1
THERE IS NO PREVIOUS VALUE OPTION IN ANY SEQUENCE.

28) CREATE A TABLE EMPLOYEE WITH COLUMNS


ID NUMBER
FNAME VARCHAR2(100)
LNAME VARCHAR2(100)
SEX CHAR(1)
EMAIL VARCHAR2(50)

ANS:

Sql> create table employee_pp


(id number,
Fname varchar2(100),
Lname varchar2(100),
Sex char(1),
Email varchar2(50));

Table created.

29) INSERT 5 RECORDS INTO THE TABLE EMPLOYEE BY SELECTING VALUES


FROM THE SEQUENCE

ANS:

Sql> insert into employee_pp values (seq_pp.nextval, '&fname', '&lname', '&sex', '&email');

Sql> select * from employee_pp;

ID FNAME LNAME S EMAIL


- ------------------------------------------------------------------------------------------------------
11 PURBASHA SAHOO F PURBA_1@YAHOO.COM

16 PRIYA RAY F PRIYA12@YAHOO.COM

21 BIRAJA MOH M JSGHJSGD@TCS.COM

26 SATISH PARIDA M GFHGAFDJADJ@TCS.COM

31 KUNAL KAPOOR M KUNAL_12@YAHOO.COM

30) RESTART THE SEQUENCE FROM 1000 AND SELECT VALUES FROM THE
SEQUENCE

ANS:

TO RESTART ANY SEQUENCE AT A DIFFERENT NUMBER, IT MUST BE DROPPED AND RE-


CREATED.
A)
Sql> drop sequence seq;

Sequence dropped.

Sql> create sequence seq


2 start with 1000
3 increment by 4;

Sequence created.

WE CAN NOT SELECT CURRENT VALUE OF A SEQUENCE FOR THE FIRST TIME AFTER ITS
CREATION, IT HAS TO BE PRECEEDED BY SELECTING NEXTVALUE ONCE
B)

Sql> select seq.nextval from dual;

NEXTVAL
----------
1000

Sql> select seq.currval from dual;

CURRVAL
----------
1000

31) FIND OUT THE NUMBER OF TABLES, VIEWS, PROCEDURES, FUNCTIONS,


AND SEQUENCES ON YOUR DATABASE.
ANS:

SQL> SELECT COUNT(*),OBJECT_TYPE FROM DBA_OBJECTS WHERE OBJECT_TYPE IN


('TABLE','VIEW','PROCEDURE','FUNCTION','SEQUENCE') GROUP BY OBJECT_TYPE;

COUNT(*) OBJECT_TYPE
---------- -------------------
44 PROCEDURE
966 TABLE
3071 VIEW
59 FUNCTION
106 SEQUENCE

32) FIND OUT THE NUMBER OF TABLES, VIEWS, PROCEDURES, FUNCTIONS,


AND SEQUENCES ON YOUR DATABASE FOR EACH OWNER.

ANS:

SQL> SELECT OWNER,OBJECT_TYPE,COUNT(*) FROM DBA_OBJECTS WHERE


OBJECT_TYPE IN ('TABLE','VIEW','PROCEDURE','FUNCTION','SEQUENCE') GROUP BY
OWNER,OBJECT_TYPE;

OWNER OBJECT_TYPE COUNT(*)


------------------------------ ------------------- ----------
SYS VIEW 2949
WMSYS VIEW 102
WMSYS PROCEDURE 1
TEST260_2 TABLE 4
DBSNMP TABLE 21
DBSNMP SEQUENCE 2
DBSNMP VIEW 1
SYSTEM VIEW 12
OUTLN PROCEDURE 1
WMSYS TABLE 42
WMSYS FUNCTION 3
MAGU TABLE 54
MAGU VIEW 7
MAGU PROCEDURE 2
SYS SEQUENCE 71
SYSTEM TABLE 139
SYS PROCEDURE 39
SYS FUNCTION 56
WMSYS SEQUENCE 9
SYSTEM SEQUENCE 20
MINU TABLE 1
SYS TABLE 695
OUTLN TABLE 3
SYSTEM PROCEDURE 1
MAGU SEQUENCE 4
NTEST3 TABLE 4
NTEST1 TABLE 1
TEST260_1 TABLE 1
TSMSYS TABLE 1

33) TRUNCATE THE TABLE AUDIT AND DROP STORAGE.

ANS:

SQL> TRUNCATE TABLE AUDIT_PP DROP STORAGE;

TABLE TRUNCATED.

34) FIND OUT THE SIZE OF EACH TABLESPACE AND THE FREE SPACE
AVAILABLE.

ANS:

SQL> SELECT * FROM (


2 SELECT C.TABLESPACE_NAME,
ROUND(A.BYTES/1048576,2) MB_ALLOCATED,
3 4 ROUND(B.BYTES/1048576,2) MB_FREE,
5 ROUND((A.BYTES-B.BYTES)/1048576,2) MB_USED,
6 ROUND(B.BYTES/A.BYTES * 100,2) TOT_PCT_FREE,
7 ROUND((A.BYTES-B.BYTES)/A.BYTES,2) * 100 TOT_PCT_USED
8 FROM (SELECT TABLESPACE_NAME,
9 SUM(A.BYTES) BYTES
10 FROM SYS.DBA_DATA_FILES A
GROUP BY TABLESPACE_NAME) A,
11 12 (SELECT A.TABLESPACE_NAME,
13 NVL(SUM(B.BYTES),0) BYTES
14 FROM SYS.DBA_DATA_FILES A,
15 SYS.DBA_FREE_SPACE B
16 WHERE A.TABLESPACE_NAME = B.TABLESPACE_NAME (+)
17 AND A.FILE_ID = B.FILE_ID (+)
GROUP BY A.TABLESPACE_NAME) B,
18 19 SYS.DBA_TABLESPACES C
20 WHERE A.TABLESPACE_NAME = B.TABLESPACE_NAME(+)
AND A.TABLESPACE_NAME = C.TABLESPACE_NAME
21 22 ) WHERE TOT_PCT_USED >=0
23 ORDER BY TABLESPACE_NAME;

TABLESPACE_NAME MB_ALLOCATED MB_FREE MB_USED TOT_PCT_FREE


------------------------------ ------------ ---------- ---------- ------------
TOT_PCT_USED
------------
AMRUTHA 500 499.69 .31 99.94
0

AMRU_LOCAL_TS 200 199.88 .13 99.94


0
:
:
27 ROWS SELECTED.

35) FIND OUT THE SIZE OF EACH DATAFILE AND THE FREE SPACE
AVAILABLE IN EACH OF THE DATAFILE.

ANS:

SQL> SELECT DF.AUTOEXTENSIBLE


"AUTOEXTENT",SUBSTR(DF.TABLESPACE_NAME,1,20) "TABLESPACE NAME",
2 SUBSTR(DF.FILE_NAME,1,50) "FILE NAME",
3 ROUND(DF.BYTES/1024/1024,2) "SIZE (M)",
4 ROUND(DF.MAXBYTES/1024/1024,2) "SIZE (MAXMBYTES)",
5 ROUND(E.USED_BYTES/1024/1024,2) "USED (M)",
6 ROUND(F.FREE_BYTES/1024/1024,2) "FREE (M)",
7 RPAD(' '|| RPAD ('X',ROUND(E.USED_BYTES*10/DF.BYTES,0), 'X'),11,'-') "% USED"
FROM DBA_DATA_FILES DF,
(SELECT FILE_ID,
8 SUM(DECODE(BYTES,NULL,0,BYTES)) USED_BYTES
FROM DBA_EXTENTS
9 10 11 12 GROUP BY FILE_ID) E,
(SELECT MAX(BYTES) FREE_BYTES,
13 14 FILE_ID
15 FROM DBA_FREE_SPACE
16 GROUP BY FILE_ID) F
17 WHERE DF.TABLESPACE_NAME='LOCAL_TS_RS' AND E.FILE_ID (+) = DF.FILE_ID
18 AND DF.FILE_ID = F.FILE_ID (+)
19 ORDER BY DF.TABLESPACE_NAME,
20 DF.FILE_NAME;

AUT TABLESPACE NAME FILE NAME


--- -------------------- --------------------------------------------------
SIZE (M) SIZE (MAXMBYTES) USED (M) FREE (M) % USED
---------- ---------------- ---------- ---------- -----------
NO LOCAL_TS_RS /TEST/RMANCAT/DBFILES/LOCAL_TS_RS.DBF
20 0 .06 19.88 ----------

36) FIND OUT WHETHER A TABLESPACE IS AUTO EXTENDIBLE OR NOT.

ANS:

SQL> SELECT FILE_NAME,TABLESPACE_NAME,AUTOEXTENSIBLE FROM


DBA_DATA_FILES WHERE TABLESPACE_NAME= ‘LOCAL_TS_PP';

FILE_NAME ` TABLESPACE_NAME AUT


---------------------------------------------------------------------------------------------------
/ora/DOGRC1P/backup01/oradata/RMANCAT/dbfiles/LOCAL_TS_PP.dbf
LOCAL_TS_PP NO

37) FIND THE PRIMARY KEYS AVAILABLE IN ALL THE TABLE AND CHECK
IN WHAT TABLES THEY ARE REFERRED TO.

ANS:

SQL> SELECT OWNER,CONSTRAINT_NAME,TABLE_NAME FROM DBA_CONSTRAINTS


WHERE CONSTRAINT_TYPE=’P’;

OWNER CONSTRAINT_NAME
------------------------------ ------------------------------
TABLE_NAME
------------------------------
DBSNMP BSLN_BASELINES_PK
MGMT_BSLN_BASELINES

DBSNMP BSLN_DATASOURCES_PK
MGMT_BSLN_DATASOURCES
.
.
.
.

376 ROWS SELECTED.

38) CHECK WHETHER THERE ARE ANY INVALID INDEXES

ANS:

SQL> SELECT OWNER,INDEX_NAME,STATUS FROM DBA_INDEXES WHERE STATUS !=


'VALID';

OWNER INDEX_NAME STATUS


------------------------------ ------------------------------ --------
SYS WRH$_SERVICE_WAIT_CLASS_PK N/A
SYS WRH$_SERVICE_STAT_PK N/A
SYS WRH$_TABLESPACE_STAT_PK N/A
SYS WRH$_ACTIVE_SESSION_HISTORY_PK N/A
SYS WRH$_INST_CACHE_TRANSFER_PK N/A
SYS WRH$_DLM_MISC_PK N/A
SYS WRH$_SEG_STAT_PK N/A
.
.
.
.
57 ROWS SELECTED.
39) REBUILD ALL THE INDEXES SUCH THAT IT WILL NOT CAUSE ANY
OUTAGE TO THE TABLE.

ANS:

SQL>ALTER INDEX INDEX_PP REBUILD ONLINE;

INDEX ALTERED.

40) DISABLE THE FOREIGN KEY CONSTRAINT ON THE AUDIT TABLE AND
INSERT A RECORD INTO AUDIT AND ENABLE THE CONSTRAINT AGAIN

ANS:

(A)

SQL> ALTER TABLE AUDIT_PP DISABLE CONSTRAINT AUD_FK_PP;

TABLE ALTERED.

(B)

SQL> INSERT INTO AUDIT_PP VALUES(003,78,'DIPA','CLOB_TRIED',SYSDATE,4,


SYSDATE,5);

1 ROW CREATED.

SQL> SELECT * FROM AUDIT_PP;

ID SESSION_ID
---------- ----------
NAME
--------------------------------------------------------------------------------
VALUE
--------------------------------------------------------------------------------
CREATED_D CREATED_BY LAST_UPDA LAST_UPDATED_BY
--------- ---------- --------- ---------------
3 78
DIPA
CLOB_TRIED
20-JUN-09 4 20-JUN-09 5

(C)
SQL> ALTER TABLE AUDIT_PP ENABLE CONSTRAINT AUD_FK_PP;
ALTER TABLE AUDIT_PP ENABLE CONSTRAINT AUD_FK_PP
*
ERROR AT LINE 1:
ORA-02298: CANNOT VALIDATE (MAGU.AUD_FK_PP) - PARENT KEYS NOT FOUND
3 USER ADMINISTRATION AND SECURITY

1) CREATE A USER TEST AND PASSWORD TEST123 WITH DEFAULT


TABLESPACE AS USERS AND ACCOUNT UNLOCKED AND THE USER HAS TO
CHANGE THE PASSWORD ON NEXT LOGIN

ANS:

SQL> CREATE USER TEST_PP IDENTIFIED BY TEST123 DEFAULT TABLESPACE USERS


ACCOUNT UNLOCK PASSWORD EXPIRE;

USER CREATED .
2) CREATE A USER TEST1 AND PASSWORD TEST1234 WITH DEFAULT
TABLESPACE AS USERS WITH 10MB QUOTA ON THE TABLESPACE –
ACCOUNT UNLOCKED

ANS:

SQL> CREATE USER TEST1_PP IDENTIFIED BY TEST1234 QUOTA 10M ON USERS


ACCOUNT UNLOCK;

USER CREATED.

3) CREATE A TABLE EMPLOYEE WITH COLUMNS EMPNO, EMPNAME AND


EMAIL IN THE SCHEMA TEST AND INSERT SOME SAMPLE RECORDS

ANS:

SQL> CONN TEST_PP


ENTER PASSWORD:
ERROR:
ORA-28001: THE PASSWORD HAS EXPIRED

CHANGING PASSWORD FOR TEST_PP


NEW PASSWORD:
RETYPE NEW PASSWORD:
ERROR:
ORA-01045: USER TEST_PP LACKS CREATE SESSION PRIVILEGE; LOGON DENIED
SQL> CREATE TABLE EMPLOYEE_PP(EMPNO NUMBER,
2 EMPNAME VARCHAR2(40),
3 EMAIL VARCHAR2(40));
TABLE CREATED.

SQL> INSERT INTO EMPLOYEE_PP VALUES(100, 'AAA','AAA@QWERTY.COM');

1 ROW CREATED.

SQL> INSERT INTO EMPLOYEE_PP VALUES(101,'BBB','BBB@QWERTY.COM');

1 ROW CREATED.

SQL> INSERT INTO EMPLOYEE_PP VALUES(102,'CCC','CCC@QWERTY.COM');

1 ROW CREATED.

4) OPEN AN OTHER SESSION AND TRY TO DROP THE USER TEST. DO ALL
THAT IS POSSIBLE TO DROP THE USER TEST.

ANS:

SQL> DROP USER TEST_PP;


DROP USER TEST_PP
*
ERROR AT LINE 1:
ORA-01940: CANNOT DROP A USER THAT IS CURRENTLY CONNECTED

SQL> SELECT SID,SERIAL#,USERNAME FROM V$SESSION WHERE USERNAME ='TEST_PP';

SID SERIAL# USERNAME


---------- ---------- ------------------------------
281 921 TEST_PP

SQL> ALTER SYSTEM KILL SESSION '281,921';

SYSTEM ALTERED.

THE SESSION IS KILLED

SQL> SELECT * FROM V$SESSION;


SELECT * FROM V$SESSION
*
ERROR AT LINE 1:
ORA-00028: YOUR SESSION HAS BEEN KILLED

5) FIND OUT WHO ARE THE USERS IN THE DATABASE AND ALL THEIR
DEFAULT TABLESPACE AND DEFAULT TEMPORARY TABLESPACE
ANS:

SQL> SELECT USERNAME, DEFAULT_TABLESPACE , TEMPORARY_TABLESPACE FROM


DBA_USERS;

USERNAME DEFAULT_TABLESPACE
------------------------------ ------------------------------
TEMPORARY_TABLESPACE
------------------------------
STUDENT USERS
TEMP

MAGU USERS
TEMP

SYSTEM SYSTEM
TEMP
.
.
.
24 ROWS SELECTED.

6) FIND OUT ALL THE USERS CREATED ON THE DATABASE BEFORE TODAY

ANS:

SQL> SELECT USERNAME,CREATED FROM DBA_USERS WHERE CREATED<SYSDATE;

USERNAME CREATED
------------------------------ ---------
STUDENT 20-JUN-09
MAGU 09-JUN-09
SYSTEM 04-JUN-09
SYS 04-JUN-09
RAMYA 20-JUN-09
HEADMASTER 20-JUN-09
NHEADMASTER 20-JUN-09
TEST_PP 20-JUN-09
DIVYA 16-JUN-09
NAYAK 16-JUN-09
NTEST1 20-JUN-09
OUTLN 04-JUN-09
MINU 16-JUN-09
PERFSTAT 16-JUN-09
TEST1_PP 20-JUN-09
NTEST3 20-JUN-09
TEST260_1 20-JUN-09
NTEACHER 20-JUN-09
TEACHER 20-JUN-09
TEST260_2 20-JUN-09
DIP 04-JUN-09
TSMSYS 04-JUN-09
WMSYS 04-JUN-09
DBSNMP 04-JUN-09

24 ROWS SELECTED.

7) FIND OUT WHICH ALL THE USERS HAVE GOT UNLIMITED QUOTA ON THE
TABLESPACES

ANS:

SQL> SELECT USERNAME, TABLESPACE_NAME FROM DBA_TS_QUOTAS WHERE


MAX_BYTES=-1;

USERNAME TABLESPACE_NAME
------------------------------ ------------------------------
PERFSTAT JR_LOCAL_TS
MINU RISHMA
NAYAK JR_LOCAL_TS

8) CONNECT AS USER TEST1 AND SEE WHETHER YOU ARE ABLE TO


CONNECT TO THE DATABASE. GRANT ALL THE PRIVILEGES THAT ARE
NECESSARY TO CONNECT TO THE DATABASE

ANS:

SQL> GRANT CREATE SESSION TO TEST1_PP;


GRANT CREATE SESSION TO TEST1_PP
*
ERROR AT LINE 1:
ORA-01031: INSUFFICIENT PRIVILEGES

SQL> GRANT CREATE SESSION TO TEST_PP WITH ADMIN OPTION;

GRANT SUCCEEDED.

SQL> GRANT CREATE SESSION TO TEST1_PP;

GRANT SUCCEEDED.

9) TRY TO CREATE A TABLE SAMPLE IN TEST1 AND SEE WHETHER YOU ARE
ABLE TO CREATE THE TABLE. IF NOT GRANT ALL THE REQUIRED
PRIVILEGES TO CREATE THE TABLE

ANS:

SQL> GRANT CREATE SESSION, CREATE ANY TABLE TO TEST1_PP;

GRANT SUCCEEDED.
SQL> CONN TEST1_PP
ENTER PASSWORD:
CONNECTED.

SQL> CREATE TABLE SAMPLE (ID NUMBER,NAME VARCHAR2(20));

TABLE CREATED.

10) CREATE AN OTHER USER TEST2 AND GRANT HIM SELECT, INSERT,
UPDATE AND DELETE ON THE TABLE SAMPLE WHICH IS IN THE SCHEMA
TEST1.

ANS:

SQL> CREATE USER TEST2_PP IDENTIFIED BY TEST2_PP ;

USER CREATED.

SQL> GRANT SELECT,INSERT,UPDATE,DELETE ON TEST1_PP.SAMPLE TO TEST2_PP;

GRANT SUCCEEDED.

11) CREATE THE SAME TABLE EMPLOYEE IN TEST2 SCHEMA AND GRANT
ALL PRIVILEGES TO TEST1
ANS:

SQL> CREATE TABLE EMPLOYEE1_PP(EMPNO NUMBER,


2 EMPNAME VARCHAR2(40),
3 EMAIL VARCHAR2(40));

TABLE CREATED.

SQL> GRANT SELECT,INSERT,UPDATE,DELETE ON EMPLOYEE1_PP TO TEST1_PP;

GRANT SUCCEEDED.

12) CREATE THE FOLLOWING TABLES IN TEST2 SCHEMA

STUDENT TABLE:
ROLLNO NUMBER(5)
NAME VARCHAR2(20)
AVERAGE NUMBER(5)
SEMESTER CHAR(1)
AGE NUMBER(5)
PRIMARY KEY ON ROLLNO
SUBJECT TABLE:
SUBID CHAR(1)
SUB VARCHAR(10)
TUTOR VARCHAR(10)
PRIMARY KEY ON SUBID

MARKS TABLE:
ROLLNO NUMBER(5)
SUBID CHAR(1)
MARKS NUMBER(5)

FOREIGN KEY ON ROLLNO AND SUBID REFERENCING STUDENT AND


SUBJECT TABLE

ANS:

SQL> CREATE TABLE STUDENT_PP


(ROLLNO NUMBER(5),
2 NAME VARCHAR2(20),
3 AVERAGE NUMBER(5),
4 SEMESTER CHAR(1),
5 AGE NUMBER(5),
6 CONSTRAINT STUPK1 PRIMARY KEY(ROLLNO));

TABLE CREATED.

SQL> CREATE TABLE SUBJECT_PP


(SUBID CHAR(1),
2 SUB VARCHAR2(10),
3 TUTOR VARCHAR2(10),
4 CONSTRAINT SUBPK1 PRIMARY KEY(SUBID));

TABLE CREATED.

SQL> CREATE TABLE MARKS_PP


(ROLLNO NUMBER(5),
2 SUBID CHAR(1),
3 MARKS NUMBER(5),
4 CONSTRAINT MARKSFK1 FOREIGN KEY (ROLLNO) REFERENCES
STUDENT_PP(ROLLNO),
5 CONSTRAINT MARKSFK2 FOREIGN KEY (SUBID) REFERENCES
SUBJECT_PP(SUBID));

TABLE CREATED.

13) CREATE A ROLE TUTOR SUCH THAT IT HAS


SELECT,INSERT,UPDATE,DELETE ON MARKS TABLE AND SELECT ON
STUDENT TABLE
ANS:

SQL> CREATE ROLE TUTOR_PP;

ROLE CREATED.

SQL> GRANT SELECT, INSERT,UPDATE,DELETE ON TEST2_PP.MARKS_PP TO TUTOR_PP;

GRANT SUCCEEDED.

SQL> GRANT SELECT ON TEST2_PP.STUDENT_PP TO TUTOR_PP;

GRANT SUCCEEDED.

14) CREATE ROLE HM SUCH THAT IT HAS SELECT,INSERT,UPDATE AND


DELETE ON SUBJECT TABLE AND SELECT ON MARKS TABLE AND STUDENT
TABLE

ANS:

SQL> CREATE ROLE HM_PP;

ROLE CREATED.

SQL> GRANT SELECT ,INSERT,UPDATE, DELETE ON TEST2_PP.SUBJECT_PP TO HM_PP;

GRANT SUCCEEDED.

SQL> GRANT SELECT ON TEST2_PP.MARKS_PP TO HM_PP;

GRANT SUCCEEDED.

SQL> GRANT SELECT ON TEST2_PP.STUDENT_PP TO HM_PP;

GRANT SUCCEEDED.

15) CREATE USER TEACHER AND GRANT THE ROLE TUTOR TO HIM AND
CREATE USER HEADMASTER AND GRANT THE ROLE HM TO HIM

ANS:

SQL> CREATE USER TEACHER_PP IDENTIFIED BY PASSWORD;

USER CREATED.

SQL> GRANT TUTOR_PP TO TEACHER_PP;


GRANT SUCCEEDED.

SQL> CREATE USER HEADMASTER_PP IDENTIFIED BY PASSWORD;

USER CREATED.

SQL> GRANT HM_PP TO HEADMASTER_PP;

GRANT SUCCEEDED.

16) REVOKE THE SELECT PRIVILEGE OF TUTOR FROM MARKS AND


STUDENTS TABLE AND REVOKE THE DELTE PRIVILEGE FROM HM ROLE ON
SUBJECT TABLE

ANS:

SQL> REVOKE SELECT ON TEST2_PP.MARKS_PP FROM TUTOR_PP;

REVOKE SUCCEEDED.

SQL> REVOKE SELECT ON TEST2_PP.STUDENT_PP FROM TUTOR_PP;

REVOKE SUCCEEDED.

SQL> REVOKE DELETE ON TEST2_PP.SUBJECT_PP FROM HM_PP;

REVOKE SUCCEEDED.

17) FIND OUT WHAT ARE THE ROLES IN THE DATABASE

ANS:

SQL> SELECT ROLE FROM DBA_ROLES;

ROLE
------------------------------
CONNECT
RESOURCE
DBA
SELECT_CATALOG_ROLE
EXECUTE_CATALOG_ROLE
DELETE_CATALOG_ROLE
HS_ADMIN_ROLE
OEM_ADVISOR
OEM_MONITOR
TUTOR_PP
:
:
TUTOR_RIS
HM_PP
JR_HM

25 ROWS SELECTED.

18) FIND OUT WHAT PRIVILEGES EACH ROLE HAS GOT

ANS:

WE CAN QUERY ROLE_SYS_PRIVS FOR SYSTEM PRIVILEGES AND


ROLE_TAB_PRIVS FOR OBJECT PRIVILEGES.

SQL> SELECT ROLE ,PRIVILEGE FROM ROLE_SYS_PRIVS WHERE ROLE='DBA';

ROLE PRIVILEGE
------------------------------ ----------------------------------------
DBA CREATE TABLE
DBA DELETE ANY TABLE
.
.
DBA ALTER ANY RULE
DBA EXECUTE ANY PROGRAM
DBA EXECUTE ANY CLASS
DBA MANAGE SCHEDULER
DBA MANAGE ANY FILE GROUP

160 ROWS SELECTED.

SQL> SELECT ROLE, PRIVILEGE, TABLE_NAME FROM ROLE_TAB_PRIVS WHERE


ROLE='TUTOR_PP';

ROLE PRIVILEGE TABLE_NAME


---------------------------------------------------------------------------------------------------
TUTOR_PP UPDATE MARKS_PP
TUTOR_PP DELETE MARKS_PP
TUTOR_PP INSERT MARKS_PP

19) CHECK OUT WHAT ARE THE PRIVILEGES YOU HAVE FOR YOUR SESSION

ANS:
SQL> SELECT * FROM SESSION_PRIVS;

PRIVILEGE
----------------------------------------
ALTER SYSTEM
AUDIT SYSTEM
CREATE SESSION
ALTER SESSION
ALTER ANY TABLE
.
.
.
CREATE ANY DIRECTORY
DROP ANY DIRECTORY
CREATE TYPE
CREATE ANY TYPE
CREATE EXTERNAL JOB

166 rows selected.

20) MAKE THE ROLE HM AS PASSWORD ENABLED.

ANS:

SQL> ALTER ROLE HM_PP IDENTIFIED BY PASSWORD;

ROLE ALTERED.

21) CREATE USER STUDENT AND CREATE ROLE STUD WHICH HAS GOT ONLY
SELECT ON THE TABLE STUDENT.

ANS:

SQL> CREATE USER STUDENT_PP IDENTIFIED BY PASSWORD;

USER CREATED.

SQL> CREATE ROLE STUD_PP;

ROLE CREATED.

SQL> GRANT SELECT ON TEST2_PP.STUDENT_PP TO STUD_PP;

GRANT SUCCEEDED.

22) GRANT THE ROLE STUD TO STUDENT

ANS:

SQL> GRANT STUD_PP TO STUDENT_PP;

GRANT SUCCEEDED.
23) MAKE STUD AS STUDENT’S DEFAULT ROLE

ANS:

SQL> ALTER USER STUDENT_PP DEFAULT ROLE STUD_PP;

USER ALTERED.

24) CHECK OUT WHAT ARE THE SYSTEM PRIVILEGES GIVEN TO USER
STUDENT AND TEACHER

ANS:

SQL> SELECT USERNAME , PRIVILEGE, ADMIN_OPTION FROM USER_SYS_PRIVS


WHERE USERNAME IN (STUDENT_PP,TEACHER_PP);

USERNAME PRIVILEGE ADM


------------------------------ ---------------------------------------- ---
TEACHER_PP CREATE SESSION NO

STUDENT_PP CREATE SESSION NO

25) CREATE A PROFILE LIMIT THAT HAS PASSWORD EXPIRED AFTER 3


MONTHS.

ANS:
SQL> CREATE PROFILE PROFILE1_PP LIMIT PASSWORD_LIFE_TIME 90;

PROFILE CREATED.

26) ALSO MAKE THE PROFILE LIMIT SUCH THAT IT TIMES OUT AFTER 30
MINUTES OF NO ACTIVITY AND IT CAN MAKE ONLY 2 SESSIONS AT A TIME

ANS:
SQL> ALTER PROFILE PROFILE1_PP LIMIT IDLE_TIME 30;

PROFILE ALTERED.

SQL> ALTER PROFILE PROFILE1_PP LIMIT SESSIONS_PER_USER 2;

PROFILE ALTERED.

27) ASSIGN THE PROFILE LIMIT TO STUDENT

ANS:
SQL> ALTER USER STUDENT_PP PROFILE PROFILE1_PP;

USER ALTERED.

28) ALTER THE PROFILE LIMIT SUCH THAT THE PASSWORD EXPIRES AFTER
2 MONTHS ALSO THE PASSWORD CASE SENSITIVE

ANS:

SQL> ALTER PROFILE PROFILE1_PP LIMIT PASSWORD_LIFE_TIME 60;

PROFILE ALTERED.

29) FIND OUT ALL THE PROFILES IN THE DATABASE.

ANS:

SQL> SELECT DISTINCT PROFILE AS PROFS FROM DBA_PROFILES ;

PROFS
------------------------------
JR_PROFILE1
PROFILE1_PP
DEFAULT
4 ORACLE UTILITIES

1) CREATE A TRIGGER ON A TABLE STUDENT SO THAT FOR EACH INSERT


TO THE TABLE THE TRIGGER FIRES AND UPDATES THE DEPARTMENT
TABLE DEPENDING ON THE STUDENT TABLE VALUE.

STUDENT: ROLLNO NUMBER(5) -> PRIMARY KEY


NAME VARCHAR2(20)
MARKS NUMBER(5)
AGE NUMBER(5)

DEPARTMENT: ROLLNO NUMBER(5) -> PRIMARY KEY


DEPT_NAME VARCHAR2(10)

ANS:

sql> create table student_pp (


rollno number(5) constraint stud_roll_pk primary key,
name varchar2(20),
marks number(5),
age number(5));

Table created.

sql> create table department_pp(


rollno number(5),
dept_name varchar2(10),
foreign key (rollno) references student_pp (rollno));

Table created.

sql> alter table department_pp add primary key (rollno);

Table altered.

sql> create or replace trigger trig_pp


after insert
on student_pp
for each row
declare
dep varchar2(10);
begin
dep:='&dep';
insert into department_pp values (:new.rollno,dep);
end;
/

Trigger created.

2) CREATE THE EMP TABLE IN TEXT/TEXT123 SCHEMA USING THE


FOLLOWING DEFINITION

EMPID NUMBER(5)
EMPNAME VARCHAR2(20)
DESIGNATION VARCHAR2(10)
SALARY NUMBER(10)
COMPANYNAME VARCHAR2(15));

ANS:

sql> conn text/text123

Connected.

sql> create table emp_pp(


empid number(5),
empname varchar2(20),
designation varchar2(10),
salary number(10),
companyname varchar2(15));

Table created.

TRANSFERING DATAFILES TO REQUIRED LOCATION

$ ftp <ip_address>

ftp> get data1.sql

(similarly for data2.sql to data6.sql)

POPULATE THE EMP TABLE USING SQLLOADER

(A) WHEN THE TABLE IS EMPTY - > DATA1.SQL


ANS:

$ sqlldr parfile=par1.par

sql*loader: release 10.2.0.3.0 - production on wed jul 15 06:19:12 2009

copyright (c) 1982, 2005, oracle. all rights reserved.

load completed - logical record count 25.

PARAMETER FILE (PAR1.PAR)

userid = text/text123
control = '/ora/dogrc1p/backup01/oradata/rmancat1/ctl1.ctl'
log = '/ora/dogrc1p/backup01/oradata/rmancat1/lg1.log'
bad = '/ora/dogrc1p/backup01/oradata/rmancat1/bd1.txt'
discard = '/ora/dogrc1p/backup01/oradata/rmancat1/dis1.txt'
direct = true

CONTROL FILE (CTL1.CTL)

load data
infile '/ora/dogrc1p/backup01/oradata/rmancat1/data1.sql'
insert into table emp_pp
fields terminated by '|' optionally enclosed by " "
(
empid integer external,
empname char,
designation char,
salary integer external,
companyname char
)

sql> select count(*) from emp_pp1;

COUNT(*)
--------------------
25

(B) AFTER LOADING, APPEND SOME DATA TO EMP -> DATA2.SQL

ANS:
$ sqlldr parfile=par2.par

sql*loader: release 10.2.0.3.0 - production on wed jul 15 06:19:12 2009

copyright (c) 1982, 2005, oracle. all rights reserved.

load completed - logical record count 30.

PARAMETER FILE (PAR2.PAR)

userid = text/text123
control = '/ora/dogrc1p/backup01/oradata/rmancat1/ctl2.ctl'
log = '/ora/dogrc1p/backup01/oradata/rmancat1/lg2.log'
bad = '/ora/dogrc1p/backup01/oradata/rmancat1/bd2.txt'
discard = '/ora/dogrc1p/backup01/oradata/rmancat1/dis2.txt'
direct = true

CONTROL FILE (CTL2.CTL)

load data
infile '/ora/dogrc1p/backup01/oradata/rmancat1/data2.sql'
append into table emp_pp
fields terminated by '|' optionally enclosed by " "
(
empid integer external,
empname char,
designation char,
salary integer external,
companyname char
)

sql> select count(*) from emp_pp1;

COUNT(*)
------------------
55

(C) DELETE THE DATA FROM TABLE AND ADD NEW DATA -> DATA3.SQL

ANS:

$ sqlldr parfile=par3.par
sql*loader: release 10.2.0.3.0 - production on wed jul 15 06:19:12 2009

copyright (c) 1982, 2005, oracle. all rights reserved.

load completed - logical record count 30.

PARAMETER FILE (PAR3.PAR)

userid = text/text123
control = '/ora/dogrc1p/backup01/oradata/rmancat1/ctl3.ctl'
log = '/ora/dogrc1p/backup01/oradata/rmancat1/lg3.log'
bad = '/ora/dogrc1p/backup01/oradata/rmancat1/bd3.txt'
discard = '/ora/dogrc1p/backup01/oradata/rmancat1/dis3.txt'
direct = true

CONTROL FILE (CTL3.CTL)

load data
infile '/ora/dogrc1p/backup01/oradata/rmancat1/data3.sql'
insert into table emp_pp truncate
fields terminated by '|' optionally enclosed by " "
(
empid integer external,
empname char,
designation char,
salary integer external,
companyname char
)

sql> select count(*) from emp_pp1;

COUNT(*)
-----------------
30

3) CREATE AND POPULATE ITEMS TABLE FROM 3 FLAT FILES USING


SQLLOADER.
-> DATA4.SQL, DATA5.SQL, DATA6.SQL

ITEMS:
ITEMNO NUMBER(5)
PRODUCT_NAME VARCHAR2(15)
PRICE NUMBER(5)
SHOPNAME VARCHAR2(15)
ANS:

sql> create table item_pp(


itemno varchar2(5),
product_name varchar2(15),
price number(5),
shopname varchar2(15));

Table created.

$ sqlldr parfile=par4.par

sql*loader: release 10.2.0.3.0 - production on wed jul 15 07:22:18 2009

copyright (c) 1982, 2005, oracle. all rights reserved.

load completed - logical record count 75.

PARAMETER FILE (PAR4.PAR)

userid = text/text123
control = '/ora/dogrc1p/backup01/oradata/rmancat1/ctl4.ctl'
log = '/ora/dogrc1p/backup01/oradata/rmancat1/lg4.log'
bad = '/ora/dogrc1p/backup01/oradata/rmancat1/bd4.txt'
discard = '/ora/dogrc1p/backup01/oradata/rmancat1/dis4.txt'
direct = true

CONTROL FILE (CTL4.CTL)

load data
infile '/ora/dogrc1p/backup01/oradata/rmancat1/data4.sql'
infile '/ora/dogrc1p/backup01/oradata/rmancat1/data5.sql'
infile '/ora/dogrc1p/backup01/oradata/rmancat1/data6.sql'
append into table item_pp
fields terminated by '|' optionally enclosed by " "
( itemno char,
product_name char,
price integer external,
shopname char
)

QUESTIONS 4 TO 9 – TRY WITH BOTH IMP/IMPDP AND EXP/EXPDP


4) EXPORT THE TABLE EMP FROM SCHEMA TEXT IN RMANCAT1
DATABASE USING EXPDP/EXP.

ANS:

USING EXPDP

sql> create directory dir_priya as


'/usr/app/oracle/product/10.2.0/rdbms/log/dir_text’;

Directory created.

sql> grant read, write on directory dir_priya to text;

Grant succeeded.

$ expdp text/text123 tables=emp_pp1 directory= dir_priya dumpfile= priya.dmp


logfile=priya.log

export: release 10.2.0.3.0 - 64bit production on wednesday, 15 july, 2009 23:55:38

copyright (c) 2003, 2005, oracle. all rights reserved.

connected to: oracle database 10g enterprise edition release 10.2.0.3.0 - 64bit production
with the partitioning, olap and data mining options
starting "text"."sys_export_table_01": text/******** tables=emp_pp1 directory= dir_priya
dumpfile= priya.dmp logfile=priya.log
estimate in progress using blocks method...
processing object type table_export/table/table_data
total estimation using blocks method: 64 kb
processing object type table_export/table/table
processing object type table_export/table/statistics/table_statistics
. . exported "text"."emp_pp1" 6.914 kb 30 rows
master table "text"."sys_export_table_01" successfully loaded/unloaded
******************************************************************************
dump file set for text.sys_export_table_01 is:
/usr/app/oracle/product/10.2.0/rdbms/log/dir_priya/priya.dmp
job "text"."sys_export_table_01" successfully completed at 23:55:59

USING EXP

$ exp userid=text/text123 tables=emp_pp1 file= priya1.dmp

export: release 10.2.0.3.0 - production on thu jul 16 00:16:44 2009


copyright (c) 1982, 2005, oracle. all rights reserved.

connected to: oracle database 10g enterprise edition release 10.2.0.3.0 - 64bit production
with the partitioning, olap and data mining options
export done in us7ascii character set and utf8 nchar character set

about to export specified tables via conventional path ...


. . exporting table emp_pp1 30 rows exported
export terminated successfully without warnings.

5. EXPORT/IMPORT ONLY THE DATA FROM TEXT USER USING EXPDP/


EXP .

ANS:

USING EXPDP

sql> create directory dir_priya1 as '/usr/app/oracle/product/10.2.0/rdbms/log/dir_priya1';

Directory created.

sql> grant read,write on directory dir_priya1 to text;

Grant succeeded.

sql> !

$ expdp text/text123 tables=emp_pp1 directory= dir_priya1 content=data_only

export: release 10.2.0.3.0 - 64bit production on thursday, 16 july, 2009 1:47:38

copyright (c) 2003, 2005, oracle. all rights reserved.

connected to: oracle database 10g enterprise edition release 10.2.0.3.0 - 64bit production
with the partitioning, olap and data mining options
starting "text"."sys_export_table_01": text/******** tables=emp_pp1 directory= dir_priya1
content=data_only
estimate in progress using blocks method...
processing object type table_export/table/table_data
total estimation using blocks method: 64 kb
. . exported "text"."emp_pp1" 6.914 kb 30 rows
master table "text"."sys_export_table_01" successfully loaded/unloaded
******************************************************************************
Dump file set for TEXT.SYS_EXPORT_TABLE_01 is:
/usr/app/oracle/product/10.2.0/rdbms/log/dir_priya1/expdat.dmp
Job "TEXT"."SYS_EXPORT_TABLE_01" successfully completed at 01:47:53
spdwd606:/usr/app/oracle/product/10.2.0/rdbms/log[RMANCAT1]$ expdp text/text123
tables=emp_pp1 directory= dir_priya1 dumpfile= priya1.dmp logfile=priya1.log
content=data_only

Export: Release 10.2.0.3.0 - 64bit Production on Thursday, 16 July, 2009 1:48:27

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Starting "TEXT"."SYS_EXPORT_TABLE_01": text/******** tables=emp_pp1 directory=
dir_priya1 dumpfile= priya1.dmp logfile=priya1.log content=data_only
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
. . exported "TEXT"."EMP_PP1" 6.914 KB 30 rows
Master table "TEXT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for TEXT.SYS_EXPORT_TABLE_01 is:
/usr/app/oracle/product/10.2.0/rdbms/log/dir_priya1/priya1.dmp
Job "TEXT"."SYS_EXPORT_TABLE_01" successfully completed at 01:48:37

USING EXP

$ exp userid=text/text123 tables=emp_pp1 file= priya1_exp.dmp full=n rows=y

Export: Release 10.2.0.3.0 - Production on Thu Jul 16 01:55:48 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and UTF8 NCHAR character set

About to export specified tables via Conventional Path ...


. . exporting table EMP_PP1 30 rows exported
Export terminated successfully without warnings.

USING IMPDP

$ impdp userid=text/text123 tables=emp_pp1 directory=dir_priya1 dumpfile=


priya1.dmp logfile=priya1.log content=data_only

Import: Release 10.2.0.3.0 - 64bit Production on Thursday, 16 July, 2009 2:01:13


Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Master table "TEXT"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
Starting "TEXT"."SYS_IMPORT_TABLE_01": userid=text/******** tables=emp_pp1
directory=dir_priya1 dumpfile= priya1.dmp logfile=priya1.log content=data_only
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "TEXT"."EMP_PP1" 6.914 KB 30 rows
Job "TEXT"."SYS_IMPORT_TABLE_01" successfully completed at 02:01:18

USING IMP

$ imp userid=text/text123 tables=emp_pp2 file= priya2_exp.dmp full=n rows=y

Import: Release 10.2.0.3.0 - Production on Thu Jul 16 02:16:00 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.02.01 via conventional path


import done in US7ASCII character set and UTF8 NCHAR character set
. importing TEXT's objects into TEXT
. importing TEXT's objects into TEXT
. . importing table "EMP_PP2" 90 rows imported
Import terminated successfully without warnings.

N:B OTHER VALUES FOR CONTENT ARE ‘METADATA ONLY’ AND ‘ALL’.

6) DO EXPORT ONLY THE STRUCTURE OF THE TABLE EMP1.

ANS:

EXPORT ( USING EXPDP)

$ expdp text/text123 tables=emp_pp1 directory= dir_priya_meta dumpfile=


priya_meta.dmp logfile=priya_meta.log content=metadata_only

Export: Release 10.2.0.3.0 - 64bit Production on Thursday, 16 July, 2009 2:23:21

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Starting "TEXT"."SYS_EXPORT_TABLE_01": text/******** tables=emp_pp1 directory=
dir_priya_meta dumpfile= priya_meta.dmp logfile=priya_meta.log content=metadata_only
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Master table "TEXT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for TEXT.SYS_EXPORT_TABLE_01 is:
/usr/app/oracle/product/10.2.0/rdbms/log/dir_priya_meta/priya_meta.dmp
Job "TEXT"."SYS_EXPORT_TABLE_01" successfully completed at 02:23:40

IMPORT ( USING IMPDP)

$ impdp userid=text/text123 tables=emp_pp1 directory=dir_priya_meta dumpfile=


priya_meta.dmp logfile=priya_meta.log content=metadata_only

Import: Release 10.2.0.3.0 - 64bit Production on Thursday, 16 July, 2009 2:29:40

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Master table "TEXT"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
Starting "TEXT"."SYS_IMPORT_TABLE_01": userid=text/******** tables=emp_pp1
directory=dir_priya_meta dumpfile= priya_meta.dmp logfile=priya_meta.log
content=metadata_only
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "TEXT"."SYS_IMPORT_TABLE_01" successfully completed at 02:29:45

7. CREATE A USER CALLED TEXT1 WITH DEFAULT TABLESPACE TBS1


AND IMPORT THE EMP TABLE FROM TEXT TO THE NEW USER TEXT1 –
USING IMP/IMPDP.

ANS:

SQL> create user text1 identified by password


default tablespace tbs1;

User created.

USING EXPDP

$ expdp text/text123 tables=emp_pp2 directory= dir_remap dumpfile=


priya_remap.dmp logfile=priya_remap.log
Export: Release 10.2.0.3.0 - 64bit Production on Friday, 17 July, 2009 0:12:01

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Starting "TEXT"."SYS_EXPORT_TABLE_01": text/******** tables=emp_pp2 directory=
dir_remap dumpfile= priya_remap.dmp logfile=priya_remap.log
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "TEXT"."EMP_PP2" 8.304 KB 90 rows
Master table "TEXT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for TEXT.SYS_EXPORT_TABLE_01 is:
/usr/app/oracle/product/10.2.0/rdbms/log/dir_remap/priya_remap.dmp
Job "TEXT"."SYS_EXPORT_TABLE_01" successfully completed at 00:12:23

USING IMPDP

$ impdp userid=text/text123 tables=emp_pp2 directory=dir_remap dumpfile=


priya_remap.dmp logfile=priya_remap.log remap_schema=text:priya

Import: Release 10.2.0.3.0 - 64bit Production on Friday, 17 July, 2009 0:22:38

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Master table "TEXT"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
Starting "TEXT"."SYS_IMPORT_TABLE_01": userid=text/******** tables=emp_pp2
directory=dir_remap dumpfile= priya_remap.dmp logfile=priya_remap.log
remap_schema=text:priya
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "PRIYA"."EMP_PP2" 8.304 KB 90 rows
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "TEXT"."SYS_IMPORT_TABLE_01" successfully completed at 00:22:51

USING EXP

$ exp userid=text/text123 tables=emp_pp2 file= dir_remap_exp.dmp


Export: Release 10.2.0.3.0 - Production on Fri Jul 17 00:19:33 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and UTF8 NCHAR character set

About to export specified tables via Conventional Path ...


. . exporting table EMP_PP2 90 rows exported
Export terminated successfully without warnings.

USING IMP

$ imp userid=text/text123 tables=emp_pp2 file= dir_remap_exp.dmp fromuser=text


touser=priya

Import: Release 10.2.0.3.0 - Production on Fri Jul 17 00:29:58 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.02.01 via conventional path


import done in US7ASCII character set and UTF8 NCHAR character set
. importing TEXT's objects into PRIYA
. . importing table "EMP_PP2" 90 rows imported
Import terminated successfully without warnings.

8) CREATE A TABLESPACE TBS2. EXPORT ALL TABLES IN TEXT1 AND


REMAP IT INTO THE NEW TABLESPACE TBS2.

ANS:

sql> create tablespace tbs2 datafile <path> size 10m;

Tablespace created.

USING IMPDP

$ impdp userid= text/text123 directory= test_data dumpfile=


'/usr/app/oracle/product/10.2.0/rdbms/log/test.dmp' logfile=
'/usr/app/oracle/product/10.2.0/rdbms/log/test.log' remap_schema=text:priya
remap_tablespace=tbs1:tbs2

( N:B SIMILARLY ‘REMAP_DATAFILE’ IS AVAILABLE IN ORACLE 10G )

9) LOAD DATA FROM MYDATA.CSV TO TABLE EMPLOYEE_TABLE AND


EXPORT IT. WHILE DOING EXPDP/IMPDP, TRY TO STOP THE JOB IN THE
MIDDLE AND AGAIN ATTACH THE JOB .

EMPLOYEE_TABLE :

FULL_NM NOT NULL VARCHAR2(80)


FIRST_NM NOT NULL VARCHAR2(33)
LAST_NM NOT NULL VARCHAR2(40)
EMP_ID NOT NULL VARCHAR2(11)
RPT_TO_EMP_ID VARCHAR2(11)
LOTUS_NOTE_ID NOT NULL VARCHAR2(33)
TITLE_TX VARCHAR2(30)

ANS:

sql> create table text.employee_table_priya(


full_nm varchar2(80) not null,
first_nm varchar2(33) not null,
last_nm varchar2(40) not null,
emp_id varchar2(15) not null,
rpt_to_emp_id varchar2(11),
lotus_note_id varchar2(33) not null,
title_tx varchar2(30));

Table created.

userid = text/text123
control = '/usr/app/oracle/product/10.2.0/rdbms/log/dir_priya1/ctl1.ctl'
bad = '/usr/app/oracle/product/10.2.0/rdbms/log/dir_priya1/bd1.txt'
discard = '/usr/app/oracle/product/10.2.0/rdbms/log/dir_priya1/dis1.txt'
direct = true

load data
infile '/usr/app/oracle/product/10.2.0/rdbms/log/dir_priya1/mydata.csv'
insert into table employee_table_priya
fields terminated by ',' optionally enclosed by " "
(
full_nm char,
first_nm char,
last_nm char,
emp_id char,
rpt_to_emp_id char,
lotus_note_id char,
title_tx char
)

$ sqlldr parfile=par1.par

SQL*Loader: Release 10.2.0.3.0 - Production on Sat Jul 18 03:35:56 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.

Load completed - logical record count 3615.

10) CREATE AN EXTERNAL TABLE EXT_EMP USING THE FLAT FILE


DATA.TXT IN TEXT_DATA DIRECTORY.

(/ORA/DOGRC1P/BACKUP01/ORADATA/RMANCAT1/TEXT_DATA)

EXT_EMP TABLE:
EMPNO CHAR(6)
FIRSTNME VARCHAR(12)
LASTNAME VARCHAR(15)
WORKDEPT CHAR(3)
PHONENO CHAR(4)
JOB CHAR(8)
SEX CHAR(1)

ANS:

sql> create table ext_emp_priya


(empno char(6),
firstnme varchar(15),
lastname varchar(15),
workdept char(5),
phoneno char(10),
job char(8),
sex char(10)
)
organization external(type oracle_loader default directory test_data
access parameters
(
records delimited by newline
fields terminated by '|'
missing field values are null
)
location ('data.txt'));

Table created.

sql> select count(*) from ext__emp_priya;

COUNT(*)
-----------------
100

11) USING DATA FROM TABLE EXT_EMP CREATE A NEW TABLE


INT_EMP.

ANS:

sql> create table int_emp_priya as select * from ext_emp_priya;

Table created.

12) TRY TO CREATE A FLAT FILE FROM EMP1 TABLE IN TEXT_DATA


DIRECTORY.

ANS:

sql> create table ext_emp1


organization external
(
type oracle_datapump
default directory test_data
location ('data_emp1.txt')
) as select * from text.emp1;

Table created.

13) USE THE FLATFILE CREATED AND USING THAT DATA CREATE
ANOTHER EXTERNAL TABLE EXT_EMP2 .

ANS:

sql> create table ext_emp1_1


(
empid number(5),
empname varchar2(20),
designation varchar2(10),
salary number(10),
companyname varchar2(15))
organization external
(
type oracle_datapump
default directory test_data
location ('data_emp1.txt')
);
Table created.

sql> select count(*) from ext_emp1_1;

COUNT(*)
-----------------
50

sql> create table text.emp1_1 as select * from ext_emp1_1;

Table created.

sql> select count(*) from text.emp1_1;

COUNT(*)
-----------------
50
5 BACKUP AND RECOVERY – I

1. QUERY TO VIEW THE GROUP NUMBER, NUMBER OF MEMBERS, STATUS,


WHETHER ARCHIVED AND THE LOG SEQUENCE NUMBER OF REDO LOG
FILES.
ANS:

SQL> select group#, members, archived, status, sequence# from v$log;

GROUP# MEMBERS ARC STATUS SEQUENCE#


--------- ---------- --- ---------------- ----------------------------------------
1 2 NO CURRENT 541
2 2 YES INACTIVE 539
3 2 YES INACTIVE 540

TIP: The view V$LOGFILE also gives information on the redo logs.

2. QUERY TO VIEW THE DESTINATION OF REDO LOG FILES.


ANS:

SQL> select group#, member from v$logfile;

GROUP# MEMBER
---------- ----------------------------------------------------------------------------------------
1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_1a
1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_1b
2 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_2a
2 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_2b
3 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_3a
3 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_3b

3. COMMAND TO PERFORM A MANUAL LOG SWITCH.


ANS:

SQL> select group#, status from v$log;

GROUP# STATUS
---------- ----------------------
1 INACTIVE
2 INACTIVE
3 CURRENT

SQL> alter system switch logfile;


System altered.
SQL> select group#, status from v$log;

GROUP# STATUS
---------- ----------------------
1 INACTIVE
2 CURRENT
3 ACTIVE

4. ADD A NEW REDO LOG GROUP WITH TWO MEMBERS TO THE


DATABASE.
ANS:

SQL> alter database add logfile group 4


('/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_4a','/ora/DOGRC1P/backu
p01/oradata/RMANCAT1/dbfiles/redo1_4b') size 20M;

Database altered.

SQL> select group#, status from v$log;

GROUP# STATUS
---------- ----------------------
1 CURRENT
2 INACTIVE
3 INACTIVE
4 UNUSED

5. ADD A NEW REDO LOG MEMBER TO THE ABOVE REDO LOG GROUP.
ANS:

SQL> alter database add logfile member


'/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_4c' to group 4;

Database altered.

6. DROP TWO LOG MEMBERS FROM THE ABOVE REDO LOG GROUP.
ANS:

SQL> alter database drop logfile member


'/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_4a';

Database altered.

SQL> alter database drop logfile member


'/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_4c';
Database altered.

7. DROP THE ABOVE REDO LOG GROUP.


ANS:

SQL> select group#, status from v$log;

GROUP# STATUS
---------- --------------------
1 INACTIVE
2 ACTIVE
3 ACTIVE
4 CURRENT

NOTE:

It is not possible to drop a logfile group that is either current or active. (Current: it is the
logfile group in use at the moment; Active: The contents of the logfile group are being
written/have not yet been written into the archive logs. It takes time for the redo logs to be
written in the archive logs. Take down the log sequence number of the redo log and check if
that has been written into the archived logs by the v$archived_log view. If the sequence
number exists in the v$archived_log view, the redo log group can be dropped successfully.

SQL> alter database drop logfile group 4;


alter database drop logfile group 4
*
ERROR at line 1:
ORA-01623: log 4 is current log for instance RMANCAT1 (thread 1) - cannot drop
ORA-00312: online log 4 thread 1:
'/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo4_4a'

SQL> alter system switch logfile;


System altered.

SQL> select group#, status from v$log;


GROUP# STATUS
---------- ---------------------
1 CURRENT
2 ACTIVE
3 ACTIVE
4 ACTIVE

SQL> alter database drop logfile group 4;


alter database drop logfile group 4
*
ERROR at line 1:
ORA-01624: log 4 needed for crash recovery of instance RMANCAT1 (thread 1)
ORA-00312: online log 4 thread 1:
'/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo4_4a'

SQL> select group#, status, sequence# from v$log where group#=4;


GROUP# STATUS SEQUENCE#
---------- ---------------- ----------
4 INACTIVE 453

SQL> select sequence#, status from v$archived_log where sequence#=453;


SEQUENCE# S
-------------------------------
453 A

SQL> alter database drop logfile group 4;


Database altered.

8. MULTIPLEX A CONTROLFILE TO A DIFFERENT DESTINATION.


ANS:

SQL> alter system set control_files=


'/ora/DOGRC1P/backup01/oradata/RMANCAT1/control/control01.ctl',
'/ora/DOGRC1P/backup01/oradata/RMANCAT1/control/control02.ctl',
'/ora/DOGRC1P/backup01/oradata/RMANCAT1/control/control03.ctl',
'/ora/DOGRC1P/backup01/oradata/RMANCAT1/control/control04.ctl'
scope=spfile;
System altered.

SQL> shu immediate


Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> !
spdwd606:/ora/DOGRC1P/backup01/oradata/RMANCAT1/control[RMANCAT1]$ cp
control04.ctl control03.ctl

SQL> startup
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 2029816 bytes
Variable Size 159385352 bytes
Database Buffers 142606336 bytes
Redo Buffers 10551296 bytes
Database mounted.
Database opened.
9. QUERY TO VIEW IF THE DATABASE IS IN ARCHIVELOG/ NOARCHIVELOG
MODE.
ANS:

SQL> select log_mode from v$database;


LOG_MODE
------------
ARCHIVELOG

SQL> archive log list


Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 445
Next log sequence to archive 445
Current log sequence 455

10. SETUP THE DATABASE IN ARCHIVELOG/NOARCHIVELOG MODE.


ANS:

SQL> select log_mode from v$database;

LOG_MODE
--------------------
ARCHIVELOG

The log mode of the database can be switched only in MOUNT stage and not while
OPEN.

SQL> shu immediate


Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount


ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 2029816 bytes
Variable Size 159385352 bytes
Database Buffers 142606336 bytes
Redo Buffers 10551296 bytes
Database mounted.

SQL> alter database noarchivelog;


Database altered.
SQL> select log_mode from v$database;
LOG_MODE
-----------------------
NOARCHIVELOG

11. QUERY TO VIEW THE ARCHIVE LOG DESTINATIONS.


ANS:

SQL> show parameter log_archive_dest

NAME TYPE VALUE


------------------------------------ --------------------------------
log_archive_dest string
log_archive_dest_1 string
log_archive_dest_10 string
log_archive_dest_2 string
log_archive_dest_3 string
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string

SQL> show parameter db_recovery_file_dest

NAME TYPE VALUE


------------------------------------------------------------------------------------------------------------
db_recovery_file_dest string /ora/DOGRC1P/backup01/oradata/RMANCAT1/fra

12. SETUP A NEW ARCHIVE LOG DESTINATION.


ANS:

SQL> alter system set


log_archive_dest='/ora/DOGRC1P/backup01/oradata/RMANCAT1/arc1' scope=spfile;

System altered.

13. CREATE A READABLE BACKUP AND A BINARY BACKUP OF A


CONTROLFILE.
ANS:

READABLE BACKUP
SQL> alter database backup controlfile to trace;
Database altered.

BINARY BACKUP
SQL> alter database backup controlfile to
'/ora/DOGRC1P/backup01/oradata/RMANCAT1/arc1/control_bkp1.ctl';

Database altered.

14. PERFORM COLD BACKUP OF A DATABASE.


ANS:

This is done by shutting down the database. Then a cp command is issued on all the datafiles,
archive logs, control files. This can also be done using the RMAN utility of oracle.

15. PERFORM HOT BACKUP OF A TABLESPACE.


ANS:

SQL> alter tablespace users_pp begin backup;

Tablespace altered.

SQL>!
spdwd606:/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles[RMANCAT1]$ cp
/ora/DOGRC1P/backup01/oradata/RMANCAT1/users1.dbf user_pp0_bkp.dbf

SQL> alter tablespace users_pp end backup;

Tablespace altered.

SQL> alter system switch logfile;

System altered.

SQL> alter database backup controlfile to trace;

Database altered.
6 ORACLE DATABASE BACKUP AND
RECOVERY- II

I. TUNING INSTANCE RECOVERY:

1. SET FAST_START_MTTR_TARGET PARAMETER TO ZERO.


ANS:

SQL> alter system set fast_start_mttr_target=0 scope=both;

System altered.

SQL> show parameter fast_start_mttr_target

NAME TYPE VALUE


------------------------------------ -------------------------------- ------------------------------
fast_start_mttr_target integer 0

2. CREATE A TABLE EMP_MTTR WITH COLUMNS


ID NUMBER
NAME VARCHAR2(50)
DESIGNATION VARCHAR2(50)
SALARY NUMBER(5,2)
EXPERIENCE NUMBER

AND POPULATE TABLE EMP_MTTR ,FROM EMP_MTTR.SQL (IN TAXI


SERVER) USING SQLLOADER.
ANS:

SQL> create table emp_mttr_pr (


id number,
name varchar2(50),
designation varchar2(50),
salary number(7,2),
experience number);

Table created.

ftp> get emp_mttr.sql


200 PORT command successful.

150 Opening BINARY mode data connection for emp_mttr.sql (127 bytes).
226 Transfer complete.

PARAMETER FILE(PAR1.PAR)

userid = pr/pr
control = '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader/ctl1.ctl'
log = '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader/lg1.log'
bad = '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader/bd1.txt'
discard = '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader/dis1.txt'
direct = true

CONTROL FILE( CTL1.CTL)

load data
infile '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader/emp_mttr.sql'
insert into table EMP_MTTR_pr
fields terminated by '|' optionally enclosed by " "
(
ID integer external,
NAME CHAR(50),
DESIGNATION CHAR(50),
SALARY integer external,
EXPERIENCE integer external
)

$ sqlldr parfile=par1.par

SQL*Loader: Release 10.2.0.3.0 - Production on Tue Jul 28 23:21:22 2009


Copyright (c) 1982, 2005, Oracle. All rights reserved.
Load completed - logical record count 5.

SQL> select * from emp_mttr_pr;

ID NAME DESIGNATION SALARY EXPERIENCE


---------- -------------------- ---------- ---------- --------------------------------
1 FERNANDEZ1 ASE 29000 2
2 FERNANDEZ2 ASE 35000 3
3 FERNANDEZ3 ASE 45000 4
4 FERNANDEZ4 ITA 65000 5
5 FERNANDEZ5 ASE-T 22000 1

3. CHECK HOW MUCH WORK WOULD BE REQUIRED TO RECOVER THE


INSTANCE IF IT CRASHED RIGHT NOW.
ANS :
SQL> select recovery_estimated_ios, actual_redo_blks, estimated_mttr from
v$instance_recovery;

RECOVERY_ESTIMATED_IOS ACTUAL_REDO_BLKS ESTIMATED_MTTR


---------------------- ---------------- ----------------------------------------------------------------
38 99 13

4. ISSUE A MANUAL CHECKPOINT.


ANS:

SQL> alter system checkpoint;

System altered.

5. AGAIN CHECK HOW MUCH WORK WOULD BE REQUIRED TO RECOVER


THE INSTANCE IF IT CRASHED RIGHT NOW.
ANS:

SQL> select recovery_estimated_ios, actual_redo_blks, estimated_mttr from


v$instance_recovery;

RECOVERY_ESTIMATED_IOS ACTUAL_REDO_BLKS ESTIMATED_MTTR


---------------------- ---------------- ----------------------------------------------------------------
0 0 13

II. FLASHBACK :

1. ENABLE FLASHBACK.
ANS:

SQL> shu immediate

Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.

Total System Global Area 314572800 bytes


Fixed Size 2029816 bytes
Variable Size 159385352 bytes
Database Buffers 142606336 bytes
Redo Buffers 10551296 bytes
Database mounted.

SQL> alter database flashback on;

Database altered.

2. SET UNDO_RETENTION=900.
ANS:

SQL> alter system set undo_retention=900 scope =both;

System altered.

3. CHECK IF UNDO_RETENTION IS GUARANTEED. IF NOT, GUARANTEE


UNDO_RETENTION.
ANS:

SQL> select tablespace_name, retention from dba_tablespaces where


tablespace_name='UNDOTBS1';

TABLESPACE_NAME RETENTION
------------------------------ ---------------------------------
UNDOTBS1 NOGUARANTEE

SQL> alter tablespace UNDOTBS1 retention guarantee;

Tablespace altered.

SQL> select tablespace_name, retention from dba_tablespaces where


tablespace_name='UNDOTBS1';

TABLESPACE_NAME RETENTION
------------------------------ ---------------------------------
UNDOTBS1 GUARANTEE

III. FLASHBACK QUERY :

1. DELETE ALL EMPLOYEES FROM TABLE EMP_MTTR ,WHOSE


EXPERIENCE IS LESS THAN 2 YEARS.
ANS:

SQL> delete from emp_mttr_pr where experience<2;


1 row deleted.

2. APPLY FLASHBACK QUERY TO RETRIEVE THE DELETED VALUES


AGAIN USING BOTH SCN AND TIMESTAMP.
ANS:

SQL> select systimestamp from dual;

SYSTIMESTAMP
-------------------------------------------------
29-JUL-09 12.09.32.377372 AM -07:00

SQL> select current_scn from v$database;

CURRENT_SCN
---------------------
320699

SQL> delete from emp_mttr_pr where experience<2;

1 row deleted.

SQL> commit;

Commit complete.

SQL> select * from emp_mttr_pr as of timestamp (systimestamp - interval '4'


minute);

ID NAME DESIGNATION SALARY EXPERIENCE


---------- -------------------- ---------- ---------- -----------------------------------
1 FERNANDEZ1 ASE 29000 2
2 FERNANDEZ2 ASE 35000 3
3 FERNANDEZ3 ASE 45000 4
4 FERNANDEZ4 ITA 65000 5
5 FERNANDEZ5 ASE-T 22000 1

(OR)

SQL> select * from emp_mttr_pr as of scn 320699;

ID NAME DESIGNATION SALARY EXPERIENCE


---------- -------------------- ---------- ---------- -----------------------------------
1 FERNANDEZ1 ASE 29000 2
2 FERNANDEZ2 ASE 35000 3
3 FERNANDEZ3 ASE 45000 4
4 FERNANDEZ4 ITA 65000 5
5 FERNANDEZ5 ASE-T 22000 1

IV. FLASHBACK TABLE :

1. GRANT FLASHBACK ANY TABLE TO USER PR.


ANS:

SQL> grant flashback any table to pr;

Grant succeeded.

2. CREATE TABLE DEPT WITH COLUMNS.


DEPT_ID NUMBER PRIMARY KEY
DEPT_NAME VARCAHR2(50)
MNGRNO VARCHAR2(20)
LOCATION VARCHAR2(40)

AND POPULATE TABLE DEPT FROM DEPT.SQL (TAXI SERVER) USING


SQLLOADER.
ANS:

SQL> create table dept_pr (


dept_id number primary key,
dept_name varchar2(50),
mngrno varchar2(20),
location varchar2(40)
);

Table created.

$ ftp 148.171.28.162
Connected to 148.171.28.162.

ftp> get emp.sql


200 PORT command successful.
150 Opening BINARY mode data connection for emp.sql (85 bytes).
226 Transfer complete.
local: emp.sql remote: emp.sql
85 bytes received in 0.044 seconds (1.87 Kbytes/s)

ftp> get dept.sql


200 PORT command successful.
150 Opening BINARY mode data connection for dept.sql (95 bytes).
226 Transfer complete.
local: dept.sql remote: dept.sql
95 bytes received in 0.044 seconds (2.11 Kbytes/s)

PARAMETER FILE(PAR1.PAR)

userid = pr/pr
control = '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader1/ctl1.ctl'
log = '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader1/lg1.log'
bad = '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader1/bd1.txt'
discard = '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader1/dis1.txt'
direct = true

CONTROL FILE( CTL1.CTL)

load data
infile '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader1/dept.sql'
insert into table dept_pr
fields terminated by '|' optionally enclosed by " "
(
dept_id integer external,
dept_name char(50),
mngrno char(20),
location char(40)
)

$ sqlldr parfile=par1.par

SQL*Loader: Release 10.2.0.3.0 - Production on Wed Jul 29 23:07:46 2009


Copyright (c) 1982, 2005, Oracle. All rights reserved.

Load completed - logical record count 4.

SQL> select * from dept_pr;

DEPT_ID DEPT_NAME MNGRNO LOCATION


---------- ---------- -------------------- --------------------------------------------
101 DEPT1 ALEX BANGALORE
102 DEPT2 VISHNU DELHI
103 DEPT3 SANTOSH PUNE
104 DEPT4 NEERAV ORISSA

3. CREATE TABLE EMP WITH THE FOLLOWING COLUMNS.


EMP_ID NUMBER PRIMARY KEY
EMP_NAME VARCHAR2(50)
DEPT_ID NUMBER FOREIGN KEY
SALARY NUMBER(7,2)
EXPERIENCE NUMBER

AND POPULATE TABLE EMP FROM EMP.SQL(TAXI SERVER) USING


SQLLOADER.
ANS:

SQL> create table emp_pr (


emp_id number primary key,
emp_name varchar2(50),
dept_id number references dept_pr (dept_id),
salary number(7,2),
experience number
);

Table created.

PARAMETER FILE(PAR2.PAR)

userid = pr/pr
control = '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader1/ctl2.ctl'
log = '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader1/lg2.log'
bad = '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader1/bd2.txt'
discard = '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader1/dis2.txt'
direct = true

CONTROL FILE( CTL2.CTL)

load data
infile '/ora/DOGRC1P/backup01/oradata/RMANCAT1/loader1/emp.sql'
insert into table emp_pr
fields terminated by '|' optionally enclosed by " "
(EMP_ID integer external,
EMP_NAME CHAR(50),
DEPT_ID integer external,
SALARY integer external,
EXPERIENCE integer external
)

$ sqlldr parfile=par2.par

SQL*Loader: Release 10.2.0.3.0 - Production on Wed Jul 29 23:24:47 2009


Copyright (c) 1982, 2005, Oracle. All rights reserved.

Load completed - logical record count 5.


SQL> select * from emp_pr;

EMP_ID EMP_NAME DEPT_ID SALARY EXPERIENCE


---------- ---------- ---------- ---------- ---------------------------------------------
1 DIVYA 101 20000 1
2 PRIYA 102 23000 2
3 RISHMA 102 30000 3
4 SUCHITRA 104 40000 5

SQL> commit;

Commit complete.

SQL> select current_scn from v$database;

CURRENT_SCN
---------------------
398306

SQL> select systimestamp from dual;

SYSTIMESTAMP
------------------------------------------------
29-JUL-09 11.36.11.451394 PM -07:00

SQL> select sysdate from dual;

SYSDATE
-------------------------
2009-07-29 23:36:19

4. DELETE ALL ROWS FROM BOTH TABLES WHERE DEPT_ID =102.


ANS:

SQL> delete from emp_pr where dept_id=102;

2 rows deleted.

SQL> delete from dept_pr where dept_id=102;

1 row deleted.

5. FLASHBACK BOTH TABLES TO RETRIEVE THE DELETED VALUES.


ANS:
SQL> alter table emp_pr enable row movement;

Table altered.

SQL> alter table dept_pr enable row movement;

Table altered.

SQL> flashback table emp_pr, dept_pr to timestamp to_timestamp('2009-07-29


23:37:22','yyyy-mm-dd hh24:mi:ss');

Flashback complete.

(OR)

SQL> flashback table emp_pr, dept_pr to scn 398306;

Flashback complete.

SQL> select * from emp_pr;

EMP_ID EMP_NAME DEPT_ID SALARY EXPERIENCE


---------- ---------- ---------- ---------- --------------------------------------------
1 DIVYA 101 20000 1
2 PRIYA 102 23000 2
3 RISHMA 102 30000 3
4 SUCHITRA 104 40000 5

V. FLASHBACK DROP :

1. DROP TABLE EMP.


ANS:

SQL> drop table emp_pr;

Table dropped.

SQL> select * from emp_pr;


select * from emp_pr
*
ERROR at line 1:
ORA-00942: table or view does not exist
2. FLASHBACK THE DROPPED TABLE EMP.
ANS:

SQL> flashback table emp_pr to before drop;

Flashback complete.

SQL> select *from emp_pr;

EMP_ID EMP_NAME DEPT_ID SALARY EXPERIENCE


---------- ---------- ---------- ---------- ---------------------------------------------
1 DIVYA 101 20000 1
2 PRIYA 102 23000 2
3 RISHMA 102 30000 3
4 SUCHITRA 104 40000 5
8 RECOVERY MANAGER UTILITY

1. TRY TO CONNECT TO THE TARGET DATABASE IN RMAN VIA


DIFFERENT METHODS:
A)NO USERNAME
B)WITH A USERNAME AND PASSWORD
C)WITH NOCATALOG EXPLICITLY

ANS:

SPDWD606:/USR/APP/ORACLE[DOGRC0P]$ EXPORT ORACLE_SID =


RMANCAT1

a)

SPDWD606:/USR/APP/ORACLE[RMANCAT1]$ rman

Recovery Manager: Release 10.2.0.3.0 - Production on Mon Jul 20 00:37:08 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN> CONNECT TARGET

connected to target database: RMANCAT1 (DBID=2968604067)

RMAN> EXIT
Recovery Manager complete.

b)

SPDWD606:/USR/APP/ORACLE[RMANCAT1]$ rman TARGET


JRUSER/AMEX123#

Recovery Manager: Release 10.2.0.3.0 - Production on Mon Jul 20 00:37:58 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: RMANCAT1 (DBID=2968604067)

RMAN> EXIT
Recovery Manager complete.

c)
SPDWD606:/USR/APP/ORACLE[RMANCAT1]$ rman NOCATALOG

Recovery Manager: Release 10.2.0.3.0 - Production on Mon Jul 20 00:39:15 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN>
RMAN> exit

Recovery Manager complete.

2:

LIST OUT ALL THE CONFIGURATION PARAMETERS AND IDENTIFY


THE DEFAULT PARAMETERS.

ANS:

SPDWD606:/USR/APP/ORACLE[RMANCAT1]$ rman TARGET


JRUSER/AMEX123#

Recovery Manager: Release 10.2.0.3.0 - Production on Mon Jul 20 00:40:58 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: RMANCAT1 (DBID=2968604067)

RMAN> SHOW ALL;

using target database control file instead of recovery catalog


RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE
SBT_TAPE TO '%F'; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK
TO '%F'; # default
CONFIGURE DEVICE TYPE 'SBT_TAPE' BACKUP TYPE TO COMPRESSED
BACKUPSET PARALLELISM 1;
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET
PARALLELISM 3;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; #
default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO
1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; #
default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO
'/usr/app/oracle/product/10.2.0/dbs/snapcf_RMANCAT1.f'; # default

3:CONFIGURE THE RETENTION POLICY FOR KEEPING THE


BACKUPS FOR 3 DAYS.

ANS:

RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3


DAYS;

new RMAN configuration parameters:


CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
new RMAN configuration parameters are successfully stored

4:CONFIGURE AUTOMATIC BACKUP OF CONTROLFILE AND


SPFILE.

ANS:

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

old RMAN configuration parameters:


CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

SPFILE IS AUTOMATICALLY BACKED UP IN 10G


5:CONFIGURE DISK PARALLELISM TO 3.

ANS:

RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET


PARALLELISM 3;

old RMAN configuration parameters:


CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET
PARALLELISM 4;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET
PARALLELISM 3;
new RMAN configuration parameters are successfully stored

6:SET THE MAXIMUM BACKUPSET SIZE TO 100M.

ANS:

RMAN> CONFIGURE MAXSETSIZE TO 100M;

new RMAN configuration parameters:


CONFIGURE MAXSETSIZE TO 100 M;
new RMAN configuration parameters are successfully stored

7:CHANGE ALL THE PARAMETER CONFIGURED ABOVE TO THEIR


DEFAULT VALUES.

ANS:

RMAN> SHOW ALL;

RMAN configuration parameters are:


CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE
SBT_TAPE TO '%F'; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK
TO '%F'; # default
CONFIGURE DEVICE TYPE 'SBT_TAPE' BACKUP TYPE TO COMPRESSED
BACKUPSET PARALLELISM 1;
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET
PARALLELISM 3;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; #
default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO
1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; #
default
CONFIGURE MAXSETSIZE TO 100 M;
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO
'/usr/app/oracle/product/10.2.0/dbs/snapcf_RMANCAT1.f'; # default

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP OFF;

old RMAN configuration parameters:


CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters are successfully stored

RMAN> CONFIGURE MAXSETSIZE TO UNLIMITED;

old RMAN configuration parameters:


CONFIGURE MAXSETSIZE TO 100 M;
new RMAN configuration parameters:
CONFIGURE MAXSETSIZE TO UNLIMITED;
new RMAN configuration parameters are successfully stored

RMAN> SHOW ALL;

RMAN configuration parameters are:


CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE
SBT_TAPE TO '%F'; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK
TO '%F'; # default
CONFIGURE DEVICE TYPE 'SBT_TAPE' BACKUP TYPE TO COMPRESSED
BACKUPSET PARALLELISM 1;
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET
PARALLELISM 3;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; #
default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO
1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; #
default
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO
'/usr/app/oracle/product/10.2.0/dbs/snapcf_RMANCAT1.f'; # default

BACKUP USING RMAN

NOTE:-CREATE THE TABLESPACE USERS AND USERS01 WITH 2


DATAFILES EACH IN YOUR DATABASE IF IT IS NOT PRESENT. POPULATE
THEM WITH SOME TABLES.

SQL> CREATE TABLESPACE JRTBS01


DATAFILE
'/ORA/DOGRC1P/BACKUP01/ORADATA/RMANCAT1/DBFILES/JRTBS01_1.DB
F' SIZE 20M,
'/ORA/DOGRC1P/BACKUP01/ORADATA/RMANCAT1/DBFILES/JRTBS01_2.DB
F' SIZE 20M; 2 3
Tablespace created.

SQL> CREATE TABLE JR1(NUM NUMBER,NAME VARCHAR2(10))


2 TABLESPACE JRTBS01;
Table created.

SQL> INSERT INTO JR1 SELECT * FROM JR1;


1 row created.

SQL> SELECT COUNT(*) FROM JR1;


COUNT(*)
----------
1024

SQL> CREATE TABLE JR11(NUM NUMBER,NAME VARCHAR2(10))


3 TABLESPACE JRTBS01;
Table created.

SQL> INSERT INTO JR11 SELECT * FROM JR11;


1 row created.
SQL> SELECT COUNT(*) FROM JR11;
COUNT(*)
----------
2048

SQL> CREATE TABLESPACE JRTBS02


DATAFILE
'/ORA/DOGRC1P/BACKUP01/ORADATA/RMANCAT1/DBFILES/JRTBS02_1.DB
F' SIZE 20M,
'/ORA/DOGRC1P/BACKUP01/ORADATA/RMANCAT1/DBFILES/JRTBS02_2.DB
F' SIZE 20M; 2 3
Tablespace created.

SQL> CREATE TABLE JR2(NUM NUMBER,NAME VARCHAR2(10))


4 TABLESPACE JRTBS02;
Table created.

SQL> INSERT INTO JR2 SELECT * FROM JR2;


1 row created.

SQL> SELECT COUNT(*) FROM JR2;


COUNT(*)
----------
2048

SQL> CREATE TABLE JR22(NUM NUMBER,NAME VARCHAR2(10))


5 TABLESPACE JRTBS02;
Table created.

SQL> INSERT INTO JR22 SELECT * FROM JR22;


1 row created.

SQL> SELECT COUNT(*) FROM JR22;


COUNT(*)
----------
1024

1. BACKUP THE TABLESPACE "TBS01" WITH TAG AS


"BACKUP_USERS".

RMAN> BACKUP TABLESPACE jrtbs01 TAG JR_BACKUP_USERS;

Starting backup at 25-JUL-09


allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=181 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00015
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_1.dbf
input datafile fno=00016
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_2.dbf
channel ORA_DISK_1: starting piece 1 at 25-JUL-09
channel ORA_DISK_1: finished piece 1 at 25-JUL-09
piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/backupset/2009
_07_25/o1_mf_nnndf_JR_BACKUP_USERS_56omrnvk_.bkp tag=JR_BACKUP_USERS
comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 25-JUL-09

2. TAKE AN IMAGE COPY OF TABLESPACE "TBS01" USING THE


FORMAT KEYWORD SPECIFYING THE LOCATION OF THE BACKUP
AS '....../RMANCAT1/COPY/.......'

The following command works when the tablespace has one or more datafiles.
However, if we try to specify a separate name to the copy when the tablespace has more
than datafile, the copy will fail as it tries to assign the same name to the copy of each
datafile, thus throwing an error.
This error is shown in one of the examples below highlighted in red.

RMAN> BACKUP AS COPY TABLESPACE JRTBS01 FORMAT


'/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/%U.DBF';

Starting backup at 24-JUL-09


using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile fno=00015
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_1.dbf
output filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/data_D-
RMANCAT1_I-2968604067_TS-JRTBS01_FNO-15_c5kktpfs.DBF
tag=TAG20090724T060859 recid=138 stamp=693036540
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile fno=00016
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_2.dbf
output filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/data_D-
RMANCAT1_I-2968604067_TS-JRTBS01_FNO-16_c6kktpft.DBF
tag=TAG20090724T060859 recid=139 stamp=693036542
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 24-JUL-09

RMAN> BACKUP AS COPY TABLESPACE JRTBS01 FORMAT


'/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/XYZ.DBF';

Starting backup at 24-JUL-09


using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile fno=00015
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_1.dbf
output filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/XYZ.DBF
tag=TAG20090724T061015 recid=140 stamp=693036616
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile fno=00016
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_2.dbf
RMAN-00571:
===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
===============
RMAN-00571:
===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 07/24/2009
06:10:18
ORA-19504: failed to create file
"/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/XYZ.DBF"
ORA-27038: created file already exists
Additional information: 1

One can create a copy of the tablespace by creating a copy of each datafile one at a time.

RMAN> backup as copy datafile


'/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_1.dbf' format
'/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01_1.dbf';

Starting backup at 24-JUL-09


using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile fno=00015
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_1.dbf
output filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01_1.dbf
tag=TAG20090724T061045 recid=141 stamp=693036646
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 24-JUL-09

RMAN> backup as copy datafile


'/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_2.dbf' format
'/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01_2.dbf';

Starting backup at 24-JUL-09


using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile fno=00016
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_2.dbf
output filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01_2.dbf
tag=TAG20090724T061100 recid=142 stamp=693036661
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 24-JUL-09

3. MAKE A COMPRESSED BACKUP OF TABLESPACE "TBS01" AND


VERIFY WHETHER THE BACKUPS ARE GOING TO FRA.

RMAN> BACKUP AS COMPRESSED BACKUPSET TABLESPACE JRTBS01;

Starting backup at 24-JUL-09


using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00015
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_1.dbf
input datafile fno=00016
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_2.dbf
channel ORA_DISK_1: starting piece 1 at 24-JUL-09
channel ORA_DISK_1: finished piece 1 at 24-JUL-09
piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/backupset/2009
_07_24/o1_mf_nnndf_TAG20090724T061126_56mdqz4j_.bkp
tag=TAG20090724T061126 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-JUL-09

RMAN> list backup of tablespace jrtbs01;


List of Backup Sets
===================

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
274 Full 1.14M DISK 00:00:00 24-JUL-09
BP Key: 274 Status: AVAILABLE Compressed: YES Tag:
TAG20090724T061126
Piece Name:
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/backupset/2009_07_24/
o1_mf_nnndf_TAG20090724T061126_56mdqz4j_.bkp
List of Datafiles in backup set 274
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
15 Full 2559216 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_1.dbf
16 Full 2559216 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_2.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
276 Full 5.68M DISK 00:00:00 24-JUL-09
BP Key: 276 Status: AVAILABLE Compressed: NO Tag: JR_BACKUP_USERS
Piece Name:
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/backupset/2009_07_24/
o1_mf_nnndf_JR_BACKUP_USERS_56mfgt3g_.bkp
List of Datafiles in backup set 276
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
15 Full 2559679 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_1.dbf
16 Full 2559679 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_2.dbf

4. COMPARE ALL THE THREE BACKUPS TAKEN ABOVE AND GIVE THE
ORDER IN WHICH THE SIZES ARE IN DESCENDING.

spdwd606:/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/
backupset/2009_07_24[RMANCAT1]$ ls -lrt
total 14000
-rw-r----- 1 oracle oinstall 1204224 Jul 24 06:11
o1_mf_nnndf_TAG20090724T061126_56mdqz4j_.bkp

-rw-r----- 1 oracle oinstall 5963776 Jul 24 06:23


o1_mf_nnndf_JR_BACKUP_USERS_56mfgt3g_.bkp
5. WRITE A RMAN SCRIPT USING RUN BLOCK USING THE
FOLLOWING CONDITIONS
A)NUMBER OF CHANNELS USED SHOULD BE 3
B)BACKUPS FULL DATABASE(INCREMENTAL LEVEL 0) WITH
ALL THE ARCHIVE LOGS
C)MAXIMUM SIZE OF A BACKUPSET SHOULD NOT EXCEED
100M
D)EACH BACKUPSET SHOULD CONTAIN ONLY ONE BACKUP
PIECE
E)BACKUP SHOULD NOT TAKE LESS THAN 10 MINUTES.
F)SKIP THE "USERS01" DATAFILE // THISIS NOT POSSIBLE.

FINALLY RUN THE ABOVE CREATED RUN BLOCK.

The command below allocates 3 channels of device type. The backup type is an
incremental level 0 i.e. a complete database backup. The duration of the backup is 10
minutes or less. There is one backup piece per backupset. The inaccessible tablespaces are
skipped. It is not possible to skip a specified tablespace. We have specified “skip
inaccessible” to skip those tablespaces which are invalid. The maximum size of a
backupset should be at least the size of the biggest datafile. Here system is 500m in size.
Thus it is not possible to keep maximum size of a backupset 100m.

RMAN> RUN
2> {ALLOCATE CHANNEL ch1 DEVICE TYPE DISK; ALLOCATE CHANNEL
ch2 DEVICE TYPE DISK; ALLOCATE CHANNEL ch3 DEVICE TYPE
DISK;
BACKUP INCREMENTAL LEVEL 0 FORMAT
'/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/%u.DBF'
3> 4> FILESPERSET 1
DURATION 00:10 MINIMIZE LOAD DATABASE
5> 6> SKIP INACCESSIBLE;
7> }

released channel: ORA_DISK_1


allocated channel: ch1
channel ch1: sid=181 devtype=DISK

allocated channel: ch2


channel ch2: sid=169 devtype=DISK

allocated channel: ch3


channel ch3: sid=158 devtype=DISK

Starting backup at 25-JUL-09


could not access datafile 19
skipping inaccessible file 19
RMAN-06060: WARNING: skipping datafile compromises tablespace USERS
recoverability
RMAN-06060: WARNING: skipping datafile compromises tablespace USERS
recoverability
channel ch1: starting incremental level 0 datafile backupset
channel ch1: specifying datafile(s) in backupset
input datafile fno=00001
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/system_01
channel ch1: starting piece 1 at 25-JUL-09
channel ch2: starting incremental level 0 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00012
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/priya01.dbf
channel ch2: starting piece 1 at 25-JUL-09
channel ch3: starting incremental level 0 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00004
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/users
channel ch3: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/djkkvr7a.DBF
tag=TAG20090725T005049 comment=NONE
channel ch3: backup set complete, elapsed time: 00:00:35
channel ch3: throttle time: 0:00:32
channel ch3: starting incremental level 0 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00006
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/r_tbs01.dbf
channel ch3: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dikkvr7a.DBF
tag=TAG20090725T005049 comment=NONE
channel ch2: backup set complete, elapsed time: 00:01:00
channel ch2: throttle time: 0:00:56
channel ch2: starting incremental level 0 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00013 name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/data1.dbf
channel ch2: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dkkkvr8d.DBF
tag=TAG20090725T005049 comment=NONE
channel ch3: backup set complete, elapsed time: 00:00:33
channel ch3: throttle time: 0:00:31
channel ch3: starting incremental level 0 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00017
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs02_1.dbf
channel ch3: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dlkkvr97.DBF
tag=TAG20090725T005049 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:32
channel ch2: throttle time: 0:00:32
channel ch2: starting incremental level 0 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00018
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs02_2.dbf
channel ch2: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dmkkvr9e.DBF
tag=TAG20090725T005049 comment=NONE
channel ch3: backup set complete, elapsed time: 00:00:33
channel ch3: throttle time: 0:00:31
channel ch3: starting incremental level 0 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00007
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/tbs_sm.dbf
channel ch3: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dokkvraf.DBF
tag=TAG20090725T005049 comment=NONE
channel ch3: backup set complete, elapsed time: 00:00:25
channel ch3: throttle time: 0:00:16
channel ch3: starting incremental level 0 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00008 name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/data1
channel ch3: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dnkkvra8.DBF
tag=TAG20090725T005049 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:34
channel ch2: throttle time: 0:00:33
channel ch2: starting incremental level 0 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00009 name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/data2
channel ch2: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dpkkvrb9.DBF
tag=TAG20090725T005049 comment=NONE
channel ch3: backup set complete, elapsed time: 00:00:16
channel ch3: throttle time: 0:00:16
channel ch3: starting incremental level 0 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00010 name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/data3
channel ch3: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dqkkvrba.DBF
tag=TAG20090725T005049 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:18
channel ch2: throttle time: 0:00:17
channel ch2: starting incremental level 0 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00011 name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/data4
channel ch2: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/drkkvrbp.DBF
tag=TAG20090725T005049 comment=NONE
channel ch3: backup set complete, elapsed time: 00:00:19
channel ch3: throttle time: 0:00:16
channel ch3: starting incremental level 0 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00003
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/sysaux.dbf
channel ch3: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dskkvrbt.DBF
tag=TAG20090725T005049 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:18
channel ch2: throttle time: 0:00:17
channel ch2: starting incremental level 0 datafile backupset
channel ch2: specifying datafile(s) in backupset
including current SPFILE in backupset
channel ch2: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dukkvrcg.DBF
tag=TAG20090725T005049 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:01
channel ch2: starting incremental level 0 datafile backupset
channel ch2: specifying datafile(s) in backupset
including current control file in backupset
channel ch2: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dvkkvrch.DBF
tag=TAG20090725T005049 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:36
channel ch2: throttle time: 0:00:30
channel ch2: starting incremental level 0 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00002
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/undo1_01
channel ch2: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e0kkvrdl.DBF
tag=TAG20090725T005049 comment=NONE
channel ch2: backup set complete, elapsed time: 00:03:15
channel ch2: throttle time: 0:03:05
channel ch2: starting incremental level 0 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00005
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/RMANCAT1/datafile/o1_
mf_undotbs1_56g8rt9z_.dbf
channel ch2: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dtkkvrcc.DBF
tag=TAG20090725T005049 comment=NONE
channel ch3: backup set complete, elapsed time: 00:05:12
channel ch3: throttle time: 0:04:59
channel ch3: starting incremental level 0 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00015
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_1.dbf
channel ch3: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e2kkvrm4.DBF
tag=TAG20090725T005049 comment=NONE
channel ch3: backup set complete, elapsed time: 00:00:55
channel ch3: throttle time: 0:00:46
channel ch3: starting incremental level 0 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00016
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_2.dbf
channel ch3: starting piece 1 at 25-JUL-09
channel ch1: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dhkkvr7a.DBF
tag=TAG20090725T005049 comment=NONE
channel ch1: backup set complete, elapsed time: 00:09:35
channel ch1: throttle time: 0:09:23
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e1kkvrjp.DBF
tag=TAG20090725T005049 comment=NONE
channel ch2: backup set complete, elapsed time: 00:02:56
channel ch2: throttle time: 0:02:49
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e3kkvrns.DBF
tag=TAG20090725T005049 comment=NONE
channel ch3: backup set complete, elapsed time: 00:00:45
channel ch3: throttle time: 0:00:39
Finished backup at 25-JUL-09
released channel: ch1
released channel: ch2
released channel: ch3

6. CREATE TABLES IN "USERS" AND "TBS01" TABLESPACE AND


INSERT AROUND 100-1000 RECORDS IN EACH OF THEM. THEN TAKE
AN INCREMENTAL LEVEL 1 BACKUP OF THE WHOLE DATABASE

RMAN> RUN
2> {ALLOCATE CHANNEL ch1 DEVICE TYPE DISK; ALLOCATE CHANNEL
ch2 DEVICE TYPE DISK; ALLOCATE CHANNEL ch3 DEVICE TYPE DISK;
BACKUP INCREMENTAL LEVEL 1 FORMAT
'/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/%u.DBF'
3> 4> FILESPERSET 1
5> DURATION 00:10 MINIMIZE LOAD DATABASE
6> SKIP INACCESSIBLE;
}7>

allocated channel: ch1


channel ch1: sid=181 devtype=DISK

allocated channel: ch2


channel ch2: sid=169 devtype=DISK

allocated channel: ch3


channel ch3: sid=158 devtype=DISK

Starting backup at 25-JUL-09


could not read file header for datafile 19 error reason 4
could not access datafile 19
skipping inaccessible file 19
RMAN-06060: WARNING: skipping datafile compromises tablespace USERS
recoverability
RMAN-06060: WARNING: skipping datafile compromises tablespace USERS
recoverability
channel ch1: starting incremental level 1 datafile backupset
channel ch1: specifying datafile(s) in backupset
input datafile fno=00004
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/users
channel ch1: starting piece 1 at 25-JUL-09
channel ch2: starting incremental level 1 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00012
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/priya01.dbf
channel ch2: starting piece 1 at 25-JUL-09
channel ch3: starting incremental level 1 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00006
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/r_tbs01.dbf
channel ch3: starting piece 1 at 25-JUL-09
channel ch1: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e4kkvrs6.DBF
tag=TAG20090725T010156 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:35
channel ch1: throttle time: 0:00:30
channel ch1: starting incremental level 1 datafile backupset
channel ch1: specifying datafile(s) in backupset
input datafile fno=00013 name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/data1.dbf
channel ch1: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e6kkvrs6.DBF
tag=TAG20090725T010156 comment=NONE
channel ch3: backup set complete, elapsed time: 00:00:35
channel ch3: throttle time: 0:00:30
channel ch3: starting incremental level 1 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00017
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs02_1.dbf
channel ch3: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e5kkvrs6.DBF
tag=TAG20090725T010156 comment=NONE
channel ch2: backup set complete, elapsed time: 00:01:01
channel ch2: throttle time: 0:00:53
channel ch2: starting incremental level 1 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00007
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/tbs_sm.dbf
channel ch2: starting piece 1 at 25-JUL-09
channel ch1: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e7kkvrt9.DBF
tag=TAG20090725T010156 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:33
channel ch1: throttle time: 0:00:29
channel ch1: starting incremental level 1 datafile backupset
channel ch1: specifying datafile(s) in backupset
input datafile fno=00018
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs02_2.dbf
channel ch1: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e8kkvrta.DBF
tag=TAG20090725T010156 comment=NONE
channel ch3: backup set complete, elapsed time: 00:00:33
channel ch3: throttle time: 0:00:30
channel ch3: starting incremental level 1 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00008 name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/data1
channel ch3: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e9kkvru3.DBF
tag=TAG20090725T010156 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:23
channel ch2: throttle time: 0:00:15
channel ch2: starting incremental level 1 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00009 name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/data2
channel ch2: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ebkkvrub.DBF
tag=TAG20090725T010156 comment=NONE
channel ch3: backup set complete, elapsed time: 00:00:16
channel ch3: throttle time: 0:00:15
channel ch3: starting incremental level 1 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00010 name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/data3
channel ch3: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eckkvrur.DBF
tag=TAG20090725T010156 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:15
channel ch2: throttle time: 0:00:15
channel ch2: starting incremental level 1 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00011 name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/data4
channel ch2: starting piece 1 at 25-JUL-09
channel ch1: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eakkvrub.DBF
tag=TAG20090725T010156 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:31
channel ch1: throttle time: 0:00:31
channel ch1: starting incremental level 1 datafile backupset
channel ch1: specifying datafile(s) in backupset
input datafile fno=00002
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/undo1_01
channel ch1: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/edkkvrur.DBF
tag=TAG20090725T010156 comment=NONE
channel ch3: backup set complete, elapsed time: 00:00:16
channel ch3: throttle time: 0:00:15
channel ch3: starting incremental level 1 datafile backupset
channel ch3: specifying datafile(s) in backupset
input datafile fno=00003
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/sysaux.dbf
channel ch3: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eekkvrva.DBF
tag=TAG20090725T010156 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:16
channel ch2: throttle time: 0:00:14
channel ch2: starting incremental level 1 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00015
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_1.dbf
channel ch2: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ehkkvrvr.DBF
tag=TAG20090725T010156 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:35
channel ch2: throttle time: 0:00:32
channel ch2: starting incremental level 1 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00016
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_2.dbf
channel ch2: starting piece 1 at 25-JUL-09
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eikkvs0u.DBF
tag=TAG20090725T010156 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:35
channel ch2: throttle time: 0:00:32
channel ch2: starting incremental level 1 datafile backupset
channel ch2: specifying datafile(s) in backupset
input datafile fno=00001
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/system_01
channel ch2: starting piece 1 at 25-JUL-09
channel ch1: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/efkkvrvb.DBF
tag=TAG20090725T010156 comment=NONE
channel ch1: backup set complete, elapsed time: 00:02:42
channel ch1: throttle time: 0:02:39
channel ch1: starting incremental level 1 datafile backupset
channel ch1: specifying datafile(s) in backupset
input datafile fno=00005
name=/ora/DOGRC1P/backup01/oradata/RMANCAT1/RMANCAT1/datafile/o1_mf_undo
tbs1_56g8rt9z_.dbf
channel ch1: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/egkkvrvb.DBF
tag=TAG20090725T010156 comment=NONE
channel ch3: backup set complete, elapsed time: 00:04:37
channel ch3: throttle time: 0:04:32
channel ch3: starting incremental level 1 datafile backupset
channel ch3: specifying datafile(s) in backupset
including current SPFILE in backupset
channel ch3: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/elkkvs81.DBF
tag=TAG20090725T010156 comment=NONE
channel ch3: backup set complete, elapsed time: 00:00:01
channel ch3: starting incremental level 1 datafile backupset
channel ch3: specifying datafile(s) in backupset
including current control file in backupset
channel ch3: starting piece 1 at 25-JUL-09
channel ch3: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/emkkvs82.DBF
tag=TAG20090725T010156 comment=NONE
channel ch3: backup set complete, elapsed time: 00:03:06
channel ch3: throttle time: 0:03:03
channel ch1: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ekkkvs4d.DBF
tag=TAG20090725T010156 comment=NONE
channel ch1: backup set complete, elapsed time: 00:05:06
channel ch1: throttle time: 0:05:02
channel ch2: finished piece 1 at 25-JUL-09
piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ejkkvs22.DBF
tag=TAG20090725T010156 comment=NONE
channel ch2: backup set complete, elapsed time: 00:06:21
channel ch2: throttle time: 0:06:16
Finished backup at 25-JUL-09
released channel: ch1
released channel: ch2
released channel: ch3

*****************
RMAN> list backup;

List of Backup Sets


===================

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
312 Incr 0 3.11M DISK 00:00:32 25-JUL-09
BP Key: 312 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/djkkvr7a.DBF
List of Datafiles in backup set 312
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
4 0 Incr 2600648 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/users

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
313 Incr 0 27.09M DISK 00:00:56 25-JUL-09
BP Key: 313 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dikkvr7a.DBF
List of Datafiles in backup set 313
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
12 0 Incr 2600647 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/priya01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
314 Incr 0 4.09M DISK 00:00:32 25-JUL-09
BP Key: 314 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dkkkvr8d.DBF
List of Datafiles in backup set 314
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
6 0 Incr 2600664 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/r_tbs01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
315 Incr 0 96.00K DISK 00:00:32 25-JUL-09
BP Key: 315 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dlkkvr97.DBF
List of Datafiles in backup set 315
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
13 0 Incr 2600673 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/data1.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
316 Incr 0 96.00K DISK 00:00:32 25-JUL-09
BP Key: 316 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dmkkvr9e.DBF
List of Datafiles in backup set 316
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
17 0 Incr 2600677 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs02_1.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
317 Incr 0 5.61M DISK 00:00:16 25-JUL-09
BP Key: 317 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dokkvraf.DBF
List of Datafiles in backup set 317
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
7 0 Incr 2600690 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/tbs_sm.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
318 Incr 0 248.00K DISK 00:00:33 25-JUL-09
BP Key: 318 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dnkkvra8.DBF
List of Datafiles in backup set 318
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
18 0 Incr 2600686 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs02_2.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
319 Incr 0 96.00K DISK 00:00:16 25-JUL-09
BP Key: 319 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dpkkvrb9.DBF
List of Datafiles in backup set 319
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
8 0 Incr 2600699 25-JUL-09 /ora/DOGRC1P/backup01/oradata/RMANCAT1/data1
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
320 Incr 0 128.00K DISK 00:00:17 25-JUL-09
BP Key: 320 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dqkkvrba.DBF
List of Datafiles in backup set 320
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
9 0 Incr 2600701 25-JUL-09 /ora/DOGRC1P/backup01/oradata/RMANCAT1/data2

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
321 Incr 0 96.00K DISK 00:00:17 25-JUL-09
BP Key: 321 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/drkkvrbp.DBF
List of Datafiles in backup set 321
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
10 0 Incr 2600708 25-JUL-09 /ora/DOGRC1P/backup01/oradata/RMANCAT1/data3

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
322 Incr 0 128.00K DISK 00:00:17 25-JUL-09
BP Key: 322 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dskkvrbt.DBF
List of Datafiles in backup set 322
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
11 0 Incr 2600710 25-JUL-09 /ora/DOGRC1P/backup01/oradata/RMANCAT1/data4

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
323 Incr 0 80.00K DISK 00:00:00 25-JUL-09
BP Key: 323 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dukkvrcg.DBF
SPFILE Included: Modification time: 24-JUL-09

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
324 Incr 0 15.30M DISK 00:00:31 25-JUL-09
BP Key: 324 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dvkkvrch.DBF
Control File Included: Ckp SCN: 2600718 Ckp time: 25-JUL-09

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
325 Incr 0 9.17M DISK 00:03:07 25-JUL-09
BP Key: 325 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e0kkvrdl.DBF
List of Datafiles in backup set 325
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
2 0 Incr 2600731 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/undo1_01

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
326 Incr 0 139.38M DISK 00:05:02 25-JUL-09
BP Key: 326 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dtkkvrcc.DBF
List of Datafiles in backup set 326
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
3 0 Incr 2600716 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/sysaux.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
327 Incr 0 4.09M DISK 00:00:47 25-JUL-09
BP Key: 327 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e2kkvrm4.DBF
List of Datafiles in backup set 327
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
15 0 Incr 2600829 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_1.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
328 Incr 0 247.71M DISK 00:09:29 25-JUL-09
BP Key: 328 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dhkkvr7a.DBF
List of Datafiles in backup set 328
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 0 Incr 2600646 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/system_01

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
329 Incr 0 5.09M DISK 00:00:39 25-JUL-09
BP Key: 329 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e3kkvrns.DBF
List of Datafiles in backup set 329
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
16 0 Incr 2601022 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_2.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
330 Incr 0 9.87M DISK 00:02:51 25-JUL-09
BP Key: 330 Status: AVAILABLE Compressed: NO Tag: TAG20090725T005049
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e1kkvrjp.DBF
List of Datafiles in backup set 330
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
5 0 Incr 2600799 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/RMANCAT1/datafile/o1_mf_undotbs1_5
6g8rt9z_.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
331 Incr 1 4.50M DISK 00:00:30 25-JUL-09
BP Key: 331 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e4kkvrs6.DBF
List of Datafiles in backup set 331
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
4 1 Incr 2601171 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/users

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
332 Incr 1 32.00K DISK 00:00:30 25-JUL-09
BP Key: 332 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e6kkvrs6.DBF
List of Datafiles in backup set 332
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
6 1 Incr 2601173 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/r_tbs01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
333 Incr 1 32.00K DISK 00:00:54 25-JUL-09
BP Key: 333 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e5kkvrs6.DBF
List of Datafiles in backup set 333
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
12 1 Incr 2601172 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/priya01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
334 Incr 1 72.00K DISK 00:00:30 25-JUL-09
BP Key: 334 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e7kkvrt9.DBF
List of Datafiles in backup set 334
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
13 1 Incr 2601193 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/data1.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
335 Incr 1 32.00K DISK 00:00:30 25-JUL-09
BP Key: 335 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e8kkvrta.DBF
List of Datafiles in backup set 335
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
17 1 Incr 2601194 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs02_1.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
336 Incr 1 3.81M DISK 00:00:15 25-JUL-09
BP Key: 336 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e9kkvru3.DBF
List of Datafiles in backup set 336
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
7 1 Incr 2601203 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/tbs_sm.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
337 Incr 1 32.00K DISK 00:00:15 25-JUL-09
BP Key: 337 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ebkkvrub.DBF
List of Datafiles in backup set 337
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
8 1 Incr 2601209 25-JUL-09 /ora/DOGRC1P/backup01/oradata/RMANCAT1/data1

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
338 Incr 1 32.00K DISK 00:00:15 25-JUL-09
BP Key: 338 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eckkvrur.DBF
List of Datafiles in backup set 338
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
9 1 Incr 2601215 25-JUL-09 /ora/DOGRC1P/backup01/oradata/RMANCAT1/data2

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
339 Incr 1 32.00K DISK 00:00:31 25-JUL-09
BP Key: 339 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eakkvrub.DBF
List of Datafiles in backup set 339
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
18 1 Incr 2601208 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs02_2.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
340 Incr 1 32.00K DISK 00:00:15 25-JUL-09
BP Key: 340 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/edkkvrur.DBF
List of Datafiles in backup set 340
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
10 1 Incr 2601216 25-JUL-09 /ora/DOGRC1P/backup01/oradata/RMANCAT1/data3

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
341 Incr 1 32.00K DISK 00:00:15 25-JUL-09
BP Key: 341 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eekkvrva.DBF
List of Datafiles in backup set 341
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
11 1 Incr 2601222 25-JUL-09 /ora/DOGRC1P/backup01/oradata/RMANCAT1/data4

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
342 Incr 1 32.00K DISK 00:00:32 25-JUL-09
BP Key: 342 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ehkkvrvr.DBF
List of Datafiles in backup set 342
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
15 1 Incr 2601231 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_1.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
343 Incr 1 32.00K DISK 00:00:33 25-JUL-09
BP Key: 343 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eikkvs0u.DBF
List of Datafiles in backup set 343
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
16 1 Incr 2601244 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_2.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
344 Incr 1 168.00K DISK 00:02:41 25-JUL-09
BP Key: 344 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/efkkvrvb.DBF
List of Datafiles in backup set 344
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
2 1 Incr 2601223 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/undo1_01

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
345 Incr 1 40.00K DISK 00:04:35 25-JUL-09
BP Key: 345 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/egkkvrvb.DBF
List of Datafiles in backup set 345
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
3 1 Incr 2601225 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/sysaux.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
346 Incr 1 80.00K DISK 00:00:00 25-JUL-09
BP Key: 346 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/elkkvs81.DBF
SPFILE Included: Modification time: 24-JUL-09

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
347 Incr 1 15.30M DISK 00:03:06 25-JUL-09
BP Key: 347 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/emkkvs82.DBF
Control File Included: Ckp SCN: 2602153 Ckp time: 25-JUL-09

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
348 Incr 1 1.19M DISK 00:06:20 25-JUL-09
BP Key: 348 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ejkkvs22.DBF
List of Datafiles in backup set 348
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 1 Incr 2601259 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/system_01

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
349 Incr 1 112.00K DISK 00:05:05 25-JUL-09
BP Key: 349 Status: AVAILABLE Compressed: NO Tag: TAG20090725T010156
Piece Name: /ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ekkkvs4d.DBF
List of Datafiles in backup set 349
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
5 1 Incr 2601453 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/RMANCAT1/datafile/o1_mf_undotbs1_5
6g8rt9z_.dbf

Check the size differences in the level 0 and level1 backups.

7. LIST OUT ALL THE BACKUPS TAKEN BY SUMMARY.

RMAN> list backup summary;

List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
312 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
313 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
314 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
315 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
316 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
317 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
318 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
319 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
320 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
321 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
322 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
323 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
324 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
325 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
326 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
327 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
328 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
329 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
330 B 0 A DISK 25-JUL-09 1 1 NO TAG20090725T005049
331 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
332 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
333 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
334 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
335 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
336 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
337 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
338 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
339 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
340 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
341 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
342 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
343 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
344 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
345 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
346 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
347 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
348 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156
349 B 1 A DISK 25-JUL-09 1 1 NO TAG20090725T010156

8. LIST OUT ALL THE BACKUPS OF ARCHIVE LOG FROM


SEQUENCE NO 930-940.

RMAN> list archivelog from logseq 930 until logseq 940;

List of Archived Log Copies


Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
1583 1 930 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_930_56ohb14k_.arc
1584 1 931 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_931_56ohb2gm_.arc
1585 1 932 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_932_56ohb4sg_.arc
1586 1 933 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_933_56ohb647_.arc
1587 1 934 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_934_56ohb7sb_.arc
1588 1 935 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_935_56ohb93v_.arc
1589 1 936 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_936_56ohbbt1_.arc
1590 1 937 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_937_56ohbd4q_.arc
1591 1 938 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_938_56ohdm2l_.arc
1592 1 939 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_939_56ohdmnc_.arc
1593 1 940 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_940_56oj5x76_.arc

9. LIST OUT ALL THE BACKUPS BY DATAFILES(LIST BACKUP BY


FILES).

RMAN> LIST BACKUP BY FILE;

List of Datafile Backups


========================

File Key TY LV S Ckp SCN Ckp Time #Pieces #Copies Compressed Tag
---- ------- - -- - ---------- --------- ------- ------- ---------- ---
1 348 B 1 A 2601259 25-JUL-09 1 1 NO TAG20090725T010156
328 B 0 A 2600646 25-JUL-09 1 1 NO TAG20090725T005049
2 344 B 1 A 2601223 25-JUL-09 1 1 NO TAG20090725T010156
325 B 0 A 2600731 25-JUL-09 1 1 NO TAG20090725T005049
3 345 B 1 A 2601225 25-JUL-09 1 1 NO TAG20090725T010156
326 B 0 A 2600716 25-JUL-09 1 1 NO TAG20090725T005049
4 331 B 1 A 2601171 25-JUL-09 1 1 NO TAG20090725T010156
312 B 0 A 2600648 25-JUL-09 1 1 NO TAG20090725T005049
5 349 B 1 A 2601453 25-JUL-09 1 1 NO TAG20090725T010156
330 B 0 A 2600799 25-JUL-09 1 1 NO TAG20090725T005049
6 332 B 1 A 2601173 25-JUL-09 1 1 NO TAG20090725T010156
314 B 0 A 2600664 25-JUL-09 1 1 NO TAG20090725T005049
7 336 B 1 A 2601203 25-JUL-09 1 1 NO TAG20090725T010156
317 B 0 A 2600690 25-JUL-09 1 1 NO TAG20090725T005049
8 337 B 1 A 2601209 25-JUL-09 1 1 NO TAG20090725T010156
319 B 0 A 2600699 25-JUL-09 1 1 NO TAG20090725T005049
9 338 B 1 A 2601215 25-JUL-09 1 1 NO TAG20090725T010156
320 B 0 A 2600701 25-JUL-09 1 1 NO TAG20090725T005049
10 340 B 1 A 2601216 25-JUL-09 1 1 NO TAG20090725T010156
321 B 0 A 2600708 25-JUL-09 1 1 NO TAG20090725T005049
11 341 B 1 A 2601222 25-JUL-09 1 1 NO TAG20090725T010156
322 B 0 A 2600710 25-JUL-09 1 1 NO TAG20090725T005049
12 333 B 1 A 2601172 25-JUL-09 1 1 NO TAG20090725T010156
313 B 0 A 2600647 25-JUL-09 1 1 NO TAG20090725T005049
13 334 B 1 A 2601193 25-JUL-09 1 1 NO TAG20090725T010156
315 B 0 A 2600673 25-JUL-09 1 1 NO TAG20090725T005049
15 342 B 1 A 2601231 25-JUL-09 1 1 NO TAG20090725T010156
327 B 0 A 2600829 25-JUL-09 1 1 NO TAG20090725T005049
16 343 B 1 A 2601244 25-JUL-09 1 1 NO TAG20090725T010156
329 B 0 A 2601022 25-JUL-09 1 1 NO TAG20090725T005049
17 335 B 1 A 2601194 25-JUL-09 1 1 NO TAG20090725T010156
316 B 0 A 2600677 25-JUL-09 1 1 NO TAG20090725T005049
18 339 B 1 A 2601208 25-JUL-09 1 1 NO TAG20090725T010156
318 B 0 A 2600686 25-JUL-09 1 1 NO TAG20090725T005049

List of Control File Backups


============================

CF Ckp SCN Ckp Time BS Key S #Pieces #Copies Compressed Tag


---------- --------- ------- - ------- ------- ---------- ---
2602153 25-JUL-09 347 A 1 1 NO TAG20090725T010156
2600718 25-JUL-09 324 A 1 1 NO TAG20090725T005049
List of SPFILE Backups
======================

Modification Time BS Key S #Pieces #Copies Compressed Tag


----------------- ------- - ------- ------- ---------- ---
24-JUL-09 346 A 1 1 NO TAG20090725T010156
24-JUL-09 323 A 1 1 NO TAG20090725T005049

10. LIST OUT ALL THE IMAGE COPIES.

RMAN> LIST COPY;

List of Datafile Copies


Key File S Completion Time Ckp SCN Ckp Time Name
------- ---- - --------------- ---------- --------------- ----
126 2 A 24-JUL-09 2555441 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/datafile/o1_mf_undotbs
1_56m6r69t_.dbf
127 5 A 24-JUL-09 2555445 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/datafile/o1_mf_undotbs
1_56m6rfr0_.dbf
125 7 A 24-JUL-09 2530207 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/datafile/o1_mf_mona_t
bs_56m04rdm_.dbf
117 8 A 18-JUL-09 1299709 18-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/9tkkda06.dbf
141 15 A 24-JUL-09 2559180 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01_1.dbf
140 15 A 24-JUL-09 2559162 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/XYZ.DBF
138 15 A 24-JUL-09 2559125 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/data_D-RMANCAT1_I-
2968604067_TS-JRTBS01_FNO-15_c5kktpfs.DBF
134 15 A 24-JUL-09 2556203 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz11.dbf
133 15 A 24-JUL-09 2556169 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz.dbf
132 15 A 24-JUL-09 2556112 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs011.dbf
130 15 A 24-JUL-09 2556015 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bgkktki6.dbf
129 15 A 24-JUL-09 2555955 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01.dbf
128 15 A 24-JUL-09 2555942 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/jrtbs01.dbf
142 16 A 24-JUL-09 2559198 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01_2.dbf
139 16 A 24-JUL-09 2559127 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/data_D-RMANCAT1_I-
2968604067_TS-JRTBS01_FNO-16_c6kktpft.DBF
135 16 A 24-JUL-09 2556265 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/test.dbf
131 16 A 24-JUL-09 2556016 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bhkktki8.dbf

List of Archived Log Copies


Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
1530 1 877 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_877_56m4jroh_.arc
1531 1 878 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_878_56m4ydh4_.arc
1532 1 879 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_879_56m55p8x_.arc
1533 1 880 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_880_56m8gknr_.arc
1534 1 881 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_881_56mcfho3_.arc
1535 1 882 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_882_56mcfjt9_.arc
1536 1 883 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_883_56mcg242_.arc
1537 1 884 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_884_56mdntlw_.arc
1538 1 885 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_885_56mdo7hm_.arc
1539 1 886 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_886_56mdp49c_.arc
1540 1 887 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_887_56mhs3vh_.arc
1541 1 888 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_888_56mhs895_.arc
1542 1 889 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_889_56mhsgy1_.arc
1543 1 890 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_890_56mjqjyv_.arc
1544 1 891 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_891_56mrzlqc_.arc
1545 1 892 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_892_56n1ss8d_.arc
1546 1 893 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_893_56nbl50h_.arc
1547 1 894 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_894_56npbcpb_.arc
1548 1 895 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_895_56nz2p7w_.arc
1549 1 896 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_896_56o4bvxv_.arc
1550 1 897 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_897_56o4clqb_.arc
1551 1 898 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_898_56o4crj8_.arc
1552 1 899 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_899_56o4cyl2_.arc
1553 1 900 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_900_56o4d4kg_.arc
1554 1 901 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_901_56o4dbhp_.arc
1555 1 902 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_902_56o4dmmq_.arc
1556 1 903 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_903_56o4dygp_.arc
1557 1 904 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_904_56o4f8qs_.arc
1558 1 905 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_905_56o4fjpy_.arc
1559 1 906 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_906_56o4fqqz_.arc
1560 1 907 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_907_56o4gdv1_.arc
1561 1 908 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_908_56o4yvow_.arc
1562 1 909 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_909_56o7xj69_.arc
1563 1 910 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_910_56o7xo47_.arc
1564 1 911 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_911_56o8q0yx_.arc
1565 1 912 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_912_56o9bpvq_.arc
1566 1 913 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_913_56o9bvdy_.arc
1567 1 914 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_914_56o9mgp5_.arc
1568 1 915 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_24
/o1_mf_1_915_56obs72n_.arc
1569 1 916 A 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_916_56odls5y_.arc
1570 1 917 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_917_56odlsvr_.arc
1571 1 918 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_918_56of9mv1_.arc
1572 1 919 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_919_56ofhtd9_.arc
1573 1 920 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_920_56og1yho_.arc
1574 1 921 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_921_56og21cg_.arc
1575 1 922 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_922_56og5kd3_.arc
1576 1 923 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_923_56og5vdh_.arc
1577 1 924 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_924_56ogt68h_.arc
1578 1 925 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_925_56ogt6tj_.arc
1579 1 926 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_926_56ogv664_.arc
1580 1 927 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_927_56ogw52g_.arc
1581 1 928 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_928_56ogw79y_.arc
1582 1 929 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_929_56ogw7v1_.arc
1583 1 930 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_930_56ohb14k_.arc
1584 1 931 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_931_56ohb2gm_.arc
1585 1 932 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_932_56ohb4sg_.arc
1586 1 933 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_933_56ohb647_.arc
1587 1 934 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_934_56ohb7sb_.arc
1588 1 935 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_935_56ohb93v_.arc
1589 1 936 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_936_56ohbbt1_.arc
1590 1 937 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_937_56ohbd4q_.arc
1591 1 938 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_938_56ohdm2l_.arc
1592 1 939 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_939_56ohdmnc_.arc
1593 1 940 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_940_56oj5x76_.arc
1594 1 941 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_941_56okp5oy_.arc
1595 1 942 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_942_56olhmnv_.arc
1596 1 943 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_943_56olpvl7_.arc
1597 1 944 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_944_56olw7wv_.arc
1598 1 945 A 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/2009_07_25
/o1_mf_1_945_56om1qof_.arc

11. LIST OUT ALL THE BACKUPS BY THE TAG "BACKUP_USERS".

RMAN> LIST BACKUP TAG JR_BACKUP_USERS;

List of Backup Sets


===================

BS Key Type LV Size Device Type Elapsed Time Completion Time


------- ---- -- ---------- ----------- ------------ ---------------
350 Full 9.16M DISK 00:00:01 25-JUL-09
BP Key: 350 Status: AVAILABLE Compressed: NO Tag: JR_BACKUP_USERS
Piece Name:
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/backupset/2009_07_25/
o1_mf_nnndf_JR_BACKUP_USERS_56omrnvk_.bkp
List of Datafiles in backup set 350
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
15 Full 2605286 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_1.dbf
16 Full 2605286 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs01_2.dbf

12. REPORT ALL THE FILES WHICH HAS LESS THAN 2 COPIES OF
BACKUPS.

RMAN> report need backup redundancy 2;

Report of files with less than 2 redundant backups


File #bkps Name
---- ----- -----------------------------------------------------
1 1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/system_01
3 1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/sysaux.dbf
4 1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/users
6 1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/r_tbs01.dbf
7 1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/tbs_sm.dbf
8 1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/data1
9 1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/data2
10 1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/data3
11 1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/data4
12 1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/priya01.dbf
13 1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/data1.dbf
17 1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs02_1.dbf
18 1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/jrtbs02_2.dbf
19 0 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/users02.dbf

13. REPORT ALL THE FILES CONSIDER OBSOLETE UNDER THE


PRESENT RETENTION POLICY.
RMAN> report obsolete;

RMAN retention policy will be applied to the command


RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Datafile Copy 117 18-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/9tkkda06.dbf
Datafile Copy 125 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/datafile/o1_mf_
mona_tbs_56m04rdm_.dbf
Datafile Copy 126 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/datafile/o1_mf_
undotbs1_56m6r69t_.dbf
Datafile Copy 127 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/datafile/o1_mf_
undotbs1_56m6rfr0_.dbf
Datafile Copy 128 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/jrtbs01.dbf
Datafile Copy 129 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01.dbf
Datafile Copy 130 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bgkktki6.dbf
Datafile Copy 131 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bhkktki8.dbf
Datafile Copy 132 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs011.dbf
Datafile Copy 133 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz.dbf
Datafile Copy 134 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz11.dbf
Datafile Copy 135 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/test.dbf
Datafile Copy 138 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/data_D-RMANCAT1_I-
2968604067_TS-JRTBS01_FNO-15_c5kktpfs.DBF
Datafile Copy 139 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/data_D-RMANCAT1_I-
2968604067_TS-JRTBS01_FNO-16_c6kktpft.DBF
Datafile Copy 140 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/XYZ.DBF
Datafile Copy 141 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01_1.dbf
Datafile Copy 142 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01_2.dbf
Backup Set 323 25-JUL-09
Backup Piece 323 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dukkvrcg.DBF
Backup Set 324 25-JUL-09
Backup Piece 324 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dvkkvrch.DBF
Backup Set 327 25-JUL-09
Backup Piece 327 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e2kkvrm4.DBF
Backup Set 329 25-JUL-09
Backup Piece 329 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e3kkvrns.DBF
Backup Set 342 25-JUL-09
Backup Piece 342 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ehkkvrvr.DBF
Backup Set 343 25-JUL-09
Backup Piece 343 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eikkvs0u.DBF

14. REPORT ALL THE FILES THAT HASN'T BEEN BACKED UP IN THE
LAST 2 DAYS.

RMAN> report need backup days=2;

Report of files whose recovery needs more than 2 days of archived logs
File Days Name
---- ----- -----------------------------------------------------
19 5 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/users02.dbf

15. REPORT ALL THE FILES NEEDED WHICH HAS A RECOVERY


WINDOW OF LESS THAN 2 DAYS.

RMAN> report need backup recovery window of 2 days;

Report of files that must be backed up to satisfy 2 days recovery window


File Days Name
---- ----- -----------------------------------------------------
19 5 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/users02.dbf

16. REPORT UNRECOVERABLE FILE IF ANY.

RMAN> report unrecoverable;

Report of files that need backup due to unrecoverable operations


File Type of Backup Required Name
---- ----------------------- -----------------------------------

17. DELETE THE BACKUP FILE OF "tujuyjiuTBS01" TABLESPACE


MANUALLY FROM THE BACKUP LOCATION AND THE RUN A
CROSSCHECK ON THE PRESENT BACKUPS. FINALLY VERIFY THE
STATUS OF THE “ TBS01” TABLESPACE BACKUP.

spdwd606:/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles[RMANCAT1]$
cd
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/backupset/
2009_07_25/
spdwd606:/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/backup
set/2009_07_25[RMANCAT1]$ ls -lrt
total 18784
-rw-r----- 1 oracle oinstall 9617408 Jul 25 02:23
o1_mf_nnndf_JR_BACKUP_USERS_56omrnvk_.bkp
spdwd606:/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/backup
set/2009_07_25[RMANCAT1]$ rm
o1_mf_nnndf_JR_BACKUP_USERS_56omrnvk_.bkp
spdwd606:/ora/DOGRC1P/bachhhhkup01/oradata/RMANCAT1/fra/RMANCAT1/ba
ckupset/2009_07_25[RMANCAT1]$ ls
spdwd606:/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/backup
set/2009_07_25[RMANCAT1]$

RMAN> crosscheck backup device type disk;

released channel: ORA_DISK_1


allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=181 devtype=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/djkkvr7a.DBF
recid=312 stamp=693103850
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dikkvr7a.DBF
recid=313 stamp=693103850
crosschecked backup piece: found to be 'AVAILABLE'
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dkkkvr8d.DBF recid=314
stamp=693103885
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dlkkvr97.DBF
recid=315 stamp=693103911
crosschecked backup piece: found to be 'AVAILABLE'
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dmkkvr9e.DBF recid=316
stamp=693103918
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dokkvraf.DBF
recid=317 stamp=693103951
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dnkkvra8.DBF
recid=318 stamp=693103944
crosschecked backup piece: found to be 'AVAILABLE'
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dpkkvrb9.DBF recid=319
stamp=693103977
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dqkkvrba.DBF
recid=320 stamp=693103978
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/drkkvrbp.DBF
recid=321 stamp=693103993
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dskkvrbt.DBF
recid=322 stamp=693103997
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dukkvrcg.DBF
recid=323 stamp=693104016
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dvkkvrch.DBF
recid=324 stamp=693104018
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e0kkvrdl.DBF
recid=325 stamp=693104053
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dtkkvrcc.DBF
recid=326 stamp=693104012
crosschecked backup piece: found to be 'AVAILABLE'
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e2kkvrm4.DBF recid=327
stamp=693104324
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dhkkvr7a.DBF
recid=328 stamp=693103850
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e3kkvrns.DBF
recid=329 stamp=693104380
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e1kkvrjp.DBF
recid=330 stamp=693104249
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e4kkvrs6.DBF
recid=331 stamp=693104518
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e6kkvrs6.DBF
recid=332 stamp=693104518
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e5kkvrs6.DBF
recid=333 stamp=693104518
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e7kkvrt9.DBF
recid=334 stamp=693104553
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e8kkvrta.DBF
recid=335 stamp=693104554
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e9kkvru3.DBF
recid=336 stamp=693104579
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ebkkvrub.DBF
recid=337 stamp=693104587
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eckkvrur.DBF
recid=338 stamp=693104603
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eakkvrub.DBF
recid=339 stamp=693104587
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/edkkvrur.DBF
recid=340 stamp=693104603
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eekkvrva.DBF
recid=341 stamp=693104618
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ehkkvrvr.DBF
recid=342 stamp=693104635
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eikkvs0u.DBF
recid=343 stamp=693104670
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/efkkvrvb.DBF
recid=344 stamp=693104619
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/egkkvrvb.DBF
recid=345 stamp=693104619
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/elkkvs81.DBF
recid=346 stamp=693104897
crosschecked backup piece: found to be 'AVAILABLE'
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/emkkvs82.DBF recid=347
stamp=693104899
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ejkkvs22.DBF
recid=348 stamp=693104706
crosschecked backup piece: found to be 'AVAILABLE'
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ekkkvs4d.DBF recid=349
stamp=693104781
crosschecked backup piece: found to be 'EXPIRED'
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/backupset/2009
_07_25/o1_mf_nnndf_JR_BACKUP_USERS_56omrnvk_.bkp recid=350
stamp=693109412
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/usr/app/oracle/product/10.2.0/dbs/control_file_rman_copy.ctl
recid=351 stamp=693111283
Crosschecked 40 objects

RMAN> delete expired backup device type disk;

released channel: ORA_DISK_1


allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=181 devtype=DISK

List of Backup Pieces


BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
350 350 1 1 EXPIRED DISK
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/backupset/2009_07_25/
o1_mf_nnndf_JR_BACKUP_USERS_56omrnvk_.bkp

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/backupset/2009
_07_25/o1_mf_nnndf_JR_BACKUP_USERS_56omrnvk_.bkp recid=350
stamp=693109412
Deleted 1 EXPIRED objects

18. DELETE ALL THE BACKUPS THAT ARE NO MORE NEEDED UNDER
THE PRESENT RETENTION POLICY.

RMAN> delete obsolete device type disk;

RMAN retention policy will be applied to the command


RMAN retention policy is set to redundancy 1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=181 devtype=DISK
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Datafile Copy 117 18-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/9tkkda06.dbf
Datafile Copy 125 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/datafile/o1_mf_
mona_tbs_56m04rdm_.dbf
Datafile Copy 126 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/datafile/o1_mf_
undotbs1_56m6r69t_.dbf
Datafile Copy 127 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/datafile/o1_mf_
undotbs1_56m6rfr0_.dbf
Datafile Copy 128 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/jrtbs01.dbf
Datafile Copy 129 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01.dbf
Datafile Copy 130 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bgkktki6.dbf
Datafile Copy 131 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bhkktki8.dbf
Datafile Copy 132 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs011.dbf
Datafile Copy 133 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz.dbf
Datafile Copy 134 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz11.dbf
Datafile Copy 135 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/test.dbf
Datafile Copy 138 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/data_D-RMANCAT1_I-
2968604067_TS-JRTBS01_FNO-15_c5kktpfs.DBF
Datafile Copy 139 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/data_D-RMANCAT1_I-
2968604067_TS-JRTBS01_FNO-16_c6kktpft.DBF
Datafile Copy 140 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/XYZ.DBF
Datafile Copy 141 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01_1.dbf
Datafile Copy 142 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01_2.dbf
Backup Set 323 25-JUL-09
Backup Piece 323 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dukkvrcg.DBF
Backup Set 324 25-JUL-09
Backup Piece 324 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dvkkvrch.DBF
Backup Set 347 25-JUL-09
Backup Piece 347 25-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/emkkvs82.DBF

Do you really want to delete the above objects (enter YES or NO)? yes
deleted datafile copy
datafile copy
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/datafil
e/o1_mf_mona_tbs_56m04rdm_.dbf recid=125 stamp=693023784
deleted datafile copy
datafile copy
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/datafil
e/o1_mf_undotbs1_56m6r69t_.dbf recid=126 stamp=693030554
deleted datafile copy
datafile copy
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/datafil
e/o1_mf_undotbs1_56m6rfr0_.dbf recid=127 stamp=693030561
deleted datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/data_D-
RMANCAT1_I-2968604067_TS-JRTBS01_FNO-15_c5kktpfs.DBF recid=138
stamp=693036540
deleted datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/data_D-
RMANCAT1_I-2968604067_TS-JRTBS01_FNO-16_c6kktpft.DBF recid=139
stamp=693036542
deleted datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/XYZ.DBF
recid=140 stamp=693036616
deleted datafile copy
datafile copy
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01_1.dbf
recid=141 stamp=693036646
deleted datafile copy
datafile copy
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01_2.dbf
recid=142 stamp=693036661
deleted backup piece
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dukkvrcg.DBF
recid=323 stamp=693104016
deleted backup piece
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dvkkvrch.DBF
recid=324 stamp=693104018
deleted backup piece
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/emkkvs82.DBF
recid=347 stamp=693104899
Deleted 11 objects

RMAN-06207: WARNING: 9 objects could not be deleted for DISK channel(s) due
RMAN-06208: to mismatched status. Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: ==========================
RMAN-06212: Object Type Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Datafile Copy
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/9tkkda06.dbf
RMAN-06214: Datafile Copy
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/jrtbs01.dbf
RMAN-06214: Datafile Copy
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01.dbf
RMAN-06214: Datafile Copy
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bgkktki6.dbf
RMAN-06214: Datafile Copy
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bhkktki8.dbf
RMAN-06214: Datafile Copy
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs011.dbf
RMAN-06214: Datafile Copy
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz.dbf
RMAN-06214: Datafile Copy
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz11.dbf
RMAN-06214: Datafile Copy
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/test.dbf

19. DELETE ALL THE BACKUPS THAT ARE NOT PRESENT PHYSICALLY
IN THEIR LOCATION.
RMAN> crosscheck copy;

released channel: ORA_DISK_1


allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=181 devtype=DISK
validation failed for datafile copy
datafile copy
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/9tkkda06.dbf
recid=117 stamp=692496391
validation failed for datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz11.dbf
recid=134 stamp=693031887
validation failed for datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz.dbf
recid=133 stamp=693031840
validation failed for datafile copy
datafile copy
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs011.dbf
recid=132 stamp=693031702
validation failed for datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bgkktki6.dbf
recid=130 stamp=693031495
validation failed for datafile copy
datafile copy
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01.dbf
recid=129 stamp=693031352
validation failed for datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/jrtbs01.dbf
recid=128 stamp=693031328
validation failed for datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/test.dbf
recid=135 stamp=693032041
validation failed for datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bhkktki8.dbf
recid=131 stamp=693031496
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_877_56m4jroh_.arc recid=1530 stamp=693028264
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_878_56m4ydh4_.arc recid=1531 stamp=693028700
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_879_56m55p8x_.arc recid=1532 stamp=693028934
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_880_56m8gknr_.arc recid=1533 stamp=693032289
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_881_56mcfho3_.arc recid=1534 stamp=693035327
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_882_56mcfjt9_.arc recid=1535 stamp=693035328
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_883_56mcg242_.arc recid=1536 stamp=693035346
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_884_56mdntlw_.arc recid=1537 stamp=693036586
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_885_56mdo7hm_.arc recid=1538 stamp=693036599
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_886_56mdp49c_.arc recid=1539 stamp=693036628
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_887_56mhs3vh_.arc recid=1540 stamp=693039796
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_888_56mhs895_.arc recid=1541 stamp=693039800
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_889_56mhsgy1_.arc recid=1542 stamp=693039807
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_890_56mjqjyv_.arc recid=1543 stamp=693040769
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_891_56mrzlqc_.arc recid=1544 stamp=693049218
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_892_56n1ss8d_.arc recid=1545 stamp=693058249
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_893_56nbl50h_.arc recid=1546 stamp=693067221
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_894_56npbcpb_.arc recid=1547 stamp=693079259
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_895_56nz2p7w_.arc recid=1548 stamp=693088230
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_896_56o4bvxv_.arc recid=1549 stamp=693093612
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_897_56o4clqb_.arc recid=1550 stamp=693093634
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_898_56o4crj8_.arc recid=1551 stamp=693093640
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_899_56o4cyl2_.arc recid=1552 stamp=693093646
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_900_56o4d4kg_.arc recid=1553 stamp=693093652
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_901_56o4dbhp_.arc recid=1554 stamp=693093658
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_902_56o4dmmq_.arc recid=1555 stamp=693093667
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_903_56o4dygp_.arc recid=1556 stamp=693093678
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_904_56o4f8qs_.arc recid=1557 stamp=693093688
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_905_56o4fjpy_.arc recid=1558 stamp=693093696
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_906_56o4fqqz_.arc recid=1559 stamp=693093703
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_907_56o4gdv1_.arc recid=1560 stamp=693093724
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_908_56o4yvow_.arc recid=1561 stamp=693094251
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_909_56o7xj69_.arc recid=1562 stamp=693097280
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_910_56o7xo47_.arc recid=1563 stamp=693097285
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_911_56o8q0yx_.arc recid=1564 stamp=693098097
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_912_56o9bpvq_.arc recid=1565 stamp=693098726
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_913_56o9bvdy_.arc recid=1566 stamp=693098731
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_914_56o9mgp5_.arc recid=1567 stamp=693099006
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_24/o1_mf_1_915_56obs72n_.arc recid=1568 stamp=693100215
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_916_56odls5y_.arc recid=1569 stamp=693102057
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_917_56odlsvr_.arc recid=1570 stamp=693102057
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_918_56of9mv1_.arc recid=1571 stamp=693102787
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_919_56ofhtd9_.arc recid=1572 stamp=693102986
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_920_56og1yho_.arc recid=1573 stamp=693103566
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_921_56og21cg_.arc recid=1574 stamp=693103569
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_922_56og5kd3_.arc recid=1575 stamp=693103681
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_923_56og5vdh_.arc recid=1576 stamp=693103691
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_924_56ogt68h_.arc recid=1577 stamp=693104342
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_925_56ogt6tj_.arc recid=1578 stamp=693104342
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_926_56ogv664_.arc recid=1579 stamp=693104374
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_927_56ogw52g_.arc recid=1580 stamp=693104405
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_928_56ogw79y_.arc recid=1581 stamp=693104407
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_929_56ogw7v1_.arc recid=1582 stamp=693104407
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_930_56ohb14k_.arc recid=1583 stamp=693104849
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_931_56ohb2gm_.arc recid=1584 stamp=693104850
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_932_56ohb4sg_.arc recid=1585 stamp=693104852
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_933_56ohb647_.arc recid=1586 stamp=693104854
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_934_56ohb7sb_.arc recid=1587 stamp=693104855
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_935_56ohb93v_.arc recid=1588 stamp=693104857
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_936_56ohbbt1_.arc recid=1589 stamp=693104858
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_937_56ohbd4q_.arc recid=1590 stamp=693104860
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_938_56ohdm2l_.arc recid=1591 stamp=693104931
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_939_56ohdmnc_.arc recid=1592 stamp=693104931
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_940_56oj5x76_.arc recid=1593 stamp=693105741
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_941_56okp5oy_.arc recid=1594 stamp=693107285
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_942_56olhmnv_.arc recid=1595 stamp=693108099
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_943_56olpvl7_.arc recid=1596 stamp=693108331
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_944_56olw7wv_.arc recid=1597 stamp=693108504
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_945_56om1qof_.arc recid=1598 stamp=693108679
validation succeeded for archived log
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archiv
elog/2009_07_25/o1_mf_1_946_56opj1xw_.arc recid=1599 stamp=693112210
Crosschecked 79 objects

RMAN> delete expired copy;

released channel: ORA_DISK_1


allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=181 devtype=DISK
specification does not match any archive log in the recovery catalog

List of Datafile Copies


Key File S Completion Time Ckp SCN Ckp Time Name
------- ---- - --------------- ---------- --------------- ----
117 8 X 18-JUL-09 1299709 18-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/9tkkda06.dbf
134 15 X 24-JUL-09 2556203 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz11.dbf
133 15 X 24-JUL-09 2556169 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz.dbf
132 15 X 24-JUL-09 2556112 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs011.dbf
130 15 X 24-JUL-09 2556015 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bgkktki6.dbf
129 15 X 24-JUL-09 2555955 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01.dbf
128 15 X 24-JUL-09 2555942 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/jrtbs01.dbf
135 16 X 24-JUL-09 2556265 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/test.dbf
131 16 X 24-JUL-09 2556016 24-JUL-09
/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bhkktki8.dbf

Do you really want to delete the above objects (enter YES or NO)? y
deleted datafile copy
datafile copy
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/9tkkda06.dbf
recid=117 stamp=692496391
deleted datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz11.dbf
recid=134 stamp=693031887
deleted datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/xyz.dbf
recid=133 stamp=693031840
deleted datafile copy
datafile copy
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs011.dbf
recid=132 stamp=693031702
deleted datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bgkktki6.dbf
recid=130 stamp=693031495
deleted datafile copy
datafile copy
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/copyjrtbs01.dbf
recid=129 stamp=693031352
deleted datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/jrtbs01.dbf
recid=128 stamp=693031328
deleted datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/test.dbf
recid=135 stamp=693032041
deleted datafile copy
datafile copy filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/bhkktki8.dbf
recid=131 stamp=693031496
Deleted 9 EXPIRED objects

RMAN> crosscheck backup device type disk;

released channel: ORA_DISK_1


allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=181 devtype=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/djkkvr7a.DBF
recid=312 stamp=693103850
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dikkvr7a.DBF
recid=313 stamp=693103850
crosschecked backup piece: found to be 'AVAILABLE'
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dkkkvr8d.DBF
recid=314 stamp=693103885
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dlkkvr97.DBF
recid=315 stamp=693103911
crosschecked backup piece: found to be 'AVAILABLE'
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dmkkvr9e.DBF
recid=316 stamp=693103918
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dokkvraf.DBF
recid=317 stamp=693103951
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dnkkvra8.DBF
recid=318 stamp=693103944
crosschecked backup piece: found to be 'AVAILABLE'
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dpkkvrb9.DBF
recid=319 stamp=693103977
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dqkkvrba.DBF
recid=320 stamp=693103978
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/drkkvrbp.DBF
recid=321 stamp=693103993
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dskkvrbt.DBF
recid=322 stamp=693103997
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e0kkvrdl.DBF
recid=325 stamp=693104053
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dtkkvrcc.DBF
recid=326 stamp=693104012
crosschecked backup piece: found to be 'AVAILABLE'
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e2kkvrm4.DBF
recid=327 stamp=693104324
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/dhkkvr7a.DBF
recid=328 stamp=693103850
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e3kkvrns.DBF
recid=329 stamp=693104380
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e1kkvrjp.DBF
recid=330 stamp=693104249
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e4kkvrs6.DBF
recid=331 stamp=693104518
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e6kkvrs6.DBF
recid=332 stamp=693104518
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e5kkvrs6.DBF
recid=333 stamp=693104518
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e7kkvrt9.DBF
recid=334 stamp=693104553
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e8kkvrta.DBF
recid=335 stamp=693104554
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/e9kkvru3.DBF
recid=336 stamp=693104579
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ebkkvrub.DBF
recid=337 stamp=693104587
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eckkvrur.DBF
recid=338 stamp=693104603
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eakkvrub.DBF
recid=339 stamp=693104587
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/edkkvrur.DBF
recid=340 stamp=693104603
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eekkvrva.DBF
recid=341 stamp=693104618
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ehkkvrvr.DBF
recid=342 stamp=693104635
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/eikkvs0u.DBF
recid=343 stamp=693104670
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/efkkvrvb.DBF
recid=344 stamp=693104619
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/egkkvrvb.DBF
recid=345 stamp=693104619
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/elkkvs81.DBF
recid=346 stamp=693104897
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ejkkvs22.DBF
recid=348 stamp=693104706
crosschecked backup piece: found to be 'AVAILABLE'
backup piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/copy/ekkkvs4d.DBF
recid=349 stamp=693104781
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/usr/app/oracle/product/10.2.0/dbs/control_file_rman_copy.ctl
recid=351 stamp=693111283
Crosschecked 36 objects

There are no expired backups.

RMAN> delete expired backup device type disk;

released channel: ORA_DISK_1


allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=181 devtype=DISK

20. BACKUP THE ARCHIVE LOG SEQUENCE NO. 900 SUCH THAT IT
GETS DELETED ONCE BACKED UP.

RMAN> backup archivelog logseq 900 delete input;

Starting backup at 25-JUL-09


using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=900 recid=1553 stamp=693093652
channel ORA_DISK_1: starting piece 1 at 25-JUL-09
channel ORA_DISK_1: finished piece 1 at 25-JUL-09
piece
handle=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/backupset/2009
_07_25/o1_mf_annnn_TAG20090725T032154_56oq63ny_.bkp
tag=TAG20090725T032154 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_1: deleting archive log(s)
archive log
filename=/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra/RMANCAT1/archivelog/20
09_07_24/o1_mf_1_900_56o4d4kg_.arc recid=1553 stamp=693093652
Finished backup at 25-JUL-09
7 V$ VIEWS

3. CREATE A USER AND TRY TO GRANT THE SELECT PRIVILEGE ON


ANY V$ VIEWS TO THE USER. IF IT FAILS THEN TRY TO GRANT
THE SELECT PRIVILEGE ON ANY OF THE UNDERLYING VIEWS SO
THAT A USER CAN ACCESS THAT VIEW.
ANS:

SQL> create user pr identified by pr;

User created.

SQL> grant create session to pr;

Grant succeeded.

SQL> grant select on v$tablespace to pr;

grant select on v$tablespace to pr

ERROR at line 1:

ORA-02030: can only select from fixed tables/views

SQL> grant select on v_$tablespace to pr;

Grant succeeded.

4. RETURN THE COUNT OF THE NO. OF VIEWS, GLOBAL VIEWS AND


FIXED VIEWS PRESENT IN THE DATABASE.

ANS:

SQL> SQL> select count(name) COUNT ,to_char('Total views') VIEW_TYPE


from v$fixed_table where type='VIEW'
2 union select count(name),to_char('Fixed Views') from v$fixed_table where
name like'V%' and type='VIEW'
3 union select count(name),to_char('Global views') from v$fixed_table where
name like'GV%' and type='VIEW';

COUNT VIEW_TYPE
---------- --------------------------------
374 Global views
398 Fixed Views
774 Total views
SQL> select count(name) from v$fixed_table where name not like'V%' and name
not like'GV$%'and type='VIEW';
COUNT(NAME)
-----------
2
SQL> select name from v$fixed_table where name not like'V%' and name not
like'GV$%'and type='VIEW';
NAME
------------------------------
GO$SQL_BIND_CAPTURE
O$SQL_BIND_CAPTURE

5. GET THE DEFINITION OF V$DATABASE VIEW AND IDENTIFY EACH


OF THE COLUMNS.

ANS:

SQL> desc v$database

NAME NULL? TYPE

----------------------------------------- -------- ----------------------------

DBID NUMBER

NAME VARCHAR2(9)

CREATED DATE

RESETLOGS_CHANGE# NUMBER

RESETLOGS_TIME DATE

PRIOR_RESETLOGS_CHANGE# NUMBER

PRIOR_RESETLOGS_TIME DATE

LOG_MODE VARCHAR2(12)
CHECKPOINT_CHANGE# NUMBER

ARCHIVE_CHANGE# NUMBER

CONTROLFILE_TYPE VARCHAR2(7)

CONTROLFILE_CREATED DATE

CONTROLFILE_SEQUENCE# NUMBER

CONTROLFILE_CHANGE# NUMBER

CONTROLFILE_TIME DATE

OPEN_RESETLOGS VARCHAR2(11)

VERSION_TIME DATE

OPEN_MODE VARCHAR2(10)

PROTECTION_MODE VARCHAR2(20)

PROTECTION_LEVEL VARCHAR2(20)

REMOTE_ARCHIVE VARCHAR2(8)

ACTIVATION# NUMBER

SWITCHOVER# NUMBER

DATABASE_ROLE VARCHAR2(16)

ARCHIVELOG_CHANGE# NUMBER

ARCHIVELOG_COMPRESSION VARCHAR2(8)

SWITCHOVER_STATUS VARCHAR2(20)

DATAGUARD_BROKER VARCHAR2(8)

GUARD_STATUS VARCHAR2(7)

SUPPLEMENTAL_LOG_DATA_MIN VARCHAR2(8)

SUPPLEMENTAL_LOG_DATA_PK VARCHAR2(3)

SUPPLEMENTAL_LOG_DATA_UI VARCHAR2(3)

FORCE_LOGGING VARCHAR2(3)

PLATFORM_ID NUMBER

PLATFORM_NAME VARCHAR2(101)

RECOVERY_TARGET_INCARNATION# NUMBER
LAST_OPEN_INCARNATION# NUMBER

CURRENT_SCN NUMBER

FLASHBACK_ON VARCHAR2(18)

SUPPLEMENTAL_LOG_DATA_FK VARCHAR2(3)

SUPPLEMENTAL_LOG_DATA_ALL VARCHAR2(3)

DB_UNIQUE_NAME VARCHAR2(30)

STANDBY_BECAME_PRIMARY_SCN NUMBER

FS_FAILOVER_STATUS VARCHAR2(21)

FS_FAILOVER_CURRENT_TARGET VARCHAR2(30)

FS_FAILOVER_THRESHOLD NUMBER

FS_FAILOVER_OBSERVER_PRESENT VARCHAR2(7)

FS_FAILOVER_OBSERVER_HOST VARCHAR2(512)

6. DESCRIBE THE VIEW THAT WILL GIVE THE INFORMATION ABOUT


WHICH VERSION OF ORACLE WE ARE USING. FIND OUT WHETHER
RAC HAS BEEN ENABLED FOR THE DATABASE.

ANS:

(A)

SQL> select * from v$version;

BANNER

----------------------------------------------------------------

Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi

PL/SQL Release 10.2.0.3.0 - Production

CORE 10.2.0.3.0 Production

TNS for Solaris: Version 10.2.0.3.0 - Production

NLSRTL Version 10.2.0.3.0 – Production


(B)

SQL> select * from v$option where parameter='real application clusters';

PARAMETER VALUE

---------------------------------------------------------------- ----------

Real Application Clusters FALSE

7. FIND THE CURRENT SCN, NAME OF THE DATABASE AND


FLASHBACK STATUS.

ANS:

SQL> select name, current_scn, flashback_on from v$database;

NAME CURRENT_SCN FLASHBACK_ON

--------- ----------- ----------------------------------------------------------

RMANCAT1 2555492 NO

8. FIND THE MODE IN WHICH THE DATABASE IS RUNNING.


(OPEN/MOUNT/NOMOUNT)

ANS:

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE
SQL> select status from v$instance;

STATUS
------------

OPEN

9. FIND OUT WHETHER THE DATABASE IS IN ARCHIVE LOG MODE OR


NOT.

ANS:

SQL> select log_mode from v$database;

LOG_MODE
---------------------
ARCHIVELOG

10. GET THE INFORMATION ABOUT THE MAX NO. OF SESSION,


SESSION WARNING LIMIT AND MAXIMUM NO OF USERS ALLOWED
FOR THE SESSION.

ANS:

SQL> select sessions_max, sessions_warning, users_max from v$license;

SESSIONS_MAX SESSIONS_WARNING USERS_MAX


------------ ---------------- -------------------------------------------------------
0 0 0
11. LIST ALL THE PRODUCTS OF ORACLE THAT ARE NOT INSTALLED
ON THE CURRENT DATABASE.

ANS:

SQL> select * from v$option where value='FALSE';


PARAMETER VALUE
----------------------------------------------------------- ---------------------
Real Application Clusters FALSE
Oracle Label Security FALSE
Data Mining Scoring Engine FALSE
Oracle Database Vault FALSE

12. LIST OUT ALL THE PARAMETERS WHICH CAN BE CHANGED FOR
THE NEXT LOGIN BUT NOT FOR THE CURRENT SESSION.

ANS:

SQL> select name, issys_modifiable from v$parameter where


issys_modifiable='DEFERRED';

NAME ISSYS_MOD
---------------------------------------- ------------------------------
backup_tape_io_slaves DEFERRED
audit_file_dest DEFERRED
object_cache_optimal_size DEFERRED
object_cache_max_size_percent DEFERRED
sort_area_size DEFERRED
sort_area_retained_size DEFERRED
olap_page_pool_size DEFERRED
7 rows selected.
13. LIST ALL THE PARAMETERS WHOSE VALUES HAS NOT BEEN
CHANGED EXPLICITLY i.e. THEY ARE HAVING THERE DEFAULT
VALUES.

ANS:

SQL> select name, isdefault from v$parameter where isdefault='TRUE';


NAME ISDEFAULT
---------------------------------------- ----------------------
tracefile_identifier TRUE
lock_name_space TRUE
timed_statistics TRUE
timed_os_statistics TRUE
resource_limit TRUE
license_max_sessions TRUE

231 rows selected.

14. WHICH VIEW WILL GIVE INFORMATION ABOUT ALL THE SPFILE
PARAMETER AND LIST OUT ALL THE PARAMETERS ARRANGED IN
DESCENDING ORDER.

ANS:

SQL> select name from v$spparameter order by name;

NAME
----------------------------------------
O7_DICTIONARY_ACCESSIBILITY
active_instance_count
aq_tm_processes
archive_lag_target

15. (A) CREATE A TABLE

EMPLOYEE : EMPID NUMBER,


NAME VARCHAR(20),
EMAILID VARCHAR(20),
DEPT CHAR(2),
DATEOFJOIN DATE
(B) CREATE UNIQUE INDEX ON EMPID, INDEX ON NAME, INDEX
ON EMAILID.

(C) INSERT 10 RECORDS TO THIS TABLE EMPLOYEE.

ANS:

(A)

SQL> create table employee_np (


empid number,
name varchar(20),
emailid varchar(20),
dept char(2),
dateofjoin date);
Table created.

(B)

SQL> create unique index ind_np on employee_np(empid,name,Emailid);

Index created.

(C)

SQL> insert into employee_np values(01,'Priya1','priya1@abc','e',to_date('12-jul-


09'));

1 row created.

SQL> insert into employee_np values(02,'Priya2','priya2@abc','e',to_date('13-jul-


09'));

1 row created.

SQL> insert into employee_np values(03,'Priya3','priya3@abc','e',to_date('14-jul-


09'));
1 row created.

SQL> insert into employee_np values(04,'Priya4','priya4@abc','e',to_date('15-jul-


09'));

1 row created.

SQL> insert into employee_np values(05,'Priya5','priya5@abc','e',to_date('16-jul-


09'));

1 row created.

SQL> insert into employee_np values(06,'Nee1','nee1@abc','e',to_date('17-jul-


09'));

1 row created.

SQL> insert into employee_np values(07,'Nee2','nee2@abc','e',to_date('18-jul-


09'));

1 row created.

SQL> insert into employee_np values(08,'Nee3','nee3@abc','e',to_date('19-jul-


09'));

1 row created.

SQL> insert into employee_np values(09,'Nee4','nee4@abc','e',to_date('20-jul-


09'));

1 row created.

SQL> insert into employee_np values(10,'Nee5','nee5@abc','e',to_date('21-jul-


09'));

1 row created.

16. START THE MONITORING OF ALL THE ABOVE CREATED INDEXES.

ANS:

SQL> alter index ind_np monitoring usage;

Index altered.

SQL> select table_name, index_name, monitoring from v$object_usage;


TABLE_NAME INDEX_NAME MON
------------------------------ ------------------------------ -------------------
EMPLOYEE_NP IND_NP YES
17. ISSUE THE FOLLOWING SELECT QUERIES:

SELECT * FROM EMPLOYEE WHERE EMPID=1;

ANS:

SQL> select * from employee_np where empid=1;

EMPID NAME EMAILID DEPT DATEOFJOIN

----------------------- ---------------------------------------------------------------------

1 Priya1 priya1@abc e 0012-07-09 00:00:00

18. LIST THE NAMES OF ALL THE INDEXES WHICH ARE NOT BEING
USED AND DROP ALL SUCH INDEXES.

ANS:

SQL> select INDEX_NAME,STATUS from user_indexes where


STATUS='UNUSABLE';

INDEX_NAME STATUS

------------------------------ ----------------------------------------------

BIN$b+erLerTbfzgRAAUT8uWog==$1 UNUSABLE

SYS_C002832 UNUSABLE

SQL>drop index SYS_C002832;

Index dropped.
19. LIST THE NAME AND SIZE OF ALL DATAFILE PRESENT IN THE
DATABASE. ARE YOU ABLE TO GET THE NAMES OF THE TEMP
FILES? IF NOT THEN DESCRIBE THE VIEW THAT WILL LIST THE
NAMES OF TEMP FILES PRESENT IN THE DATABASE.

ANS:

(A)

SQL> select name,bytes from v$datafile;

(OR)

SQL> select file_name, bytes from dba_data_files;

NAME BYTES
------------------------------------------------------------ ------------------------------------
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/system_01 314572800
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/undo1_01 20971520
/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/sysaux.dbf 94371840

19 rows selected.
(B)

NO ! We are not able to view the temp file information from the view
DBA_DATA_FILES.

(C)

SQL> desc v$tempfile

Name Null? Type


----------------------------------------- -------- ----------------------------
FILE# NUMBER
CREATION_CHANGE# NUMBER
CREATION_TIME DATE
TS# NUMBER
RFILE# NUMBER
STATUS VARCHAR2(7)
ENABLED VARCHAR2(10)
BYTES NUMBER
BLOCKS NUMBER
CREATE_BYTES NUMBER
BLOCK_SIZE NUMBER
NAME VARCHAR2(513)

SQL> desc dba_temp_files

Name Null? Type


----------------------------------------- -------- ----------------------------
FILE_NAME VARCHAR2(513)
FILE_ID NUMBER
TABLESPACE_NAME NOT NULL VARCHAR2(30)
BYTES NUMBER
BLOCKS NUMBER
STATUS CHAR(9)
RELATIVE_FNO NUMBER
AUTOEXTENSIBLE VARCHAR2(3)
MAXBYTES NUMBER
MAXBLOCKS NUMBER
INCREMENT_BY NUMBER
USER_BYTES NUMBER
USER_BLOCKS NUMBER
20. LIST ALL THE TABLESPACE IN THE DATABASE AND IDENTIFY ALL
THE BIGFILE TABLESPACES?

ANS:

SQL> select name, bigfile from v$tablespace;

(OR)

SQL> select tablespace_name, bigfile from dba_tablespaces;

NAME BIG
------------------------------ ------------
SYSTEM NO
UNDOTBS1 NO
SYSAUX NO
TEMP NO
USERS NO
USER_D NO
USER_A NO
PRIYA_TBS NO
R_TBS NO
MONA_TBS NO
JRTBS01 NO
JRTBS02 NO
12 rows selected.

21. LIST ALL THE DATAFILES ALONG WITH THEIR RESPECTIVE


TABLESPACE NAMES?

ANS:

SQL> select d.name file_name,t.name tablespace_name from v$datafile d,


v$tablespace t where d.ts#=t.ts#;
(OR)

SQL> select file_name, tablespace_name from dba_data_files;

FILE_NAME TABLESPACE_NAME

------------------------------------------------------------ -----------------------------------------------

/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/system_01 SYSTEM

/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/undo1_01 UNDOTBS1

/ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/sysaux.dbf SYSAUX

19 rows selected.

22. FIND OUT THE NUMBER OF PHYSICAL READS AND WRITES


HAPPENING IN THE DATABASE.

ANS:

SQL> select sum(phyrds) reads, sum(phywrts) writes from v$filestat;

READS WRITES

---------------------------

25754 9297

23. LIST ALL THE CONTROL FILES ALONG WITH THEIR STATUS.

ANS:

SQL> select name, status from v$controlfile;

NAME STATUS
---------------------------------------- --------------------------------------------
/ora/DOGRC1P/backup01/oradata/RMANCAT1/
control/control01.ctl
/ora/DOGRC1P/backup01/oradata/RMANCAT1/
control/control02.ctl
24. LIST ALL THE COMPONENTS THAT ARE PRESENT IN SYSAUX
TABLESPACE. WHICHEVER COMPONENT IN SYSAUX TABLESPACE
IS OCCUPYING MAXIMUM SPACE, MOVE THE COMPONENT TO
ANOTHER TABLESPACE.

ANS:

SQL> select occupant_name from v$sysaux_occupants;

OCCUPANT_NAME
----------------------------
LOGMNR
LOGSTDBY
STREAMS
XDB
AO
XSOQHIST
XSAMD

26 rows selected.

SQL> select occupant_name, space_usage_kbytes from v$sysaux_occupants


where space_usage_kbytes=(select max(space_usage_kbytes) from
v$sysaux_occupants);

OCCUPANT_NAME SPACE_USAGE_KBYTES
------------------------------------------------------------------------
SM/AWR 77760

SQL> select occupant_name,move_procedure from v$sysaux_occupants where


space_usage_kbytes=(select max(space_usage_kbytes) from
v$sysaux_occupants);

OCCUPANT_NAME MOVE_PROCEDURE

-----------------------------------------------------------------

SM/AWR

NB: Since the occupant with maximum space usage is not having a move
procedure, so we can not move it to any other tablespace.

25. LIST ALL THE LOG FILE NAMES AND MEMBERS PRESENT IN THE
DATABASE.

ANS:

SQL> select group#, member from v$logfile;

GROUP# MEMBER

---------- --------------------------------------------------------------------------------------

1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_1a

1 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_1b

2 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_2a

2 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_2b

3 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_3a

3 /ora/DOGRC1P/backup01/oradata/RMANCAT1/dbfiles/redo1_3b

6 rows selected.
26. LIST ALL THE ARCHIVE LOG DESTINATIONS AND CHECK
WHETHER IT IS VALID OR NOT.

ANS:

SQL> select dest_name, status from v$archive_dest;

DEST_NAME STATUS
---------------------------------------------------------------
LOG_ARCHIVE_DEST_1 INACTIVE
LOG_ARCHIVE_DEST_2 INACTIVE
LOG_ARCHIVE_DEST_3 INACTIVE
LOG_ARCHIVE_DEST_4 INACTIVE
LOG_ARCHIVE_DEST_5 INACTIVE
LOG_ARCHIVE_DEST_6 INACTIVE
LOG_ARCHIVE_DEST_7 INACTIVE
LOG_ARCHIVE_DEST_8 INACTIVE
LOG_ARCHIVE_DEST_9 INACTIVE
LOG_ARCHIVE_DEST_10 VALID
10 rows selected.

27. GET THE SUMMARY INFORMATION OF SGA.

ANS:

SQL> select * from v$sga;

NAME VALUE
---------------------------------------- ----------
Fixed Size 2029816
Variable Size 155191048
Database Buffers 46800640
Redo Buffers 10551296

28. FIND OUT HOW MUCH EXTRA MEMORY IS AVAILABLE FOR


FUTURE USE.

ANS:

SQL> select * from v$sga_dynamic_free_memory;

CURRENT_SIZE
------------------------
8388608

29. DETERMINE THE SIZE OF SGA_TARGET.

ANS:

SQL> select ( (select sum(value) from v$sga) - (select current_size from


v$sga_dynamic_free_memory)) "SGA_TARGET"from dual;

SGA_TARGET
----------
306184192

30. FIND OUT THE CURRENT SIZE OF ALL DYNAMIC COMPONENTS.

ANS:

SQL> select component, current_size from v$sga_dynamic_components;

COMPONENT CURRENT_SIZE
---------------------------------------------------------------- -----
shared pool 134217728
large pool 4194304
java pool 4194304
streams pool 4194304
DEFAULT buffer cache 146800640
KEEP buffer cache 0
RECYCLE buffer cache 0
DEFAULT 2K buffer cache 0
DEFAULT 4K buffer cache 0
DEFAULT 8K buffer cache 0
DEFAULT 16K buffer cache 0
DEFAULT 32K buffer cache 0
ASM Buffer Cache 0

13 rows selected.

31. FIND OUT HOW MUCH FREE MEMORY IS AVAILABLE IN SHARED


POOL.

ANS:

SQL> select * from v$sgastat where pool='shared pool' and name='free memory';

POOL NAME BYTES


------------ ----------------------------------------
shared pool free memory 16856904
32. DETERMINE THE DICTIONARY CACHE HIT RATIO.

ANS:
SQL> select ((1 - (Sum(GetMisses) / (Sum(Gets) + Sum(GetMisses)))) * 100)
"Dictionary Cache Hit Rate" from V$RowCache where Gets +
GetMisses <> 0;

Dictionary Cache Hit Rate


-----------------------------------
88.565951

33. DETERMINE THE LIBRARY CACHE HIT RATIO.

ANS:

SQL> select metric_name, value from v$sysmetric where metric_name = 'Library


Cache Hit Ratio';

METRIC_NAME VALUE
---------------------------------------------------------------- ------------
Library Cache Hit Ratio 99.9832677
Library Cache Hit Ratio 100

34. LIST THE NAME OF ALL USERS WHO ARE HAVING SYSOPR OR
SYSDBA ROLES.

ANS:

SQL> select * from v$pwfile_users;

USERNAME SYSDB SYSOP


------------------------------ ----- ---------------------------
SYS TRUE TRUE
JRUSER TRUE TRUE
35. IDENTIFY THE USERS WHO HAVE THEIR SESSION LOCKED FOR
LONG TIME AND THEN KILL THEIR SESSION.
ANS:

SQL> select sid, serial#, username, status from v$session;

SID SERIAL# USERNAME STATUS


---------- ---------------------------------------- --------------------------
143 138 SYS INACTIVE
145 58 SYS INACTIVE
154 16 SYS INACTIVE
158 51 SYS INACTIVE
159 12 SYS INACTIVE
….
43 rows selected.

SQL> alter system kill session '159,12';

System altered.

SQL> select sid, serial#, username, status from v$session;

SID SERIAL# USERNAME STATUS


---------- ---------------------------------------- --------------------------
143 138 SYS INACTIVE
145 58 SYS INACTIVE
154 16 SYS INACTIVE
158 51 SYS INACTIVE
159 12 SYS KILLED

43 rows selected.

36. IDENTIFY USERS WHO ARE HAVING MULTIPLE SESSIONS AND


COUNT ALL THE BACKGROUND PROCESSES RUNNING IN THE
DATABASE.

ANS:
SQL> select username, count(*) from v$session group by username;

USERNAME COUNT(*)
------------------------------ --------------
19
SYS 16
JRUSER 1
SUCHI 1
4 rows selected.

37. IDENTIFY WHICH USER IS ACCESSING WHICH OBJECT.

ANS:

SQL> select s.sid, s.username, a.owner, a.object, a.type from v$session s,


v$access a
where s.sid = a.sid;

SID USERNAME OWNER OBJECT TYPE


---------- ------------ ------------ --------------------
----------------------------------------------
194 SYS IND_STATS$ TABLE
194 SYS OBJ$ TABLE
192 SYS GV$SORT_SEGMENT CURSOR

750 rows selected.

38. CALCULATE BUFFER CACHE HIT RATIO. IF IT IS BELOW 90% THEN


RESIZE THE DB_CACHE_SIZE.

ANS:
SQL> select metric_name, value from v$sysmetric where metric_name = 'Buffer
Cache Hit Ratio';

METRIC_NAME VALUE
---------------------------------------------------------------- -------------
Buffer Cache Hit Ratio 33.3333333
Buffer Cache Hit Ratio 0

39. IDENTIFY THE SQL STATEMENTS WHICH NEED (> 250) DISK READS.

ANS:

SQL> select sql_text, disk_reads from v$sqlarea where disk_reads>250;

SQL_TEXT DISK_READS
-------------------------------------------------- -----------------------------------
select o.obj#, u.name, o.name, t.spare1, D 538
ECODE(bitand(t.flags, 268435456), 268435456, t.ini
trans, t.pctfree$) from sys.obj$ o, sys.user$ u
, sys.tab$ t where (bitand(t.trigflag, 1048576
) = 1048576) and o.obj#=t.obj# and o.own
er# = u.user#

select /*+ rule */ bucket, endpoint, col#, epvalue 439


from histgrm$ where obj#=:1 and intcol#=:2 and ro
w#=:3 order by bucket

40. IDENTIFY THE SQL STATEMENTS THAT IS RESPONSIBLE FOR


GENERATING BUFFER READS > 1000.TRY TO GET THE WHOLE
QUERY.
ANS:

SQL> select sql_text,buffer_gets from v$sqlarea where buffer_gets>10000;

SQL_TEXT BUFFER_GETS
-------------------------------------------------- ----------------------------------
INSERT INTO TAB3_XYZ VALUES(1,2) 68555

7 rows selected.

41. GET THE INSTANCE NAME, VERSION, HOST NAME AND THE
PRESENT MODE OF THE DATABASE.

ANS:

SQL> select instance_name, host_name,version, startup_time,status,


database_status from v$instance;

INSTANCE_NAME HOST_NAME VERSION STARTUP_TIME STATUS DATABASE_STATUS

---------------- ---------------------------------------------------------------- -------------------------------------------------

RMANCAT1 spdwd606 10.2.0.3.0 2009-07-24 04:01:04 OPEN ACTIVE

42. LIST THE NAME OF USERS WHO ARE HOLDING LOCKS AND
IDENTIFY THE TYPE OF LOCK THAT THEY ARE HOLDING.

ANS:

SQL> select username , v$lock .type, lmode, request from v$lock, v$session
where v$lock.sid=v$session.sid;

SID TYPE LMODE REQUEST


---------- -------------------- ---------- ----------------
195 XR 1 0
195 CF 2 0
185 TO 3 0
195 RS 2 0
196 RT 6 0
194 TS 3 0
144 TO 3 0
200 MR 4 0
200 MR 4 0
9 rows selected.

NOTE

Lock mode 0: None

Lock mode 1: Null (NULL)


Lock mode 2: Row lock shared (SS)
Lock mode 3: Row lock exclusive (SX)
Lock mode 4: Shared lock (S)
Lock mode 5: Shared lock row exclusive (SSX)
Lock mode 6: Exclusive (X)

SQL> select username from v$session where SID=144;

USERNAME
-----------------
ABC

43. LIST ALL THE ACTIVE PROCESSES IN THE DATABASE.

ANS:

SQL> select username, serial#, latchwait, program from v$process;

USERNAME SERIAL# LATCHWAIT PROGRAM


------------ ---------- ---------------- ------------------------------------------------

0 PSEUDO

oracle 1 oracle@spdwd606 (PMON)

oracle 1 oracle@spdwd606 (PSP0)

oracle 1 oracle@spdwd606 (MMAN)

oracle 1 oracle@spdwd606 (DBW0)

44. DETERMINE THE PHYSICAL I/O AND LOGICAL I/O FOR A


TRANSACTION.

ANS:

SQL> select name, log_io, phy_io from v$transaction;

NAME LOG_IO PHY_IO


---------------------------------------- ---------- ----------
421 148
569 443
47 201

45. DETERMINE THE AMOUNT OF UNDO SPACE CONSUMED BY THE


INSTANCE.

ANS:

46. LIST ALL THE FILES THAT NEED RECOVERY.

ANS:

SQL> select name, status from v$datafile, v$recover_file where v$datafile.file#


=v$recover_file.file#;
NAME STATUS
---------------------------------------- ----------------------------------------------
/ora/DOGRC1P/backup01/oradata/RMANCAT1/ RECOVER
dbfiles/users02.dbf

47. DETERMINE THE SIZE AND LOCATION OF FLASH RECOVERY AREA.

ANS:

SQL> select name, space_limit from v$recovery_file_dest;

NAME SPACE_LIMIT
---------------------------------------- --------------------------------------------
/ora/DOGRC1P/backup01/oradata/RMANCAT1/fra 581959680

48. LIST ALL THE BACKUP DEVICES THAT IS USED IN RMAN BACKUP.

ANS:

49. LIST ALL THE FILES THAT ARE IN BACKUP MODE.

ANS:

SQL> select name, v$backup. status from v$backup, v$datafile where


v$datafile.file#=v$backup.file#;

NAME STATUS
---------------------------------------- --------------------------------------------------
/ora/DOGRC1P/backup01/oradata/RMANCAT1/ NOT ACTIVE
dbfiles/system_01
/ora/DOGRC1P/backup01/oradata/RMANCAT1/ NOT ACTIVE
dbfiles/undo1_01
/ora/DOGRC1P/backup01/oradata/RMANCAT1/ NOT ACTIVE
dbfiles/sysaux.dbf
...
17 rows selected.

9 QUERY TUNING PRACTICALS


PRE-REQUISITES:

SQL> create tablespace t_xyz datafile


'/ora/DOGRC1P/backup01/oradata/RMANCAT1/data1.dbf' size 20M;

Tablespace created.
SQL> create user user_xyz identified by Password123 default tablespace t_xyz;

User created.

1. CREATE TWO TABLES AND INSERT A MINIMUM OF 20000 ROWS.

ANS:

SQL> insert into tab_xyz select * from tab_xyz;(execute more than 15 times)

1 row created.

SQL>update tab_xyz set col=20 where rownum between 1 and 10;

SQL>create table tab2_xyz(col1 number,col2 number);

SQl>insert into tab2_xyz values(10,20);

SQL> insert into tab_xyz select * from tab_xyz;

1 row created.

SQL> update tab_xyz set col=20 where rownum between 1 and 10;

10 rows updated.

SQL> select count(*) from tab_xyz;

COUNT(*)
----------
65536

SQL> commit;

Commit complete.

CREATION OF TAB3_XYZ AND INSERTION OF RECORDS

SQL> create table tab3_xyz(col1 number,col2 number) tablespace t_xyz;


Table created.

INSERTION OF RECORDS INTO TABLE tab3_xyz USING A PL/SQL


PROCEDURE.

SQL> create or replace procedure t_xyz_procedure as


n number(5);
begin
for n in 1…65536 loop
insert into tab3_xyz values(1,2);
end loop;
end;
/
Procedure created.

SQL> exec t_xyz_procedure


PL/SQL procedure successfully completed.

SQL> select count(*) from tab3_xyz;

COUNT(*)
----------
65536
SQL> update tab3_xyz set col1=9,col2=0 where rownum between 1 and 10;
10 rows updated.

SQL> commit;
Commit complete.

2. EXECUTE THE QUERY


SELECT COUNT(COL) FROM TAB_XYZ WHERE COL1=20; //WHERE THE
QUERY RETURNS 10 VALUES
AND VIEW PERFORMANCE BEFORE AND AFTER CREATING THE INDEX
ON COL COLUMN OF TAB1 TABLE.

ANS:

SQL> set timing on


SQL> set autotrace on

EXECUTING THE GIVEN QUERY WITHOUT AN INDEX

select count(col) from tab_xyz where col=20;

COUNT(COL)
----------
10

Elapsed: 00:00:00.11
Execution Plan
----------------------------------------------------------
Plan hash value: 2570285304

------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 13 | 27 (12)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 13 | | |
|* 2 | TABLE ACCESS FULL| TAB_XYZ | 16 | 208 | 27 (12)| 00:00:01 |
------------------------------------------------------------------------------

Predicate Information (identified by operation id):


---------------------------------------------------

2 - filter("COL"=20)

Note
-----
- dynamic sampling used for this statement

Statistics
----------------------------------------------------------
7 recursive calls
0 db block gets
166 consistent gets
101 physical reads
0 redo size
517 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

SQL> alter system flush buffer_cache;

System altered.

Elapsed: 00:00:00.10

select count(col) from tab_xyz where col=20;


COUNT(COL)
----------
10

Elapsed: 00:00:00.11

Execution Plan
----------------------------------------------------------
Plan hash value: 2570285304

------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 13 | 27 (12)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 13 | | |
|* 2 | TABLE ACCESS FULL| TAB_XYZ | 16 | 208 | 27 (12)| 00:00:01 |
------------------------------------------------------------------------------

Predicate Information (identified by operation id):


---------------------------------------------------

2 - filter("COL"=20)

Note
-----
- dynamic sampling used for this statement

Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
104 consistent gets
101 physical reads
0 redo size
517 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

EXECUTING THE GIVEN QUERY WITH INDEX


SQL> alter system flush buffer_cache;
System altered.

Elapsed: 00:00:00.03
SQL> create index idx_tab1_col on tab_xyz(col);
Index created.

Elapsed: 00:00:00.58
SQL> select count(col) from tab_xyz where col=20;

select count(col) from tab_xyz where col=20;

COUNT(COL)
----------
10

Elapsed: 00:00:00.09

Execution Plan
----------------------------------------------------------
Plan hash value: 3746999400

--------------------------------------------------------------------------------
--

| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time


|

--------------------------------------------------------------------------------
--

| 0 | SELECT STATEMENT | | 1| 13 | 1 (0)| 00:00:01


|

| 1 | SORT AGGREGATE | | 1| 13 | |
|

|* 2 | INDEX RANGE SCAN| IDX_TAB1_COL | 10 | 130 | 1 (0)| 00:00:01


|

--------------------------------------------------------------------------------
--

Predicate Information (identified by operation id):


---------------------------------------------------
2 - access("COL"=20)

Note
-----
- dynamic sampling used for this statement

Statistics
----------------------------------------------------------
13 recursive calls
0 db block gets
67 consistent gets
1 physical reads
0 redo size
517 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

3. EXECUTE THE QUERY


SELECT COUNT(COL) FROM TAB_XYZ WHERE COL=10; //WHERE THE
QUERY RETURNS LARGE NUMBER OF VALUES
AND VIEW PERFORMANCE BEFORE AND AFTER CREATING THE INDEX
ON COL1 COLUMN OF TAB1 TABLE.

ANS:

EXECUTING THE GIVEN QUERY WITH INDEX

SQL> alter system flush buffer_cache;


System altered.
Elapsed: 00:00:00.06

SQL> select count(col) from tab_xyz where col=10;

select count(col) from tab_xyz where col=10;

COUNT(COL)
----------
65526

Elapsed: 00:00:00.12
Execution Plan
----------------------------------------------------------
Plan hash value: 2570285304

------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 13 | 27 (12)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 13 | | |
|* 2 | TABLE ACCESS FULL| TAB_XYZ | 58962 | 748K| 27 (12)| 00:00:01 |
------------------------------------------------------------------------------

Predicate Information (identified by operation id):


---------------------------------------------------

2 - filter("COL"=10)

Note
-----
- dynamic sampling used for this statement

Statistics
----------------------------------------------------------
9 recursive calls
0 db block gets
173 consistent gets
108 physical reads
0 redo size
519 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

EXECUTING THE GIVEN QUERY WITHOUT AN INDEX

SQL> drop index idx_tab1_col;


Index dropped.
Elapsed: 00:00:00.26

SQL> alter system flush buffer_cache;


System altered.
Elapsed: 00:00:00.19
SQL> select count(col) from tab_xyz where col1=10;

SQL> select count(col) from tab_xyz where col=10;

COUNT(COL)
----------
65526

Elapsed: 00:00:00.13

Execution Plan
----------------------------------------------------------
Plan hash value: 2570285304

------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 13 | 27 (12)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 13 | | |
|* 2 | TABLE ACCESS FULL| TAB_XYZ | 58962 | 748K| 27 (12)| 00:00:01 |
------------------------------------------------------------------------------

Predicate Information (identified by operation id):


---------------------------------------------------

2 - filter("COL"=10)

Note
-----
- dynamic sampling used for this statement

Statistics
----------------------------------------------------------
7 recursive calls
0 db block gets
166 consistent gets
101 physical reads
0 redo size
519 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

4. FORCE AN INDEX BY USING HINT AS BELOW


SELECT /*+ INDEX(<TABLENAME> <INDEXNAME>) */ COUNT(COL1) FROM
TAB1 WHERE COL1=1;
VIEW THE PERFORMANCE FOR THE QUERIES WHICH RETURN SMALL
AND LARGE NUMBER OF VALUES.

ANS:

FORCING AN INDEX HINT

EXECUTING A QUERY THAT RETURNS LARGE NUMBER OF ROWS

In this case, its not efficient to use the index.


If index is not there,forcing an index using hints is not effective.

SQL> select /*+ index(tab_xyz idx_tab1_col1) */ count(col) from tab_xyz where col=10;

COUNT(COL)
----------
65526

Elapsed: 00:00:00.12

Execution Plan
----------------------------------------------------------
Plan hash value: 2570285304

------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 13 | 27 (12)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 13 | | |
|* 2 | TABLE ACCESS FULL| TAB_XYZ | 64200 | 815K| 27 (12)| 00:00:01 |
------------------------------------------------------------------------------

Predicate Information (identified by operation id):


---------------------------------------------------

2 - filter("COL"=10)
Note
-----
- dynamic sampling used for this statement

Statistics
----------------------------------------------------------
9 recursive calls
0 db block gets
178 consistent gets
5 physical reads
0 redo size
519 bytes sent via SQL*Net to client
487 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

SQL> select /*+ index(tab_xyz idx_tab1_col1) */ count(col) from tab_xyz where col=20;

COUNT(COL)
----------
10

Elapsed: 00:00:00.09

Execution Plan
----------------------------------------------------------
Plan hash value: 3746999400

--------------------------------------------------------------------------------
--

| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time


|

--------------------------------------------------------------------------------
--

| 0 | SELECT STATEMENT | | 1| 13 | 1 (0)| 00:00:01


|

| 1 | SORT AGGREGATE | | 1| 13 | |
|
|* 2 | INDEX RANGE SCAN| IDX_TAB1_COL | 10 | 130 | 1 (0)| 00:00:01
|

--------------------------------------------------------------------------------
--

Predicate Information (identified by operation id):


---------------------------------------------------

2 - access("COL"=20)

Note
-----
- dynamic sampling used for this statement

Statistics
----------------------------------------------------------
9 recursive calls
0 db block gets
72 consistent gets
0 physical reads
0 redo size
517 bytes sent via SQL*Net to client
487 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

5. FORCE A FULL HINT AS SHOWN BELOW


SELECT /*+ FULL(<TABLENAME>) */ COUNT(COL1)
FROM TAB2
WHERE COL2 = 0;
VIEW THE PERFORMANCE BEFORE AND AFTER FORCING THE HINT.

ANS:

SQL> create index idx_tab2_col2 on tab2(col2);


Index created.
Elapsed: 00:00:00.11

USING HINT
SQL> alter system flush buffer_cache;
System altered.
Elapsed: 00:00:00.03

SQL> select /*+ full(tab2) */ count(col1)


2 from tab2
3 where col2 = 0;

COUNT(COL1)
-----------
10
Elapsed: 00:00:00.04
Execution Plan
----------------------------------------------------------
Plan hash value: 2781695375
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 26 | 10 (10)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 26 | | |
|* 2 | TABLE ACCESS FULL| TAB2 | 10 | 260 | 10 (10)| 00:00:01 |
---------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - filter("COL2"=0)
Note
-----
- dynamic sampling used for this statement

WITHOUT USING HINT

SQL> alter system flush buffer_cache;


System altered.
Elapsed: 00:00:00.03

SQL> select count(col1)


2 from tab2
3 where col2 = 0;

COUNT(COL1)
-----------
10
Elapsed: 00:00:00.03
Execution Plan
----------------------------------------------------------
Plan hash value: 355492385
----------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 26 | 2 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 26 | | |
| 2 | TABLE ACCESS BY INDEX ROWID| TAB2 | 10 | 260 | 2 (0)|
00:00:01 |
|* 3 | INDEX RANGE SCAN | IDX_TAB2_COL2 | 10 | | 1 (0)| 00:00:01 |
----------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
3 - access("COL2"=0)
Note
-----
- dynamic sampling used for this statement

6. INDEX THE COLUMNS USED IN THE SELECT AND WHERE CLAUSE AND
CHECK OUT WHICH GIVES OUT THE BEST PERFORMANCE
I) WHEN ONLY COLUMN IN SELECT CLAUSE IS INDEXED
II) WHEN ONLY COLUMN IN WHERE CLAUSE IS INDEXED
III)WHEN BOTH THE COLUMNS ARE INDEXED

ANS:

CONSIDER THE QUERY


"SELECT COUNT(COL1) FROM TAB2 WHERE COL2=0;"
OUTPUT WITHOUT ANY INDEXES

SQL> select table_name,index_name from user_indexes;

no rows selected

SQL> alter system flush buffer_cache;


System altered.
Elapsed: 00:00:00.04

SQL> SELECT COUNT(COL1) FROM TAB2 WHERE COL2=0;

COUNT(COL1)
-----------
10
Elapsed: 00:00:00.02
Execution Plan
----------------------------------------------------------
Plan hash value: 2365719534
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 5 | 10 (10)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1| 5| | |
|* 2 | TABLE ACCESS FULL| TAB2 | 10 | 50 | 10 (10)| 00:00:01 |
---------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - filter("COL2"=0)

Statistics
----------------------------------------------------------
164 recursive calls
0 db block gets
55 consistent gets
45 physical reads
0 redo size
518 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
4 sorts (memory)
0 sorts (disk)
1 rows processed

i)INDEXING THE COLUMN IN THE SELECT CLAUSE

SQL> create index idx_tab2_col1 on tab2(col1);

Index created.

SQL> alter system flush buffer_cache;


System altered.
Elapsed: 00:00:00.01

SQL> select count(col1) from tab2 where col2=0;

COUNT(COL1)
-----------
10

Elapsed: 00:00:00.01

Execution Plan
----------------------------------------------------------
Plan hash value: 2365719534

---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 5 | 10 (10)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1| 5| | |
|* 2 | TABLE ACCESS FULL| TAB2 | 10 | 50 | 10 (10)| 00:00:01 |
---------------------------------------------------------------------------

Predicate Information (identified by operation id):


---------------------------------------------------

2 - filter("COL2"=0)

Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
38 consistent gets
0 physical reads
0 redo size
518 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

ii)INDEXING THE COLUMN IN THE WHERE CLAUSE

SQL> drop index idx_tab2_col1;

Index dropped.

SQL> create index idx_tab2_col2 on tab2(col2);

Index created.

SQL> alter system flush buffer_cache;


System altered.
Elapsed: 00:00:00.02

SQL> SELECT COUNT(COL1) FROM TAB2 WHERE COL2=0;


COUNT(COL1)
-----------
10

Elapsed: 00:00:00.02

Execution Plan
----------------------------------------------------------
Plan hash value: 3867443030

--------------------------------------------------------------------------------
--------------

| Id | Operation | Name | Rows | Bytes | Cost (%CP


U)| Time |

--------------------------------------------------------------------------------
--------------

| 0 | SELECT STATEMENT | | 1| 5| 2 (
0)| 00:00:01 |

| 1 | SORT AGGREGATE | | 1| 5|
| |

| 2 | TABLE ACCESS BY INDEX ROWID| TAB2 | 10 | 50 | 2 (


0)| 00:00:01 |

|* 3 | INDEX RANGE SCAN | IDX_TAB2_COL2 | 10 | | 1 (


0)| 00:00:01 |

--------------------------------------------------------------------------------
--------------

Predicate Information (identified by operation id):


---------------------------------------------------

3 - access("COL2"=0)

Statistics
--------------------------------- -------------------------
178 recursive calls
0 db block gets
27 consistent gets
15 physical reads
0 redo size
518 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
5 sorts (memory)
0 sorts (disk)
1 rows processed

iii)INDEXING BOTH THE COLUMNS INDLXYJMSKJ SELECT AND WHERE


CLAUSE(separately)

SQL> select index_name,table_name from user_indexes;

INDEX_NAME TABLE_NAME
------------------------------ ------------------------------
IDX_TAB2_COL2COL1 TAB2
IDX_TAB1_COL1COL2 TAB2
IDX_TAB2_COL2 TAB2
IDX_TAB2_COL1 TAB2

SQL> alter system flush buffer_cache;


System altered.
Elapsed: 00:00:00.03

SQL> SELECT COUNT(COL1) FROM TAB2 WHERE COL2=0;

COUNT(COL1)
-----------
10

Elapsed: 00:00:00.01

Execution Plan
----------------------------------------------------------
Plan hash value: 2358433514

--------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
Time |
--------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 5 | 2 (0) |
00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 5 | |
|
|* 2 | INDEX RANGE SCAN| IDX_TAB2_COL2COL1 | 10 | 50 | 2 (0) |
00:00:01 |
--------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("COL2"=0)

Statistics
----------------------------------------------------------
1 recursive calls
0 db block gets
2 consistent gets
2 physical reads
0 redo size
518 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

7. FORCE A INDEX_FFS HINT AS GIVEN BELOW


SELECT /*+ INDEX_FFS(<TABLENAME> <INDEXNAME>) */ COUNT(COL1)
FROM TAB2
WHERE COL2 = 0;
AND VIEW THE PERFORMANCE BEFORE AND AFTER FORCING THIS
HINT.

ANS:

SQL> select table_name,index_name,column_name from dba_ind_columns where


2 table_name='TAB2';

TABLE_NAME INDEX_NAME COLUMN_NAME


--------------------------------------------------------------------------------

TAB2 TDX_TAB2_COL1 COL1


TAB2 IDX_TAB2_COL2 COL2
TAB2 IDX_TAB2_BOTH COL1
TAB2 IDX_TAB2_BOTH COL2

SQL> alter system flush buffer_cache;


System altered.
Elapsed: 00:00:00.01
SQL> select /*+ index_ffs(tab2 idx_tab2_col2) */ count(col2)
from tab2
where col2 = 0;
2 3
COUNT(COL2)
-----------
10

Elapsed: 00:00:00.02

Execution Plan
----------------------------------------------------------
Plan hash value: 4139480431
--------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time
|
--------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 3 | 11 (10)|
00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 3 | |
|
|* 2 | INDEX FAST FULL SCAN| IDX_TAB2_COL2 | 10 | 30 | 11 (10)|
00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):


---------------------------------------------------

2 - filter("COL2"=0)

Statistics
----------------------------------------------------------
1 recursive calls
0 db block gets
45 consistent gets
40 physical reads
0 redo size
518 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

8. CACHE A TABLE IN MEMORY AND VIEW THE TIME ELAPSED BEFORE


AND AFTER CACHING IT.
ANS:
CONSIDER THE QUERY
“select count(*) from tab2 where col1=9;”

BEFORE CACHING THE TABLE IN MEMORY

SQL> alter system flush buffer_cache;


System altered.
Elapsed: 00:00:00.04
SQL> select count(*) from tab2 where col1=9;

COUNT(*)
----------
10

Elapsed: 00:00:00.01

Execution Plan
----------------------------------------------------------
Plan hash value: 2077983073
--------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 3 | 1 (0) |
00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 3 | |
|
|* 2 | INDEX RANGE SCAN| IDX_TAB2_COL1 | 10 | 30 | 1 (0) |
00:00:01 |
--------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------

2 - access("COL1"=9)

Statistics
----------------------------------------------------------
1 recursive calls
0 db block gets
2 consistent gets
2 physical reads
0 redo size
515 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

SQL> alter system flush buffer_cache


2 ;
System altered.
Elapsed: 00:00:00.01

AFTER CACHING THE TABLE IN MEMORY

SQL> alter table tab2 cache;


Table altered.
Elapsed: 00:00:00.46

SQL> select count(*) from tab2 where col1=9;

COUNT(*)
----------
10

Elapsed: 00:00:00.02

Execution Plan
----------------------------------------------------------
Plan hash value: 2077983073
--------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 3 | 1 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 3 | | |
|* 2 | INDEX RANGE SCAN| IDX_TAB2_COL1 | 10 | 30 | 1 (0)| 00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):


---------------------------------------------------
2 - access("COL1"=9)

Statistics
----------------------------------------------------------
213 recursive calls
0 db block gets
46 consistent gets
3 physical reads
0 redo size
515 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
5 sorts (memory)
0 sorts (disk)
1 rows processed

SQL> select count(*) from tab2 where col1=9;

COUNT(*)
----------
10

Elapsed: 00:00:00.01

Execution Plan
----------------------------------------------------------
Plan hash value: 2077983073
--------------------------------------------------------------------------------------------------------------
-
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
Time |
-----------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 3 | 1 (0)|
00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 3 | |
|
|* 2 | INDEX RANGE SCAN| IDX_TAB2_COL1 | 10 | 30 | 1 (0)|
00:00:01 |
-------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):


---------------------------------------------------
2 - access("COL1"=9)

Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
2 consistent gets
0 physical reads
0 redo size
515 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

9. EXECUTE THE FOLLOWING QUERIES AND FIND WHICH INDEXES ARE


GETTING SUPPRESSED BY ORACLE.
SELECT COUNT(COL1),COUNT(COL2)
FROM TAB2
WHERE COL1+7=16;
SELECT COUNT(COL1),COUNT(COL2)
FROM TAB2
WHERE COL1=9;
ALSO VIEW THE PERFORMANCE BY FORCING OTHER INDEXES.
ANS:

Query1:

SQL> alter system flush buffer_cache;

System altered.

Elapsed: 00:00:00.10
SQL> select count(col1),count(col2)
from tab2
where col1+7=16;
2 3
COUNT(COL1) COUNT(COL2)
----------- -----------
10 10

Elapsed: 00:00:00.03

Execution Plan
----------------------------------------------------------
Plan hash value: 2365719534

-------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 5 | 10 (10) | 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 5 | | |
|* 2 | TABLE ACCESS FULL| TAB2 | 200 | 1000 | 10 (10) | 00:00:01 |
---------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):


---------------------------------------------------
2 - filter("COL1"+7=16)

Statistics
----------------------------------------------------------
1 recursive calls
0 db block gets
38 consistent gets
36 physical reads
0 redo size
590 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

Query2:
SQL> select count(col1),count(col2)
from tab2
where col1=9;
2 3
COUNT(COL1) COUNT(COL2)
----------- -----------
10 10

Elapsed: 00:00:00.02

Execution Plan
----------------------------------------------------------
Plan hash value: 3552527035
--------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
Time |
--------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 5 | 2 (0) |
00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 5| |
|
|* 2 | INDEX RANGE SCAN| IDX_TAB1_COL1COL2 | 10 | 50 | 2 (0) |
00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):


---------------------------------------------------
2 - access("COL1"=9)

Statistics
----------------------------------------------------------
1 recursive calls
0 db block gets
2 consistent gets
2 physical reads
0 redo size
590 bytes sent via SQL*Net to client
488 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

10. CREATE AN AUTOMATIC TUNING TASK AND VIEW THE REPORT


FOR AN WORST PERFORMING SQL QUERY AND TUNE IT
ACCORDINGLY.

10 PRACTICALS ON AWR
1. FIND WHETHER AWR SNAPSHOT IS ENABLED?

SQL> SHOW PARAMETER STATISTICS_LEVEL;

NAME TYPE
------------------------------------ --------------------------------
VALUE
------------------------------
STATISTICS_LEVEL STRING
TYPICAL

TYPICAL AND ALL---ENABLED


BASIC---DISABLED

2. CHECK THE CURRENT SETTINGS OF AWR PARAMETERS?

SQL> select * from dba_hist_wr_control;

DBID SNAP_INTERVAL RETENTION


TOPNSQL
---------- ---------------------------------------------------------------------------
--------------------------------------------------------------------------- ----------
2968604067 +00000 00:45:00.0 +00004 00:00:00.0
DEFAULT

3. CHANGE SETTINGS TO RETENTION=4 DAYS, INTERVAL =45 MIN AND


AGAIN CHECK THE CURRENT SETTINGS?

SQL> BEGIN
DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS (
RETENTION => 4320,
INTERVAL => 60);
END;
/
2 3 4 5 6
PL/SQL PROCEDURE SUCCESSFULLY COMPLETED.

SQL> SELECT * FROM DBA_HIST_WR_CONTROL;

DBID SNAP_INTERVAL RETENTION


TOPNSQL
---------- ---------------------------------------------------------------------------
--------------------------------------------------------------------------- ----------
2968604067 +00000 01:00:00.0 +00003 00:00:00.0
DEFAULT

4. DROP SNAPSHOT CREATED BEFORE LAST THREE DAYS?

SQL> SELECT SNAP_ID,BEGIN_INTERVAL_TIME,END_INTERVAL_TIME


FROM DBA_HIST_SNAPSHOT WHERE END_INTERVAL_TIME<SYSDATE-3
ORDER BY SNAP_ID;
SNAP_ID BEGIN_INTERVAL_TIME
END_INTERVAL_TIME
---------- ---------------------------------------------------------------------------
---------------------------------------------------------------------------
320 12-JUL-09 08.48.18.244 PM 12-JUL-09
09.30.26.908 PM
321 12-JUL-09 09.30.26.908 PM 12-JUL-09
10.13.34.198 PM
322 12-JUL-09 10.13.34.198 PM 12-JUL-09
10.13.50.811 PM
323 12-JUL-09 10.13.50.811 PM 12-JUL-09
10.59.44.809 PM
331 13-JUL-09 02.00.06.042 AM 13-JUL-09
02.45.30.366 AM
332 13-JUL-09 02.45.30.366 AM 13-JUL-09
03.30.39.448 AM
333 13-JUL-09 03.30.39.448 AM 13-JUL-09
04.15.48.530 AM
334 13-JUL-09 04.15.48.530 AM 13-JUL-09
05.00.57.612 AM
335 13-JUL-09 05.00.57.612 AM 13-JUL-09
05.45.06.495 AM
336 13-JUL-09 05.45.06.495 AM 13-JUL-09
06.30.15.579 AM
337 13-JUL-09 06.30.15.579 AM 13-JUL-09
07.15.24.662 AM

11 ROWS SELECTED.

SQL> EXEC
DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE(320,337);

PL/SQL PROCEDURE SUCCESSFULLY COMPLETED.

SQL> SELECT SNAP_ID,BEGIN_INTERVAL_TIME,END_INTERVAL_TIME FROM


DBA_HIST_SNAPSHOT WHERE END_INTERVAL_TIME<SYSDATE-3 ORDER BY
SNAP_ID;

NO ROWS SELECTED

5. GET SNAPSHOT ID OF SNAPSHOTS THAT WAS CREATED YESTERDAY


FROM 10AM TO 11AM?

SQL> SELECT SNAP_ID,BEGIN_INTERVAL_TIME,END_INTERVAL_TIME FROM


DBA_HIST_SNAPSHOT WHERE
((BEGIN_INTERVAL_TIME BETWEEN TO_TIMESTAMP ('15- JUL-09 10.00.00.000
AM')AND TO_TIMESTAMP ('15- JUL-09 11.00.00.000 AM')) OR
( END_INTERVAL_TIME BETWEEN TO_TIMESTAMP ('15- JUL-09 10.00.00.000
AM')AND TO_TIMESTAMP ('15- JUL-09 11.00.00.000 AM')));

SNAP_ID BEGIN_INTERVAL_TIME
END_INTERVAL_TIME
---------- ---------------------------------------------------------------------------
---------------------------------------------------------------------------
418 15-JUL-09 09.00.53.448 AM 15-JUL-09
10.00.05.332 AM
419 15-JUL-09 10.00.05.332 AM 15-JUL-09
11.00.17.896 AM

SQL> SELECT SNAP_ID,BEGIN_INTERVAL_TIME,END_INTERVAL_TIME


FROM DBA_HIST_SNAPSHOT WHERE
((BEGIN_INTERVAL_TIME BETWEEN TO_TIMESTAMP ('15- JUL-09 05.00.00.000
AM')AND TO_TIMESTAMP ('15- JUL-09 10.00.00.000 AM')) AND
( END_INTERVAL_TIME BETWEEN TO_TIMESTAMP ('15- JUL-09 05.00.00.000
AM')AND TO_TIMESTAMP ('15- JUL-09 10.00.00.000 AM')));

NO ROWS SELECTED

6. CREATE BASELINE SNAPSHOT FOR THE SNAPSHOT CREATED TODAY


BETWEEN 5AM TO 10 AM AS ‘NEWBASELINE’?

SQL> SELECT SNAP_ID,BEGIN_INTERVAL_TIME,END_INTERVAL_TIME FROM


DBA_HIST_SNAPSHOT WHERE
2 ((BEGIN_INTERVAL_TIME BETWEEN TO_TIMESTAMP ('15- JUL-09
05.00.00.000 AM')AND TO_TIMESTAMP ('15- JUL-09 10.00.00.000 AM')) AND
( END_INTERVAL_TIME BETWEEN TO_TIMESTAMP ('15- JUL-09 05.00.00.000
AM')AND TO_TIMESTAMP ('15- JUL-09 10.00.00.000 AM')));

SNAP_ID BEGIN_INTERVAL_TIME
END_INTERVAL_TIME
---------- ---------------------------------------------------------------------------
---------------------------------------------------------------------------
417 15-JUL-09 07.36.30.000 AM 15-JUL-09
09.00.53.448 AM
415 15-JUL-09 05.22.47.646 AM 15-JUL-09
06.07.57.396 AM
416 15-JUL-09 07.19.52.000 AM 15-JUL-09
07.30.59.814 AM
SQL> BEGIN
DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE (
START_SNAP_ID => 415,
END_SNAP_ID => 417,
BASELINE_NAME => 'NEWBASELINE_DIV');
END;
/
2 3 4 5 6 7

PL/SQL procedure successfully completed.

7. DROP THAT BASELINE ?

SQL> SELECT BASELINE_NAME,START_SNAP_TIME,


END_SNAP_TIME,BASELINE_ID FROM DBA_HIST_BASELINE;

BASELINE_NAME START_SNAP_TIME
END_SNAP_TIME BASELINE_ID
----------------------------------------------------------------
---------------------------------------------------------------------------
--------------------------------------------------------------------------- -----------
NEWBASELINE_DIV 15-JUL-09 06.07.57.396 AM
15-JUL-09 09.00.53.448 AM 6

SQL> EXEC DBMS_WORKLOAD_REPOSITORY.DROP_BASELINE


('NEWBASELINE_DIV');

PL/SQL PROCEDURE SUCCESSFULLY COMPLETED.