Tuesday, October 13, 2015

Step by Step Cloning - R12.2

DB Tier Cloning

1. Prepare source node for cloning
cd /u01/PROD/fs1/inst/apps/PROD_oracle/admin/scripts
perl adpreclone.pl appsTier
cd /u01/PROD/db/11.2.0/appsutil/scripts/PROD_oracle
perl adpreclone.pl dbTier
2. Shutdown Application and DB
cd /u01/PROD/fs1/inst/apps/PROD_oracle/admin/scripts
./adstpall.sh 
sqlplus / as sysdba
shutdown immediate; 
3. Copy db directory from source to target
scp -r /u01/PROD/db <targetIP>:/u01/DEV/
4. Set permission for db filesystem
chmod -R 775 /u01/DEV/db
chown -R oracle:dba u01/DEV/db
5. Switch user who own the db binary file system
su - oracle
6. Configure target DB Tier
cd /u01/DEV/db/11.2.0/appsutil/clone/bin
perl adcfgclone.pl dbTier

Apps Tier Cloning



1. Create following directories on target host
mkdir /u01/DEV/fs1 -p
mkdir /u01/DEV/fs2 -p
mkdir /u01/DEV/fs_ne -p
2. Copy EBSapps directory from source to target (no need to copy FMW_Home and inst Directories)
scp -r /u01/PROD/fs1/EBSapps <targetIP>:/u01/DEV/fs1
3. Set permission for Apps file system
chmod -R 775 /u01/DEV/fs1
chown -R oracle:dba u01/DEV/fs1
4. Switch user who own the db binary file system
su - oracle
5. Configure target run file system
cd /u01/DEV/fs1/EBSapps/comn/clone/bin
perl adcfgclone.pl appsTier
6. After startup target application server, prepare system for patch file system
cd /u01/DEV/fs1/inst/apps/PROD_oracle/admin/scripts
perl adpreclone.pl appsTier
7. Shutdown application Server
cd /u01/DEV/fs1/inst/apps/PROD_oracle/admin/scripts
./adstpall.sh
8. Copy EBSapps directory from run file system to patch file system on target host
cp -r /u01/DEV/fs1/EBSapps /u01/DEV/fs2
9. Configure target patch file system
cd /u01/DEV/fs2/EBSapps/comn/clone/bin
perl adcfgclone.pl appsTier
10. If all goes well, then start application Server
cd /u01/DEV/fs1/inst/apps/PROD_oracle/admin/scripts
./adstrtal.sh

Wednesday, October 7, 2015

'Host key verification failed' Error when scp from one host to another in linux


Problem

When Try to copy file from one host to another below error occur
[root@backup u01]# scp -r RPM_oel6/ 192.168.22.4:/u01
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
ea:d6:b9:ac:45:e5:4a:46:ff:71:0b:84:a6:24:de:b2.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:2
RSA host key for 192.168.22.4 has changed and you have requested strict checking.
Host key verification failed.
lost connection

Solution

Please execute below command and copy again to overcome the issue
sed -i '2d' /root/.ssh/known_hosts 
Where '2d' is line number. If the line number is different then use the same

Thursday, July 16, 2015

Mount NTFS file system on Linux

Below are the steps to mount ntfs file system on linux OS

1. Download fuse RPM from below link and Install
http://www.atrpms.net/dist/el5/fuse/
$ rpm -Uvh --nodeps --force fuse-2.7.4-8_12.el5.x86_64.rpm
$ rpm -Uvh --nodeps --force fuse-kmdl-2.6.18-371.el5xen-2.7.4-8_12.el5.x86_64.rpm
$ rpm -Uvh --nodeps --force fuse-libs-2.7.4-8_12.el5.x86_64.rpm

2. Download fuse-ntfs RPM from below link and Install
http://dag.wieers.com/rpm/packages/fuse-ntfs-3g/
$ rpm -Uvh --nodeps --force fuse-ntfs-3g-1.417-1.el4.rf.x86_64.rpm

3. Mount the HD
$ mount.ntfs-3g /dev/sdb1 /media/disk1 -o force

Tuesday, July 14, 2015

Change sysman Password on 12c EM

Can not Change sysman password through sqlplus when running on Enterprise Manager. Have to use emctl to change sysman because this is used by oms. Please follow below steps to change the password

1. Stop oms
$ export OMS_HOME=/u01/app/oracle/oms12cr3/oms
$ cd $OMS_HOME/bin
$ ./emctl stop oms
do not use -all as admin server need to be up for change password 2. Modify sysman password
$ cd $OMS_HOME/bin
$ emctl config oms -change_repos_pwd -use_sys_pwd -sys_pwd <'sys password'> -new_pwd <'new sysman password'>
2. Restart all oms including Admin server
$ cd $OMS_HOME/bin
$ ./emctl stop oms -all
$ ./emctl start oms

Thursday, June 25, 2015

Add Swap Space on Linux

Find current swap space on the system
# free -m
           total   used    free   shared   buffers  cached
Mem:       16051   15570    481      0       707     12644
-/+ buffers/cache: 2218    13833
Swap:      8189     0      8189

Or

# swapon -s
Filename         Type        Size    Used    Priority
/dev/sda2      partition   8385920    88       -1

 Or

# cat /proc/swaps
Filename         Type        Size    Used    Priority
/dev/sda2      partition   8385920    88       -1

Method 1 - Use Hard Drive Partition

If you have additional hard disk or space available in existing disk then create partition using fdisk command. Assume /dev/sdc1 is newly created partition 

