Google it ....

Showing posts with label 11g. Show all posts
Showing posts with label 11g. 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.

Wednesday, April 10, 2019

ORA-39142: incompatible version number 5.1 in dump file

Recently I faced error:
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39142: incompatible version number 5.1 in dump file 
while making import table data on Oracle Database 11g.

Dump file was made from Oracle Database 12c (12.2.0.1.0) with parameter compatible to 12.2.0
SQL> show parameter compatible
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      12.2.0
noncdb_compatible                    boolean     FALSE
 
SQL> 

and during impdp on Oracle Database 11g (11.2.0.4.0) with compatible parameter to 11.2.0.4.0 occurred error:
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39142: incompatible version number 5.1 in dump file "xxx.dmp"

Data Pump Import can always read Data Pump dump file sets created by older releases of the database but In a downgrade situation, when the target release of a Data Pump-based migration is lower than the source, the VERSION parameter should be explicitly specified to be the same version as the target. An exception is when the target release version is the same as the value of the COMPATIBLE initialization parameter on the source system; then VERSION does not need to be specified. In general however, Data Pump import cannot read dump file sets created by an Oracle release that is newer than the current release unless the VERSION parameter is explicitly specified
So solution is to specify value of target database compatible parameter in version parameter in expdp while exporting table.

for my situation on expdp on 12c database I specify version=11.2 and impdp on 11g run successfully.

on Oracle Database 12c (12.2.0.1.0) with compatible 12.2.0
expdp test_user/test_pass version=11.2 tables=test_table CONTENT=DATA_ONLY directory=TEST_DUMP dumpfile=test.dmp logfile=test_exp.log

on Oracle Database 11g (11.2.0.4.0) with compatible 11.2.0.4.0
impdp test_user/test_pass tables=test_table CONTENT=DATA_ONLY directory=TEST_DUMP dumpfile=test.dmp logfile=test_imp.log

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.

Friday, October 24, 2014

Upgrade Oracle Database from 10g to 11g on another host

In this post we will discuss about restoring 10g database into new host with 11g oracle software installed.
Source database is 10.2.0.1, O/S is Windows server 2003 64 bit
On destination server installed oracle database software 11.2.0.1, O/S is Windows server 2012 64 bit

Note : direct upgrade between these versions is not possible, see Oracle Documentation http://docs.oracle.com/cd/E11882_01/server.112/e23633/preup.htm#UPGRD12358, hence we need to upgrade source database version from 10.2.0.1 to 10.2.0.2 or(higher)

after applying patchset 10.2.0.5, we can continue upgrading to 11g on another host.

The steps for 10g database:
1) Run the utlu112i.sql Pre-upgrade script. You can find this script under @%ORACLE_HOME%\rdbms\admin\. It must be copied from the 11g database software.
SQL> @%ORACLE_HOME%\rdbms\admin\utlu112i.sql

it performs following operation
SQL> ALTER TABLE registry$database ADD (tz_version NUMBER);
SQL> UPDATE registry$database set tz_version =4;
SQL> ALTER  PACKAGE “SYS”.”DBMS_REGISTRY”  COMPILE BODY;
SQL> ALTER VIEW “SYS”.”DBA_REGISTRY_DATABASE”  COMPILE;

2) Connect to 10g database and take RMAN full backup.
run {
ALLOCATE CHANNEL RMAN_BACK_CH01 TYPE DISK;
backup tag test_full database format "E:\databasefiles_%d_%u_%s_%T";
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP archivelog all format "E:\archivelogs_%d_%u_%s_%T";
backup current controlfile format "E:\control01.cf";
RELEASE CHANNEL RMAN_BACK_CH01;
}

3) Copy 10g database backup files and archive files to 11g database server.

The steps for 11g database:
1) Create temporary pfile in $ORACLE_HOME$\dbs and change path of directories parameters as you have.

2) Open the database in NOMOUNT state.
rman target /

RMAN> startup nomount;

3) Restore controlfile from backup.
RMAN> restore controlfile from 'D:\backup\control01.cf';

4) Open the database in MOUNT state.
RMAN> alter database mount;

5) Make crosscheck backup and archive log, for delete expireds, Catalog RMAN backup files and archive log files.
RMAN> crosscheck backup;
RMAN> crosscheck archivelog all;
RMAN> delete expired backup;
RMAN> delete expired archivelog all; 
RMAN> catalog start with 'D:\backup';

6) restore and recover 10g database backup
RMAN> run
{
allocate channel c1 device type disk FORMAT 'D:\backup';
SET NEWNAME FOR DATAFILE 1 TO ‘D:\oradata\sd01\SYSTEM01.DBF';
SET NEWNAME FOR DATAFILE 2 TO ‘D:\oradata\sd01\UNDOTBS01.DBF';
SET NEWNAME FOR DATAFILE 3 TO ‘D:\oradata\sd01\SYSAUX01.DBF';
SET NEWNAME FOR DATAFILE 4 TO ‘D:\oradata\sd01\USERS01.DBF';
SET NEWNAME FOR DATAFILE 5 TO ‘D:\oradata\sd01\USERS02.DBF';
SET NEWNAME FOR DATAFILE 6 TO ‘D:\oradata\sd01\USERS03.DBF';
SET NEWNAME FOR DATAFILE 7 TO ‘D:\oradata\sd01\USERS04.DBF';
restore database;
switch datafile all;
recover database;
}

7) open database with upgrade mode
SQL> shutdown immediate;
SQL> startup upgrade;

8) Run the upgrade script
SQL> SPOOL upgradelog.log
SQL> @%ORACLE_HOME%\rdbms\admin\catupgrd.sql
SQL> SPOOL off

9) If our 10g and 11g database os platforms are different then you must run utlmmig.sql script
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP UPGRADE
SQL> SPOOL upgradelog.log
SQL> @%ORACLE_HOME%\rdbms\admin\utlmmig.sql
SQL> SPOOL off

10) open the database
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP

11) Run the Post-Upgrade script
SQL> @%ORACLE_HOME%\rdbms\admin\utlu112s.sql

12) Compile invalid objects
SQL> @%ORACLE_HOME%\rdbms\admin\utlrp.sql

that's all, have a good upgrade.