Sunday, January 31, 2021

Oracle DB Archive log mode enable step

 

Check the database version which database version you work

SQL> select banner from v$version;

 

BANNER

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

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

PL/SQL Release 12.2.0.1.0 - Production

CORE     12.2.0.1.0             Production

TNS for Linux: Version 12.2.0.1.0 - Production

NLSRTL Version 12.2.0.1.0 - Production

Step-2: we can check the given below  command that I have checking archive log mode is open or not. I have write given below command and got the output.

SQL> archive log list

Database log mode                No Archive Mode

Automatic archival                  Disabled

Archive destination                /u01/app/oracle/product/12.2.0.1/db_1/dbs/arch

Oldest online log sequence     46

Current log sequence           48

Step-3: check the archive log destination with write the given below command:

SQL> show parameter DB_RECOVERY_FILE_DEST

 

NAME                                                        TYPE VALUE

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

db_recovery_file_dest                       string

db_recovery_file_dest_size             big integer 0

Step-4:  We are enable oracle database archive mode  and given below following step need to archive log mode enable and open it. It is also recommended before archive log mode is open , it’s better practice take database image backup .  

SQL> shut immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

Step-5: startup database in mount state mode

SQL> startup mount

ORACLE instance started.

 

Total System Global Area 1509949440 bytes

Fixed Size                                8793016 bytes

Variable Size                        570426440 bytes

Database Buffers               922746880 bytes

Redo Buffers                          7983104 bytes

Database mounted.

Step-6: apply command for enable archive log Mode

SQL> alter database archivelog;

 

Database altered.

Ste-7: Apply command Database in open mode

SQL> alter database open;

 

Database altered.

Step-8: Checking database archivelog mode enable

SQL> archive log list

Database log mode                Archive Mode

Automatic archival                  Enabled

Archive destination                /u01/app/oracle/product/12.2.0.1/db_1/dbs/arch

Oldest online log sequence     46

Next log sequence to archive   48

Current log sequence           48

Thursday, January 28, 2021

