DisplayAdd1

TechnoTechDB is a platform, which will help to grow your carrier in Information sector. Having 15 years of Experience in Oracle/MongoDB/Postgres/Mysql databases, along with having good expertise level of knowledge in Scripting to automate database task. Our goal to start with zero to hero level expertise in Database. You can access/refer my some blogs on https://mrorcldba.blogspot.com link and post your comments and your suggestion to motive us.

Wednesday, 12 July 2023

Some Important MOS DOC ID for Oracle Real Application Testing (RAT)

 Real Application Testing: Database Capture FAQ (Doc ID 1920275.1)

FAQ: Database Upgrade Using Real Application Testing (Doc ID 1600574.1)

Real Application Testing: Database Replay FAQ (Doc ID 2204090.1)

Database Testing: Best Practices (Doc ID 1535885.1)

Primary Note for Real Application Testing Option (Doc ID 1464274.1)

Database Testing: Best Practices (Doc ID 1535885.1)

Real Application Testing: Database Replay FAQ (Doc ID 2204090.1)

Mandatory Patches for Database Testing Functionality for Current and Earlier Releases (Doc ID 560977.1)

How To Find Database Replay Divergence Details (RAT) (Doc ID 1388309.1)

Scripts to Debug Slow Replay (Doc ID 760402.1)

Comprehensive Database Real Application Testing Diagnostic Information (Doc ID 1287620.1)

Database Capture and Replay: Common Errors and Reasons (Doc ID 463263.1)

Slow Database Replay with Waits on “WCR: replay clock” (Doc ID 1538269.1)

Real Application Testing: How to Run Workload Analyzer (Doc ID 1268920.1)

Dbms_Stats.Gather_Fixed_Object_Stats Is Hanging While Reading X$DBKFDG (Doc ID 2417784.1)


Tuesday, 4 July 2023

WGET Command to download any patchs or binary from Oracle Support site in Linux.

Hello Friends, 


First you need to search patch or binary from oracle support or MOS. Once you get it, click on download, right click on the patch and copy URL and update the same URL in highlighted yellow portions.

Also you need update your oracle support login ID and password in highlighted sky blue portion. 

Once Command is ready put the same in Linux prompt where you have internet access it will start to download the file. 














wget --http-user=<userid>@oracle.com --http-password=<SomePassword> --no-check-certificate --output-document=p35042068_190000_Linux-x86-64.zip "https://updates.oracle.com/Orion/Services/download/p35042068_190000_Linux-x86-64.zip?aru=12345678&patch_file=p35042068_190000_Linux-x86-64.zip"


Silent Mode - Oracle Database Installation and DB creation.

Steps to install oracle 11g and Database silent mode  .


============================================

--- Silent DB Binary Installation  on File System.

============================================


cat /tmp/db_install.rsp


oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

oracle.install.option=INSTALL_DB_SWONLY

ORACLE_HOSTNAME=instance-20230630-1255

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION=/ora11g/oracle/oraInventory

SELECTED_LANGUAGES=en

ORACLE_HOME=/ora11g/oracle/product/11g/dbhome_1

ORACLE_BASE=/ora11g/oracle

oracle.install.db.InstallEdition=EE

oracle.install.db.DBA_GROUP=dba

oracle.install.db.BACKUPDBA_GROUP=dba

oracle.install.db.DGDBA_GROUP=dba

oracle.install.db.KMDBA_GROUP=dba

oracle.install.db.OSRACDBA_GROUP=dba

SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

DECLINE_SECURITY_UPDATES=true

oracle.installer.autoupdates.option=SKIP_UPDATES


./runInstaller -silent -responseFile /tmp/db_install.rsp



============================================

--- Silent DB creation on File System.

============================================


export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_BASE=/opt/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11g/dbhome_1

export ORA_INVENTORY=/u01/app/oraInventory

export PATH=/usr/sbin:/usr/local/bin:$PATH

export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

export ORACLE_SID=ORCL11G

export DATA_DIR=/u01/app/oracle/oradata/ORCL11G

dbca -silent -createDatabase                                                   \

     -templateName $ORACLE_BASE/product/11g/dbhome_1/assistants/dbca/templates/General_Purpose.dbc                                        \

     -gdbname ${ORACLE_SID} -sid  ${ORACLE_SID} -responseFile NO_VALUE         \

     -characterSet AL32UTF8                                                    \

     -sysPassword SysPassword                                                 \

     -systemPassword SysPassword                                              \

     -databaseType MULTIPURPOSE                                                \

     -totalMemory 4096 -automaticMemoryManagement true \

     -storageType FS                                                           \

     -datafileDestination "${DATA_DIR}"                                        \

     -redoLogFileSize 50                                                       \

     -emConfiguration NONE                                                     



============================================