Setup newly created partition as swap area
# mkswap /dev/sdc1
Enable swap partition
# swapon /dev/sdc1
Add following line to /etc/fstab to available even after reboot
# cat /etc/fstab
/dev/sdc1        swap         swap    defaults        0 0
Verify whether newly created swap space is available
# swapon -s
Filename         Type       Size     Used    Priority
/dev/sda2      partition   8385920    88       -1
/dev/sdc1      partition  10234430     0       -2

Method 2 - Use a file for Additional swap space

If you does not have any additional disk then you can create a file on your system and use that for swap space

Create the swap file called 'myswap' using following command (file size in bytes=bs*count)
# dd if=/dev/zero of=/root/myswap bs=1M count=2048
Change the permission of newly created file
# chmod 755 /root/myswap
Make this file as a swap file
# mkswap /root/myswap
Add following line to /etc/fstab to available even after reboot
# cat /etc/fstab
/root/myswap        swap         swap    defaults        0 0
Verify whether newly created swap space is available
# swapon -s
Filename         Type       Size     Used    Priority
/dev/sda2      partition   8385920    88       -1
/root/myswap     file      2097152     0       -2

Tuesday, June 23, 2015

Deploy 12c Management Agent

Here explain how to add target hosts to enterprise manager

Login to Enterprise Manager via Sysman login
Go to Setup->Add Target->Add Targets Manually


 Select Add Host Targets and Click Add Host Button

Click on Add Button and Add the target host name which need to deploy agent and Click on Next Button

Provide Installation Base Directory and Instance directory on target host

Review the Host Information and click on Deploy Agent button to begin the installation

Now Management Agent will deploy on target host

Ignore the Privileges warning and click on Continue->Continue, All Host

Run the root.sh to complete the Agent deployment


Go to Setup->Add Target->Add Targets Manually and select 'Add Target Declaratively by Specifying Target Monitoring Properties'
Select 'Database Instance' to Target Type and specific hostname for Monitoring Agent and click on 'Add Manually' Button

Provide Database Details of Agent and Test the connection


Agent configuration completed and now can monitor newly added DB through EM

Thursday, June 11, 2015

Install 12c Enterprise Manager

Prerequisites 

  • Download and Install Oracle Database 11g R2 on linux platform
  • Download Enterprise Manager Cloud control from following link
  • http://www.oracle.com/technetwork/oem/grid-control/downloads/index.html

  • If you have performed a default database installation you will need to de-configure Enterprise Manager Database Control. Run the following command as the "oracle" user.

  • $ emca -deconfig dbcontrol db -repos drop -SYS_PWD <sys pasword> -SYSMAN_PWD <sysman password>

  • Make following initialization parameter changes and restart the instance

  • $sqlplus / AS SYSDBA
    SQL>ALTER SYSTEM SET processes=300 SCOPE=SPFILE;
    SQL>ALTER SYSTEM SET session_cached_cursors=200 SCOPE=SPFILE
    SQL>ALTER SYSTEM SET sga_target=2G SCOPE=SPFILE;
    SQL>ALTER SYSTEM SET shared_pool_size=600M SCOPE=SPFILE;
    SQL>ALTER SYSTEM SET pga_aggregate_target=1G SCOPE=SPFILE;
    SQL>ALTER SYSTEM SET job_queue_processes=20 SCOPE=SPFILE;
    
    SQL>SHUTDOWN IMMEDIATE
    SQL>STARTUP
    
    If you have done a default installation as described here, the UNDO tablespace will be autoextensible. If you have done a custom installation make sure the UNDO tablespace is at least 200M in size. Also, make sure you have 3 redo logs of at least 300M to prevent a warning during the installation.

    Cloud Control Installation

    Create Following installation directories for management server and agent

    $ mkdir -p /u01/app/oracle/oms12cr3
    $ mkdir -p /u01/app/oracle/agent12cr3
    
    Unzip the cloud control media and begin the installation by running runinstaller
    $ mkdir em
    $ unzip -d em em12103p1_linux64_disk1.zip
    $ unzip -d em em12103p1_linux64_disk2.zip
    $ unzip -d em em12103p1_linux64_disk3.zip
    $ cd em
    
    $ ./runInstaller
    
    If you wish to receive support information enter the e-mail address else skip

    If you wish to check for updates enter the details else skip

    If you have completed all the prerequisites then installation pass all the checks

    Select 'Create a new Enterprise Manager System' and 'simple' option

    Enter Middleware and Agent installation locations

    Enter Administrator password and Database Details

    If you have any additional warnings, check they don't look like show-stoppers, then click the 'OK' button to continue and click 'Install' button to begin the installation


    When prompted, run the root scripts, then click the 'OK' button
    Make note of the URL below and close. Copy of following information are stored in /u01/app/oracle/oms12cr3/oms/install/setupinfo.txt file.

    Login to the EM using above URL.


    Startup and Shutdown Enterprise Manager

    Oracle Management Server
    export OMS_HOME=/u01/app/oracle/oms12cr3/oms
    $OMS_HOME/bin/emctl start oms
    $OMS_HOME/bin/emctl stop oms
    $OMS_HOME/bin/emctl status oms
    
    Agent
    export AGENT_HOME=/u01/app/oracle/agent12cr3/core/12.1.0.3.0
    $AGENT_HOME/bin/emctl start agent
    $AGENT_HOME/bin/emctl stop agent
    $AGENT_HOME/bin/emctl status agent