About Me

My photo
Bangalore, India
I am an Oracle Certified Professional working in SAP Labs. Everything written on my blog has been tested on my local environment, Please test before implementing or running in production. You can contact me at amit.rath0708@gmail.com.
Showing posts with label Installation. Show all posts
Showing posts with label Installation. Show all posts

Thursday, October 5, 2017

How to Clone Grid Infrastructure binaries for Oracle Server(Standalone)

Yesterday I was applying patch on one of our development servers and patch on Grid Home failed with space issue and binaries got corrupted.

I thought of reinstalling the grid binaries by cloning it from a fresh development server. PFB steps for that :-

1. Stop the source(fresh) grid binaries. Hostname is Source_server
2. Tar the binaries 
3. Scp to the target(corrupted) server.  Hostname is Target_server

4. Detach the grid home from the Central inventory in Corrupted server :-

==>./runInstaller.sh -silent -detachHome ORACLE_HOME=/opt/grid/12.1.0.2 ORACLE_HOME_NAME=" Ora11g_gridinfrahome1"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 16383 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
'DetachHome' was successful.
[target_server][oracle][]

5. Clone the grid home so that binaries are linked and grid home is attached to Central inventory

./runInstaller -clone -waitForCompletion  "ORACLE_HOME=/opt/grid/12.1.0.2" "ORACLE_HOME_NAME=OraHome1Grid" "INVENTORY_LOCATION=/opt/orainv/oraInventory" "LOCAL_NODE=target_server" "CRS=FASLE" "ORACLE_BASE=/opt/oracle" -silent -paramFile /opt/grid/12.1.0.2/clone/clone_oraparam.ini
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   Actual 233206 MB    Passed
Checking swap space: must be greater than 500 MB.   Actual 16383 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-10-03_05-47-08AM. Please wait ...You can find the log of this install session at:
 /opt/orainv/oraInventory/logs/cloneActions2017-10-03_05-47-08AM.log
..................................................   5% Done.
..................................................   10% Done.
..................................................   15% Done.
..................................................   20% Done.
..................................................   25% Done.
..................................................   30% Done.
..................................................   35% Done.
..................................................   40% Done.
..................................................   45% Done.
..................................................   50% Done.
..................................................   55% Done.
..................................................   60% Done.
..................................................   65% Done.
..................................................   70% Done.
..................................................   75% Done.
..................................................   80% Done.
..................................................   85% Done.
..........Could not backup file /opt/grid/12.1.0.2/root.sh to /opt/grid/12.1.0.2/root.sh.ouibak
Could not backup file /opt/grid/12.1.0.2/rootupgrade.sh to /opt/grid/12.1.0.2/rootupgrade.sh.ouibak

Copy files in progress.

Copy files successful.

Link binaries in progress.

Link binaries successful.

Setup files in progress.

Setup files successful.

Setup Inventory in progress.

Setup Inventory successful.

Finish Setup successful.
The cloning of OraHome1Grid was successful.
Please check '/opt/orainv/oraInventory/logs/cloneActions2017-10-03_05-47-08AM.log' for more details.

Setup Oracle Base in progress.

Setup Oracle Base successful.
..................................................   95% Done.

As a root user, execute the following script(s):
        1. /opt/grid/12.1.0.2/root.sh


..................................................   100% Done.
[target_server][oracle][]

6. Execute the root.sh script

7. Configure your CRS instance on the cluster

While Configuring , I got below error :-

[root@target_server grid]# /opt/grid/12.1.0.2/perl/bin/perl -I/opt/grid/12.1.0.2/perl/lib -I/opt/grid/12.1.0.2/crs/install /opt/grid/12.1.0.2/crs/install/roothas.pl
Using configuration parameter file: /opt/grid/12.1.0.2/crs/install/crsconfig_params
2017/06/03 06:00:59 CLSRSC-350: Cannot configure two CRS instances on the same cluster

2017/10/03 06:00:59 CLSRSC-352: CRS is already configured on this node for the CRS home location /opt/grid/12.1.0.2

we have to deconfigure the existing one before configuring it again

8. Deconfigure the existing CRS 

[root@target_server install]# ./roothas.pl -deconfig -force
Using configuration parameter file: ./crsconfig_params
2017/10/03 06:13:02 CLSRSC-337: Successfully deconfigured Oracle Restart stack

9. Configure it again :-

