How to remove UEK (unbreakable enterprise kernel)

Check all the kernel’s installed

Check current kernel in use.

remove uek kernel using yum command

now my kernel is downgraded to 2.6.18-398.el5.

please feel free to write me at sunil@sunilthetechfreak.com

How to extend root partition on linux using lvm

Here my partition is on lvm (Logical volume manager)

Check physical volume

Check Volume group

here you can see i have only one disk sda

Now i will add new disk to my virtual machine
right click on the virtual machine and select settings
then click on add select hard disk from the above list
click on next
select scsi and click next
create new disk and click next
specify disk capacity in my case i am adding 15g and click on split virtual disk into multiple files and click next
provide the diskname.vmdk and specify the location where it should be saved and click on finish
click on ok to exit the virtual machine settings

no need to restart the running virtual machine just type the below command so that system scans the new disk

new disk is added /dev/sde

now follow the step to extend the root partition

create physical volume & check /dev/sde1 has 19.99G free space.

we have only one volume group VolGroup00 so we will extend our volume group first

you can see Free PE is 639 / 19.97GB available

we have to extend our root partition which is  /dev/VolGroup00/LogVol00

if you have any doubts or need help please feel free to email me at sunil@sunilthetechfreak.com

 

 

How to Drop Oracle Enterprise Manager 12c repository

[oracle@db11gr2 config]$ $ORACLE_HOME/bin/emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Feb 10, 2013 4:59:04 PM

EM Configuration Assistant, Version 11.2.0.0.2 Production

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

Enter the following information:

Database SID: DB11G

Listener port number: 1521

Password for SYS user:

Password for SYSMAN user:

Do you wish to continue? [yes(Y)/no(N)]: y

Feb 10, 2013 4:59:24 PM oracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/DB11G/emca_2013_02_10_16_59_04.log.

Feb 10, 2013 4:59:24 PM oracle.sysman.emcp.util.DBControlUtil stopOMS

INFO: Stopping Database Control (this may take a while) …

Feb 10, 2013 4:59:54 PM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl

WARNING: Error initializing SQL connection. SQL operations cannot be performed

Feb 10, 2013 4:59:54 PM oracle.sysman.emcp.EMReposConfig invoke

INFO: Dropping the EM repository (this may take a while) …

Feb 10, 2013 5:15:12 PM oracle.sysman.emcp.EMReposConfig invoke

INFO: Repository successfully dropped

Enterprise Manager configuration completed successfully

FINISHED EMCA at Feb 10, 2013 5:15:18 PM

[oracle@db11gr2 config]$

ORA-28000 account locked error while creating database using dbca on Grid Infrastructure with ASM on Standalone Server

My environment details
OS : OEL 6.5 64bit
Database version : 11.2.0.4
grid infrastructure with asm on Standalone Server

I had two issues while creating database using dbca

1) I was not able to see the diskgroup at step 6 after selecting Automatic storage management, i selected use oracle-managed files
and at database area after clicking the browse button no diskgroup was shown in that area it was blank

Cause of problem :
oracle user was not part of asmdba group

Solution :
I added oracle user to asmdba group as i missed to add oracle user to asmdba group

usermod -G asmdba oracle

after that i could see the diskgroup after selecting browse button

2) ORA-28000 account locked error after it completes 43% while creating database

Cause of problem :
oracle user was not part of dba group

as you can see from the output

[oracle@oralab1 cfgtoollogs]$ id oracle

uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54324(asmdba)

[oracle@oralab1 cfgtoollogs]$ id grid