Oracle db_name vs oracle_unique_name (RAC , data guard and MAA

 


Names Among MAA

Under Oracle Maximum Availability Architecture (MAA), we might be confused about various kinds of name. Here I try to clarify these names by chart and table.

DB_NAME (Enterprise-wide Name)

You must set this parameter for every instance in order to startup the database. If you didn't assign DB_NAME at installation-time, then

DB_NAME = $ORACLE_SID

DB_UNIQUE_NAME (Site-wide Name)

If you didn't assign DB_UNIQUE_NAME in the parameter file at startup-time, then

DB_UNIQUE_NAME = DB_NAME

If you didn't assign SERVICE_NAMES in the parameter file at startup-time, then

SERVICE_NAMES = DB_UNIQUE_NAME

INSTANCE_NAME (Server-wide Name)

If you didn't assign INSTANCE_NAME in the parameter file at startup-time, then

INSTANCE_NAME = $ORACLE_SID

Naming Scope and Default Values

Parameter Name

Name Scope

Default Value

Level

DB_NAME

Enterprise-wide

= $ORACLE_SID
(Installation-time)

Database

DB_UNIQUE_NAME

Site-wide

= DB_NAME
(Startup-time)

Role

SERVICE_NAMES

Site-wide (or Enterprise-wide)

= DB_UNIQUE_NAME
(Startup-time)

Role (or Database)

INSTANCE_NAME

Server-wide

= $ORACLE_SID
(Startup-time)

Instance

$ORACLE_SID

Server-wide

N/A

Instance

The above featured image illustrates you a hierarchy tree for better understanding on the relationship among names. For more details, you may check DB_NAME and DB_UNIQUE_NAME in Oracle documentation.

Wednesday, October 7, 2020

Error while loading shared libraries: libXm.so.3: cannot open shared object file

 Symptoms:
During the installation of Oracle Fusion Middleware Portal Forms Reports or the compilation of forms the utilities frmcmp or frmbld cant find the libs to execute.

Cause:
The executable is looking for a shared library libXm.so.3 in 64 bits because OAS 11g software distribution being installed is 64 bits and the current shared library on /usr/lib/libXm.so.3 is from a 32 bits RPM package.
This lib belongs to openmotif lib packages, so you have to validate if this is the case - libs not installed in your system:

Eg via rpm:
rpm -q --queryformat "%{NAME}.%{ARCH}\n" openmotif

rpm -q --queryformat "%{NAME},%{ARCH}\n" openmotif22


Eg via yum:

yum info openmotif

yum info openmotif22


Solution:
Make sure the following 64 bits openmotif packages are installed:
Example for RedHat 4.

openmotif-2.2.3-10.5.el4.x86_64.rpm
openmotif22-2.2.3-18.x86_64.rpm

You can also check on the Oracle Fusion installation guide, section pre-requirements will give you a list of all libraries that you need installed on your OS.
 

https://www.oracle.com/technetwork/middleware/ias/downloads/fusion-requirements-100147.html

From above link, the libraries needed to be installed on the OS are:


Oracle Linux 7 (UL0+)
Red Hat Linux 7 (UL0+)

yum install -y binutils-2.23.52.0.1
yum install -y compat-libcap1-1.10
yum install -y compat-libstdc++-33-3.2.3 for x86_64
yum install -y compat-libstdc++-33-3.2.3 for i686
yum install -y gcc-4.8.2
yum install -y gcc-c++-4.8.2
yum install -y glibc-2.17 for x86_64
yum install -y glibc-2.17 for i686
yum install -y glibc-devel-2.17 for x86_64   
yum install -y glibc-devel-2.17 for i686
yum install -y libaio-0.3.109 for x86_64
yum install -y libaio-devel-0.3.109 for x86_64
yum install -y libgcc-4.8.2 for x86_64
yum install -y libgcc-4.8.2 for i686
yum install -y libstdc++-4.8.2 for x86_64
yum install -y libstdc++-4.8.2 for i686
yum install -y libstdc++-devel-4.8.2 for x86_64
yum install -y ksh make-3.82 ocfs2-tools-1.8.0
yum install -y libXext-1.3.2 for i686
yum install -y libXext-1.3.2 for x86_64
yum install -y libXtst-1.2.2 for x86_64
yum install -y libXtst-1.2.2 for i686
yum install -y sysstat-10.1.5
yum install -y motif-2.3.4-7 for x86_64
yum install -y motif-devel-2.3.4-7 for x86_64
yum install -y motif-2.3.4-7 for i686
yum install -y motif-devel-2.3.4-7 for i686
yum install -y redhat-lsb-4.1-27.0.1.el7 for x86_64
yum install -y redhat-lsb-core-4.1-27.0.1.el7 for x86_64


For RH/OL 7, it might be missing a symbolic link for version 3. See below:
$ ls -la /usr/lib64/libXm.so*
/usr/lib64/libXm.so -> libXm.so.4.0.4
/usr/lib64/libXm.so.4 -> libXm.so.4.0.4

/usr/lib64/libXm.so.4.0.4

cd /usr/lib64/
ln -s /usr/lib64/libXm.so.4.0.4 libXm.so.3


$ ls -la /usr/lib64/libXm.so*
/usr/lib64/libXm.so -> libXm.so.4.0.4
/usr/lib64/libXm.so.3 -> /usr/lib64/libXm.so.4.0.4
/usr/lib64/libXm.so.4 -> libXm.so.4.0.4

/usr/lib64/libXm.so.4.0.4


Append /usr/lib64 to all LD_LIBRARY_PATH referenced in $ORACLE_HOME/bin/config.sh, like so:

if [ x${LD_LIBRARY_PATH} != x ]; then                 LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH:/usr/lib64
 export LD_LIBRARY_PATH
else
 LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib64
 export LD_LIBRARY_PATH

Run the config.sh from $ORACLE_HOME/bin.



Oracle Linux 6 (UL1+)
Red Hat Linux 6 (UL1+)

yum install -y binutils-2.20.51.0.2-5.28.el6
yum install -y compat-libcap1-1.10-1
yum install -y compat-libstdc++-33-3.2.3-69.el6 for x86_64
yum install -y compat-libstdc++-33-3.2.3-69.el6 for i686
yum install -y gcc-4.4.4-13.el6
yum install -y gcc-c++-4.4.4-13.el6
yum install -y glibc-2.12-1.7.el6 for x86_64
yum install -y glibc-2.12-1.7.el6 for i686
yum install -y glibc-devel-2.12-1.7.el6 for i686
yum install -y libaio-0.3.107-10.el6
yum install -y libaio-devel-0.3.107-10.el6
yum install -y libgcc-4.4.4-13.el6
yum install -y libstdc++-4.4.4-13.el6 for x86_64
yum install -y libstdc++-4.4.4-13.el6 for i686
yum install -y libstdc++-devel-4.4.4-13.el6
yum install -y libXext for i686
yum install -y libXtst for i686
yum install -y openmotif-2.2.3 for x86_64
yum install -y openmotif22-2.2.3 for x86_64
yum install -y sysstat-9.0.4-11.el6
yum install -y redhat-lsb-4.0-3.el6 for x86_64
yum install -y redhat-lsb-core-4.0-3.el6 for x86_64


References: Oracle Support Doc ID 1298279.1

Monday, January 13, 2020

Redo Log Corruption - Dropping Redo Log Is Not Possible (ORA-367 checksum error in log file header)



     I have faced redo log corrupted problem in database . nand can't drop the corrupted redo log . I have   recover the database given below following step:

     SQL> select GROUP#,THREAD#,BYTES from v$log;

    GROUP#    THREAD#      BYTES
---------- ---------- ----------
     1         1        52428800
     2         1        52428800
     3         1        52428800

SQL> select MEMBER from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/redo03.log
/u01/app/oracle/oradata/orcl/redo02.log
/u01/app/oracle/oradata/orcl/redo01.log


Create new ones:

SQL > ALTER DATABASE
  ADD LOGFILE GROUP 4 ('/u01/app/oracle/oradata/orcl/redo04.log')
      SIZE 5G;

SQL> ALTER DATABASE

  ADD LOGFILE GROUP 5 ('/u01/app/oracle/oradata/orcl/redo05.log')

      SIZE 5G;

SQL> ALTER DATABASE

  ADD LOGFILE GROUP 6 ('/u01/app/oracle/oradata/orcl/redo06.log')

      SIZE 5G;

Drop the old one:


SQL> ALTER SYSTEM SWITCH LOGFILE;

SQL> ALTER SYSTEM SWITCH LOGFILE;

SQL> ALTER DATABASE DROP LOGFILE GROUP 1;
SQL> ALTER DATABASE DROP LOGFILE GROUP 2;
ERROR at line 1:

ORA-01624: log 2 needed for crash recovery of instance orcl (thread 1)

ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/orcl/redo02.log'
SQL> ALTER DATABASE DROP LOGFILE GROUP 3;

SQL> alter system checkpoint;
SQL> ALTER DATABASE DROP LOGFILE GROUP 2;
(Dropping group 2 is OK after checkpoint)



check the redo log group

SQL> select GROUP#,THREAD#,BYTES from v$log;


    GROUP#    THREAD#       BYTES

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

     4          1     5368709120

     5          1     5368709120

     6          1     5368709120


Thanks.

Oracle 12c Pluggable database (PDB) wise resource used query




 In Oracle 12c have multi tenant feature  i.e we can create multiple pluggable database and pluggable database used hardware resource (i.e memory) vary . Here given below different query we can find out  pdb wise resource.

set linesize 150
set pagesize 3000
set NUMWIDTH 15

col Parameter format a30
col component format a28
COLUMN DEFAULT_ATTR FORMAT A7
COLUMN OWNER FORMAT A15
COLUMN OBJECT_NAME FORMAT A15
COLUMN ALL_CONTAINERS FORMAT A3
COLUMN CONTAINER_NAME FORMAT A10
COLUMN CON_ID FORMAT 999
COLUMN pdb_name FORMAT A20
COLUMN memory Format A25
COLUMN spid HEADING 'OSpid' FORMAT a8
COLUMN pid HEADING 'Orapid' FORMAT 999999
COLUMN sid HEADING 'Sess id' FORMAT 99999
COLUMN serial# HEADING 'Serial#' FORMAT 999999
COLUMN status HEADING 'Status' FORMAT a8
COLUMN pga_alloc_mem HEADING 'PGA alloc' FORMAT 999,999,999
COLUMN pga_used_mem HEADING 'PGA used' FORMAT 999,999,999
COLUMN pga_max_mem HEADING 'PGA Max' FORMAT 999,999,999
COLUMN username HEADING 'oracleuser' FORMAT a12
COLUMN osuser HEADING 'OS user' FORMAT a12
COLUMN program HEADING 'Program' FORMAT a24
COLUMN Mbytes Heading 'Mbytes' FORMAT 999,999,999
COLUMN name FORMAT A22

----check pdb name , container Name and Id
select name, cdb, con_id from v$database;

--Information About Each Container (pluggable database ) Name
SELECT NAME, CON_ID, OPEN_MODE, RESTRICTED, DBID, CON_UID, GUID FROM V$CONTAINERS ORDER BY CON_ID;

----PGA Memory over 10MB size
SELECT p.spid, s.sid, p.con_id, substr(n.name,1,25) memory, ROUND(s.value/1024/1024) as MBytes
FROM v$sesstat s, v$statname n, v$process p, v$session vs
WHERE s.statistic# = n.statistic#
AND n.name LIKE '%pga memory%'
AND s.sid=vs.sid
AND vs.paddr=p.addr
AND s.value > 10000000 ;                                                                      

-------List the large amount memory used process
SELECT pid, spid, con_id, substr(username,1,13) username, program, ROUND(pga_used_mem/1024/1024) pga_used, ROUND(pga_alloc_mem/1024/1024) pga_alloc, ROUND(pga_freeable_mem/1024/1024) pga_freeable, ROUND(pga_max_mem/1024/1024) pga_max
FROM v$process
WHERE pga_alloc_mem = (SELECT max(pga_alloc_mem)
                       FROM v$process
                       WHERE program NOT LIKE '%LGWR%');

-----Summation of ALL PGA based on v$process: allocated includes free PGA memory not yet ---released to the operating system by the server process

SELECT ROUND(SUM(pga_alloc_mem)/1024/1024) AS "Mbytes allocated", ROUND(SUM(PGA_USED_MEM)/1024/1024) AS "Mbytes used"
FROM v$process;

------Summation of each container PGA based on v$process:REM allocated includes free PGA ---memory not yet released to the operating system by the server process

compute sum of "Mbytes allocated" on report
break on report
SELECT con_id, ROUND(SUM(pga_alloc_mem)/1024/1024) AS "Mbytes allocated", ROUND(SUM(PGA_USED_MEM)/1024/1024) AS "Mbytes used"
FROM v$process
group by con_id
order by con_id;


--Summation of ALL PGA memory based on V$SESSTAT:

SELECT ROUND(SUM(value)/1024/1024) AS Mbytes
FROM v$sesstat s, v$statname n
WHERE n.STATISTIC# = s.STATISTIC#
AND n.name = 'session pga memory';

--Summation each container PGA memory based on V$SESSTAT:


compute sum of MBYTES on report
break on report
select con_id, ROUND(sum(bytes)/1024/1024) as MBYTES from (SELECT p.con_id, s.value as bytes
FROM v$sesstat s, v$statname n, v$process p, v$session vs
WHERE s.statistic# = n.statistic#
AND n.name = 'session pga memory'
AND s.sid=vs.sid
AND vs.paddr=p.addr)
group by con_id
order by con_id;

break on off


--PGA stats from V$PGASTAT:
--show max total pga allocated since instance startup

select name, ROUND(value/1024/1024) as Mbytes from v$pgastat
where name in ('maximum PGA allocated','aggregate PGA target parameter','aggregate PGA auto target');


--show max pga allocated from history
select * from (select name,SNAP_ID, ROUND(VALUE/1024/1024) Mbytes from CDB_HIST_PGASTAT
where name='maximum PGA allocated'
order by Mbytes desc,snap_id desc)
where rownum <11 br="">
----The example results below show the largest size a pga has reached is 24MB; the MMON process.
 
break on con_id skip 4
compute sum of pga_alloc_mem on con_id

SELECT p.con_id,
       p.spid,
       p.pid,
       s.sid,
       s.serial#,
       s.status,
       ROUND(p.pga_alloc_mem/1024/1024) as pga_alloc_mem,
       ROUND(p.pga_used_mem/1024/1024) as pga_used_mem,
       ROUND(p.PGA_MAX_MEM/1024/1024) as pga_max_mem,
       s.username,
       s.osuser,
       s.program
FROM v$process p, v$session s
WHERE s.paddr( + ) = p.addr
--AND p.background is null
ORDER BY con_id,pga_alloc_mem;


--user defined parameters sga,pga,memory_target,

select con_id, name as Parameter, value/1024/1024 as Mbytes from v$parameter
where name in ('pga_aggregate_target','memory_target','memory_max_target','sga_max_size','sga_target','pga_aggregate_limit')
order by name;

Monday, March 27, 2017

 Flash/Fast Recovery Area (FRA) in Oracle
------------------------------------------
FRA :
  FRA (flash or fast recovery area) is a storage area (directory on disk or ASM diskgroup) that contains
redo logs, control file, archived logs, backup pieces and copies, flashback logs and, in 11g, foreign archived logs. The flash recovery area was first introduced in Oracle 10g.

Choosing a Location for the Flash Recovery Area:
 When setting up a flash recovery area, you must choose a location (a directory or Automatic Storage Management disk group) to hold the files. The flash recovery area cannot be stored on a raw file system.

Planning the Size of the Flash Recovery Area:

The larger the flash recovery area is, the more useful it becomes. Ideally, the flash recovery area should be large enough to contain all of the following files:

   a) A copy of all datafiles

   b) Incremental backups, as used by your chosen backup strategy

    c) Online redo logs

    d) Archived redo logs not yet backed up to tape

    e) Control files

    f) Control file autobackups (which include copies of the control file and SPFILE)