[root@target_server install]# /opt/grid/12.1.0.2/perl/bin/perl -I/opt/grid/12.1.0.2/perl/lib -I/opt/grid/12.1.0.2/crs/install /opt/grid/12.1.0.2/crs/install/roothas.pl
Using configuration parameter file: /opt/grid/12.1.0.2/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'sigdba'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node target_server successfully pinned.
2017/10/03 06:15:36 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.conf'


target_server 2017/10/03 06:16:02 /opt/grid/12.1.0.2/cdata/target_server/backup_20170603_061602.olr 3924561976
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'target_server'
CRS-2673: Attempting to stop 'ora.evmd' on 'target_server'
CRS-2677: Stop of 'ora.evmd' on 'target_server' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'target_server' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
2017/10/03 06:16:33 CLSRSC-327: Successfully configured Oracle Restart for a standalone server

9. Add the asm details and start the asm

==>srvctl add asm -d /dev/mapper/
[target_server][oracle][+ASM]
/dev/mapper$
==>
[target_server][oracle][+ASM]
/dev/mapper$
==>srvctl start asm
[target_server][oracle][+ASM]
/dev/mapper$

[target_server][oracle][+ASM]
/dev/mapper$
==>sqlplus  /as sysasm

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Automatic Storage Management option

SQL> alter diskgroup AMIT_GROUP mount;

Diskgroup altered.

10 . Add database to CRS 

==>srvctl add database -d amit -o /opt/oracle/product/database/12.1.0.2/
[target_server][oracle][amit]

/dev/mapper$
==>sqlplus /as sysdba

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 8589934592 bytes
Fixed Size                  7663544 bytes
Variable Size            3288334408 bytes
Database Buffers         3137339392 bytes
Redo Buffers                9113600 bytes
In-Memory Area           2147483648 bytes
Database mounted.
SQL> alter database open;

Database altered.

Cloning of Grid home binaries completed.

I hope this article helped you

Thanks
Amit Rath

Monday, February 29, 2016

OMS 12.1.0.4 installation failed with "The database details which you have provided doesn't contain valid Management Repository. Provide correct database details and retry"

Yesterday I was installing OMS 121.0.4 and got below error while attempting to connect to database:-

OMS 12.1.0.4 installation failed with "The database details which you have provided doesn't contain valid Management Repository. Provide correct database details and retry"

Cause :-

Generally this error comes when the database we are using as OMS database was already used as a database for OMS installation before or A failed OMS installation already happened using this database.

Solution :-

we have to properly clean the database before using it again as a OMS database :-

Below steps I did to clean my database :-

1. Drop sysman related schemas.

DROP USER SYSMAN CASCADE;  ( will take time)
DROP USER SYSMAN_OPSS CASCADE;
DROP USER SYSMAN_MDS CASCADE;
DROP USER SYSMAN_APM CASCADE;
DROP USER SYSMAN_RO CASCADE;

2. Remove Synonyms related to sysman accounts :-

DECLARE
  CURSOR l_syn_csr IS
    SELECT 'DROP ' ||
      CASE owner
        WHEN 'PUBLIC'
          THEN 'PUBLIC SYNONYM '
        ELSE 'SYNONYM ' || owner || '.'
      END ||
      synonym_name AS cmd
    FROM
      dba_synonyms 
    WHERE
      table_owner IN (
        'SYSMAN',
        'SYSMAN_MDS',
        'MGMT_VIEW',
        'SYSMAN_BIP',
        'SYSMAN_APM',
        'BIP',
        'SYSMAN_OPSS',
        'SYSMAN_RO'
      );
BEGIN
  FOR l_syn_rec IN l_syn_csr LOOP
    BEGIN
      EXECUTE IMMEDIATE l_syn_rec.cmd;
    EXCEPTION
      WHEN OTHERS THEN
        dbms_output.put_line( '===> ' || l_syn_rec.cmd );
        dbms_output.put_line( sqlerrm );
    END;
  END LOOP;
END;
/

3. Removing remaining Objects and tablespaces :-

DROP USER mgmt_view CASCADE;
DROP TABLESPACE mgmt_ecm_depot_ts INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;
DROP TABLESPACE mgmt_tablespace   INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;
DROP TABLESPACE mgmt_ad4j_ts      INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;

4.  As proper database cleaning using RepManager dropall didn't happen, so we have to clean up the registry details :-

