Monday, November 9, 2015

Moving a volume group to another system

- Moving a volume group to another system

It is quite easy to move a whole volume group to another system if, for example, a user department acquires a new server. To do this we use the vgexport and vgimport commands.

Notevgexport/vgimport is not necessary to move drives from one system to another. It is an administrative policy tool to prevent access to volumes in the time it takes to move them.

1. Unmount the file system

First, make sure that no users are accessing files on the active volume, then unmount it. Here the mount point directory is /mnt/temp1.

# unmount /mnt/temp1
          

2. Mark the volume group inactive

Marking the volume group inactive removes it from the kernel and prevents any further activity on it.Here users is the volume group name.

# vgchange -an users
vgchange -- volume group "users" successfully deactivated
          

3. Export the volume group

It is now necessary to export the volume group. This prevents it from being accessed on the ``old'' host system and prepares it to be removed.

# vgexport users
vgexport -- volume group "users" successfully exported
          
When the machine is next shut down, the disk can be unplugged and then connected to it's new machine

4. Import the volume group

When plugged into the new system it becomes /dev/sdb so an initial pvscan shows:

# pvscan
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- inactive PV "/dev/sdb1"  is in EXPORTED VG "users" [996 MB / 996 MB free]
pvscan -- inactive PV "/dev/sdb2"  is in EXPORTED VG "users" [996 MB / 244 MB free]
pvscan -- total: 2 [1.95 GB] / in use: 2 [1.95 GB] / in no VG: 0 [0]
          
We can now import the volume group (which also activates it) and mount the file system.
If you are importing on an LVM 2 system, run:

# vgimport users
  Volume group "users" successfully imported
          
If you are importing on an LVM 1 system, add the PVs that need to be imported:

# vgimport users /dev/sdb1 /dev/sdb2
vgimport -- doing automatic backup of volume group "users"
vgimport -- volume group "users" successfully imported and activated
          

5. Activate the volume group

You must activate the volume group before you can access it.

# vgchange -ay users
          

6. Mount the file system


# mkdir -p /mnt/temp1
# mount /dev/users/lv00 /mnt/temp1
          
The file system is now available for use.

Wednesday, September 2, 2015

Linux Rename Eth0 Network Interface Card Name [ Udev ]



wireless NIC is showing as wlan0 but I need to be appear as eth1. How can I rename wlan0 devices through udev as eth1? How do I change or rename eth0 as wan0 under Linux operating systems?
A

The best way to rename Ethernet devices is through udev. It is the device manager for the Linux kernel. Primarily, it manages device nodes in /dev. It is the successor of devfs and hotplug, which means that it handles /dev directory and all user space actions when adding/removing devices, including firmware load.
The order of the network interfaces may be unpredictable under certain configurations. Between reboots it usually stays the same, but often after an upgrade to a new kernel or the addition or replacement of a network card (NIC) the order of all network interfaces changes. For example, what used to be rl0 now becomes wlan0 or what used to be eth0 now becoems eth2 or visa versa.

Step #1: Find out the MAC address of the Ethernet device

Type the following command:
# ifconfig -a | grep -i --color hwaddr
Sample outputs:
eth0      Link encap:Ethernet  HWaddr b8:ac:6f:65:31:e5
pan0      Link encap:Ethernet  HWaddr 4a:71:40:ed:5d:99
vmnet1    Link encap:Ethernet  HWaddr 00:50:56:c0:00:01
vmnet8    Link encap:Ethernet  HWaddr 00:50:56:c0:00:08
wlan0     Link encap:Ethernet  HWaddr 00:21:6a:ca:9b:10
Note down the MAC address.

Step #2: Rename eth0 as wan0

To rename eth0 as wan0, edit a file called 70-persistent-net.rules in /etc/udev/rules.d/directory, enter:
# vi /etc/udev/rules.d/70-persistent-net.rules
The names of the Ethernet devices are listed in this file as follows:
 
# PCI device 0x14e4:0x1680 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="b8:ac:6f:65:31:e5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
 
Locate and identify the line with the NIC from step 1 (look for the MAC address). It may look like above. In this example, the interface eth0 will be renamed to wan0 (change NAME="eth0" toNAME="wan0"):
 
# PCI device 0x14e4:0x1680 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="b8:ac:6f:65:31:e5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="wan0"
 
