SlideShare a Scribd company logo
1 of 1
Macro to show current perm and maxperm allowed for each database
----------------------------------------------------------------
replace macro showspace as (
sel diskspace.databasename,
sum(maxperm),sum(currentperm)
group by databasename
order by databasename
with sum(maxperm),sum(currentperm);
);




Version that also shows percent used
------------------------------------

REPLACE MACRO SHOWSPACE AS (
LOCKING TABLE
DBC.DISKSPACE IN ACCESS MODE
SEL
SUBSTR(DATABASENAME,1,15) (TITLE 'DatabaseName'),
SUM(MAXPERM),
SUM(CURRENTPERM),
((SUM(CurrentPerm))/NULLIFZERO(Sum(MaxPerm))*100)
(FORMAT 'zz9.99%',TITLE 'Percent//Used')
FROM DBC.DISKSPACE
GROUP BY DATABASENAME
ORDER BY 2 DESC, 3 DESC
WITH SUM(MAXPERM), SUM(CURRENTPERM);
);

This query will identify databases within 25% of maxperm
---------------------------------------------------------
SEL databasename, SUM(currentperm)
FROM dbc.diskspace
HAVING SUM(currentperm) * 1.25 > SUM(maxperm)
group by 1;

Labels parameters

More Related Content

What's hot

Ansible - simple it automation
Ansible - simple it automationAnsible - simple it automation
Ansible - simple it automationLarry Nung
 
Volume migration from one aggregate to other without impacting the applicatio...
Volume migration from one aggregate to other without impacting the applicatio...Volume migration from one aggregate to other without impacting the applicatio...
Volume migration from one aggregate to other without impacting the applicatio...Saroj Sahu
 
Scheduler job using mule
Scheduler job using muleScheduler job using mule
Scheduler job using muleRajkumar Epari
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryMongoDB
 
PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016
PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016
PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016Tomas Vondra
 
Configuration of NTP Server on CentOS 8
Configuration of NTP Server on CentOS 8Configuration of NTP Server on CentOS 8
Configuration of NTP Server on CentOS 8Kaan Aslandağ
 
Reconsidering tracing in Ceph - Mohamad Gebai
Reconsidering tracing in Ceph - Mohamad GebaiReconsidering tracing in Ceph - Mohamad Gebai
Reconsidering tracing in Ceph - Mohamad GebaiCeph Community
 
LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control GroupsMarian Marinov
 
HP-UX 11i Log File Management with Logrotate by Dusan Baljevic
HP-UX 11i Log File Management with Logrotate by Dusan BaljevicHP-UX 11i Log File Management with Logrotate by Dusan Baljevic
HP-UX 11i Log File Management with Logrotate by Dusan BaljevicCircling Cycle
 
Session 9 4 alp to display the current system time using dos int 21 h
Session 9  4 alp to display the current system time using dos int 21 hSession 9  4 alp to display the current system time using dos int 21 h
Session 9 4 alp to display the current system time using dos int 21 hDr. Loganathan R
 
クラウド環境におけるキャッシュメモリQoS制御の評価
クラウド環境におけるキャッシュメモリQoS制御の評価クラウド環境におけるキャッシュメモリQoS制御の評価
クラウド環境におけるキャッシュメモリQoS制御の評価Ryousei Takano
 
How to shutdown and power up of the netapp cluster mode storage system
How to shutdown and power up of the netapp cluster mode storage systemHow to shutdown and power up of the netapp cluster mode storage system
How to shutdown and power up of the netapp cluster mode storage systemSaroj Sahu
 
Tems 8 Basic steps for beginners
Tems 8 Basic steps for beginners Tems 8 Basic steps for beginners
Tems 8 Basic steps for beginners Syed Muhammad Zaidi
 
Configuration IPTables On CentOS 8
Configuration IPTables On CentOS 8Configuration IPTables On CentOS 8
Configuration IPTables On CentOS 8Kaan Aslandağ
 
Gluster dev session #3 xlator interface
Gluster dev session #3   xlator interfaceGluster dev session #3   xlator interface
Gluster dev session #3 xlator interfacePranith Karampuri
 
Dns configuration on rhel 5
Dns configuration on rhel 5Dns configuration on rhel 5
Dns configuration on rhel 5Subin Selvaraj
 
System ctl file that is created at time of installation
System ctl file that is created at time of installationSystem ctl file that is created at time of installation
System ctl file that is created at time of installationAshishRanjan975320
 

