Tuesday, December 27, 2022

12c Single Instance Patching

12c Single Instance Patching


$ORACLE_HOME/OPatch/opatch lsinv | grep -i applied
$ORACLE_HOME/OPatch/opatch lspatches | sort -nr


$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/12c_Soft/32518631/32328632
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/12c_Soft/32518631/31704029


/u01/app/oracle/product/12c/db_1/OPatch/opatch apply -oh /u01/app/oracle/product/12c/db_1 -local -silent /u01/12c_Soft/32518631/32328632
/u01/app/oracle/product/12c/db_1/OPatch/opatch apply -oh /u01/app/oracle/product/12c/db_1 -local -silent /u01/12c_Soft/32518631/31704029


$ORACLE_HOME/OPatch/opatch lsinv | grep -i applied
$ORACLE_HOME/OPatch/opatch lspatches | sort -nr


cd $ORACLE_HOME/OPatch
./datapatch -verbose

select name,open_mode,database_role from V$database;

show parameter cluster

set lines 200 pages 500
col owner for a15
col OBJECT_NAME for a35
select owner,object_name,object_type,status from dba_objects where status='INVALID';


col COMP_NAME for a40
select COMP_ID,COMP_NAME,VERSION,STATUS from dba_registry;


col ACTION_TIME for a30
col action for a30
col version for a10
col BUNDLE_SERIES for a30
col COMMENTS for a47
select ACTION_TIME,ACTION,VERSION,BUNDLE_SERIES,COMMENTS from dba_registry_history;

col comp_id for a10
col version for a11
col status for a10
col comp_name for a37
select con_id,comp_id,comp_name,version,status from cdb_registry;


col action_time for a28
col action for a8
col version for a8
col status for a8
col comments for a30
set line 999 pages 999

select con_id, patch_id, version, status, Action, Action_time from cdb_registry_sqlpatch order by action_time;

select patch_id, patch_uid, version, status, description from cdb_registry_sqlpatch;
select patch_id, version, status, Action, Action_time from cdb_registry_sqlpatch order by action_time;

Database Upgrade Using AutoUpgrade Option (12c to 19c)

Database Upgrade Using AutoUpgrade Option (12c to 19c)



Saturday, December 3, 2022

Day to Day Commands

Day to Day Commands



How to verify the OS exact details?

How to verify the OS exact details?


[oracle@qtest ~]$ uname -a
Linux qtest 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux

[oracle@qtest ~]$ cat /etc/redhat-release

Red Hat Enterprise Linux Server release 7.5 (Maipo)

[oracle@qtest ~]$ more /etc/os-release

NAME="Red Hat Enterprise Linux Server"
VERSION="7.5 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.5"
PRETTY_NAME="Red Hat Enterprise Linux"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.5:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.5
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.5"


[oracle@qtest ~]$ cat /etc/redhat-release

Red Hat Enterprise Linux Server release 7.5 (Maipo)

Purging of Listener log file in Oracle Database

Purging of Listener log file in Oracle Database


Solution 1 :

First find the location of listener log file.

[oracle@qtest ~]$ lsnrctl status
Go the listener log file location and execute the below commands.

[oracle@qtest]$ cp listener.log listener_backup.log
[oracle@qtest]$ cat /dev/null>listener.log
[oracle@qtest]$ gzip listener_backup.log

Solution 2 :

LSNRCTL>
LSNRCTL> set current_listener <listenername>
LSNRCTL> set log_status off

Login into another window and rename the log file and then return to the previous window
LSNRCTL> set log_status on
The above command will create a new and empty listener.log file which will continue logging.

Top CPU & MEMORY Consuming Sessions

Top CPU & MEMORY Consuming Sessions


Solution:

The ps (process status) command is handy for quickly identifying top resource-consuming processes. For example, this command displays the top 10 CPU-consuming resources on the box:

$ ps -e -o pcpu,pid,user,tty,args | sort -n -k 1 -r | head

Here is a partial listing of the output:

65.5 5017 oracle ? oracleO12C (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
0.8 5014 oracle pts/1 sqlplus
0.8 23255 oracle ? ora_vktm_O12C

In the prior output, the process named oracleO12C is consuming an inordinate amount of CPU resources on the server. The process name identifies this as an Oracle process associated with the O12C database.

Similarly, you can also display the top memory-consuming processes:

$ ps -e -o pmem,pid,user,tty,args | sort -n -k 1 -r | head

Here is a snippet of the output:

11.2 5017 oracle ? oracleO12C (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
7.1 23317 oracle ? ora_mmon_O12C
6.3 23285 oracle ? ora_dbw0_O12C