Save and close the file. Reboot the system to test changes:
# reboot
Verify new settings:
# ifconfig -a
# ifconfig wan0
# ifconfig -a | less
# ip addr show

Sunday, July 5, 2015

How to use a new partition in RHEL6 without reboot?

 Issue

  • Added a new partition to a disk that have some existing partitions already mounted. Can the new partition be used without reboot in RHEL6?
  • New partition created with fdisk command is not visible in the OS.

Resolution

partprobe was commonly used in RHEL 5 to inform the OS of partition table changes on the disk. In RHEL 6, it will only trigger the OS to update the partitions on a disk that none of its partitions are in use (e.g. mounted). If any partition on a disk is in use, partprobe will not trigger the OS to update partitions in the system because it is considered unsafe in some situations.
So in general we would suggest:
  1. Unmount all the partitions of the disk before modifying the partition table on the disk, and then run partprobe to update the partitions in system.
  2. If this is not possible (e.g. the mounted partition is a system partition), reboot the system after modifying the partition table. The partitions information will be re-read after reboot.
If a new partition was added and none of the existing partitions were modified, consider using the partx command to update the system partition table. Do note that the partx command does not do much checking between the new and the existing partition table in the system and assumes the user knows what they are are doing. So it can corrupt the data on disk if the existing partitions are modified or the partition table is not set correctly. So use at one's own risk.
For example, a partition #1 is an existing partition and a new partition #2 is already added in /dev/sdb by fdisk. Here we usepartx -v -a /dev/sdb to add the new partition to the system:

# ls /dev/sdb*  
/dev/sdb  /dev/sdb1  
List the partition table of disk:

# partx -l /dev/sdb
# 1:        63-   505007 (   504945 sectors,    258 MB)  
# 2:    505008-  1010015 (   505008 sectors,    258 MB)  
# 3:         0-       -1 (        0 sectors,      0 MB)  
# 4:         0-       -1 (        0 sectors,      0 MB)  
Read disk and try to add all partitions to the system:

# partx -v -a /dev/sdb                                         
device /dev/sdb: start 0 size 2097152  
gpt: 0 slices  
dos: 4 slices  
# 1:        63-   505007 (   504945 sectors,    258 MB)  
# 2:    505008-  1010015 (   505008 sectors,    258 MB)  
# 3:         0-       -1 (        0 sectors,      0 MB)  
# 4:         0-       -1 (        0 sectors,      0 MB)  
BLKPG: Device or resource busy
error adding partition 1
(These last 2 lines are normal in this case because partition 1 is already added in the system before partition 2 is added)
Check that we have device nodes for /dev/sdb itself and the partitions on it:

# ls /dev/sdb*  
/dev/sdb  /dev/sdb1  /dev/sdb2
-> Referred to Redhat official site: 
https://access.redhat.com/solutions/57542

Sunday, June 14, 2015

Switching to Graphical Login - Red Hat Enterprise Linux 6

To switch to a graphical environment, you might need to install extra software from a repository. You can access Red Hat Enterprise Linux repositories with your Red Hat Network subscription through the Internet or use a Red Hat Enterprise Linux installation DVD as a repository. 

If you installed using a text login and wish to switch to a graphical login, follow this procedure.
  1. If you are not already root, switch users to the root account:
    su -
    Provide the administrator password when prompted.
  2. If you have not already done so, install the X Window System and a graphical desktop environment. For example, to install the GNOME desktop environment, use this command:
    yum groupinstall "X Window System" Desktop
    To install the KDE desktop environment, use:
    yum groupinstall "X Window System" "KDE Desktop"
    This step may take some time as your Red Hat Enterprise Linux system downloads and installs additional software. You may be asked to provide the installation media depending on your original installation source.
  3. Run the following command to edit the /etc/inittab file:
    vi /etc/inittab
  4. Press the I key to enter insert mode.
  5. Find the line that includes the text initdefault. Change the numeral 3 to 5.
  6. Type :wq and press the Enter key to save the file and exit the vi text editor.
Reboot the system using the reboot command. Your system will restart and present a graphical login.
If you encounter any problems with the graphical login, refer to Chapter 10, Troubleshooting Installation on an Intel or AMD System.

35.3.1. Enabling Access to Software Repositories from the Command Line

