Saturday 22 May 2021

space issue /oracle --ARCI

 du -sh /oracle/admin/*

du -sh /oracle/admin/diag/*

du -sh /oracle/admin/diag/rdbms/*

du -sh /oracle/admin/diag/tnslsnr/*


} adrci


[oracle@koprd-027 trace]$ adrci


ADRCI: Release 12.1.0.2.0 - Production on Fri May 21 22:19:31 2021


Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.


ADR base = "/oracle/admin"

adrci> show homes

ADR Homes:

diag/rdbms/c_koprd027/PROD

adrci> set home diag/rdbms/dsprod_koprd027/KOPROD

adrci> host 'du -sh ./'

12G     ./

adrci> purge -age 15 -type trace

adrci>  purge -age 15 -type incident

adrci> purge -age 1440 -type alert

adrci> host 'du -sh ./'

558M    ./

adrci> exit


Tempdb shrink in sqlserver

 

Process can take a long time to complete.  Status can be checked by


select session_id, 

blocking_session_id, 

db_name(database_id) as [Database],

command, 

percent_complete, 

wait_type,

wait_time, 

wait_resource, 

scheduler_id, 

Qry.text 

  from sys.dm_exec_requests req 

cross apply sys.fn_get_sql(req.sql_handle) as Qry 


This SQL will show all currently running processes and percentage done

if the tempdb is not shrink after two attempts then follow the below steps.


DBCC FREEPROCCACHE

Run 

   use tempdb

   go

dbcc shrinkfile (tempdev, 'target size in MB')

   go

   -- this command shrinks the primary data file


Use same command above using the file name of the secondary datafiles to shrink all data files


Datafile names can be found U:\MSSQL\TempDB\Data


dbcc shrinkfile (templog, 'target size in MB')

   go

   -- this command shrinks the log file



Featured post

Postgres commads

 [oracle@Tesdb ~]$ systemctl status postgresql-15 ● postgresql-15.service - PostgreSQL 15 database server    Loaded: loaded (/usr/lib/system...