--- Silent DB creation on File System with 11g EM.

============================================


dbca -silent -createDatabase -templateName /ora11g/oracle/product/11g/dbhome_3/assistants/dbca/templates/General_Purpose.dbc -gdbname oratdb -sid oratdb -responseFile NO_VALUE -characterSet AL32UTF8 -totalMemory 4096 -automaticMemoryManagement true  -emConfiguration LOCAL -datafiledestination /u01/app/oracle/oradata/ora11g -sysPassword Oracle123 -systemPassword Oracle123 -dbsnmpPassword Oracle123 -sysmanPassword Oracle123


Friday, 30 June 2023

How to Enable X11 in Linux

    ┌───────────────────────────────────────────────────┐
    │                 • MobaXterm Personal Edition v22.0 •                                               │
    │               (SSH client, X server and network tools)                                              │
    │                                                                                                                        │
    │ ➤ SSH session to opc@XXXXXX                                                                          │
    │   • Direct SSH      :  ✔                                                                                       │
    │   • SSH compression :  ✔                                                                                   │
    │   • SSH-browser     :  ✔                                                                                     │ 
    │   • X11-forwarding  :  ✘  (disabled or not supported by server)                          │
    │                                                                                                                        │
    │ ➤ For more info, ctrl+click on help or visit our website.                                   │
    └───────────────────────────────────────────────────┘

Activate the web console with: systemctl enable --now cockpit.socket

[root@instance ~]# sudo yum install xorg-x11-xauth
Last metadata expiration check: 0:02:38 ago on Fri 30 Jun 2023 07:43:21 AM GMT.
Dependencies resolved.
===================================================================================================
 Package                          Architecture             Version                          Repository                       Size
===================================================================================================
Installing:
 xorg-x11-xauth                   x86_64                   1:1.0.9-12.el8                   ol8_appstream                    39 k
Installing dependencies:
 libICE                           x86_64                   1.0.9-15.el8                     ol8_appstream                    74 k
 libSM                            x86_64                   1.2.3-1.el8                      ol8_appstream                    47 k
 libXmu                           x86_64                   1.1.3-1.el8                      ol8_appstream                    75 k
 libXt                            x86_64                   1.1.5-12.el8                     ol8_appstream                   185 k

Transaction Summary
===================================================================================================
Install  5 Packages

Total download size: 421 k
Installed size: 1.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): libSM-1.2.3-1.el8.x86_64.rpm                                                               432 kB/s |  47 kB     00:00
(2/5): libICE-1.0.9-15.el8.x86_64.rpm                                                             544 kB/s |  74 kB     00:00
(3/5): libXt-1.1.5-12.el8.x86_64.rpm                                                              2.6 MB/s | 185 kB     00:00
(4/5): xorg-x11-xauth-1.0.9-12.el8.x86_64.rpm                                                     656 kB/s |  39 kB     00:00
(5/5): libXmu-1.1.3-1.el8.x86_64.rpm                                                              253 kB/s |  75 kB     00:00
----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                             1.4 MB/s | 421 kB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                          1/1
  Installing       : libICE-1.0.9-15.el8.x86_64                                                                               1/5
  Installing       : libSM-1.2.3-1.el8.x86_64                                                                                 2/5
  Installing       : libXt-1.1.5-12.el8.x86_64                                                                                3/5
  Installing       : libXmu-1.1.3-1.el8.x86_64                                                                                4/5
  Installing       : xorg-x11-xauth-1:1.0.9-12.el8.x86_64                                                                     5/5
  Running scriptlet: xorg-x11-xauth-1:1.0.9-12.el8.x86_64                                                                     5/5
  Verifying        : libICE-1.0.9-15.el8.x86_64                                                                               1/5
  Verifying        : libSM-1.2.3-1.el8.x86_64                                                                                 2/5
  Verifying        : libXmu-1.1.3-1.el8.x86_64                                                                                3/5
  Verifying        : libXt-1.1.5-12.el8.x86_64                                                                                4/5
  Verifying        : xorg-x11-xauth-1:1.0.9-12.el8.x86_64                                                                     5/5
Installed:
  libICE-1.0.9-15.el8.x86_64              libSM-1.2.3-1.el8.x86_64    libXmu-1.1.3-1.el8.x86_64    libXt-1.1.5-12.el8.x86_64
  xorg-x11-xauth-1:1.0.9-12.el8.x86_64

Complete!
[root@instance ~]# sudo yum install xterm
Last metadata expiration check: 0:02:48 ago on Fri 30 Jun 2023 07:43:21 AM GMT.
Dependencies resolved.
===================================================================================================
 Package                             Architecture           Version                           Repository                     Size
===================================================================================================
Installing:
 xterm                               x86_64            331-1.el8_3.2                     ol8_appstream                 528 k