The usual way to install new software on a Red Hat Enterprise Linux system is through a software repository. You can access Red Hat Enterprise Linux repositories through the Internet with your Red Hat Network subscription, or use a Red Hat Enterprise Linux installation DVD as a repository. The software that you access through online repositories is more up-to-date than what is available on an installation DVD. Furthermore, configuring a Red Hat Enterprise Linux system to access online repositories is generally easier than configuring the system to use an installation DVD as a repository, as long as you have an existing, wired network connection available.

35.3.1.1. Enabling Access to Software Repositories Through the Internet

If you supplied your Red Hat Network subscription number during the installation process, your system is already configured to access Red Hat Enterprise Linux repositories through the Internet. Therefore, all you must do is ensure that the system can access the Internet. If you have an existing, wired network connection available, this process is straightforward:
  1. If you are not already root, switch users to the root account:
    su -
  2. Ensure that the system is plugged into your network. Note that your network might be as small as two devices — a computer and an external modem/router.
  3. Run system-config-network. The network configuration tool starts and displays the Select Action screen.
  4. Select Device configuration and press Enter. The network configuration tool displays the Select A Device screen with a list of network interfaces present on your system. The first interface is named eth0 by default.
  5. Select a network interface to configure and press Enter. The network configuration tool takes you to theNetwork Configuration screen.
  6. You can manually configure a static IP, gateway, and DNS servers on this screen or leave these fields blank to accept the default values. When you have chosen a configuration, select OK, and press Enter. The network configuration tool takes you back to the Select A Device screen.
  7. Select Save and press Enter. The network configuration tool takes you back to the Select Action screen.
  8. Select Save&Quit and press Enter. The network configuration tool saves your settings and exits.
  9. Run ifup interface, where interface is the network interface that you configured with the network configuration tool. For example, run ifup eth0 to start eth0.
Configuration of dial-up or wireless Internet connections is more complicated and beyond the scope of this guide.

35.3.1.2. Using a Red Hat Enterprise Linux Installation DVD as a Software Repository

To use a Red Hat Enterprise Linux installation DVD as a software repository, either in the form of a physical disc, or in the form of an ISO image file.
  1. If you are using a physical DVD, insert the disc into your computer.
  2. If you are not already root, switch users to the root account:
    su -
  3. Create a mount point for the repository:
    mkdir -p /path/to/repo
    where /path/to/repo is a location for the repository, for example, /mnt/repo
  4. Mount the DVD on the mount point that you just created. If you are using a physical disc, you need to know the device name of your DVD drive. You can find the names of any CD or DVD drives on your system with the command cat /proc/sys/dev/cdrom/info. The first CD or DVD drive on the system is typically named sr0. When you know the device name, mount the DVD:
    mount -r -t iso9660 /dev/device_name /path/to/repo
    For example: mount -r -t iso9660 /dev/sr0 /mnt/repo
    If you are using an ISO image file of a disc, mount the image file like this:
    mount -r -t iso9660 -o loop /path/to/image/file.iso /path/to/repo
    For example: mount -r -o loop /home/root/Downloads/RHEL6.6-Server-i386-DVD.iso /mnt/repo
    Note that you can only mount an image file if the storage device that holds the image file is itself mounted. For example, if the image file is stored on a hard drive that is not mounted automatically when the system boots, you must mount the hard drive before you mount an image file stored on that hard drive. Consider a hard drive named /dev/sdb that is not automatically mounted at boot time and which has an image file stored in a directory named Downloads on its first partition:
    mkdir /mnt/temp
    mount /dev/sdb1 /mnt/temp
    mkdir /mnt/repo
    mount -r -t iso9660 -o loop mount -r -o loop /mnt/temp/Downloads/RHEL6.6-Server-i386-DVD.iso /mnt/repo
    If you are not sure whether a storage device is mounted, run the mount command to obtain a list of current mounts. If you are not sure of the device name or partition number of a storage device, run fdisk -l and try to identify it in the output.
  5. Create a new repo file in the /etc/yum.repos.d/ directory. The name of the file is not important, as long as it ends in .repo. For example, dvd.repo is an obvious choice.
    1. Choose a name for the repo file and open it as a new file with the vi text editor. For example:
      vi /etc/yum.repos.d/dvd.repo
    2. Press the I key to enter insert mode.
    3. Supply the details of the repository. For example:
      [dvd]
      baseurl=file:///mnt/repo/Server
      enabled=1
      gpgcheck=1
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
      The name of the repository is specified in square brackets — in this example, [dvd]. The name is not important, but you should choose something that is meaningful and recognizable.
      The line that specifies the baseurl should contain the path to the mount point that you created previously, suffixed with /Server for a Red Hat Enterprise Linux server installation DVD, or with /Client for a Red Hat Enterprise Linux client installation DVD.
    4. Press the Esc key to exit insert mode.
    5. Type :wq and press the Enter key to save the file and exit the vi text editor.
    6. After installing or upgrading software from the DVD, delete the repo file that you created.