uid=54322(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(asmadmin),54324(asmdba),54325(asmoper)

Solution :
usermod -a -G dba oracle

after adding oracle user to dba group database creation was successful

How to fix shared folder issue in vmware workstation 10 for Oracle Linux 6.5 guest

[root@asm1 bin]# yum -y install kernel-uek.x86_64
[root@asm1 bin]# yum -y install gcc
[root@asm1 bin]# yum -y install kernel-uek-devel.x86_64

[root@asm1 bin]# ln -s /usr/src/kernels/3.8.13-16.2.1.el6uek.x86_64/include/generated/uapi/linux/version.h /usr/src/kernels/3.8.13-16.2.1.el6uek.x86_64/include/linux/version.h

uninstall vmware-tools

[root@asm1 bin]# cd /tmp/vmware-tools-distrib/bin
[root@asm1 bin]# ./vmware-uninstall-tools.pl

reinstall vmware-tools
[root@asm1 bin]# cd /tmp/vmware-tools-distrib
[root@asm1 bin]# ./vmware-install.pl -default

now you can change your directory to /mnt/hgfs and check your shared folder
[root@asm1 /]# cd /mnt/hgfs/

 

Upgrade oracle database 10.2.0.4 to 11.2.0.1

Download document

Rman hot cloning oracle database

Rman hot cloning oracle database

source database : ora10gdb
target database (clone database) : clone5

your source database should be in archivelog mode

set up the environment and start the database and take backup of source database

[oracle@db10g ~]$ export ORACLE_SID=ora10gdb
[oracle@db10g ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Mon Jun 23 16:14:31 2014

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

Connected to an idle instance.

SYS@ora10gdb>startup
ORACLE instance started.

Total System Global Area 1207959552 bytes
Fixed Size                  2020352 bytes
Variable Size             318770176 bytes
Database Buffers          872415232 bytes
Redo Buffers               14753792 bytes
Database mounted.
Database opened.
SYS@ora10gdb>quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production
With the Partitioning, OLAP and Data Mining options

[oracle@db10g ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 – Production on Mon Jun 23 16:16:44 2014

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

connected to target database: ORA10GDB (DBID=1868814969)

RMAN> backup database plus archivelog;

RMAN> quit

Recovery Manager complete.

connect to the source database and create pfile for clone5 database
[oracle@db10g ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Mon Jun 23 16:20:01 2014

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

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

SYS@ora10gdb>create pfile=’$ORACLE_HOME/dbs/initclone5.ora’ from spfile;

File created.

Edit the pfile with new locations for controlfiles, datafile & logfiles and two important parameter for rman cloning
the contents after changing is as below

[oracle@db10g ~]$ cat $ORACLE_HOME/dbs/initclone5.ora
clone5.__db_cache_size=872415232
clone5.__db_cache_size=872415232
clone5.__java_pool_size=16777216
clone5.__java_pool_size=16777216
clone5.__large_pool_size=16777216
clone5.__large_pool_size=16777216
clone5.__shared_pool_size=285212672
clone5.__shared_pool_size=285212672
clone5.__streams_pool_size=0
clone5.__streams_pool_size=0
*.audit_file_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone5/adump’
*.background_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone5/bdump’
*.compatible=’10.2.0.1.0′
*.control_files=’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone5/control01.ctl’,’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone5/control02.ctl’,’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone5/control03.ctl’
*.core_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone5/cdump’
*.db_block_size=8192
*.db_create_file_dest=’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone5′
*.db_domain=”
*.db_file_multiblock_read_count=16
*.db_name=’clone5′
*.db_recovery_file_dest_size=2147483648
*.db_recovery_file_dest=’/u03/clone5/flash_recovery_area’
*.db_unique_name=’clone5′
*.dispatchers='(PROTOCOL=TCP) (SERVICE=clone5XDB)’
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=402653184
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.sga_target=1207959552
*.undo_management=’AUTO’
*.undo_tablespace=’UNDOTBS1′
*.user_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone5/udump’
db_file_name_convert=’/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01′,’/u01/app/oracle/product/10.2.0.1/oradata/clone5′  [very important parameter for rman cloning]
log_file_name_convert=’/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01′,’/u01/app/oracle/product/10.2.0.1/oradata/clone5′ [very important parameter for rman cloning]
[oracle@db10g ~]$

Now create directories for clone5 database
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone5/adump
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone5/bdump
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone5/cdump
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone5/udump
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/oradata/clone5
[oracle@db10g ~]$ mkdir -p /u03/clone5/flash_recovery_area
[oracle@db10g ~]$

Create password file for clone5 database
[oracle@db10g ~]$ orapwd file=$ORACLE_HOME/dbs/orapwclone5 password=sys entries=5

configure the listener and tns. we have already created listener for source database now create for clone5 database
[oracle@db10g ~]$ netmgr

[oracle@db10g admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0.1/db01/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/10.2.0.1/db01)
(SID_NAME = ora10gdb)
)
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/10.2.0.1/db01)
(SID_NAME = 10gdb02)
)
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/10.2.0.1/db01)
(SID_NAME = clone3)
)
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/10.2.0.1/db01)
(SID_NAME = clone4)
)
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/10.2.0.1/db01)
(SID_NAME = clone5)
)
)

LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = db10g.localdomain)(PORT = 1521))
)

[oracle@db10g admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0.1/db01/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

CLONE5 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = db10g.localdomain)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = clone5)
)
)

CLONE4 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = db10g.localdomain)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = clone4)
)
)

CLONE3 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = db10g.localdomain)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = clone3)
)
)

ORA10GDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = db10g.localdomain)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora10gdb)
)
)

10GDB02 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = db10g.localdomain)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = 10gdb02)
)
)

check using tnsping if you can ping source and clone

start clone5 database in nomount stage
[oracle@db10g admin]$ export ORACLE_SID=clone5
[oracle@db10g admin]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Mon Jun 23 19:36:11 2014

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

Connected to an idle instance.

SYS@clone5>startup nomount
ORACLE instance started.

Total System Global Area 1207959552 bytes
Fixed Size                  2020352 bytes
Variable Size             318770176 bytes
Database Buffers          872415232 bytes
Redo Buffers               14753792 bytes
SYS@clone5>quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production
With the Partitioning, OLAP and Data Mining options
[oracle@db10g admin]$

[oracle@db10g admin]$ export ORACLE_SID=ora10gdb
[oracle@db10g admin]$ rman target / auxiliary sys/sys@clone5

Recovery Manager: Release 10.2.0.1.0 – Production on Mon Jun 23 19:39:45 2014

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

connected to target database: ORA10GDB (DBID=1868814969)
connected to auxiliary database: CLONE5 (not mounted)

RMAN> duplicate target database to ‘clone5’;

[oracle@db10g flash_recovery_area]$ export ORACLE_SID=clone5
[oracle@db10g flash_recovery_area]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Mon Jun 23 20:27:53 2014

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

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

SYS@clone5>select name, open_mode from v$database;

NAME      OPEN_MODE
——— ———-
CLONE5    READ WRITE

if you have any queries please feel free to write to me at sunil@sunilthetechfreak.com

 

Hot clone oracle database on same server

Hot cloning oracle database on the same server

source database : ora10gdb01
clone  database : clone2

database is up and running
[oracle@db10g /]$ ps -ef | grep pmon
oracle    6603     1  0 Jun20 ?        00:00:02 ora_pmon_clone1
oracle   10339     1  0 16:28 ?        00:00:00 ora_pmon_ora10gdb01
oracle   10484 10300  0 16:36 pts/4    00:00:00 grep pmon

