Google it ....

Showing posts with label Oracle Linux. Show all posts
Showing posts with label Oracle Linux. Show all posts

Friday, May 22, 2020

Error in invoking target 'agent nmhs' of make file ins_emagent.mk while installing Oracle database software

Error in invoking target 'agent nmhs' of make file ins_emagent.mk while installing Oracle 11gr2 11.2.0.4.0 on Red Hat Enterprise Linux 7
Problem:

While installing Oracle database software 11.2.0.4.0 on Linux 7 we may encounter this error in between installation:

Error in invoking target 'agent nmhs' of make file 
/u0/app/oracle/product/11.2.0.4.0/sysman/lib/ins_emagent.mk

Cause:

Linking error due to "ins_emagent.mk"

Solution:

To fix edit the ins_emagent.mk file and change the following line in $ORACLE_HOME/sysman/lib/ins_emagent.mk


$(MK_EMAGENT_NMECTL)

to

$(MK_EMAGENT_NMECTL) -lnnz11

and press the retry button again.

Thursday, July 27, 2017

Textual description of firstImageUrl

Create RPM packages local repository for Oracle Enterprise Linux 7.0 on Virtual Machine

In this blog post I''ll show you how to create local RPM packages repository for Oracle Enterprise Linux 7.0. Let's start.
First of all we need connected Linux 7.0 ISO, go to the machine setting and check connected checkbox, under ISO image file choose Linux 7.0 installation file as shown below



















with root user
mkdir -p /mnt/cdrom
mount -t iso9660 -o ro /dev/sr0 /mnt/cdrom

mkdir -p /repo
cd /mnt/cdrom/Packages
cp * /repo/

cd /repo
rpm -Uvh deltarpm-3.6-3.el7.x86_64.rpm
rpm -Uvh python-deltarpm-3.6-3.el7.x86_64.rpm
rpm -Uvh createrepo-0.9.9-23.el7.noarch.rpm

createrepo .
Spawning worker 0 with 4292 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

mv /etc/yum.repos.d/public-yum-ol7.repo /etc/yum.repos.d/public-yum-ol7.repo.bkp
create rhel_repo.repo file under /etc/yum.repos.d/ and write next parameters
vi /etc/yum.repos.d/rhel_repo.repo

[rhel_repo]
name=repo
baseurl="file:///repo/"
gpgcheck=0
enabled=1
now you can check local repository
yum repolist
Loaded plugins: langpacks
rhel_repo                                                                                                                                                                     | 2.9 kB  00:00:00
rhel_repo/primary_db                                                                                                                                                          | 3.8 MB  00:00:00
repo id                                                                                           repo name                                                                                    status
rhel_repo                                                                                         repo                                                                                         4,292
repolist: 4,292

that's all now you have local RPM packages repository for Oracle Enterprise Linux 7.0

Monday, May 15, 2017

CRS-4124: Oracle High Availability Services startup failed - ohasd failed to start: Inappropriate ioctl for device on Linux 6

During Automatic storage Management (ASM) installation occurred error
CRS-4124: Oracle High Availability Services startup failed 
ohasd failed to start: Inappropriate ioctl for device
Environment : 
OS : CentOS release 6.7
Grid : Oracle Grid Infrastructure 11g Release 2 (11.2.0.1.0) for Linux x86
This happened because in Linux 6 is not supported Oracle 11g Release 2 (11.2.0.1.0) 
Solution :  Here I''ll show you how to solve this problem.
1) open $GRID_HOME/crs/install/s_crsconfig_lib.pm file
2)Add the following lines before the # Start OHASD
my $UPSTART_OHASD_SERVICE = "oracle-ohasd";
my $INITCTL = "/sbin/initctl";