Installing dependencies:
 libXaw                              x86_64                 1.0.13-10.el8                     ol8_appstream                 194 k
 libXft                              x86_64                 2.3.3-1.el8                       ol8_appstream                  67 k
 libXpm                              x86_64                 3.5.12-9.el8_7                    ol8_appstream                  58 k
 libfontenc                          x86_64                 1.1.3-8.el8                       ol8_appstream                  37 k
 xorg-x11-font-utils                 x86_64                 1:7.5-41.el8                      ol8_appstream                 104 k
 xterm-resize                        x86_64                 331-1.el8_3.2                     ol8_appstream                  38 k
Installing weak dependencies:
 xorg-x11-fonts-misc                 noarch                 7.5-19.el8                        ol8_appstream                 5.8 M

Transaction Summary
===================================================================================================
Install  8 Packages
Total download size: 6.8 M
Installed size: 9.5 M
Is this ok [y/N]: y
Downloading Packages:
(1/8): libXpm-3.5.12-9.el8_7.x86_64.rpm                                                           748 kB/s |  58 kB     00:00
(2/8): libXaw-1.0.13-10.el8.x86_64.rpm                                                            1.1 MB/s | 194 kB     00:00
(3/8): libXft-2.3.3-1.el8.x86_64.rpm                                                              386 kB/s |  67 kB     00:00
(4/8): libfontenc-1.1.3-8.el8.x86_64.rpm                                                          375 kB/s |  37 kB     00:00
(5/8): xterm-331-1.el8_3.2.x86_64.rpm                                                             4.9 MB/s | 528 kB     00:00
(6/8): xorg-x11-font-utils-7.5-41.el8.x86_64.rpm                                                  819 kB/s | 104 kB     00:00
(7/8): xterm-resize-331-1.el8_3.2.x86_64.rpm                                                      377 kB/s |  38 kB     00:00
(8/8): xorg-x11-fonts-misc-7.5-19.el8.noarch.rpm                                                   19 MB/s | 5.8 MB     00:00
----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                              14 MB/s | 6.8 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                          1/1
  Installing       : libXpm-3.5.12-9.el8_7.x86_64                                                                             1/8
  Installing       : libXaw-1.0.13-10.el8.x86_64                                                                              2/8
  Installing       : xterm-resize-331-1.el8_3.2.x86_64                                                                        3/8
  Installing       : libfontenc-1.1.3-8.el8.x86_64                                                                            4/8
  Installing       : xorg-x11-font-utils-1:7.5-41.el8.x86_64                                                                  5/8
  Installing       : xorg-x11-fonts-misc-7.5-19.el8.noarch                                                                    6/8
  Running scriptlet: xorg-x11-fonts-misc-7.5-19.el8.noarch                                                                    6/8
  Installing       : libXft-2.3.3-1.el8.x86_64                                                                                7/8
  Installing       : xterm-331-1.el8_3.2.x86_64                                                                               8/8
  Running scriptlet: xterm-331-1.el8_3.2.x86_64                                                                               8/8
  Verifying        : libXaw-1.0.13-10.el8.x86_64                                                                              1/8
  Verifying        : libXft-2.3.3-1.el8.x86_64                                                                                2/8
  Verifying        : libXpm-3.5.12-9.el8_7.x86_64                                                                             3/8
  Verifying        : libfontenc-1.1.3-8.el8.x86_64                                                                            4/8
  Verifying        : xorg-x11-font-utils-1:7.5-41.el8.x86_64                                                                  5/8
  Verifying        : xorg-x11-fonts-misc-7.5-19.el8.noarch                                                                    6/8
  Verifying        : xterm-331-1.el8_3.2.x86_64                                                                               7/8
  Verifying        : xterm-resize-331-1.el8_3.2.x86_64                                                                        8/8

Installed:
  libXaw-1.0.13-10.el8.x86_64          libXft-2.3.3-1.el8.x86_64                      libXpm-3.5.12-9.el8_7.x86_64
  libfontenc-1.1.3-8.el8.x86_64        xorg-x11-font-utils-1:7.5-41.el8.x86_64        xorg-x11-fonts-misc-7.5-19.el8.noarch
  xterm-331-1.el8_3.2.x86_64           xterm-resize-331-1.el8_3.2.x86_64

Complete!
[root@instance ~]#

Wednesday, 21 June 2023

Oracle Database Query Running more than 1 minutes and will kill automatically

Hello Friends, 

Below script help us to get SID and Serial details which is running more than 1 minutes and will kill automatically if you will keep below steps into a .sql file and run it from sql prompt. Please refer below screenshot. 

















SQL> select  round(last_call_et / 60,2) Time_in_mins, sid, serial# from gv$session where type<>'BACKGROUND' and username<>'SYS' and username <> 'DBSNMP' and last_call_et / 60 > 1;

