Import Database IMPDP - Different Versions - oracle

We are having oracle installed in 2 different servers.
Server 1: Oracle Version Details
Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
PL/SQL Release 11.2.0.2.0 - Production
"CORE 11.2.0.2.0 Production"
TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
Server 2: Oracle Version Details
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
"CORE 11.2.0.1.0 Production"
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
I need to import a database backup from Server 1 to Server 2. I have tried this.
Export From Server 1:
EXPDP Username/Password#xe DIRECTORY=CUSTOM_DIR SCHEMAS=PRICE DUMPFILE=PRICE.DMP
Import To Server 2:
IMPDP Username/Password#\"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=Test)(PORT=1500)))(CONNECT_DATA=(SID=TESTSID)))\" DIRECTORY=CUSTOM_DIR DUMPFILE=TEST.DMP TABLE_EXISTS_ACTION=REPLACE LOGFILE=TEST.LOG
While importing, i am getting the exception as,
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
UDI-00018: Data Pump client is incompatible with database version 11.2.0.1.0
Is that not possible to import the backups between different versions.?

Yes, it is possible. You need to supply the "version" parameter on the export, and specify 11.2.0.1. This will instruct expdp to create a dmp file that is compatible with that version. See expdp command reference

I tried to use Oracle Database 12g Data Pump to import dump file inside a Oracle 11g Database. The return i got was UDI-00018: Data Pump client is incompatible with database version 11.2.0.4.0 .
The cause is: Two Oracle Homes in different versions, and the expdp/impdp called is wrong (verify path variable).
This may be occuring with you. You have another $ORACLE_HOME in your environment, and the data pump called is from this environment. Verify your .bash_profile or .profile files and set the correct environment.

Related

import data into Oracle 18xe using IMPDP failed

I have created a new oracle DB 18xe on a docker.
I am trying to import a dump file using the following command
impdp **/**#xepdb1 directory=DATA_PUMP_DIR dumpfile=file.dmp
remap_schema='source:dest' logfile=imp.log CONTENT=DATA_ONLY
I am getting the following error
Import: Release 18.0.0.0.0 - Production on Thu Dec 9 05:39:42 2021
Version 18.4.0.0.0
Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
ORA-39002: invalid operation
I could not figure out why I am getting this error, I tried to import one table only, used the following command
impdp **/**#xepdb1 directory=DATA_PUMP_DIR dumpfile=file.dmp
remap_schema='source:dest' logfile=imp.log CONTENT=DATA_ONLY tables=table1
I got the following error
Import: Release 18.0.0.0.0 - Production on Thu Dec 9 05:39:42 2021
Version 18.4.0.0.0
Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
ORA-39002: invalid operation
ORA-39166: Object dest.table1 was not found or could not be exported or imported.
Appreciate your assistance people.
As far as I can tell, remap_schema doesn't / shouldn't have single quotes.
No : remap_schema='source:dest'
Yes: remap_schema=source:dest
See REMAP_SCHEMA in documentation.

Oracle DB - Connecting 11gR2 DB from 19c Client - ORA-12650 : No Common Encryption or data integrity algorithm