DELETE
  FROM
    schema_version_registry
  WHERE
    (comp_name,owner) IN (
      ('Authorization Policy Manager','SYSMAN_APM'),
      ('Metadata Services','SYSMAN_MDS'),
      ('Oracle Platform Security Services','SYSMAN_OPSS')
    );
commit;

5. Now the database clean up completed, Please continue with the installation, I tried and it completed successfully.

I hope this article helped you, Please go through the below article also for proper error details :-
https://sites.google.com/site/yetanotherocm/home/system-builds/cronulla/07-complete-oms-12-1-0-3-1-installation

Thanks
Amit Rath

Friday, September 27, 2013

How to install Oracle Database 10.2.0.1(10GR2) in RedHat Linux 5 step by step


PFB steps to install Oracle Database 10.2.0.1(10GR2) on RHEL 5 :-

1. Download Software from Oracle Metalink.

10201_database_linux_x86_64.cpio.gz

2. Unzip file in same directory one by one. PFB how to unzip .cpio extension file :-

[oracle@localhost database]$ gunzip 10201_database_linux_x86_64.cpio.gz
[oracle@localhost database]$ cpio -ivmd < 10201_database_linux_x86_64.cpio

3. You need minimum 3.5 GB space for this installation excluding software.

4. Prerequisites for Oracle Installation in RHEL5 :-

a. Check Memory :- Minimum 1GB required, But 2GB recommended.

[root@localhost ~]# grep MemTotal /proc/meminfo
MemTotal:      2058824 kB

b. Check that System architecture can run software :-

[root@localhost ~]# uname -m
x86_64

As system is 64 bit , Oracle which has to be installed has to be 64 bit.

c. Check Swap Space :-

1GB -2GB RAM    ----------  SWAP space 1.5 times
2GB - 16GB RAM ---------   SWAP space equal to RAM
> 16GB RAM        ---------   SWAP space equals 16GB

[root@localhost ~]# grep SwapTotal /proc/meminfo
SwapTotal:     4095992 kB

d. Check /tmp directory :-

[root@localhost ~]# df -h /tmp
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       2G   436m  1.5G  21% /tmp

/tmp directory must have 1GB free space.

e. Check Kernal Version :-

[root@localhost ~]# uname -r
2.6.18-274.el5

f. Check Package requirements :-

go to location : - /media/RHEL_5.7 x86_64 DVD/Server and run below commands 


rpm -Uvh setarch-1*
rpm -Uvh compat-libstdc++-33-3*
rpm -Uvh make-3*
rpm -Uvh glibc-2*
rpm -Uvh openmotif-2*
rpm -Uvh compat-db-4*
rpm -Uvh libaio-0*
rpm -Uvh gcc-3*
rpm -Uvh compat-gcc-32-3*
rpm -Uvh compat-gcc-32-c++-3*
rpm -Uvh libXp-1.0.0-8.1.el5.i386.rpm

Run above packages , if they are already installed then it will give message as 'INSTALLED' and those are not installed it will install those.

If you need to check which package is there or not then use :-

rpm -q package_name

g. Create required groups, User and Directories :-