[oracle@db10g ~]$ . oraenv
ORACLE_SID = [oracle] ? ora10gdb01
[oracle@db10g ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Jun 21 16:44:16 2014

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

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

SYS@ora10gdb01>select name from v$database;

NAME
———
ORA10GDB

Check the datafiles in your database
SYS@ora10gdb01>select name from v$datafile;

NAME
——————————————————————————–
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/system01.dbf
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/undotbs01.dbf
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/sysaux01.dbf
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/users01.dbf
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/users02.dbf

create pfile so you can edit for your clone2 database
SYS@ora10gdb01>create pfile=’/$ORACLE_HOME/dbs/initclone2.ora’ from spfile;

File created.

[oracle@db10g ~]$ vi $ORACLE_HOME/dbs/initclone2.ora
[oracle@db10g ~]$

contents after changing initclone2.ora
[oracle@db10g ~]$ cat $ORACLE_HOME/dbs/initclone2.ora
clone2.__db_cache_size=872415232
clone2.__java_pool_size=16777216
clone2.__large_pool_size=16777216
clone2.__shared_pool_size=285212672
clone2.__streams_pool_size=0
*.audit_file_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone2/adump’
*.background_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone2/bdump’
*.compatible=’10.2.0.1.0′
*.control_files=’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone2/control01.ctl’,’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone2/control02.ctl’,’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone2/control03.ctl’
*.core_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone2/cdump’
*.db_block_size=8192
*.db_create_file_dest=’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone2′
*.db_domain=”
*.db_file_multiblock_read_count=16
*.db_name=’clone2′
*.db_recovery_file_dest_size=2147483648
*.db_recovery_file_dest=’/u03/clone2/flash_recovery_area’
*.db_unique_name=’clone2′
*.dispatchers='(PROTOCOL=TCP) (SERVICE=clone2XDB)’
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=402653184
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.sga_target=1207959552
*.undo_management=’AUTO’
*.undo_tablespace=’UNDOTBS1′
*.user_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone2/udump’
[oracle@db10g ~]$

create required directories
[oracle@db10g tmp]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone2/adump
[oracle@db10g tmp]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone2/bdump
[oracle@db10g tmp]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone2/udump
[oracle@db10g tmp]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone2/cdump
[oracle@db10g tmp]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/oradata/clone2/
[oracle@db10g tmp]$ mkdir -p /u03/clone2/flash_recovery_area

backup controlfile
SYS@ora10gdb01>alter database backup controlfile to trace as ‘/tmp/control_script.sql’;

Database altered.

SYS@ora10gdb01>alter system switch logfile;

System altered.

SYS@ora10gdb01>archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     45
Next log sequence to archive   47
Current log sequence           47

SYS@ora10gdb01>alter database begin backup;

Database altered.

SYS@ora10gdb01>!
[oracle@db10g ~]$ cp /u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/*.dbf $ORACLE_HOME/oradata/clone2/

updated few data
SUNIL@ora10gdb01>update emp set sal=&sal where empno=&empno
2  /
Enter value for sal: 1500
Enter value for empno: 7934
old   1: update emp set sal=&sal where empno=&empno
new   1: update emp set sal=1500 where empno=7934

1 row updated.

SUNIL@ora10gdb01>/
Enter value for sal: 7500
Enter value for empno: 7839
old   1: update emp set sal=&sal where empno=&empno
new   1: update emp set sal=7500 where empno=7839

1 row updated.

SUNIL@ora10gdb01>/
Enter value for sal: 2000
Enter value for empno: 7900
old   1: update emp set sal=&sal where empno=&empno
new   1: update emp set sal=2000 where empno=7900

1 row updated.

SUNIL@ora10gdb01>commit;

Commit complete.

SYS@ora10gdb01>alter database end backup;

Database altered.

SYS@ora10gdb01>alter system switch logfile;

System altered.

SYS@ora10gdb01>archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     47
Next log sequence to archive   49
Current log sequence           49
SYS@ora10gdb01>
SYS@ora10gdb01>exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production
With the Partitioning, OLAP and Data Mining options

edit the controlfile
[oracle@db10g ~]$ vi /tmp/control_script.sql
CREATE CONTROLFILE SET DATABASE “clone2” RESETLOGS  ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone2/redo01.log’  SIZE 50M,
GROUP 2 ‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone2/redo02.log’  SIZE 50M,
GROUP 3 ‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone2/redo03.log’  SIZE 50M
DATAFILE
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone2/system01.dbf’,
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone2/undotbs01.dbf’,
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone2/sysaux01.dbf’,
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone2/users01.dbf’,
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone2/users02.dbf’
CHARACTER SET WE8ISO8859P1
;

[oracle@db10g ~]$ export ORACLE_SID=clone2
[oracle@db10g ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/10.2.0.1/db01
[oracle@db10g ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Jun 21 17:45:14 2014

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

Connected to an idle instance.

SYS@clone2>startup nomount
ORACLE instance started.

Total System Global Area 1207959552 bytes
Fixed Size                  2020352 bytes
Variable Size             318770176 bytes
Database Buffers          872415232 bytes
Redo Buffers               14753792 bytes
SYS@clone2>@/tmp/control_script.sql

Control file created.

SYS@clone2>

Now recover the database using backup control file

SYS@clone2>recover database using backup controlfile until cancel;

you will be prompted for archive log files. Specify the full path and file name from your source database as you have not copied the
archive log files on the target because we are cloning on the same server. you have to keep specifying the archive log till you cross the
last old sequence then type cancel to end the media recovery

SYS@clone2>alter database open resetlogs;

Also update the /etc/oratab file for new cloned database

for any queries feel free to write to me at sunil@sunilthetechfreak.com

Cold cloning oracle database on the same server

Cold cloning oracle database on the same server

Source database SID : ora10gdb01
Clone database SID  : clone1

First connect to the database which you are planning to clone

[oracle@db10g ~]$ . oraenv
ORACLE_SID = [ora10gdb01] ? ora10gdb01

[oracle@db10g ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Fri Jun 20 21:25:06 2014

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

Connected to an idle instance.

SYS@ora10gdb01>startup
ORACLE instance started.

Total System Global Area 1207959552 bytes
Fixed Size                  2020352 bytes
Variable Size             318770176 bytes
Database Buffers          872415232 bytes
Redo Buffers               14753792 bytes
Database mounted.
Database opened.
SYS@ora10gdb01>

SYS@ora10gdb01>select name from v$datafile;

NAME
——————————————————————————–
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/system01.dbf
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/undotbs01.dbf
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/sysaux01.dbf
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/users01.dbf
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/users02.dbf

SYS@ora10gdb01>create pfile=’$ORACLE_HOME/dbs/initclone1.ora’ from spfile;

File created.

SYS@ora10gdb01>alter database backup controlfile to trace as ‘/tmp/control_script.sql’;

Database altered.

edit pfile for clone1 database

[oracle@db10g ~]$ vi $ORACLE_HOME/dbs/initclone1.ora

contents before change
ora10gdb01.__db_cache_size=872415232
ora10gdb01.__java_pool_size=16777216
ora10gdb01.__large_pool_size=16777216
ora10gdb01.__shared_pool_size=285212672
ora10gdb01.__streams_pool_size=0
*.audit_file_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/ora10gdb01/adump’
*.background_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/ora10gdb01/bdump’
*.compatible=’10.2.0.1.0′
*.control_files=’/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/control01.ctl’,’/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/control02.ctl’,’/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/control03.ctl’
*.core_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/ora10gdb01/cdump’
*.db_block_size=8192
*.db_create_file_dest=’/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01′
*.db_domain=”
*.db_file_multiblock_read_count=16
*.db_name=’ora10gdb’
*.db_recovery_file_dest_size=2147483648
*.db_recovery_file_dest=’/u03/ora10gdb01/flash_recovery_area’
*.db_unique_name=’ora10gdb01′
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ora10gdb01XDB)’
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=402653184
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.sga_target=1207959552
*.undo_management=’AUTO’
*.undo_tablespace=’UNDOTBS1′
*.user_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/ora10gdb01/udump’

contents after change
clone1.__db_cache_size=872415232
clone1.__java_pool_size=16777216
clone1.__large_pool_size=16777216
clone1.__shared_pool_size=285212672
clone1.__streams_pool_size=0
*.audit_file_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone1/adump’
*.background_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone1/bdump’
*.compatible=’10.2.0.1.0′
*.control_files=’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/control01.ctl’,’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/control02.ctl’,’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/control03.ctl’
*.core_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone1/cdump’
*.db_block_size=8192
*.db_create_file_dest=’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1′
*.db_domain=”
*.db_file_multiblock_read_count=16
*.db_name=’ora10gdb’
*.db_recovery_file_dest_size=2147483648
*.db_recovery_file_dest=’/u03/clone1/flash_recovery_area’
*.db_unique_name=’clone1′
*.dispatchers='(PROTOCOL=TCP) (SERVICE=clone1XDB)’
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=402653184
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.sga_target=1207959552
*.undo_management=’AUTO’
*.undo_tablespace=’UNDOTBS1′
*.user_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone1/udump’

make changes to the controlfile the contents should be

vi /tmp/control_script.sql
CREATE CONTROLFILE SET  DATABASE  “clone1” RESETLOGS  ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/redo01.log’  SIZE 50M,
GROUP 2 ‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/redo02.log’  SIZE 50M,
GROUP 3 ‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/redo03.log’  SIZE 50M
DATAFILE
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/system01.dbf’,
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/undotbs01.dbf’,
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/sysaux01.dbf’,
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/users01.dbf’,
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/users02.dbf’
CHARACTER SET WE8ISO8859P1
;

create directories as referred in pfile
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone1/adump
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone1/bdump
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone1/cdump
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone1/udump
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/oradata/clone1
[oracle@db10g ~]$ mkdir -p /u03/clone1/flash_recovery_area

copy all datafile to clone directory
[oracle@db10g ~]$ cd /u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01
[oracle@db10g ora10gdb01]$ ll
total 1373152
-rw-r—–  1 oracle oinstall   7061504 Jun 20 21:30 control01.ctl
-rw-r—–  1 oracle oinstall   7061504 Jun 20 21:30 control02.ctl
-rw-r—–  1 oracle oinstall   7061504 Jun 20 21:30 control03.ctl
drwxr-x—  3 oracle oinstall      4096 Jun  4 20:16 ORA10GDB01
-rw-r—–  1 oracle oinstall  52429312 Jun 20 21:30 redo01.log
-rw-r—–  1 oracle oinstall  52429312 Jun 20 21:25 redo02.log
-rw-r—–  1 oracle oinstall  52429312 Jun 20 21:25 redo03.log
-rw-r—–  1 oracle oinstall 272637952 Jun 20 21:30 sysaux01.dbf
-rw-r—–  1 oracle oinstall 503324672 Jun 20 21:30 system01.dbf
-rw-r—–  1 oracle oinstall  27271168 Jun 14 06:00 temp01.dbf
-rw-r—–  1 oracle oinstall 429924352 Jun 20 21:30 undotbs01.dbf
-rw-r—–  1 oracle oinstall   6561792 Jun 20 21:30 users01.dbf
-rw-r—–  1 oracle oinstall  10493952 Jun 20 21:30 users02.dbf

[oracle@db10g ora10gdb01]$ cp -v *.dbf $ORACLE_HOME/oradata/clone1

[oracle@db10g ora10gdb01]$ export ORACLE_SID=clone1
[oracle@db10g ora10gdb01]$ export ORACLE_HOME=/u01/app/oracle/product/10.2.0.1/db01

[oracle@db10g ora10gdb01]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Fri Jun 20 21:47:18 2014

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

Connected to an idle instance.

SYS@clone1>startup nomount
ORACLE instance started.

Total System Global Area 1207959552 bytes
Fixed Size                  2020352 bytes
Variable Size             318770176 bytes
Database Buffers          872415232 bytes
Redo Buffers               14753792 bytes
SYS@clone1>

SYS@clone1>@/tmp/control_script.sql

Control file created.

SYS@clone1>alter database open resetlogs;

Database altered.

SYS@clone1>select name from v$database;

NAME
———
CLONE1

Edit the oratab file for clone database

[oracle@db10g dbs]$ vi /etc/oratab

[oracle@db10g dbs]$ cat /etc/oratab
#
# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ‘:’, is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, ‘#’, are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third filed indicates
# to the dbstart utility that the database should , “Y”, or should not,
# “N”, be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
ora10gdb01:/u01/app/oracle/product/10.2.0.1/db01:N
10gdb02:/u01/app/oracle/product/10.2.0.1/db01:N
clone1:/u01/app/oracle/product/10.2.0.1/db01:N

for any queries write to me at sunil@sunilthetechfreak.com

Error in invoking target client_sharelib of makefile

while installing oracle 10g 10.2.0.1 on Oracle enterprise Linux 4.5. I encountered the error

“Error in invoking target client_sharelib of make file.
/u01/app/oracle/product/10.2.0.1/db01/network/lib/ins_net_client.mk

Cause of the problem : My Linux platform was Oracle enterprise linux 4.5 64bit and Oracle
software used for installation was Oracle 10g (10.2.0.1) 32bit

Solution
Installed correct oracle 10g 64bit software for 64bit Linux system.