Friday, May 22, 2015

Oracle 11g Database Cloning using Active Database

This demo is to show issues during Oracle 11g Database cloning.

Oracle Version: 11.2.0.4
Operating System: Oracle Enterprise Linux 6.5

I have two nodes : rac1 ( Catalog Database )  & rac2 ( Target Database )
Target Database Name: DB002
Catalog DB Name: DB001
Catalog TNS service name: SN001
Auxiliary DB Name: clone
Auxiliary TNS Service Name: clone

Catalog TNS entry:

 SN001 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1)(PORT = 1621))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = SN001)
    )
  )

Auxiliary TNS Entry:

CLONE =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1721))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = clone)
    )
  )

We are going to create the Auxiliary instance on the node rac1 where we already have Catalog Database. 
Here we are going to create clone by connecting from Target DB Server(rac2).

Now, Initially we must copy the parameter file & password file from Target(rac2) to Auxiliary(rac1). It is possible to just start the auxiliary instance using db_name & db_unique_name parameters and pass the other parameters from active database . In this case I have passed all the parameters on Auxiliary parameter file reciting on its server itself.

The parameter file looks as below:

clone.__db_cache_size=444596224
clone.__java_pool_size=4194304
clone.__large_pool_size=4194304
clone.__oracle_base='/oracle'#ORACLE_BASE set from environment
clone.__pga_aggregate_target=432013312
clone.__sga_target=641728512
clone.__shared_io_pool_size=0
clone.__shared_pool_size=176160768
clone.__streams_pool_size=0
*.audit_file_dest='/oracle/admin/CLONE/adump'
*.compatible='11.2.0.4'
*.control_files='+DATA1/clone/controlfile/current.278.880327563'#Set by RMAN
*.db_block_size=8192
*.db_file_name_convert='+DATA1/db002/datafile','+DATA1/clone/datafile'
*.db_name='CLONE'#Reset to original value by RMAN
*.db_recovery_file_dest='+DATA1'
*.db_recovery_file_dest_size=10737418240
*.diagnostic_dest='/oracle'
*.local_listener='CLNLIST'
*.log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST'
*.log_file_name_convert='+DATA1/db002/onlinelog','+DATA1/clone/onlinelog'
*.memory_target=1024m
*.service_names='CLONE'
*.undo_tablespace='UNDOTBS1'


Firstly, I have copied the pfile from target and then created the spfile with appropriate changes. The parameters which were changed are db_name,db_unique_name,db_file_name_convert,log_file_name_convert,control_files and very important "compatible" parameter. 

[oracle@rac2 ~]$ cd $ORACLE_HOME/dbs
[oracle@rac2 dbs]$ pwd
/oracle/app/db/dbs
[oracle@rac2 dbs]$ scp -r initDB002.ora rac1:/oracle/app/db/dbs/initclone.ora


Now, copy the password file of Target DB from Target DB Server (rac2) to Auxiliary DB Server(rac1):

[oracle@rac2 ~]$ cd $ORACLE_HOME/dbs
[oracle@rac2 dbs]$ pwd
/oracle/app/db/dbs
[oracle@rac2 dbs]$ scp -r orapwDB002 rac1:/oracle/app/db/dbs/orapwclone


 Once copied make the changes in the Auxiliary instance "clone" parameter file as mentioned above.

Now, we are ready with our setup. Execute the following command from Target DB Server(rac2):

[oracle@rac2 dbs]$ rman target / catalog rman11g/<password>@sn001 auxiliary sys/<password>@clone

Recovery Manager: Release 11.2.0.4.0 - Production on Thu May 21 23:36:05 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DB002 (DBID=1192118653)
connected to recovery catalog database
connected to auxiliary database: CLONE (not mounted)

RMAN>