($status, @output) = system_cmd_capture ("$INITCTL start $UPSTART_OHASD_SERVICE");
if (0 != $status)
{
error ("Failed to start $UPSTART_OHASD_SERVICE, error: $!");
return $FAILED;
}
# Start OHASD
vi s_crsconfig_lib.pm
/Start OHASD  --- for search string in vi
3) create file with /etc/init/oracle-ohasd.conf file with below entries
# Oracle OHASD start
start on runlevel [35]
stop on runlevel [!35]
respawn
exec /etc/init.d/init.ohasd run >/dev/null 2>&1
4) De configuration of Oracle Restart stack with root user : 
[root@testdb install]# cd $GRID_HOME/crs/install/
[root@testdb install]# ./roothas.pl -deconfig -force -verbose
Checking for super user privileges
User has super user privileges
Parsing the host name
Using configuration parameter file: ./crsconfig_params
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Delete failed, or completed with errors.
CRS-2791: Starting shutdown of Oracle High Availability Services-managed 
resources on 'testdb'
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'testdb'
CRS-2673: Attempting to stop 'ora.evmd' on 'testdb'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'testdb'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'testdb'
CRS-2677: Stop of 'ora.cssdmonitor' on 'testdb' succeeded
CRS-2677: Stop of 'ora.evmd' on 'testdb' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'testdb' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'testdb'
CRS-2677: Stop of 'ora.mdnsd' on 'testdb' succeeded
CRS-2677: Stop of 'ora.gipcd' on 'testdb' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources 
on 'testdb' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully deconfigured Oracle Restart stack
5) run again root.sh script with root user and make overwrite "Y"

[root@testdb ~]# cd $GRID_HOME/
[root@testdb 11.2.0]# ./root.sh
................
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
...............

That's all OHASD service started and working.

Tuesday, February 4, 2014

Automatically start oracle database on linux after server reboot

Here I'll show you how to configure system for automatically start oracle database after server reboot.
oracle database 11g --- Oracle Linux 6.3
First of all, you need to make sure that any database instances you want to auto start are set to "Y" in the /etc/oratab file
#
# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# 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::
#
# 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.
#
#
orcl:/u0/app/oracle/product/11.2.0/dbhome_1:Y

Oracle 11g includes 2 scripts which can be used to start or shut down Oracle databases on Linux. Both scripts are in $ORACLE_HOME/bin and called dbstart and dbshut. We can add some more actions for example start enterprise manager if we create our scripts. Let's make two scripts db_start.sh and db_stop.sh
vi /u0/app/oracle/db_start.sh
# script to start the Oracle database, listener and dbconsole
. ~/.bash_profile
# start the listener and the database
$ORACLE_HOME/bin/dbstart $ORACLE_HOME
# start the Enterprise Manager db console
$ORACLE_HOME/bin/emctl start dbconsole
exit 0

vi /u0/app/oracle/db_stop.sh
# script to stop the Oracle database, listener and dbconsole
. ~/.bash_profile
# stop the Enterprise Manager db console
$ORACLE_HOME/bin/emctl stop dbconsole
# stop the listener and the database
$ORACLE_HOME/bin/dbshut $ORACLE_HOME
exit 0

inside script we are calling the .bash_profile file of the user "oracle" for export environment variables, we need it for $ORACLE_HOME.
give execute right:
chmod u+x db_start.sh db_stop.sh
With user root, create a file called "oracle" under /etc/init.d
vi /etc/init.d/oracle
ORA_OWNER=oracle
RETVAL=0
 
case "$1" in
    'start')
        # Start the Oracle databases:
        su - $ORA_OWNER -c "/u0/app/oracle/db_start.sh"
        touch /var/lock/subsys/oracle
        ;;
    'stop')
        # Stop the Oracle databases:
        su - $ORA_OWNER -c "/u0/app/oracle/db_stop.sh"
        rm -f /var/lock/subsys/oracle
        ;;
    *)
        echo $"Usage: $0 {start|stop}"
        RETVAL=1
esac
exit $RETVAL

change permission for /etc/init.d/oracle file:
chmod 750 /etc/init.d/oracle
to create service of this script:
chkconfig --add oracle

and now we can start and stop database with:
service oracle stop
service oracle start

Now it's time to test our automatically startup procedure, for this reboot your server and check if your database starts automatically after reboot.