[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# useradd -g oinstall -G dba oracle
[root@localhost ~]# mkdir -p /oracle_home/app
[root@localhost /]# chown -R oracle:oinstall /oracle_home/app
[root@localhost /]# chmod -R 750 /oracle_home/app
[root@localhost /]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

h. Configuring Kernal Parameters :-

Enter the below mentioned entries in /etc/sysctl.conf file :-


kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144

If values for above already present commnt those. Run below mentioned command to change current kernal values :-


[root@localhost ~]# /sbin/sysctl -p
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144

i. Configure the Resource limits for Oracle User :-

Enter the below mentioned entries in /etc/security/limits.conf file :-


*               soft    nproc   2047
*               hard    nproc   16384
*               soft    nofile  1024
*               hard    nofile  65536

j. Edit /etc/pam.d/login file

session    required     pam_limits.so

k. Set the Display setting for graphical Oracle Installation :-

[root@localhost /]# su - oracle
[oracle@localhost ~]$ export DISPLAY=localhost:0.0
[oracle@localhost ~]$ echo $DISPLAY
localhost:0.0

Prerequisites have been completed . Now we can start Oracle Installation.

5. Installation of Oracle

a. Run the ./runInstaller in database folder which has been created after Unzipping the software :-

1. select advanced installation
2. Enter Oracle_HOME location as we have created directory
3. Enter password for sys,system admin users 
4. Select to install database also including software.
5. select location of datafiles.
6. select FRA location.
7. Enable Automated backups, for this enter os user details. In our case "oracle".
8. First it will install Network utility then Oracle Database and one optional Isqlplus.
9. Run root.sh script 

Installation completed successfully for 10GR2.

I hope this article helped you.

Regards,
Amit Rath

Wednesday, September 25, 2013

How to install Oracle Database 11.2.0.1(11GR2) in Redhat Linux 5 step by step

PFB steps to install Oracle Database 11gR201 on RHEL 5 :-

1. Download Software from www.oracle.com, Downloads section --> Oracle Database.

linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip

2. Unzip both the files in same directory one by one. A single directory named database will be created after you unzip both the files.

3. You need minimum 5 GB space for this installation excluding software.

4. Prerequisites for Oracle Installation in RHEL5 :-

a. Check Memory :- Minimum 1GB required, But 2GB recommended.

[root@localhost ~]# grep MemTotal /proc/meminfo
MemTotal:      2058824 kB

b. Check that System architecture can run software :-

[root@localhost ~]# uname -m
x86_64

As system is 64 bit , Oracle which has to be installed has to be 64 bit.

c. Check Swap Space :-

1GB -2GB RAM    ----------  SWAP space 1.5 times
2GB - 16GB RAM ---------   SWAP space equal to RAM
> 16GB RAM        ---------   SWAP space equals 16GB

[root@localhost ~]# grep SwapTotal /proc/meminfo
SwapTotal:     4095992 kB

d. Check /tmp directory :-

[root@localhost ~]# df -h /tmp
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       2G   436m  1.5G  21% /tmp

/tmp directory must have 1GB free space.

e. Check Kernal Version :-

[root@localhost ~]# uname -r
2.6.18-274.el5

f. Check Package requirements :-

rpm -Uvh binutils-2.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh compat-libstdc++-33*.i386.rpm
rpm -Uvh elfutils-libelf*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh glibc-devel-2.*
rpm -Uvh glibc-headers-2.*
rpm -Uvh ksh*
rpm -Uvh libaio-0.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libgomp-4.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh make-3.*
rpm -Uvh sysstat-7.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*
rpm -Uvh numactl-devel-*

Run above packages , if they are already installed then it will give message as 'INSTALLED' and those are not installed it will install those.

If you need to check which package is there or not then use :-

rpm -q package_name

g. Create required groups, User and Directories :-

[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# useradd -g oinstall -G dba oracle
[root@localhost ~]# mkdir -p /oracle_home/app
[root@localhost /]# chown -R oracle:oinstall /oracle_home/app
[root@localhost /]# chmod -R 750 /oracle_home/app
[root@localhost /]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

h. Configuring Kernal Parameters :-

Enter the below mentioned entries in /etc/sysctl.conf file :-

fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

If values for above already present commnt those. Run below mentioned command to change current kernal values :-

[root@localhost /]# /sbin/sysctl -p
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

i. Configure the Resource limits for Oracle User :-

Enter the below mentioned entries in /etc/security/limits.conf file :-

oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240

j. Set the Display setting for graphical Oracle Installation :-

[root@localhost /]# su - oracle
[oracle@localhost ~]$ export DISPLAY=localhost:0.0
[oracle@localhost ~]$ echo $DISPLAY
localhost:0.0

Prerequisites have been completed . Now we can start Oracle Installation.

5. Installation of Oracle

a. Run the ./runInstaller in database folder which has been created after Unzipping the software :-

[oracle@localhost database]$ ./runInstaller 
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 7482 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3999 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 65536    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-09-25_09-43-28PM. Please wait ...[oracle@localhost database]$ 




















Execute these scripts as root user 

[root@localhost ~]# /oracle_home/app/product/11.2.0/dbhome_1/root.sh
Running Oracle 11g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /oracle_home/app/product/11.2.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@localhost ~]#


Database 11GR2O1 installation completed.

6. Configure Oracle Settings in .bash_profile :-

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME
ORACLE_BASE=/oracle_home/app; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

export PATH

[oracle@localhost ~]$ echo $ORACLE_HOME
/oracle_home/app/product/11.2.0/dbhome_1
[oracle@localhost ~]$ sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 25 22:47:19 2013

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

Enter user-name: /as sysdba

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

I hope this article helped you.

Regards,
Amit Rath