Now, Please execute the below "Duplicate" command. Ensure that you have copied the target database password file(orapwDB002) and rename it (orapwclone) otherwise you will face the Segmentation Fault error. Below is the Oracle Support Note to resolve the issue:

Segmentation Fault During Duplicate From Active Database (Doc ID 1370601.1)


Also, ensure that you have change the parameter "COMPATIBLE" to the correct version of the database. Otherwise, you will get the following error:

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/21/2015 23:32:53
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-06136: ORACLE error from auxiliary database: ORA-00201: control file version 11.2.0.4.0 incompatible with ORACLE version 11.2.0.0.0
ORA-00202: control file: '+DATA1/clone/controlfile/current.278.880327563'


In order to resolve the above error make the changes in the spfile of auxiliary instance(clone) as follows:

SQL> show parameter compatible

NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
compatible     string 11.2.0

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

NAME
---------------------------------------------------------------------------
ISSYS_MOD
---------
compatible
FALSE



SQL> alter system set compatible='11.2.0.4' scope=spfile;

System altered.

SQL> shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size    2260088 bytes
Variable Size  616563592 bytes
Database Buffers  444596224 bytes
Redo Buffers    5517312 bytes
SQL> exit
 
 Once making the above changes execute the following command:

[oracle@rac2 dbs]$ rman target / catalog rman11g/rmaniig@sn001 auxiliary sys/sys123@clone

Recovery Manager: Release 11.2.0.4.0 - Production on Thu May 21 23:36:05 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DB002 (DBID=1192118653)
connected to recovery catalog database
connected to auxiliary database: CLONE (not mounted)

RMAN> duplicate target database to 'clone' from active database nofilenamecheck;

Starting Duplicate Db at 21-MAY-15
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=24 device type=DISK

