Where is the Crontab File on Solaris

Many times to see the crontab content we use the crontab -l command and to modify it we use the crontab -e command. The crontab as we see it or edit it is not more than a file, which can be seen with a simple cat, view, etc and can be modified directly (having the right permissions since it is owned by root and we must have permission from this to modify it). In Solaris the file is located in the following location (usually each user have its own file);

/var/spool/cron/crontabs

HTH – Antonio NAVARRO

Advertisements

How To Get ORACLE_HOME From SQL

In many occasions we need to know the ORACLE_HOME of a database. To get this value we usually go to the operating system and look at the environment variable ($ORACLE_HOME for unix environments,%ORACLE_HOME% in Windows environments or ORACLE_HOME logic in VMS environments). Now from the database we can get this value (if I’m not wrong from version 12c) with the following query;

SELECT SYS_CONTEXT (‘USERENV’,’ORACLE_HOME’) FROM DUAL;

HTH – Antonio NAVARRO

How To Get DDL From a Diskgroup

This week I had to rebuild several diskgroups asm for a new environment that I have mounted, the issue is that I did not find a “DBMS_METADATA” or a script on the internet that would serve me for what I wanted to do, on the other hand it is a simple thing and can that being something relatively easy nobody has published something similar.

Here I put the little script that I put in if it can help someone.

 

SET SERVEROUTPUT ON SIZE 100000
SET LINES 1000
SET PAGES 1000SET VER OFF 

DECLARE
IS_FIRST_TIME  BOOLEAN := TRUE;
LINEA VARCHAR2 (100);
BEGIN
DBMS_OUTPUT.PUT_LINE ('==========================================================');
/* Create command */
select 'CREATE DISKGROUP ' || '&1' INTO LINEA FROM DUAL;
DBMS_OUTPUT.PUT_LINE (LINEA);
/* Redundancy type */
select decode ( type, 'EXTERN','EXTERNAL', type)  || ' REDUNDANCY DISK' INTO LINEA from v$asm_diskgroup where name =upper ( '&&1' );
DBMS_OUTPUT.PUT_LINE (LINEA);
/* Disks associated to the DG */
FOR i IN  (
SELECT PATH  FROM V$ASM_DISK JOIN  V$ASM_DISKGROUP ADG USING (GROUP_NUMBER)
WHERE ADG.name =   upper ( '&&1' )
)  LOOP
/* Put comma if multirows are returned */
IF NOT IS_FIRST_TIME THEN
DBMS_OUTPUT.PUT (',');
END IF;
DBMS_OUTPUT.PUT_LINE (i.path);
IS_FIRST_TIME := FALSE;
END LOOP i;
/* Allocation unit */
SELECT 'ATTRIBUTE ''au_size''=''' || ALLOCATION_UNIT_SIZE/1048576 || 'M'','  INTO LINEA from v$asm_diskgroup where name =  upper ( '&&1' );
DBMS_OUTPUT.PUT_LINE (LINEA);
/* Compatible ASM */
SELECT  '''compatible.asm''=''' || VALUE  || ''',' INTO LINEA  FROM V$ASM_ATTRIBUTE A JOIN  V$ASM_DISKGROUP ADG USING (GROUP_NUMBER)  WHERE ADG.name =  upper ( '&&1' )
AND A.NAME = 'compatible.asm';
DBMS_OUTPUT.PUT_LINE (LINEA);
/* Compatible RDBMS */
SELECT  '''compatible.rdbms''=''' || VALUE  || ''';'  INTO LINEA  FROM V$ASM_ATTRIBUTE A JOIN  V$ASM_DISKGROUP ADG USING (GROUP_NUMBER)  WHERE ADG.name =  upper ( '&&1' )
AND A.NAME = 'compatible.rdbms';
DBMS_OUTPUT.PUT_LINE (LINEA);
END;
/

HTH – Antonio NAVARRO

How Does OUI Decide oraInventory Location?

Here I like talk about where oraInventory is located. The Oracle Inventory is where all the software, bundles, merges, oneoffs that are installed on that machine are registered. Actually there are several files and it is important to have them located and make periodic backup of them. The following code tells us where it is.


if ORACLE_BASE is SET then { $ORACLE_BASE/../oraInventory }
else if not OFA-Complaint {/home/oracle/oraInventory}
else { /u[01-09]/app/oraInventory }

OFA is Optimal Flexible Architecture

HTH – Antonio NAVARRO

 

 

SYSTEM STATE Levels

Many times need perform SYSTEM STATE command to recopile information on some problem or by applyed from Support. In this post I like show the levels Many times need perform SYSTEM STATE command to recopile information on some problem or by applyed from Support. In this post I like show the levels that you can use for this command. Please be carefull using it in Production enviroments, and pay attention on some of them because it can “freze” the database (or Cluster if you use the -g all option).

  • 2 dump (not including the lock element)
  • 10 dump11 dump + global cache of RAC
  • 256 short stack (function stack)
  • 258 256 + 2 -> short stack + dump (not including the lock element)
  • 266 256 + 10 -> short stack + dump267 256 + 11 -> short stack + dump + global cache of RAC

 

Example;

oradebug dump systemstate 258

HTH – Antonio NAVARRO

Installing and Using OSWatcher (Release 8.1.2)

For those who do not know this tool, tell you that it is basically a shell script that collects a series of unix commands about the time dimension.

OSWatcher only use the next operating systems commands to recopile information;
VMSTAT
IOSTAT
MPSTAT
IFCONFIG
NETSTAT
TOP
TRACEROUTE

 

To install the latest version you must download it from ML / MOS, you need a license, even the most basic one.

To start it (in an easy way, many options are avaliables);

./startOSWbb.sh

To stop it;

./stopOSWbb.sh

To see the data;

Normally these traces are used to send information to Oracle, but you can see the data graphically with the following command

java -jar $OSWATCHER_HOME/oswbba.jar -i $OSWATCHER_HOME/archive

 

HTH – Antonio NAVARRO

 

 

New Release Of 7ZIP

Today I want to talk about 7zip, a free and open source tool, which is widely used in many of the places where I have worked and worked. For those who do not know is a free compressor / descompressor that supports many compression formats, perhaps the most used is the .zip. Of course, it does not support .rar for being proprietary software.

A few days ago (30.04.2018) a new version of this versatile tool came out, which I personally use almost daily in my day to day work.

I leave below the link to your website.

7Zip website

HTH – Antonio NAVARRO