no rows selected

SQL> select  round(last_call_et / 60,2) Time_in_mins, sid, serial# from gv$session where type<>'BACKGROUND' and username<>'SYS' and username <> 'DBSNMP' and last_call_et / 60 > 1;

TIME_IN_MINS        SID    SERIAL#

------------ ---------- ----------

        12.6         15         21

        12.6        125         63

        12.6        138         55

SQL> set pagesize 0 linesize 1000 feedback off verify off trimspool on heading off echo off

SQL> SET SERVEROUTPUT ON

SQL> SET PAGESIZE 500

SQL> SET LINESIZE 300

SQL> spool /tmp/sid_kill.sql

SQL> select  'alter system kill session '''||sid||','||serial#||'''immediate ;' from gv$session where type<>'BACKGROUND' and username<>'SYS' and username <> 'DBSNMP' and last_call_et / 60 > 1;

alter system kill session '15,21'immediate ;

alter system kill session '125,63'immediate ;

alter system kill session '138,55'immediate ;

SQL> spool off;

SQL> set pagesize 0 linesize 1000 feedback on verify on trimspool on heading on echo on

SQL> @/tmp/sid_kill.sql

SQL> SQL> select  'alter system kill session '''||sid||','||serial#||'''immediate ;' from gv$session where type<>'BACKGROUND' and username<>'SYS' and username <> 'DBSNMP' and last_call_et / 60 > 1;

SQL> alter system kill session '15,21'immediate ;

System altered.

SQL> alter system kill session '125,63'immediate ;

System altered.

SQL> alter system kill session '138,55'immediate ;

System altered.

SQL> spool off;

SQL> exec dbms_lock.sleep(5);

PL/SQL procedure successfully completed.

SQL> select  sid, serial# from gv$session where type<>'BACKGROUND' and username<>'SYS' and username <> 'DBSNMP' and last_call_et / 60 > 1;

no rows selected

Sunday, 18 June 2023

TRANSPOSE Column to Rows in Linux script

Below commands I have used in Oracle query where some time I need to put data in IN clause from txt file manually or with other method. But with this commands you can put in script it will automatically generate syntax format for ORACLE IN Clause  
















[oracle@oracle11g ]cat sqlid.txt    <<--- Input
c3yw7auzsah15
378r7ukq8caam
9y55n98wubu9d
f7m1bh706uqss


[oracle@oracle11g ]$ cat /tmp//sqlid.txt | while read a
> do
> _sqlid+="'$a',"
> echo $_sqlid >/tmp//_sqlid1.log
> done
[oracle@oracle11g ]$ cat /tmp//_sqlid1.log
'c3yw7auzsah15','378r7ukq8caam','9y55n98wubu9d','f7m1bh706uqss',
[oracle@oracle11g ]$



[oracle@oracle11g ]$ _sid_lst=`  cat /tmp//_sqlid1.log | rev | cut -c2- | rev`
[oracle@oracle11g ]$ echo $_sid_lst
'c3yw7auzsah15','378r7ukq8caam','9y55n98wubu9d','f7m1bh706uqss'     <-- Output


Monday, 12 June 2023

Direct upgrade and Migrate DB from 11.2.0.4 to 19c PDB

 /opt/oracle/product/19c/dbhome_1/jdk/bin/java -jar /opt/oracle/product/19c/dbhome_1/rdbms/admin/autoupgrade.jar -create_sample_file config



cat /home/oracle/autoupg/11204upgrade.cfg

global.autoupg_log_dir=/opt/oracle/cfgtoollogs/autoupgrade

upg1.sid=orcl1

upg1.dbname=orcl1

upg1.start_time=NOW

upg1.source_home=/opt/oracle/product/11g/dbhome_1

upg1.log_dir=/home/oracle/autoupg

upg1.target_home=/opt/oracle/product/19c/dbhome_1

upg1.upgrade_node=oracle11g

upg1.target_version=19.1.0

upg1.run_utlrp=yes

upg1.timezone_upg=yes

upg1.target_cdb=cdb1


/opt/oracle/product/19c/dbhome_1/jdk/bin/java -jar /opt/oracle/product/19c/dbhome_1/rdbms/admin/autoupgrade.jar -config /home/oracle/autoupg/11204upgrade.cfg -mode ANALYZE



/opt/oracle/product/19c/dbhome_1/jdk/bin/java -jar /opt/oracle/product/19c/dbhome_1/rdbms/admin/autoupgrade.jar -config /home/oracle/autoupg/11204upgrade.cfg -mode DEPLOY



















Steps to Rename Host in Oracle RESTART (ASM) in Linux

  oracle@localhost ] asmcmd ASMCMD> lsdg State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_...