We have Oracle 19c Client installed in our application Unix server.
When we connect to a 19c Database server from our application Unix server, it is working as expected.
But when we try Connecting 11gR2 Database schema using sqlplus from our application server, getting the error ORA-12650 : No Common Encryption or data integrity algorithm
From our application Unix server, we did a tnsping with the connect descriptor we had used. TNSPING is working fine from our application server.
etladm#myappserver992[DEV][admin] $ tnsping MYOLD_DB_DEV
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 15-MAR-2021 01:36:00
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/client/19c/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =my11gr2dbserverdaas)(PORT = 1622))) (CONNECT_DATA = (SERVICE_NAME = DEV.hk.myorg.com)))
OK (450 msec)
etladm#myappserver992[DEV][admin] $
Note:
In our application server we have both Oracle 11gR2 Oracle client as well as 19c Oracle client are installed due to other module's dependencies. But Unix PATH variable is set to point Oracle 19c Oracle home path
etladm#myappserver992[DEV][~] $ echo $ORACLE_HOME
/u01/app/oracle/product/client/19c
etladm#myappserver992[DEV][~] $
sqlnet.ora found in our 19c Client admin directory:
# Forces Network Data Encryption during Transit
NAMES.DIRECTORY_PATH=(EZCONNECT,TNSNAMES)
SQLNET.ENCRYPTION_CLIENT = REQUIRED
SQLNET.ENCRYPTION_TYPES_CLIENT = AES256
SQLNET.CRYPTO_CHECKSUM_CLIENT = REQUIRED
SQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT = SHA256
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
# SQLNET.ALLOWED_LOGON_VERSION_CLIENT=12
We are unable to upgrade our 11gR2 DB currently. So looking for any settings at sqlnet.ora or somewhere.
Edit #1: We are able to connect to 12c Oracle DB server from our application server using 19c sqlplus.
etladm#myappserver992[DEV][admin] $ sqlplus username/password#my12cdbserversilos:1624/DEV.uk.myorg.com
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Mar 15 01:48:17 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Last Successful login time: Mon Mar 15 2021 01:46:36 +08:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> select * from v$version;
BANNER CON_ID
--------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 0
PL/SQL Release 12.2.0.1.0 - Production 0
CORE 12.2.0.1.0 Production 0
TNS for Linux: Version 12.2.0.1.0 - Production 0
NLSRTL Version 12.2.0.1.0 - Production 0
SQL>
Edit #2:
11g Server Version:
select * from v$version;
BANNER
----------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
"CORE 11.2.0.4.0 Production"
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
SQLNET.ORA in 11g Server:
NAMES.DIRECTORY_PATH= (TNSNAMES, LDAP, EZCONNECT)
SQLNET.ENCRYPTION_SERVER=REQUESTED
SEC_USER_AUDIT_ACTION_BANNER=/u01/app/oracle/global/scripts/BANNER/dbbanner.txt
Your 19c client sqlnet.ora requires a SHA256 checksum:
SQLNET.ENCRYPTION_CLIENT = REQUIRED
SQLNET.ENCRYPTION_TYPES_CLIENT = AES256
SQLNET.CRYPTO_CHECKSUM_CLIENT = REQUIRED
SQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT = SHA256
Oracle 11gR2 only supports the SQLNET.CRYPTO_CHECKSUM_TYPES_SERVER value SHA1. See documentation here: https://docs.oracle.com/cd/E11882_01/network.112/e40393/asoappa.htm#ASOAG9780.
If you want to make a TCPS connection to the 11.2 database, you're going to have to include SHA1 in the list of SQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT values on your 19c client, and see that the server sqlnet.ora is similarly configured. Note that use of SHA1 has been considered insecure since at least 2016.
client sqlnet.ora:
SQLNET.CRYPTO_CHECKSUM_CLIENT = REQUIRED
SQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT = (SHA256, SHA1)
11gR2 server sqlnet.ora:
SQLNET.ENCRYPTION_SERVER = REQUIRED
SQLNET.ENCRYPTION_TYPES_SERVER = AES256
SQLNET.CRYPTO_CHECKSUM_SERVER = REQUIRED
SQLNET.CRYPTO_CHECKSUM_TYPES_SERVER = SHA1
Also note that per Oracle Support Doc ID 207303.1 your 11gR2 database must be at least version 11.2.0.3 or 11.2.0.4 to support a 19c client. Previous releases (e.g. 11.2.0.1) do not support the 19c client at all.
Finally my DBAs pitch in. Client sqlnet.ora is updated as below and no change to 11gR2 server sqlnet.ora:
NAMES.DIRECTORY_PATH=(EZCONNECT,TNSNAMES)
SQLNET.ENCRYPTION_CLIENT = REQUIRED
SQLNET.ENCRYPTION_TYPES_CLIENT = (AES256,RC4_256,AES192,3DES168,AES128,RC4_128,3DES112,RC4_56,DES,RC4_40,DES40)
SQLNET.CRYPTO_CHECKSUM_CLIENT = REQUIRED
SQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT =(SHA256,MD5)
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
Thank you #pmdba for your guidance.

Get the Oracle Version using CMD

Is there is any command to find my installed oracle version from windows command prompt. (just like java -version..)
You need to locate ORACLE_HOME directory, to set it as environment variable and then to run opatch:
set ORACLE_HOME=...
"ORACLE_HOME"\OPatch\opatch lspatches
This command lists the installed patches with the Oracle major version.
You can use the below to get the database version by navigating to the ORACLE_HOME directory
$ORACLE_HOME\OPatch\opatch lsinventory | find "Oracle Database"
Well, that depends on what you really have.
If you have installed Oracle onto your PC (such as my 11gXE), then you could try sqlplus -v:
c:\Temp>sqlplus -v
SQL*Plus: Release 11.2.0.2.0 Production
11.2.0.2.0; is that really so?
c:\Temp>sqlplus scott/tiger
SQL*Plus: Release 11.2.0.2.0 Production on Sri Svi 6 07:40:29 2020
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL>
Yes, it is. I use SQL*Plus 11.2.0.2.0 which connects me to 11.2.0.2.0 database.
However, if I don't have Oracle installed on my PC but it is somewhere on database server and I access it via network, then it won't work because it'll display SQL*Plus (i.e. client installed on my PC), not database version. Besides, I can have several clients installed, so it depends on which sqlplus executable I ran.
Database version - in such a case - can't be retrieved from operating system command prompt only (at least, I don't know how to do it). You can obtain it by connecting to the database itself, e.g.
Client version:
M:\>sqlplus -v
SQL*Plus: Release 11.2.0.1.0 Production
ORCL database version is 11.2.0.4.0
M:\>sqlplus scott/tiger#orcl
SQL*Plus: Release 11.2.0.1.0 Production on Sri Svi 6 08:12:27 2020
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
ORCL2 database version is 10.2.0.5.0:
M:\>sqlplus scott/tiger#orcl2
SQL*Plus: Release 11.2.0.1.0 Production on Sri Svi 6 08:13:42 2020
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, Data Mining and Real Application Testing options
SQL>
When you're in SQL*Plus, query v$version, e.g.
SQL> select * From v$version where rownum = 1;
BANNER CON_ID
-------------------------------------------------------------------------------- ----------
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 0
SQL>
which shows that I'm currently connected to 12.2.0.1.0.
This code allows you to display only the version of the database.
#echo off
set user_name=scott
set password=tiger
set net_service_name=edcu
set sql=select version from PRODUCT_COMPONENT_VERSION where rownum=1;
(echo conn %user_name%/%password%#%net_service_name%
echo set heading off
echo %sql%
echo exit) |sqlplus -s /nolog
For example output
D:\upwork\stackoverflow\get_version_oracle>get_oracle_version.bat
11.2.0.3.0