If providing this much space is impractical, it is best to create an area large enough to keep a backup
of the most important tablespaces and all the archived logs not yet copied to tape. At an absolute minimum,
the flash recovery area must be large enough to contain the archived logs that have not been copied to tape/DISK.


Setting Step for FRA:

Step-1
After you start SQL*Plus and connect to the database, set the size of the flash recovery area

SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 100G SCOPE=BOTH SID='*';

Set the location of the flash recovery area. For example, if the location is the file system directory /u01/app/oracle/fast_recovery_area, then you can do the following:

SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = '/u01/app/oracle/fast_recovery_area' SCOPE=BOTH SID='*';

If the flash recovery area location is an Automatic Storage Management disk group named FRA, for example, then you can do the following:

SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = '+FRA' SCOPE=BOTH SID='*';


Fast Recovery related data dictionary View:

Here given below Fast Recovery related data dictionary views
V$RECOVERY_FILE_DEST
V$FLASH_RECOVERY_AREA_USAGE
V$DBA_OUTSTANDING_ALERTS
V$FLASHBACK_DATABASE_LOGFILE

Some Query for Monitoring FRA:

-- Utilization (GB) the FRA ----
select
   name,
  floor(space_limit / 1024 / 1024) "Size MB",
  ceil(space_used / 1024 / 1024) "Used MB"