What's hot (20)

Ansible - simple it automation
Ansible - simple it automationAnsible - simple it automation
Ansible - simple it automation
 
Volume migration from one aggregate to other without impacting the applicatio...
Volume migration from one aggregate to other without impacting the applicatio...Volume migration from one aggregate to other without impacting the applicatio...
Volume migration from one aggregate to other without impacting the applicatio...
 
Scheduler job using mule
Scheduler job using muleScheduler job using mule
Scheduler job using mule
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster Recovery
 
PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016
PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016
PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016
 
Configuration of NTP Server on CentOS 8
Configuration of NTP Server on CentOS 8Configuration of NTP Server on CentOS 8
Configuration of NTP Server on CentOS 8
 
Reconsidering tracing in Ceph - Mohamad Gebai
Reconsidering tracing in Ceph - Mohamad GebaiReconsidering tracing in Ceph - Mohamad Gebai
Reconsidering tracing in Ceph - Mohamad Gebai
 
Firewalld LAB
Firewalld LABFirewalld LAB
Firewalld LAB
 
LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control Groups
 
HP-UX 11i Log File Management with Logrotate by Dusan Baljevic
HP-UX 11i Log File Management with Logrotate by Dusan BaljevicHP-UX 11i Log File Management with Logrotate by Dusan Baljevic
HP-UX 11i Log File Management with Logrotate by Dusan Baljevic
 
Session 9 4 alp to display the current system time using dos int 21 h
Session 9  4 alp to display the current system time using dos int 21 hSession 9  4 alp to display the current system time using dos int 21 h
Session 9 4 alp to display the current system time using dos int 21 h
 
クラウド環境におけるキャッシュメモリQoS制御の評価
クラウド環境におけるキャッシュメモリQoS制御の評価クラウド環境におけるキャッシュメモリQoS制御の評価
クラウド環境におけるキャッシュメモリQoS制御の評価
 
How to shutdown and power up of the netapp cluster mode storage system
How to shutdown and power up of the netapp cluster mode storage systemHow to shutdown and power up of the netapp cluster mode storage system
How to shutdown and power up of the netapp cluster mode storage system
 
Tems 8 Basic steps for beginners
Tems 8 Basic steps for beginners Tems 8 Basic steps for beginners
Tems 8 Basic steps for beginners
 
MongoDB 3.2.0 Released
MongoDB 3.2.0 ReleasedMongoDB 3.2.0 Released
MongoDB 3.2.0 Released
 
Configuration IPTables On CentOS 8
Configuration IPTables On CentOS 8Configuration IPTables On CentOS 8
Configuration IPTables On CentOS 8
 
Mydumper
MydumperMydumper
Mydumper
 
Gluster dev session #3 xlator interface
Gluster dev session #3   xlator interfaceGluster dev session #3   xlator interface
Gluster dev session #3 xlator interface
 
Dns configuration on rhel 5
Dns configuration on rhel 5Dns configuration on rhel 5
Dns configuration on rhel 5
 
System ctl file that is created at time of installation
System ctl file that is created at time of installationSystem ctl file that is created at time of installation
System ctl file that is created at time of installation
 

Viewers also liked

Viewers also liked (15)

Emac syllbus
Emac syllbusEmac syllbus
Emac syllbus
 
Grafico diario del eurostoxx 50 para el 12 02 2013
Grafico diario del eurostoxx 50 para el 12 02 2013Grafico diario del eurostoxx 50 para el 12 02 2013
Grafico diario del eurostoxx 50 para el 12 02 2013
 
Hoja de reflexión (1)
Hoja de reflexión (1)Hoja de reflexión (1)
Hoja de reflexión (1)
 
De que-sirve-que-las-personas-enfrenten-problemas-y-sufrimiento
De que-sirve-que-las-personas-enfrenten-problemas-y-sufrimientoDe que-sirve-que-las-personas-enfrenten-problemas-y-sufrimiento
De que-sirve-que-las-personas-enfrenten-problemas-y-sufrimiento
 
Documento
DocumentoDocumento
Documento
 
Saberes previos
Saberes previosSaberes previos
Saberes previos
 
P2 algebra (2)
P2 algebra  (2)P2 algebra  (2)
P2 algebra (2)
 
Assassincreedblackflag
Assassincreedblackflag Assassincreedblackflag
Assassincreedblackflag
 
Ex algebra (1)
Ex algebra  (1)Ex algebra  (1)
Ex algebra (1)
 
