Posts by Venkatesh GK

Script to create VMSTAT and to collect Metrix in a database

Please use the below.   CREATE TABLE DBA.STATS$TOTALUSERS ( MEASURED_DATE DATE, TOTAL_USERS NUMBER, ACTIVE_USERS NUMBER ) TABLESPACE USERS PCTUSED 0 PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 64K…

Read More

Query to get the user details from Cluster database

Please use the below query. set line size 750 pages 9999 col box for a30 col username for a30 col spid for a30 col program for a30 col os_user for…

Read More

Query to get the baseline for an sql id

Please use below query.   col sql_text for a60 wrap set verify off set pagesize 999 set lines 155 col username format a13 col prog format a22 col sid format…

Read More

Steps to Uninstall Apex in Database

Please follow the below steps col COMP_ID for a15 col COMP_NAME for a45 col STATUS for a20 set lines 100 pages 100 select COMP_ID,COMP_NAME,STATUS from dba_registry; COMP_ID COMP_NAME STATUS —————…

Read More

Stesp to Add/Resize Redolog files

Steps to Resize the Online Redo Logfiles >sqlplus /nolog SQL> connect / as sysdba SQL> select name,open_mode from v$database; NAME OPEN_MODE ——— ——————– PROD READ WRITE Please check the below…

Read More

Script to compare two initoras.sh file

Please use the below script.   #!/bin/ksh file1=$1 file2=$2 for parameter in `cat $file1 | grep = | awk ‘{print $1}’ | grep -v ‘#’` do value1=`grep ^$parameter $file1 |…

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