from v$recovery_file_dest;

-------FRA Occupants------------
select * from v$flash_recovery_area_usage;

/
-- Location and size of the FRA
show parameter db_recovery_file_dest
/

--
Size, used, Reclaimable --------------
SELECT
  ROUND((A.SPACE_LIMIT / 1024 / 1024 / 1024), 2) AS FLASH_IN_GB,
  ROUND((A.SPACE_USED / 1024 / 1024 / 1024), 2) AS FLASH_USED_IN_GB,
  ROUND((A.SPACE_RECLAIMABLE / 1024 / 1024 / 1024), 2) AS FLASH_RECLAIMABLE_GB,
  SUM(B.PERCENT_SPACE_USED)  AS PERCENT_OF_SPACE_USED
FROM
  V$RECOVERY_FILE_DEST A,
  V$FLASH_RECOVERY_AREA_USAGE B
GROUP BY
  SPACE_LIMIT,
  SPACE_USED ,
  SPACE_RECLAIMABLE ;

------FRA Size and Space available Avaiable ------------

 SELECT NAME,
SPACE_LIMIT/1024/1024/1024 AS SPACE_LIMIT_GB,
(SPACE_LIMIT - SPACE_USED + SPACE_RECLAIMABLE) /1024/1024/1024 AS SPACE_AVAILABLE_GB,
ROUND((SPACE_USED - SPACE_RECLAIMABLE)/SPACE_LIMIT * 100, 1) AS PERCENT_FULL
FROM V$RECOVERY_FILE_DEST;
/