contents of Memory Script:
{
   sql clone "alter system set  control_files = 
  ''+DATA1/clone/controlfile/current.278.880327563'' comment=
 ''Set by RMAN'' scope=spfile";
   sql clone "alter system set  db_name = 
 ''DB002'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name = 
 ''CLONE'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   backup as copy current controlfile auxiliary format  '+DATA1/clone/controlfile/current.278.880327563';
   sql clone "alter system set  control_files = 
  ''+DATA1/clone/controlfile/current.278.880327563'' comment=
 ''Set by RMAN'' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  control_files =   ''+DATA1/clone/controlfile/current.278.880327563'' comment= ''Set by RMAN'' scope=spfile

sql statement: alter system set  db_name =  ''DB002'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''CLONE'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2260088 bytes
Variable Size                616563592 bytes
Database Buffers             444596224 bytes
Redo Buffers                   5517312 bytes

Starting backup at 21-MAY-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/oracle/app/db/dbs/snapcf_DB002.f tag=TAG20150521T233642 RECID=24 STAMP=880328203
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 21-MAY-15

sql statement: alter system set  control_files =   ''+DATA1/clone/controlfile/current.278.880327563'' comment= ''Set by RMAN'' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2260088 bytes
Variable Size                616563592 bytes
Database Buffers             444596224 bytes
Redo Buffers                   5517312 bytes

database mounted
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.

contents of Memory Script:
{
   set newname for datafile  1 to 
 "+data1";
   set newname for datafile  2 to 
 "+data1";
   set newname for datafile  3 to 
 "+data1";
   set newname for datafile  4 to 
 "+data1";
   set newname for datafile  5 to 
 "/oracle/dbfs/qrapp_ts_01.dbf";
   backup as copy reuse
   datafile  1 auxiliary format 
 "+data1"   datafile 
 2 auxiliary format 
 "+data1"   datafile 
 3 auxiliary format 
 "+data1"   datafile 
 4 auxiliary format 
 "+data1"   datafile 
 5 auxiliary format 
 "/oracle/dbfs/qrapp_ts_01.dbf"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 21-MAY-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/oracle/dbfs/qrapp_ts_01.dbf
output file name=/oracle/dbfs/qrapp_ts_01.dbf tag=TAG20150521T233701
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:37
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA1/db002/datafile/system.268.877566173
output file name=+DATA1/clone/datafile/system.273.880328381 tag=TAG20150521T233701
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+DATA1/db002/datafile/sysaux.269.877566407
output file name=+DATA1/clone/datafile/sysaux.287.880328637 tag=TAG20150521T233701
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:06
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DATA1/db002/datafile/undotbs1.270.877566553
output file name=+DATA1/clone/datafile/undotbs1.286.880328823 tag=TAG20150521T233701
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DATA1/db002/datafile/users.272.877566575
output file name=+DATA1/clone/datafile/users.285.880328837 tag=TAG20150521T233701
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 21-MAY-15

sql statement: alter system archive log current
starting full resync of recovery catalog
full resync complete

contents of Memory Script:
{
   backup as copy reuse
   archivelog like  "+DATA1/db002/archivelog/2015_05_21/thread_1_seq_5.259.880328843" auxiliary format 
 "+DATA1"   ;
   catalog clone start with  "+DATA1";
   switch clone datafile all;
}
executing Memory Script

Starting backup at 21-MAY-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=5 RECID=23 STAMP=880328862
output file name=+DATA1/clone/archivelog/2015_05_21/thread_1_seq_5.284.880328873 RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:25
Finished backup at 21-MAY-15

searching for all files that match the pattern +DATA1

List of Files Unknown to the Database
=====================================
File Name: +data1/CLONE/ARCHIVELOG/2015_05_21/thread_1_seq_5.284.880328873
File Name: +data1/CLONE/DATAFILE/SYSTEM.273.880328381
File Name: +data1/CLONE/DATAFILE/SYSAUX.287.880328637
File Name: +data1/CLONE/DATAFILE/UNDOTBS1.286.880328823
File Name: +data1/CLONE/DATAFILE/USERS.285.880328837
File Name: +data1/CLONE/CONTROLFILE/Current.269.880153829
File Name: +data1/CLONE/CONTROLFILE/Current.272.880153829
File Name: +data1/CLONE/CONTROLFILE/Current.271.880154783
File Name: +data1/CLONE/CONTROLFILE/Current.270.880154783
File Name: +data1/CLONE/CONTROLFILE/Current.288.880155389
File Name: +data1/CLONE/CONTROLFILE/Current.280.880155389
File Name: +data1/CLONE/CONTROLFILE/Current.279.880327563
File Name: +data1/DB001/spfileDB001.ora
File Name: +data1/DB001/TEMPFILE/TEMP.262.877261011
File Name: +data1/DB001/ONLINELOG/group_1.261.877260993
File Name: +data1/DB001/ONLINELOG/group_2.257.877260997
File Name: +data1/DB001/ONLINELOG/group_3.258.877260999
File Name: +data1/DB001/CONTROLFILE/Current.263.877260989
File Name: +data1/DB001/DATAFILE/TBS1.266.877304819
File Name: +data1/DB001/DATAFILE/TBS2.267.877305447
File Name: +data1/DB001/DATAFILE/RMAN_TS.268.877478703
File Name: +data1/ASM/ASMPARAMETERFILE/REGISTRY.253.876617431
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: +data1/CLONE/ARCHIVELOG/2015_05_21/thread_1_seq_5.284.880328873
File Name: +data1/CLONE/DATAFILE/SYSTEM.273.880328381
File Name: +data1/CLONE/DATAFILE/SYSAUX.287.880328637
File Name: +data1/CLONE/DATAFILE/UNDOTBS1.286.880328823
File Name: +data1/CLONE/DATAFILE/USERS.285.880328837
File Name: +data1/DB001/TEMPFILE/TEMP.262.877261011
File Name: +data1/DB001/DATAFILE/TBS1.266.877304819
File Name: +data1/DB001/DATAFILE/TBS2.267.877305447
File Name: +data1/DB001/DATAFILE/RMAN_TS.268.877478703

List of Files Which Where Not Cataloged
=======================================
File Name: +data1/CLONE/CONTROLFILE/Current.269.880153829
  RMAN-07517: Reason: The file header is corrupted
File Name: +data1/CLONE/CONTROLFILE/Current.272.880153829
  RMAN-07517: Reason: The file header is corrupted
File Name: +data1/CLONE/CONTROLFILE/Current.271.880154783
  RMAN-07517: Reason: The file header is corrupted
File Name: +data1/CLONE/CONTROLFILE/Current.270.880154783
  RMAN-07517: Reason: The file header is corrupted
File Name: +data1/CLONE/CONTROLFILE/Current.288.880155389
  RMAN-07517: Reason: The file header is corrupted
File Name: +data1/CLONE/CONTROLFILE/Current.280.880155389
  RMAN-07517: Reason: The file header is corrupted
File Name: +data1/CLONE/CONTROLFILE/Current.279.880327563
  RMAN-07517: Reason: The file header is corrupted
File Name: +data1/DB001/spfileDB001.ora
  RMAN-07518: Reason: Foreign database file DBID: 0  Database Name: 
File Name: +data1/DB001/ONLINELOG/group_1.261.877260993
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: +data1/DB001/ONLINELOG/group_2.257.877260997
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: +data1/DB001/ONLINELOG/group_3.258.877260999
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: +data1/DB001/CONTROLFILE/Current.263.877260989
  RMAN-07519: Reason: Error while cataloging. See alert.log.
File Name: +data1/ASM/ASMPARAMETERFILE/REGISTRY.253.876617431
  RMAN-07518: Reason: Foreign database file DBID: 0  Database Name: 

datafile 1 switched to datafile copy
input datafile copy RECID=31 STAMP=880328972 file name=+DATA1/clone/datafile/system.273.880328381
datafile 2 switched to datafile copy
input datafile copy RECID=32 STAMP=880328973 file name=+DATA1/clone/datafile/sysaux.287.880328637
datafile 3 switched to datafile copy
input datafile copy RECID=33 STAMP=880328973 file name=+DATA1/clone/datafile/undotbs1.286.880328823
datafile 4 switched to datafile copy
input datafile copy RECID=34 STAMP=880328973 file name=+DATA1/clone/datafile/users.285.880328837
datafile 5 switched to datafile copy
input datafile copy RECID=35 STAMP=880328974 file name=/oracle/dbfs/qrapp_ts_01.dbf

contents of Memory Script:
{
   set until scn  1185386;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 21-MAY-15
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=23 device type=DISK

starting media recovery

archived log for thread 1 with sequence 5 is already on disk as file +DATA1/clone/archivelog/2015_05_21/thread_1_seq_5.284.880328873
archived log file name=+DATA1/clone/archivelog/2015_05_21/thread_1_seq_5.284.880328873 thread=1 sequence=5
media recovery complete, elapsed time: 00:00:08
Finished recover at 21-MAY-15
Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2260088 bytes
Variable Size                616563592 bytes
Database Buffers             444596224 bytes
Redo Buffers                   5517312 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''CLONE'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''CLONE'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2260088 bytes
Variable Size                616563592 bytes
Database Buffers             444596224 bytes
Redo Buffers                   5517312 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONE" RESETLOGS ARCHIVELOG 
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP   1 ( '+data1', '+data1' ) SIZE 100 M  REUSE,
  GROUP   2 ( '+data1', '+data1' ) SIZE 100 M  REUSE,
  GROUP   3 ( '+data1', '+data1' ) SIZE 100 M  REUSE
 DATAFILE
  '+DATA1/clone/datafile/system.273.880328381'
 CHARACTER SET WE8MSWIN1252


contents of Memory Script:
{
   set newname for tempfile  2 to 
 "+data1";
   switch clone tempfile all;
   catalog clone datafilecopy  "+DATA1/clone/datafile/sysaux.287.880328637", 
 "+DATA1/clone/datafile/undotbs1.286.880328823", 
 "+DATA1/clone/datafile/users.285.880328837", 
 "/oracle/dbfs/qrapp_ts_01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 2 to +data1 in control file

cataloged datafile copy
datafile copy file name=+DATA1/clone/datafile/sysaux.287.880328637 RECID=1 STAMP=880329054
cataloged datafile copy
datafile copy file name=+DATA1/clone/datafile/undotbs1.286.880328823 RECID=2 STAMP=880329054
cataloged datafile copy
datafile copy file name=+DATA1/clone/datafile/users.285.880328837 RECID=3 STAMP=880329054
cataloged datafile copy
datafile copy file name=/oracle/dbfs/qrapp_ts_01.dbf RECID=4 STAMP=880329054

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=880329054 file name=+DATA1/clone/datafile/sysaux.287.880328637
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=880329054 file name=+DATA1/clone/datafile/undotbs1.286.880328823
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=880329054 file name=+DATA1/clone/datafile/users.285.880328837
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=880329054 file name=/oracle/dbfs/qrapp_ts_01.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 21-MAY-15


Now, please verify the Control files/Database files/logfiles. Also, make the changes as per the requirement. 

Cheers!!!!!