Production schedulewb27.04.2015
Production schedulewb27.04.2015Production schedulewb27.04.2015
Production schedulewb27.04.2015
 
Animal class
Animal classAnimal class
Animal class
 
P3 calculo i_(1)
P3 calculo i_(1)P3 calculo i_(1)
P3 calculo i_(1)
 
PyCon Poster 2014 music21
PyCon Poster 2014 music21PyCon Poster 2014 music21
PyCon Poster 2014 music21
 
Mary Rebecca Lamy
Mary Rebecca LamyMary Rebecca Lamy
Mary Rebecca Lamy
 
Crysis
CrysisCrysis
Crysis
 

Similar to Query to find permspace to all databases

Scripts related to temp tablespace
Scripts related to temp tablespaceScripts related to temp tablespace
Scripts related to temp tablespaceSoumya Das
 
6Modify the bfs.java program (Listing A) to find the minimu.docx
6Modify the bfs.java program (Listing  A) to find the minimu.docx6Modify the bfs.java program (Listing  A) to find the minimu.docx
6Modify the bfs.java program (Listing A) to find the minimu.docxevonnehoggarth79783
 
Hive Poster
Hive PosterHive Poster
Hive Posterragho
 
Asm troubleshooting and asm scripts
Asm troubleshooting and asm scriptsAsm troubleshooting and asm scripts
Asm troubleshooting and asm scriptsLucky Ally
 
Database & Technology 1 _ Clancy Bufton _ Flashback Query - oracle total reca...
Database & Technology 1 _ Clancy Bufton _ Flashback Query - oracle total reca...Database & Technology 1 _ Clancy Bufton _ Flashback Query - oracle total reca...
Database & Technology 1 _ Clancy Bufton _ Flashback Query - oracle total reca...InSync2011
 

Similar to Query to find permspace to all databases (7)

Scripts related to temp tablespace
Scripts related to temp tablespaceScripts related to temp tablespace
Scripts related to temp tablespace
 
6Modify the bfs.java program (Listing A) to find the minimu.docx
6Modify the bfs.java program (Listing  A) to find the minimu.docx6Modify the bfs.java program (Listing  A) to find the minimu.docx
6Modify the bfs.java program (Listing A) to find the minimu.docx
 
SQLQueries
SQLQueriesSQLQueries
SQLQueries
 
Hive Poster
Hive PosterHive Poster
Hive Poster
 
Membrane protein-ligand tutorial with GROMACS.pdf
Membrane protein-ligand tutorial with GROMACS.pdfMembrane protein-ligand tutorial with GROMACS.pdf
Membrane protein-ligand tutorial with GROMACS.pdf
 
Asm troubleshooting and asm scripts
Asm troubleshooting and asm scriptsAsm troubleshooting and asm scripts
Asm troubleshooting and asm scripts
 
Database & Technology 1 _ Clancy Bufton _ Flashback Query - oracle total reca...
Database & Technology 1 _ Clancy Bufton _ Flashback Query - oracle total reca...Database & Technology 1 _ Clancy Bufton _ Flashback Query - oracle total reca...
Database & Technology 1 _ Clancy Bufton _ Flashback Query - oracle total reca...
 

Query to find permspace to all databases

  • 1. Macro to show current perm and maxperm allowed for each database ---------------------------------------------------------------- replace macro showspace as ( sel diskspace.databasename, sum(maxperm),sum(currentperm) group by databasename order by databasename with sum(maxperm),sum(currentperm); ); Version that also shows percent used ------------------------------------ REPLACE MACRO SHOWSPACE AS ( LOCKING TABLE DBC.DISKSPACE IN ACCESS MODE SEL SUBSTR(DATABASENAME,1,15) (TITLE 'DatabaseName'), SUM(MAXPERM), SUM(CURRENTPERM), ((SUM(CurrentPerm))/NULLIFZERO(Sum(MaxPerm))*100) (FORMAT 'zz9.99%',TITLE 'Percent//Used') FROM DBC.DISKSPACE GROUP BY DATABASENAME ORDER BY 2 DESC, 3 DESC WITH SUM(MAXPERM), SUM(CURRENTPERM); ); This query will identify databases within 25% of maxperm --------------------------------------------------------- SEL databasename, SUM(currentperm) FROM dbc.diskspace HAVING SUM(currentperm) * 1.25 > SUM(maxperm) group by 1; Labels parameters