Managing the Flash Recovery Area:

If you are facing flash_recovery_area full and resolving this error given below step:

The database issues a warning alert when reclaimable space is less than 15% and a critical alert when reclaimable space is less than 3%.
You can see the alerts in the alert.log and in DBA_OUTSTANDING_ALERTS.

SELECT object_type, message_type, message_level, reason, suggested_action
     FROM dba_outstanding_alerts;

If the flash recovery area becomes full, an error is issued. Beware of using the flash recovery area for log_archive_dest_n.
If the flash recovery becomes full and Oracle cannot archive redo logs then the instance will hang.

The following actions can be done to resolve the space issue :
  - Add disk space to the Flash Recovery Area or increase DB_RECOVERY_FILE_DEST_SIZE
         alter system set DB_RECOVERY_FILE_DEST_SIZE= ;
  - Use the command BACKUP RECOVERY AREA, to back up the contents of the Flash Recovery Area to a tertiary device such as tape.
          RMAN> backup device type 'sbt_tape' recovery area;
     or
         RMAN> backup recovery area;

  - Delete the files from the Flash Recovery Area using RMAN.
           The removal is desribed in the RMAN documentation but this is a quick and dirty way if you don't have an rman repository - but could endanger your ability to recover - so be careful.
           a) delete unwanted archive log files from disk ( rm /del )
           b) connect to rman
           c) rman> crosscheck archivelog all;         - marks the controlfile that the archives have been deleted
           d) rman> delete expired archivelog all;    - deletes the log entries identified above.
  - Changing RMAN retention policy.

