Skip to main content

Posts

How to install nagios client and plugins in solaris 10

How to install nagios client in Solaris 10 and NRPE Plugings 1.- Download the Nagios Client Installer You can download the nagios client for solaris 10 from exchange.nagios.org, previously you need to have connection from the server to internet #wget assets.nagios.com/downloads/nagiosxi/agents/solaris-nrpe-agent.tar.gz  (Only if you have installed the wget package) 2.- If you do not have connection, please download in your machine and upload it to the server as below # scp -pr solaris-nrpe-agent.tar.gz    root@india:/var/tmp Password: solaris-nrpe-agent.t 100% |**************************************************************************************************************************************************|  4202 KB    00:00 Once you uploaded the package, connect with ssh to the server, plesase uncompress the information in order to execute the install program 2.- Execute the fullinstall script in order to begin the installation root@india:/var/tmp #gunzip solari

How to move datafiles in Oracle.

In this example, we will move UNDO tablespace datafiles in another location. 1- Check what daatfiles does contains UNDO tablespace. SQL> select file_name from dba_data_files where tablespace_name='UNDOTBS'; file_name -------------------------------- /home/ora11/oradata/db1/undo.dbf 2- SQL> shutdown immediate 3- Copy physically the datafile to the new location with same name. mv /home/ora11/oradata/db1/undo.dbf  /home/ora11/oradata/db2/undo.dbf 4- SQL> startup mount 5- SQL> alter database rename file '/home/ora11/oradata/db1/undo.dbf ' to '/home/ora11/oradata/db2/undo.dbf'; 6-  SQL> shutdown immediate     SQL> startup     SQL> select file_name     from dba_data_files     where tablespace_name='UNDOTBS';     file_name     --------------------------------     /home/ora11/oradata/db2/undo.dbf

How to check archive amount per day and hour

This report generates Generacion_archives_db.html in html format. set echo off set termout on set heading on set feedback off set trimspool on set pagesize 500 set linesize 180 set markup html on spool on spool Generacion_archives_db.html SELECT LOG_HISTORY.*,          SUM_ARCH.GENERATED_MB,          SUM_ARCH_DEL.DELETED_MB,          SUM_ARCH.GENERATED_MB - SUM_ARCH_DEL.DELETED_MB "REMAINING_MB"     FROM (  SELECT TO_CHAR (COMPLETION_TIME, 'DD/MM/YYYY') DAY,                    SUM (                       DECODE (TO_CHAR (COMPLETION_TIME, 'HH24'), '00', 1, NULL))                       "00-01",                    SUM (                       DECODE (TO_CHAR (COMPLETION_TIME, 'HH24'), '01', 1, NULL))                       "01-02",                    SUM (                       DECODE (TO_CHAR (COMPLETION_TIME, 'HH24'), '02', 1, NULL))                       "02-03",

How to obtain schema size and number of objects

SELECT owner, count (distinct segment_name) as obj_number, sum(bytes) / 1024/1024/1024 as "Gigas" FROM dba_segments WHERE owner in  ('SAPSR3') GROUP BY owner;

How to check table size including their indexes.

Hot to check table size including their indexes. SELECT    owner, table_name, TRUNC(sum(bytes)/1024/1024) gigas FROM (SELECT segment_name table_name, owner, bytes  FROM dba_segments  WHERE segment_type = 'TABLE'  AND SEGMENT_NAME NOT LIKE  ('BIN%')  UNION ALL  SELECT i.table_name, i.owner, s.bytes  FROM dba_indexes i, dba_segments s  WHERE s.segment_name = i.index_name  AND   s.owner = i.owner  AND   s.segment_type = 'INDEX'  AND s.SEGMENT_NAME NOT LIKE  ('BIN%')  UNION ALL  SELECT l.table_name, l.owner, s.bytes  FROM dba_lobs l, dba_segments s  WHERE s.segment_name = l.segment_name  AND s.SEGMENT_NAME NOT LIKE  ('BIN%')  AND   s.owner = l.owner  AND   s.segment_type = 'LOBSEGMENT'  UNION ALL  SELECT l.table_name, l.owner, s.bytes  FROM dba_lobs l, dba_segments s  WHERE s.segment_name = l.index_name  AND s.SEGMENT_NAME NOT LIKE  ('BIN%')  AND   s.owner = l.owner  AND   s.segment_type = 'LOBIND

Script to generate dbverify for all datafiles.

Script to generate dbverify for all datafiles. set head off set lines 200 set feedback off set define off spool dbv.sh select 'dbv file='||name||' blocksize= '||block_size|| ' LOGFILE=FILE-'||FILE#||'.LOG' from v$datafile; spool off  

How to check repeated datafiles

How to check repeated datafiles  set linesize 300 select tablespace_name,file_name from dba_data_files a where 1< (select count(*) from dba_data_files b where substr(a.file_name,24,60)=substr (b.file_name,24,60));