Database Blog

Script to find Session_longops query for datapump

select x.job_name,b.state,b.job_mode,b.degree , x.owner_name,z.sql_text, p.message , p.totalwork, p.sofar , round((p.sofar/p.totalwork)*100,2) done , p.time_remaining from dba_datapump_jobs b left join dba_datapump_sessions x on (x.job_name = b.job_name) left join v$session y on (y.saddr…

Read More

Script to Identify the Datapump Progress

set lines 150 pages 100 numwidth 7 col program for a38 col username for a10 col spid for a7 select to_char(sysdate,’YYYY-MM-DD HH24:MI:SS’) “DATE”, s.program, s.sid, s.status, s.username, d.job_name, p.spid, s.serial#,…

Read More

Query to check snapshot refresh are successfully completed and refresh for materialized views.

Please use the below query.   SELECT DISTINCT(TRUNC(last_refresh)) FROM dba_snapshot_refresh_times;   select owner, mview_name, last_refresh_type, last_refresh_date from dba_mviews;

Read More

Query to check whether database has any externally authenticated SSL users

Please use the below query.   SELECT name FROM sys.user$ WHERE ext_username IS NOT NULL AND password = ‘GLOBAL’;

Read More

Script to check for corruption in the database dictionary

Set verify off Set space 0 Set line 120 Set heading off Set feedback off Set pages 1000 Spool analyze.sql SELECT ‘Analyze cluster “‘||cluster_name||'” validate structure cascade;’ FROM dba_clusters WHERE…

Read More

Script to check duplicate objects in SYS and SYSTEM

Please use the below query to check the same. column object_name format a30 select object_name, object_type from dba_objects where object_name||object_type in (select object_name||object_type from dba_objects where owner = ‘SYS’) and…

Read More

Installing sqlt

  Download sqlt_10g_11g_12c_18c_19c_5th_June_2020.zip set db environment cd /home/oracle unzip sqlt_10g_11g_12c_18c_19c_5th_June_2020.zip cd sqlt/install sqlplus / as sysdba sql> start sqlcreate.sql Enter password for SQLTXPLAIN Enter Tablespace name Enter Temp tablespace name…

Read More

MIGRATING 19C DATABASE FROM LINUX TO WINDOWS.

INTRODUCTION The below steps showes us how to migrate a 19c database using Transportable Tablespace. MIGRATION FROM LINUX TO WINDOWS MIGRATION FROM LINUX TO WINDOWS BY TRANSPORTABLE TABLESPACE CREATED A TABLESPACE CREATED A TABLE BY HAVING DEFAULT TABLESPACE AS TBS(CREATED TABLESPACE),   EXECUTED THE DBMS_TTS.TRANSPORT_SET_CHECK FOR TRANSPORTING TABLESPACE TBS THAT IS TRUE, ALSO CHECKED IF THERE IS ANY VIOLATIONS   CHECKED THE ENDIAN FORMAT ON BOTH THE PLATFORMS PERFORMED EXPORT BY DATAPUMP FOR TRANSPORT TABLESPACE   DATABASE IN THE WINDOWS PLATFORM   PERFORMED AN IMPORT IN THE TARGET PLATFORM   AFTER THE IMPORT HECK WHETHER THE TABLESPACE IS AVAILABLE AND MAKE IT READ WRITE, CHECK FOR THE TABLE CREATED WITH DEFAULT TABLESPACE(TBS)

Read More

Steps to scp file from one server to another server in oracle cloud

INTRODUCTION: The below steps shows us how to enable the scp for file transfers in oracle cloud. Open the puttygen Import the target server ppk file It will ask for the target server ppk file we are going to scp Select the file and click open The ssh keys will be generated. Select the Export OpenSSH Key Save the File with ssh extension move the file to source server in /etc/ssh folder Now we are able to move the pfile to target server.

Read More

Moving Table from one tablespace to another tablespace

    The alter table  move command moves rows down into un-used space and adjusts the HWM but does not adjust the segments extents, and the table size remains the same. …

Read More