NOTE= Manually removing fixed files from the FRA can have unexpected consequences. Oracle does not immediately detect the removal of these files, and thus the space is not reclaimed. If you end up manually removing files (or loose a disk perhaps), use the RMAN crosscheck command along with the delete command to cause Oracle to update the current control file information on the FRA. The folks at Oracle recommend that you not manually remove files managed by Oracle if at all possible.

Oracle does not delete eligible files from the Flash Recovery Area until the space must be reclaimed for some other purpose. The effect is that files recently moved to tape are often still available on disk for use in recovery. The recovery area can thus serve as a kind of cache for tape. Once the Flash Recovery Area is full, Oracle automatically deletes eligible files to reclaim space in the Flash Recovery Area as needed.





Happy configuring Oracle FRA...........


Thursday, February 6, 2014

RMAN BACKUP On Database No Archive Mode


RMAN BACKUP On Database  No Archive Mode
========================================

When Database in No archive Mode we only can take consistent Backup by RMAN
Here the following step take consistent Backup by RMAN
 Step-1 : Start RMAN and connect to a target database.
  Step-2: Shut down the database consistently and then mount it.
Step-3: Run the BACKUP DATABASE command.
Step-4: Open the database and resume normal operations.

Here  Given Below Issue the Command and Output the Result

RMAN> connect target /

connected to target database: TESTDB (DBID=2598668270)
using target database control file instead of recovery catalog