RMAN connect error - db reporting incompatible target version

I'm trying to use RMAN to backup an Oracle database without a backup catalog. When attempting to connect to the target database I'm getting an error message that my RMAN version is incompatible with my database version. This seems odd to me as my RMAN version is 11.2.0.1 and my database version is 11.2.0.3 but the RMAN error states that I need to use RMAN 8.0.4.0 to 11.1.0.7. Why is my database reporting version 11.1.0.7 to RMAN when it should be reporting as 11.2.0.3?
C:\>rman
Recovery Manager: Release 11.2.0.1.0 - Production on Tue May 24 09:48:07 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
RMAN> connect target SYS/oracle#tnsname
Recovery Manager incompatible with TARGET database: RMAN 8.0.4.0 to 11.1.0.7 req
uired
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-06429: TARGET database is not compatible with this version of RMAN
RMAN> exit
Recovery Manager complete.
C:\>sqlplus SYS/oracle#tnsname
SQL*Plus: Release 11.2.0.1.0 Production on Tue May 24 09:49:24 2016
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for 32-bit Windows: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
SQL>
You need to change the compatible initialisation parameter to 11.2.0 (or higher). You can do that with alter system:
ALTER SYSTEM SET COMPATIBLE = '11.2.0' SCOPE = SPFILE;
The change won't take effect until you restart the database. If you don't have a server parameter file for some reason then you can change it in the pfile instead, but you still need to bounce the database to pick up the change.
Make sure you understand the setting and its implications, from the upgrade guide and admin guide. It sounds like it was just missed after upgrading from 11gR1, but if you can make sure it wasn't left on the old version for a reason before changing it.
My problem was due to an incomplete upgrade. Apparently not all of the catalog update scripts were executed properly. Here's what fixed it for me:
SQLPLUS /nolog
SQL> CONNECT / AS SYSDBA
SQL> #?/rdbms/admin/dbmsrman.sql
SQL> #?/rdbms/admin/prvtrmns.plb
SQL> #?/rdbms/admin/dbmsbkrs.sql
SQL> #?/rdbms/admin/prvtbkrs.plb
Error
While connecting with RMAN Command window getting the following errors:
RMAN-06438: error executing package DBMS_RCVMAN in TARGET database
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-06429: TARGET database is not compatible with this version of RMAN
Cause
“SYS.DBMS_RCVMAN” package has error which causing the problem. May be package is in-valid state.
Solution
We tried to check in target database if it’s invalid.
select OWNER, STATUS, substr(OBJECT_NAME,1,40), OBJECT_TYPE from DBA_OBJECTS where OBJECT_NAME IN ('DBMS_RCVMAN', 'DBMS_BACKUP_RESTORE' ) ;
Try to recompile it and check the status.
#$ORACLE_HOME/rdbms/admin/utlrp.sql
If 2nd steps is not working the package is not become valid, then try to re-create the package by executing following steps from SYS user.
#?/rdbms/admin/dbmsrman.sql
#?/rdbms/admin/prvtrmns.plb

Oracle: Remotely import using Impdp with DB link

I'm trying to import a schema using data pump. Here's my problem: I can only access the impdp utility on the source DB server, but it's version 11.1, and the target DB version is 11.2, so if I run the import, I got an error:
UDI-00018: Data Pump client is incompatible with database version 11.01.00.06.00
I want to work around this by using my laptop, installed with the Oracle express version 11.2, same version as the target DB, by using this command:
impdp username/password#targetDB directory=data_pump_dir network_link=sourceDB schemas=EMP
In this command, targetDB is a public db link created on my local oracle, and the same record has been added to tnsnames.ora; sourceDB is a public db link created in the target DB, pointing to the source DB.
But I got this error:
Connected to: Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
ORA-39001: invalid argument value
ORA-39200: Link name "sourceDB" is invalid.
ORA-12170: TNS:Connect timeout occurred
The source DB version is:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for 64-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
The target DB version is:
Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
My local DB version is:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
So what did I do wrong?
Is there a way to import from the source to target?
It looks like you cannot access your local database remotely:
In order to avoid
ORA-12170: TNS:Connect timeout occurred
Is to make sure that you are able to connect to the remote database.
I advise you start making sure it works with a simple query accessing the db-link:
SQL> select * from dual#sourceDB;
Another solution
Another solution to your problem is to specify the target version of the export file at the time you export it, e.g. with:
version=11.1

Resources