Upgrade oracle database 10.2.0.4 to 11.2.0.1

Download document

Oracle DBA 11g, 12c Training – Oracle Genesis

Hi friends,

Oracle DBA 11g, 12c training is being conducted by OracleGenesis. Anyone interested can join demo tomorrow.

Register now: https://attendee.gotowebinar.com/rt/4101773566875783937

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

Advanced DBA Training – Crash Course

Hi Friends,

This is golden chance for people who are looking for Advanced oracle dba training. It is one week crash course and covers all the advanced topics required for oracle dba. Register soon as they have limited seats!!!!

Register: https://attendee.gotowebinar.com/rt/4039442252251558658

Advanced Training

 

Training Details

How to setup environment variables in oracle to sucessfuly connect to a particular database/instance

Oracle environment variable is set to inform your operating system about the Oracle software installation directory and which oracle software/binaries should interact with which database/instance.

The most important environment variable are listed below
ORACLE_HOME : setting oracle home means which oracle product/software or installation you will be using to associate with your databasehaving oracle home environment variable makes easier for maintenance and management of oracle software.As per Oracle optimal flexible architecture (OFA)
/u01/app/oracle/product/10.2.0.1/dbhome_1

ORACLE_SID : The oracle system identifier is a unique identifier which is set to interact with a particular instance. You may have multiple oracle database on a single machine by setting this variable we are information oracle software to connect to that particular instance.

we will learn various way to set this variable

firstly we will check oracle home and how many databases are installed on the machine

[oracle@db10g /]$ 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

In the above out put we can see we have two databases ora10gdb01 & 10gdb02

now let see if our environment variable is not set correctly what will happen

Login: oracle
Last login: Sat May 31 18:12:45 2014 from 192.168.1.1
[oracle@db10g ~]$ sqlplus
-bash: sqlplus: command not found
[oracle@db10g ~]$

the operating system doesn’t know what is sqlplus command

setting oracle home and sid for ora10gdb01 manually

set oracle_sid by giving below command
[oracle@db10g /]$ export ORACLE_SID=ora10gdb01

check if the environment variable is set correctly
[oracle@db10g /]$ echo $ORACLE_SID

set oracle_home by giving below command
[oracle@db10g /]$ export ORACLE_HOME=/u01/app/oracle/product/10.2.0.1/db01

check if the environment variable is set correctly
[oracle@db10g /]$ echo $ORACLE_HOME
/u01/app/oracle/product/10.2.0.1/db01

now you can connect to the database issuing below
[oracle@db10g /]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat May 31 20:07:18 2014

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

Connected to an idle instance.

SQL>

using .oraenv script provided by oracle, installed during software installation