Before Issue the Database Backup Command we check the RMAN Configuration


RMAN> show all ;

RMAN configuration parameters for database with db_unique_name TESTDB are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK 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 COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\APP\USER\PRODUCT\11.2.0\DBHOME_1\DATABASE\SNCFTESTDB.ORA'; # default

RMAN>

Then Issue Shutdown Command


RMAN> shutdown immediate;

database closed
database dismounted
Oracle instance shut down

RMAN> startup force dba;

Oracle instance started
database mounted
database opened

Total System Global Area     535662592 bytes

Fixed Size                     1375792 bytes
Variable Size                327156176 bytes
Database Buffers             201326592 bytes
Redo Buffers                   5804032 bytes

RMAN> shutdown immediate;

database closed
database dismounted
Oracle instance shut down

RMAN> startup mount;

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area     535662592 bytes

Fixed Size                     1375792 bytes
Variable Size                327156176 bytes
Database Buffers             201326592 bytes
Redo Buffers                   5804032 bytes

Issue the given below command full Database backup

RMAN> backup database;

Starting backup at 06-FEB-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=D:\APP\USER\TESTDB\SYSTEM01.DBF
input datafile file number=00002 name=D:\APP\USER\TESTDB\SYSAUX01.DBF
input datafile file number=00003 name=D:\APP\USER\TESTDB\UNDOTBS01.DBF
input datafile file number=00005 name=D:\APP\USER\TESTDB\EXAMPLE01.DBF
input datafile file number=00004 name=D:\APP\USER\TESTDB\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 06-FEB-14
channel ORA_DISK_1: finished piece 1 at 06-FEB-14
piece handle=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\BACKUPSET\2014_02_06\O1_MF_NNNDF_TAG20140206T180300_9H6YHOS4_.BKP tag=TAG20140206T180300 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 06-FEB-14
channel ORA_DISK_1: finished piece 1 at 06-FEB-14
piece handle=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\BACKUPSET\2014_02_06\O1_MF_NCSNF_TAG20140206T180300_9H6YKG2K_.BKP tag=TAG20140206T180300 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-FEB-14

The following variation of the command creates image copy backups of all datafiles in the database:

RMAN> backup as copy database;

Starting backup at 06-FEB-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=D:\APP\USER\TESTDB\SYSTEM01.DBF
output file name=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\DATAFILE\O1_MF_SYSTEM_9H6ZR1FJ_.DBF tag=TAG20140206T182433 RECID=2 STAMP=838837492
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=D:\APP\USER\TESTDB\SYSAUX01.DBF
output file name=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\DATAFILE\O1_MF_SYSAUX_9H6ZRTM6_.DBF tag=TAG20140206T182433 RECID=3 STAMP=838837518
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=D:\APP\USER\TESTDB\UNDOTBS01.DBF
output file name=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\DATAFILE\O1_MF_UNDOTBS1_9H6ZSMS2_.DBF tag=TAG20140206T182433 RECID=4 STAMP=838837531
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=D:\APP\USER\TESTDB\EXAMPLE01.DBF
output file name=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\DATAFILE\O1_MF_EXAMPLE_9H6ZT301_.DBF tag=TAG20140206T182433 RECID=5 STAMP=838837542
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:08
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=D:\APP\USER\TESTDB\USERS01.DBF
output file name=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\DATAFILE\O1_MF_USERS_9H6ZTB6G_.DBF tag=TAG20140206T182433 RECID=6 STAMP=838837546
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\CONTROLFILE\O1_MF_TAG20140206T182433_9H6ZTC9R_.CTL tag=TAG20140206T182433 RECID=7 STAMP=838837547
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 06-FEB-14
channel ORA_DISK_1: finished piece 1 at 06-FEB-14
piece handle=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\BACKUPSET\2014_02_06\O1_MF_NNSNF_TAG20140206T182433_9H6ZTDDZ_.BKP tag=TAG20140206T182433 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-FEB-14

RMAN> ALTER DATABASE OPEN;

database opened

RMAN>

Happy Reading.......