How to check Oracle patches are installed? - oracle

How do I check that all services and patches are installed in Oracle?
I have an Oracle 10.2.0.2.0 db version and want to install patches. Also I want to get a list with all services and patches.

Here is an article on how to check and or install new patches :
To find the OPatch tool setup your database enviroment variables and then issue this comand:
cd $ORACLE_HOME/OPatch
> pwd
/oracle/app/product/10.2.0/db_1/OPatch
To list all the patches applies to your database use the lsinventory option:
[oracle#DCG023 8828328]$ opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home : /u00/product/11.2.0/dbhome_1
Central Inventory : /u00/oraInventory
from : /u00/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.4
OUI version : 11.2.0.1.0
Log file location : /u00/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2013-11-13_13-55-22PM_1.log
Lsinventory Output file location : /u00/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2013-11-13_13-55-22PM.txt
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.1.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 8405205 : applied on Mon Aug 19 15:18:04 BRT 2013
Unique Patch ID: 11805160
Created on 23 Sep 2009, 02:41:32 hrs PST8PDT
Bugs fixed:
8405205
OPatch succeeded.
To list the patches using sql :
select * from registry$history;

I understand the original post is for Oracle 10 but this is for reference by anyone else who finds it via Google.
Under Oracle 12c, I found that that my registry$history is empty.
This works instead:
select * from registry$sqlpatch;

Maybe you need "sys." before:
select * from sys.registry$history;

Related

Oracle 19.5 giving ORA-39358 for 19.0 dump

I am importing 19.0 dump (exported on Oracle 19.0c) on Oracle 19.5c oracle. But it give strange message as below,
Import: Release 19.0.0.0.0 - Production on Wed Mar 23 05:46:48 2022
Version 19.5.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
ORA-39002: invalid operation
ORA-39358: Export dump file version 19.0.0.0.0 not compatible with target version 12.2.0.0.0
Can anyone explain.
Here is the compatible parameter I have:
\`SQL\> SELECT name, value FROM v$parameter
WHERE name = 'compatible'; 2
NAME
-
VALUE
-
compatible
12\.2.0
\`

How to resolve error code 73 for Oracle WLS/Coherence patching?

I'm trying to fix security vulnerabilities for Oracle Weblogic on Windows systems by applying the recommended patch file. However, many systems I am updating are rejecting the recommended patch - saying that coherence is not installed. The systems have been installed with fmw_12.2.1.4.0_wls (which includes Coherence(?)), and I have updated OPatch to the most recent version as well. I have also set the ORACLE_HOME and JAVA_HOME environment variables to point to the correct file paths, and have tried running the attachHome command.
Here is what the command prompt shows after attempting to apply the patch:
Oracle Interim Patch Installer version 13.9.4.2.4
Copyright (c) 2020, Oracle Corporation. All rights reserved.
Oracle Home : C:\Oracle\MIDDLE~1
Central Inventory : C:\Program Files (x86)\Oracle\Inventory
from :
OPatch version : 13.9.4.2.4
OUI version : 13.9.4.0.0
Log file location : C:\Oracle\MIDDLE~1\cfgtoollogs\opatch\opatch2020-12-29_20-42-48PM_1.log
OPatch detects the Middleware Home as "C:\Oracle\Middleware"
Verifying environment and performing prerequisite checks...
UtilSession failed: Patch 121307 requires component(s) that are not installed in OracleHome. Or don't have required patch level. These not-installed components are oracle.coherence:12.1.3.0.0:patchlevel-(or higher),
Log file location: C:\Oracle\MIDDLE~1\cfgtoollogs\opatch\opatch2020-12-29_20-42-48PM_1.log
OPatch failed with error code = 73
The log file produces the same error as well.

My question is about exportdump with a query on oracle 9i

I am getting the following error and i need help.
hcp7 (spar)/tmp $ exp system/puppy parfile=rr.prm
Export: Release 9.2.0.8.0 - Production on Thu Oct 31 13:27:11 2019
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
Current user changed to AHS
. . exporting table HB_CONTROL_OUT_DATA
EXP-00056: ORACLE error 933 encountered
ORA-00933: SQL command not properly ended
Export terminated successfully with warnings.
hcp7 (spar)/tmp $
hcp7 (spar)/tmp $ vi rr.prm
"rr.prm" 6 lines, 258 characters
file=raj.dmp
log=raj.log
STATISTICS=none
compress=y
tables=AHS.HB_CONTROL_OUT_DATA
query="[select * from hb_control_out_data where exists (select '1' from hb_control_out where hbod_tran_num = hbo_tran_num and ADD_MO
NTHS(HBO_TO_MIS_DATE,24) >SYSDATE)]"
You need to escape your quotes in the query. See the documentation at https://docs.oracle.com/cd/B10501_01/server.920/a96652/ch01.htm#1005843.
BTW, version 9i belongs in a software museum. It was released 17 years ago and the final patch set was released over 12 years ago.
The error message is
EXP-00056: ORACLE error 933 encountered
ORA-00933: SQL command not properly ended
What SQL are you executing? Well, your parameter file includes a QUERY parameter. It may be a trick of the cut'n'paste into the StackOverflow question box but this looks odd:
ADD_MO NTHS(HBO_TO_MIS_DATE,24)
^
If that space or newline is not an artefact remove and re-run the export.

oracle 11g impdp returns invalid operation and object was not found

I wanted to transfer an oracle table between two users using expdp and impdp commands.
First of all, I created a directory and granted proper privileges to source and destination users:
SQL> CREATE OR REPLACE DIRECTORY TEST_DIR AS '/u01/app/oracle/oradata/temp_dirs';
Directory created.
SQL> GRANT READ, WRITE ON DIRECTORY test_dir TO SOURCE_USER;
Grant succeeded.
SQL> GRANT READ, WRITE ON DIRECTORY test_dir TO DEST_USER;
Grant succeeded.
SQL> commit;
This is my expdp command and it's output:
oracle#lab-57:~$ expdp SOURCE_USER/SOURCE_USER tables=tbl_user directory=TEST_DIR dumpfile=users.dmp logfile=exp_users.log
Export: Release 11.2.0.1.0 - Production on Tue Jul 24 16:18:27 2018
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
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
Starting "SOURCE_USER"."SYS_EXPORT_TABLE_01": SOURCE_USER/******** tables=tbl_user directory=TEST_DIR dumpfile=users.dmp logfile=exp_users.log
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "SOURCE_USER"."TBL_USER" 8.085 KB 2 rows
Master table "SOURCE_USER"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SOURCE_USER.SYS_EXPORT_TABLE_01 is:
/u01/app/oracle/oradata/temp_dirs/users.dmp
Job "SOURCE_USER"."SYS_EXPORT_TABLE_01" successfully completed at 16:18:38
This implies the export operation was done successfully.
Then I tried to import it using impdp as following:
oracle#lab-57:~$ impdp DEST_USER/DEST_USER tables=TBL_USER directory=TEST_DIR dumpfile=users.dmp logfile=imp_users.log
Import: Release 11.2.0.1.0 - Production on Tue Jul 24 17:26:58 2018
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
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
ORA-39002: invalid operation
ORA-39166: Object DEST_USER.TBL_USER was not found.
I also tried tables=DEST_USER.TBL_USER and content=data_only; both returned same error.
As you're exporting as SOURCE_USER and importing as DEST_USER, the REMAP_SCHEMA parameter might help. (I'll split the command into several rows for easier reading)
impdp DEST_USER/DEST_USER tables=TBL_USER directory=TEST_DIR
dumpfile=users.dmp logfile=imp_users.log
remap_schema=source_user:dest_user --> this
If you're on 11.2, you might hit a bug which won't allow you to do that (see My Oracle Support for more info). In that case, you can still perform import, but you'll have to omit the TABLES parameter, i.e.
TABLES was in this gap
|
impdp DEST_USER/DEST_USER v directory=TEST_DIR
dumpfile=users.dmp logfile=imp_users.log
remap_schema=source_user:dest_user
Simple answer :
Create import : keep the dump ready.
Two option to restore the dump , consider complete dump or specific table.
For table specific :- Table name = MONTHS_DAY
impdp DBA_USER/DBA_Password tables = SOURCE_SCHEMA.MONTHS_DAY directory=AKSHAY_SPM_EDIR dumpfile=MONTHS_DAY.dmp logfile=impdpMONTHS_DAY.log remap_schema = SOURCE_SCHEMA:DESTINATION_SCHEMA
For complete import :
impdp DBA_USER/DBA_Password directory = AKSHAY_SPM_EDIR dumpfile=MONTHS_DAY.dmp logfile=impdpMONTHS_DAY.log remap_schema = SOURCE_SCHEMA:DESTINATION_SCHEMA
Make sure, directory is accessible as dump is present there

What is the version number of Oracle 18c?

Oracle changed the release schedule for their database, announcing that version 12.2.0.2 will be called "Oracle Database 18c."
What is the version number of the database, 12.2.0.2 or 18.x.x.x?
Internally 18c identifies itself as version 18.
On API level:
$ cat /u01/app/oracle/product/18.1.0.0/dbhome_1/rdbms/public/ociver.h
#ifndef OCIVER_ORACLE
#define OCIVER_ORACLE
#define OCI_MAJOR_VERSION 18 /* Major release version */
#define OCI_MINOR_VERSION 0 /* Minor release version */
#endif
And also on SQL level:
SQL> SELECT VERSION FROM PRODUCT_COMPONENT_VERSION;
VERSION
----------
18.0.0.0.0
And also on JDBC level:
java -jar /u01/app/18.1.0.0/grid/jdbc/lib/ojdbc8.jar
Oracle 18.0.0.0.0 JDBC 4.2 compiled with javac 1.8.0_152 on Wed_Dec_06_05:42:32_PST_2017
#Default Connection Properties Resource
#Thu May 31 12:52:24 CEST 2018
Ah, found it, the database is not yet available for download, but livesql says
SELECT * FROM v$version;
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
EDIT: Hmm, the documentation for 18c is online, but it refers in the text to 12c, for instance
46.2 DBMS_DB_VERSION Constants
The Oracle Database 12c Release 2 version of the DBMS_DB_VERSION package uses the constants shown in the following table.

Resources