[oracle@db10g ~]$ . oraenv
ORACLE_SID = [ora10gdb01] ? ora10gdb01
[oracle@db10g ~]$ echo $ORACLE_SID
ora10gdb01
[oracle@db10g ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/10.2.0.1/db01

let us again login as oracle user and check the environment variables

Login: oracle
Last login: Sat May 31 20:10:07 2014 from 192.168.1.1
[oracle@db10g ~]$ echo $ORACLE_HOME

[oracle@db10g ~]$ echo $ORACLE_SID

[oracle@db10g ~]$

as you can see not output our environment variables are not set

now we will again use .oraenv to set environment variable for our second database

[oracle@db10g ~]$ . oraenv
ORACLE_SID = [oracle] ? 10gdb02
[oracle@db10g ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/10.2.0.1/db01
[oracle@db10g ~]$ echo $ORACLE_SID
10gdb02
[oracle@db10g ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat May 31 20:27:10 2014

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

Connected to an idle instance.

SQL> 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.
SQL> select name from v$database;

NAME
———
10GDB02

SQL>

third way  to set the environment variable in user’s .bash_profile

our user is oracle so we will set the variable as shown below

[oracle@db10g ~]$ vi .bash_profile

[oracle@db10g ~]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export ORACLE_HOME=/u01/app/oracle/product/10.2.0.1/db01    [this line is added]
export ORACLE_SID=ora10gdb01                    [this line is added]    

export PATH
unset USERNAME

set the variable set running the .bash_profile file (. .bash_profile)
or by login back again with user oracle

it is not recommended to set the environment variable in bash_profile because we have more then one database on a single machine.

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.

How to move oracle datafile, redo log files and control file to a new location

# MOVING DATAFILE TO NEW LOCATION

To check the current location login to database as sysdba

SQL> startup mount

SQL> select name from v$datafile;

NAME
————————————————————————————————————————————————
/u01/app/oracle/oradata/DB11G/system01.dbf
/u01/app/oracle/oradata/DB11G/sysaux01.dbf
/u01/app/oracle/oradata/DB11G/undotbs01.dbf
/u01/app/oracle/oradata/DB11G/users01.dbf
/u01/app/oracle/oradata/DB11G/example01.dbf
/u01/app/oracle/oradata/DB11G/mgmt_depot.dbf
/u01/app/oracle/oradata/DB11G/mgmt.dbf
/u01/app/oracle/oradata/DB11G/mgmt_ad4j.dbf

8 rows selected.

Need to move from above location to /u02/oracle/oradata/DB11G/

SQL> shutdown immediate

# Now move the files from source to the required destination

SQL> host mv /u01/app/oracle/oradata/DB11G/users01.dbf /u02/oracle/oradata/DB11G/users01.dbf
SQL> host mv /u01/app/oracle/oradata/DB11G/undotbs01.dbf /u02/oracle/oradata/DB11G/undotbs01.dbf
SQL> host mv /u01/app/oracle/oradata/DB11G/sysaux01.dbf /u02/oracle/oradata/DB11G/sysaux01.dbf
SQL> host mv /u01/app/oracle/oradata/DB11G/system01.dbf /u02/oracle/oradata/DB11G/system01.dbf
SQL> host mv /u01/app/oracle/oradata/DB11G/example01.dbf /u02/oracle/oradata/DB11G/example01.dbf
SQL> host mv /u01/app/oracle/oradata/DB11G/mgmt_depot.dbf /u02/oracle/oradata/DB11G/mgmt_depot.dbf
SQL> host mv /u01/app/oracle/oradata/DB11G/mgmt.dbf /u02/oracle/oradata/DB11G/mgmt.dbf
SQL> host mv /u01/app/oracle/oradata/DB11G/mgmt_ad4j.dbf /u02/oracle/oradata/DB11G/mgmt_ad4j.dbf

alter database rename file ‘/u01/app/oracle/oradata/DB11G/users01.dbf’ to ‘/u02/oracle/oradata/DB11G/users01.dbf’
alter database rename file ‘/u01/app/oracle/oradata/DB11G/undotbs01.dbf’ to ‘/u02/oracle/oradata/DB11G/undotbs01.dbf’
alter database rename file ‘/u01/app/oracle/oradata/DB11G/sysaux01.dbf’ to ‘/u02/oracle/oradata/DB11G/sysaux01.dbf’
alter database rename file ‘/u01/app/oracle/oradata/DB11G/system01.dbf’ to ‘/u02/oracle/oradata/DB11G/system01.dbf’
alter database rename file ‘/u01/app/oracle/oradata/DB11G/mgmt_depot.dbf’ to ‘/u02/oracle/oradata/DB11G/mgmt_depot.dbf’
alter database rename file ‘/u01/app/oracle/oradata/DB11G/mgmt.dbf’ to ‘/u02/oracle/oradata/DB11G/mgmt.dbf’
alter database rename file ‘/u01/app/oracle/oradata/DB11G/mgmt_ad4j.dbf’ to ‘/u02/oracle/oradata/DB11G/mgmt_ad4j.dbf’

MOVING REDOLOG FILE TO NEW LOCATION

host mv /u01/app/oracle/oradata/DB11G/redo01.log /u02/oracle/oradata/DB11G/
host mv /u01/app/oracle/oradata/DB11G/redo02.log /u02/oracle/oradata/DB11G/
host mv /u01/app/oracle/oradata/DB11G/redo03.log /u02/oracle/oradata/DB11G/

alter database rename file ‘/u01/app/oracle/oradata/DB11G/redo01.log’ to ‘/u02/oracle/oradata/DB11G/redo01.log’
alter database rename file ‘/u01/app/oracle/oradata/DB11G/redo02.log’ to ‘/u02/oracle/oradata/DB11G/redo02.log’
alter database rename file ‘/u01/app/oracle/oradata/DB11G/redo03.log’ to ‘/u02/oracle/oradata/DB11G/redo03.log’

MOVING CONTROL FILE TO NEW LOCATION

SQL> select name from v$controlfile;

NAME
——————————————————————————–
/u01/app/oracle/oradata/DB11G/control01.ctl
/u01/app/oracle/flash_recovery_area/DB11G/control02.ctl

or

SQL> show parameter control_file;

NAME TYPE VALUE
———————————— ———– ——————————
control_file_record_keep_time integer 7
control_files string /u01/app/oracle/oradata/DB11G/
control01.ctl, /u01/app/oracle
/flash_recovery_area/DB11G/con
trol02.ctl

SQL> shutdown immediate

SQL> create pfile from spfile;

SQL> host vi /u02/oracle/product/11.2.0.3/db01/dbs/initDB11G.ora

change the control

SQL> host cp /u01/app/oracle/oradata/DB11G/control01.ctl /u02/oracle/oradata/DB11G/control01.ctl
SQL> host cp /u01/app/oracle/flash_recovery_area/DB11G/control02.ctl /u02/oracle/flash_recovery_area/control02.ctl

SQL> create spfile from pfile;

SQL> startup
ORACLE instance started.

Total System Global Area 3223535616 bytes
Fixed Size 2232680 bytes
Variable Size 1795165848 bytes
Database Buffers 1409286144 bytes
Redo Buffers 16850944 bytes
Database mounted.
Database opened.
SQL> show parameter control_file;

NAME TYPE VALUE
———————————— ———– ——————————
control_file_record_keep_time integer 7
control_files string /u02/oracle/oradata/DB11G/cont
rol01.ctl, /u02/oracle/flash_r
ecovery_area/control02.ctl

Configure PXE Server to automate Oracle Linux 6 unattended installation via network

I am using http method (My images are hosted on the web server)

I configured my virtual machine as below

Memory 2gb
Processors 1
Hard disk (SCSI) 30gb
Network Adapter Bridged(Automatic) (For Internet access and yum installation)
Network Adapter 2 Custom (VMnet4) ( Having IP 192.168.222.1 netmask 255.255.255.0 only for pxe server)

After installing oracle linux server 6.0 configure ip address for network adapter 2

setup public yum server using my guide as per below link.

http://sunilthetechfreak.com/2012/07/18/how-to-setup-public-yum-for-all-updates-on-oracle-linux-6/

The required packages for PXE Server (xinetd,syslinux,dhcpd,tftp-server,httpd)

# install the packages

yum install -y syslinux xinetd tftp-server dhcp httpd

# Enable tftp server & start tftp service

vi /etc/xinetd.d/tftp
Disable=no (only change this line from the tftp file)

service xinetd restart or /etc/init.d/xinetd restart
chkconfig xinetd on (To auto start the service when the system boot)

# Configure DHCP server & start the dhcp service
vi /etc/dhcp/dhcpd.conf

#Global options (also important for pxe booting)

lease-file-name “/var/lib/dhcpd/dhcpd.leases”;
allow booting;
allow bootp;
authoritative;

#subnet of our local network

subnet 192.168.222.0 netmask 255.255.255.0

{

# Parameters for local subnet
option subnet-mask 255.255.255.0;
option domain-name “localdomain”
option domain-name-servers 192.168.222.1; #(This is optional, but i am pointing it to this same server)
default-lease-time 21600;
max-lease-time 43200;

# Client ip range (the range defined here will be given to the client which request the ip for auto installation)

range dynamic-bootp 192.168.222.20 192.168.222.50;

#very important for pxe booting

filename “pxelinux.0”;
next-server 192.168.222.1; (I am point to this same pxe server)

}

#save & close

service dhcpd restart or /etc/init.d/dhcpd restart
chkconfig dhcpd on

# create required directory to copy oracle linux 6 media

[root@oel6-server1 sunil]# mkdir -p /var/pxe/ol6
[root@oel6-server1 sunil]# mkdir -p /var/lib/tftpboot/ol6

#mount the oracle linux 6 dvd or iso file which ever is available

[root@oel6-server1 sunil]# cd /media
[root@oel6-server1 media]# ls
OL6.0 x86_64 Disc 1 20110203

[root@oel6-server1 media]# cd OL*

# Check the contents to see if it is properly mounted.

[root@oel6-server1 OL6.0 x86_64 Disc 1 20110203]# ls -l
total 706
drwxr-xr-x. 3 sunil sunil 2048 Feb 4 2011 EFI
-rw-r–r–. 1 sunil sunil 7041 Feb 4 2011 EULA
-rw-r–r–. 1 sunil sunil 7041 Feb 4 2011 eula.en_US
-rw-r–r–. 1 sunil sunil 3334 Feb 4 2011 eula.py
-rw-r–r–. 1 sunil sunil 18390 Feb 4 2011 GPL
drwxr-xr-x. 3 sunil sunil 2048 Feb 4 2011 HighAvailability
drwxr-xr-x. 3 sunil sunil 2048 Feb 4 2011 images
drwxr-xr-x. 2 sunil sunil 2048 Feb 4 2011 isolinux
drwxr-xr-x. 3 sunil sunil 2048 Feb 4 2011 LoadBalancer
-rw-r–r–. 1 sunil sunil 98 Feb 4 2011 media.repo
drwxr-xr-x. 2 sunil sunil 614400 Feb 4 2011 Packages
-rw-r–r–. 1 sunil sunil 2613 Feb 4 2011 README-en
-rw-r–r–. 1 sunil sunil 7046 Feb 4 2011 README-en.html
-rw-r–r–. 1 sunil sunil 16807 Feb 4 2011 RELEASE-NOTES-en
-rw-r–r–. 1 sunil sunil 19168 Feb 4 2011 RELEASE-NOTES-en.html
lrwxrwxrwx. 1 sunil sunil 15 Feb 4 2011 repodata -> Server/repodata
drwxr-xr-x. 3 sunil sunil 2048 Feb 4 2011 ResilientStorage
-rw-r–r–. 1 sunil sunil 1011 Feb 4 2011 RPM-GPG-KEY
-rw-r–r–. 1 sunil sunil 1011 Feb 4 2011 RPM-GPG-KEY-oracle
drwxr-xr-x. 3 sunil sunil 2048 Feb 4 2011 ScalableFileSystem
drwxr-xr-x. 4 sunil sunil 2048 Feb 4 2011 Server
-rw-r–r–. 1 sunil sunil 108 Feb 4 2011 supportinfo
-r–r–r–. 1 sunil sunil 5357 Feb 4 2011 TRANS.TBL

# copy all the contents to the /var/pxe/ol6 directory.

[root@oel6-server1 OL6.0 x86_64 Disc 1 20110203]# cp –ivr * /var/pxe/ol6

# now copy the kernel & image file from images folder to tftpboot/ol6 directory

[root@oel6-server1 pxeboot]# pwd
/var/pxe/ol6/images/pxeboot

[root@oel6-server1 pxeboot]# ls -l
total 33044
-rw-r–r–. 1 root root 30039242 Jul 9 21:06 initrd.img
-r–r–r–. 1 root root 441 Jul 9 21:06 TRANS.TBL
-rwxr-xr-x. 1 root root 3791744 Jul 9 21:06 vmlinuz

# copy the vmlinuz and initrd.img files to the tftpboot directory.

[root@oel6-server1 pxeboot]# cp vmlinuz /var/lib/tftpboot/ol6
[root@oel6-server1 pxeboot]# cp initrd.img /var/lib/tftpboot/ol6

[root@oel6-server1 pxeboot]# cd /usr/share/syslinux

# copy the menu file.

[root@oel6-server1 syslinux]# cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot

#create folder

[root@oel6-server1 sunil]# mkdir -p /var/lib/tftpboot/pxelinux.cfg

# create default menu file

[root@oel6-server1 sunil]# vi /var/lib/tftpboot/pxelinux.cfg/default
timeout 100
default menu.c32

menu title =======Network Boot Menu=======
label 1
menu label ^ 1) Oracle Linux 6
kernel ol6/vmlinuz
append initrd=ol6/initrd.img ks=http://192.168.0.70/ks/ks.cfg ksdevice=eth0

# save and close

# now configure the webserver (Apache server to get the installation files)

[root@oel6-server1 sunil]# vi /etc/httpd/conf.d/pxeboot.conf

Alias /ol6 /var/pxe/ol6

Options Indexes FollowSymLinks
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 192.168.222.0/24 192.168.1.0/24

#save & close restart the webserver

service httpd restart or /etc/init.d/httpd restart
chkconfig httpd on

#now create kickstart file as per the required configuration

yum install -y system-config-kickstart

system-config-kickstart # you can configure the system as per your requirement

[root@oel6-server1 sunil]# mkdir /var/www/html/ks

# As i already have anaconda-ks.cfg from my earlier installation i will use the same

[root@oel6-server1 sunil]# cp /root/anaconda-ks.cfg /var/www/html/ks/ks.cfg

# Change the permission as below

chmod 644 /var/www/html/ks/ks.cfg

# check if you are able to browse both the installation media & kickstart file from the webserver

Oracle Linux 6 Http image
http://192.168.222.1/ol6

ks file
http://192.168.222.1/ks/ks.cfg

# Stop the Linux firewall

[root@oel6-server1 sunil]# service iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
[root@oel6-server1 sunil]# chkconfig iptables off

# restart all the service httpd,dhcp, xinetd

#configure a new virtual machine using the same network adapter setting Custom (VMnet4) and test your installation. if you have any queries do write to me so i would be able to help.