Saturday, December 28, 2013

quickly view reserved words for both SQL and PL/SQL


SQL> help reserved RESERVED

 WORDS (PL/SQL)

 -----------------------

 PL/SQL Reserved Words have special meaning in PL/SQL, and may not be used

 for identifier names (unless enclosed in "quotes").

 An asterisk (*) indicates words are also SQL Reserved Words.

 ALL*            DESC*           JAVA            PACKAGE         SUBTYPE

 ALTER*          DISTINCT*       LEVEL*          PARTITION       SUCCESSFUL

 * AND*            DO              LIKE*           PCTFREE*        SUM

 ANY*            DROP*           LIMITED         PLS_INTEGER     SYNONYM*

 ARRAY           ELSE*           LOCK*           POSITIVE        SYSDATE*

 AS*             ELSIF           LONG*           POSITIVEN       TABLE*

 ASC*            END             LOOP            PRAGMA          THEN*

 AT              EXCEPTION       MAX             PRIOR*          TIME

 AUTHID          EXCLUSIVE*      MIN             PRIVATE         TIMESTAMP

 AVG             EXECUTE         MINUS*          PROCEDURE       TIMEZONE_ABBR

 BEGIN           EXISTS*         MINUTE          PUBLIC*         TIMEZONE_HOUR

 BETWEEN*        EXIT            MLSLABEL*       RAISE           TIMEZONE_MINUTE

 BINARY_INTEGER  EXTENDS         MOD             RANGE           TIMEZONE_REGION

 BODY            EXTRACT         MODE*           RAW*            TO*

 BOOLEAN         FALSE           MONTH           REAL            TRIGGER*

 BULK            FETCH           NATURAL         RECORD          TRUE

 BY*             FLOAT*          NATURALN        REF             TYPE

CHAR*           FOR*            NEW             RELEASE         UI CHAR_BASE    

FORALL          NEXTVAL         RETURN          UNION* CHECK*          FROM*        

NOCOPY          REVERSE         UNIQUE* CLOSE           FUNCTION        NOT*         

ROLLBACK        UPDATE* CLUSTER*        GOTO            NOWAIT*         ROW*         

USE COALESCE        GROUP*          NULL*           ROWID*          USER*

COLLECT         HAVING*         NULLIF          ROWNUM*         VALIDATE*

COMMENT*        HEAP            NUMBER*         ROWTYPE         VALUES*

COMMIT          HOUR            NUMBER_BASE     SAVEPOINT       VARCHAR*

COMPRESS*       IF              OCIROWID        SECOND          VARCHAR2*

CONNECT*        IMMEDIATE*      OF*             SELECT*         VARIANCE

CONSTANT        IN*             ON*             SEPERATE        VIEW*

CREATE*         INDEX*          OPAQUE          SET*            WHEN

CURRENT*        INDICATOR       OPEN            SHARE*          WHENEVER*

CURRVAL         INSERT*         OPERATOR        SMALLINT*       WHERE*

CURSOR          INTEGER*        OPTION*         SPACE           WHILE

DATE*           INTERFACE       OR*             SQL             WITH*

DAY             INTERSECT*      ORDER*          SQLCODE         WORK

DECIMAL*        INTERVAL        ORGANIZATION    SQLERRM         WRITE

DECLARE         INTO*           OTHERS          START*          YEAR

DEFAULT*        IS*             OUT             STDDEV          ZONE

DELETE*         ISOLATION

Database Link password Change in 11gR2

Before 11gR2 for changing  database link we have  to be drop and recreated db link  with an updated password.

Sample here is on the database where database link is located:

The password of the database link’s account has just been changed.

SQL> select count(*) from PUMP@DB_LiNK_CUST;
select count(*) from PUMP@DB_LiNK_CUST
*
ERROR at line 1:
ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from DB_LiNK_CUST

SQL> alter database link DB_LiNK_CUST connect to dblink_source identified by dblink_source;

Database link altered.

SQL> select count(*) from PUMP@DB_LiNK_CUST;

COUNT(1)
----------
18762

This option is not available in the pre-11gR2.

ORA-24247: network access denied by access control list (ACL)

Last month we just migrated an application from 10G to 11g. During a test of the send mail package using UTL_SMTP, we got this error, “ORA-24247: network access denied by access control list (ACL).” After a quick search, found below way to setup ALC in 11G.


1. The send mail package which executes the UTL_SMTP failed.

TEST_USER SQL> exec pkg_mails.SendMail('user@.com', 'Test Subject', 'Hello World');

ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SYS.UTL_TCP", line 17
ORA-06512: at "SYS.UTL_TCP", line 246
ORA-06512: at "SYS.UTL_SMTP", line 115
ORA-06512: at "SYS.UTL_SMTP", line 138
ORA-06512: at "pkg_mails", line 283
ORA-06512: at line 3

2. To fix it, an ACL has to be created.

The principal is the user or role to be added into this ACL. In this case, the TEST_USER account is added during the ACL creation. This field is case sensitive.

SQL> connect / as sysdba

begin
dbms_network_acl_admin.create_acl (
acl             => 'Resolve_Access.xml',      -- Name of the access control list XML file
description     => 'Resolve Network Access using UTL_INADDR',  -- Brief description
principal       => 'TEST_USER',               -- First user account or role being granted or denied permission
                                              --   this is case sensitive,
                                              --   but typically user names and roles are stored in upper-case letters
is_grant        => TRUE,                      -- TRUE = granted, FALSE = denied
privilege       => 'resolve',                 -- connect or resolve, this setting is case sensitive,
                                              --   so always enter it in lowercase
                                              --    connect if user uses the UTL_TCP, UTL_HTTP, UTL_SMTP, and UTL_MAIL
                                              --    resolve if user uses the UTL_INADDR
start_date      => null,                      -- optional, null is the default
                                              --   in format of timestamp_with_time_zone (YYYY-MM-DD HH:MI:SS.FF TZR)
                                              --   for example, '2008-02-28 06:30:00.00 US/Pacific'
end_date        => null                       -- optional, null is the default
);

commit;
end;
/
http://download.oracle.com/docs/cd/B28359_01/network.111/b28531/authorization.htm#insertedID11

Note that the privilege used for UTL_INADDR is resolve in lowecase.


The description of each variable is clearly described in the Oracle-Base’s article.

3. Verify a newly-created ACL.

SQL> SELECT any_path
     FROM resource_view
     WHERE any_path like '%.xml';

ANY_PATH
--------------------------------------------------------------------------------
/sys/acls/all_owner_acl.xml
/sys/acls/bootstrap_acl.xml
/sys/acls/ro_all_acl.xml
/sys/acls/ro_anonymous_acl.xml

4. Optionally you can add more users or roles into this ACL by using the add_privilege procedure. This is similar to the create_acl procedure except no description. Sample shown here is to add ADMIN_ADMIN_ROLE role.

begin
dbms_network_acl_admin.add_privilege (
acl           => 'Mail_UTL_Access.xml',
principal     => 'APP_ADMIN_ROLE',
is_grant      => TRUE,
privilege     => 'connect',
start_date    => null,
end_date      => null);

commit;
end;
/

5. Add a host and port range allowed.

begin dbms_network_acl_admin.assign_acl (
acl           => 'Resolve_Access.xml', -- Name of the access control list XML file to be modified
host          => '*',                   -- Network host to which this access control list will be assigned
-- This a host name or IP address or wild card name
lower_port    => null,                  -- (optional)
upper_port    => null);                 -- (optional)
commit;
end; /

SELECT utl_inaddr.get_host_name FROM dual;
GET_HOST_NAME
--------------------------------------------------------------------------------
hostname1

6. Test the send mail package again. This time there is no error, and the recipient receives email.

TEST_USER SQL> exec pkg_mails.SendMail('user@company.com', 'Test Subject', 'Hello World');

PL/SQL procedure successfully completed

Alter Statement Hangs

I found this tip from Oracle document while looking for a solution for session hung at the SQL prompt after issuing "alter tablespace read only". Usually "alter tablespace read only" executes very quickly. However, the likelihood cause of waiting for tablespace to become read-only is due to existing in-flight transactions started before "alter tablespace read only" are still running.

To identify these transactions that are preventing the read-only tablespace is to first identify the "alter tablespace read only" session.

SELECT SQL_TEXT, SADDR
FROM V$SQLAREA,V$SESSION
WHERE V$SQLAREA.ADDRESS = V$SESSION.SQL_ADDRESS
AND SQL_TEXT LIKE 'alter %';

SQL_TEXT                                 SADDR
---------------------------------------- ----------------
alter tablespace tbs_tts1 read only      0000040634C0D8B8

Based on the identified session address and start SCN number, we can find the earlier executions before the read-only statement by querying the v$TRANSACTION order by ascending start SCN.

SELECT SES_ADDR, START_SCNB
FROM V$TRANSACTION
ORDER BY START_SCNB;

SES_ADDR         START_SCNB
---------------- ----------
0000040634C254F8 2976616884    --> Waiting on this transaction
0000040634C0D8B8 2980274305    --> alter Statement
0000040634C53858 2980283454

From the session address of the blocking transaction, we then can find information about that session.

SELECT T.SES_ADDR, S.USERNAME, S.MACHINE
FROM V$SESSION S,  V$TRANSACTION T
WHERE T.SES_ADDR = S.SADDR
ORDER BY T.SES_ADDR

SES_ADDR          USERNAME              MACHINE
----------------  --------------------  ------------------
0000040634C254F8  RT_ADMIN              test1

Sunday, December 1, 2013

RMAN-06169: could not read file header for datafile 236 error reason 4


Today I got a new problem in one of our 3 node cluster  database .During rman cold backup my job was failing -

RMAN-06169: could not read file header for datafile 236 error reason 4
+ [ -z '' ]
+ page_msg=abended
+ [ -z 'RMAN- or ORA- errors encountered.  Please check audit log' ]
--

Above it's clear that something wrong with datafile numbre  236.


 using v$recover_file checked datafile status.

SQL> select * from v$recover_file where error like '%FILE%';

  FILE# ONLINE  ONLINE_ ERROR                                                                CHANGE# TIME
---------- ------- ------- ----------------------------------------------------------------- ---------- ---------------
       236 OFFLINE OFFLINE FILE NOT FOUND                                                             0


--  Above is the key point "OFFLINE"

SQL> select file#,name from v$datafile where file#=236;

     FILE#
----------
NAME
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
       236
/d001/product/oracle/11.2.0.2/db/dbs/SHARED_DATA


SQL> show parameter db_create_file_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest                  string      +SHARED_DATA


As  db_create_file_dest define as +SHARED_DATA , it shows something wrong happen during adding this datafile. common cause is while add datafile if we given space between "add datafile ' +vale of db_create_file_dest'  this way datafile will create inside $ORACLE_HOME/dbs'. seem same happen here for this db also .
Let's fix this now .

SQL>  select file#,name from v$datafile where file#=236;

     FILE#
----------
NAME
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
       236
/d001/product/oracle/11.2.0.2/db/dbs/SHARED_DATA

alter database create datafile '/d001/product/oracle/11.2.0.2/db/dbs/SHARED_DATA' as '+SHARED_DATA'

SQL> show parameter db_create_file_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest                  string      +SHARED_DATA
SQL>

SQL> alter database create datafile '/d001/product/oracle/11.2.0.2/db/dbs/SHARED_DATA' as '+SHARED_DATA'
  2  ;
alter database create datafile '/d001/product/oracle/11.2.0.2/db/dbs/SHARED_DATA' as '+SHARED_DATA'
*
ERROR at line 1:
ORA-01136: specified size of file 236 (12800 blocks) is less than original size of 131072 blocks
ORA-01110: data file 236: '/d001/product/oracle/11.2.0.2/db/dbs/SHARED_DATA'

No problem .

SQL> alter database create datafile '/d001/product/oracle/11.2.0.2/db/dbs/SHARED_DATA' as new;

Database altered.

SQL> select file#,name from v$datafile where file#=236;

     FILE#
----------
NAME
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
       236
+SHARED_DATA/XXXX/datafile/otd.1475.832988265


Saturday, November 30, 2013

background process that exists in 11gr2 and functionality

Process NameFunctionality
crsd•The CRS daemon (crsd) manages cluster resources based on configuration information that is stored in Oracle Cluster Registry (OCR) for each resource. This includes start, stop, monitor, and failover operations. The crsd process generates events when the status of a resource changes.
cssd•Cluster Synchronization Service (CSS): Manages the cluster configuration by controlling which nodes are members of the cluster and by notifying members when a node joins or leaves the cluster. If you are using certified third-party clusterware, then CSS processes interfaces with your clusterware to manage node membership information. CSS has three separate processes: the CSS daemon (ocssd), the CSS Agent (cssdagent), and the CSS Monitor (cssdmonitor). The cssdagent process monitors the cluster and provides input/output fencing. This service formerly was provided by Oracle Process Monitor daemon (oprocd), also known as OraFenceService on Windows. A cssdagent failure results in Oracle Clusterware restarting the node.
diskmon•Disk Monitor daemon (diskmon): Monitors and performs input/output fencing for Oracle Exadata Storage Server. As Exadata storage can be added to any Oracle RAC node at any point in time, the diskmon daemon is always started when ocssd is started.
evmd•Event Manager (EVM): Is a background process that publishes Oracle Clusterware events
mdnsd•Multicast domain name service (mDNS): Allows DNS requests. The mDNS process is a background process on Linux and UNIX, and a service on Windows.
gnsd•Oracle Grid Naming Service (GNS): Is a gateway between the cluster mDNS and external DNS servers. The GNS process performs name resolution within the cluster.
ons•Oracle Notification Service (ONS): Is a publish-and-subscribe service for communicating Fast Application Notification (FAN) events
oraagent•oraagent: Extends clusterware to support Oracle-specific requirements and complex resources. It runs server callout scripts when FAN events occur. This process was known as RACG in Oracle Clusterware 11g Release 1 (11.1).
orarootagent•Oracle root agent (orarootagent): Is a specialized oraagent process that helps CRSD manage resources owned by root, such as the network, and the Grid virtual IP address
oclskd•Cluster kill daemon (oclskd): Handles instance/node evictions requests that have been escalated to CSS
gipcd•Grid IPC daemon (gipcd): Is a helper daemon for the communications infrastructure
ctssd•Cluster time synchronisation daemon(ctssd) to manage the time syncrhonization between nodes, rather depending on NTP

Environment Variables for a Running Process in linux

Checking  environment Variables detail for a Running Process in linux.

strings –a /proc/<pid_of_the_process>/environ

[root@joshi11 ~]# ps -ef |grep pmon
root     59844 12268  0 23:21 pts/0    00:00:00 grep pmon
oracle   62026     1  0 20:42 ?        00:00:02 asm_pmon_+ASM2
[root@joshi11 ~]# strings -a /proc/62026/environ
__CLSAGFW_TYPE_NAME=ora.mdns.type
ORA_CRS_HOME=/prod/grid/11.2.0/grid
HOSTNAME=joshi11
SHELL=/bin/bash
TERM=xterm
__CRSD_CONNECT_STR=(ADDRESS=(PROTOCOL=IPC)(KEY=OHASD_IPC_SOCKET_11))
HISTSIZE=1000
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
CRF_HOME=/prod/grid/11.2.0/grid
WAS_ROOTMACRO_CALL_MADE=YES
GIPCD_PASSTHROUGH=false
SSH_TTY=/dev/pts/0
LC_ALL=
__CRSD_AGENT_NAME=/prod/grid/11.2.0/grid/bin/oraagent_oracle
__CRSD_MSG_FRAME_VERSION=2
USER=root

Friday, November 29, 2013

Script to show change in query execution

Below script just queries DBA_HIST_SQLSTAT for a given sql_id. A sql_id corresponds to a single SQL query.  

set linesize 32000
set pagesize 1000
set long 2000000000
set longchunksize 1000

select ss.sql_id,
ss.plan_hash_value,
sn.END_INTERVAL_TIME,
ss.executions_delta,
ELAPSED_TIME_DELTA/(executions_delta*1000) "Elapsed Average ms",
CPU_TIME_DELTA/(executions_delta*1000) "CPU Average ms",
IOWAIT_DELTA/(executions_delta*1000) "IO Average ms",
CLWAIT_DELTA/(executions_delta*1000) "Cluster Average ms",
APWAIT_DELTA/(executions_delta*1000) "Application Average ms",
CCWAIT_DELTA/(executions_delta*1000) "Concurrency Average ms",
BUFFER_GETS_DELTA/executions_delta "Average buffer gets",
DISK_READS_DELTA/executions_delta "Average disk reads",
ROWS_PROCESSED_DELTA/executions_delta "Average rows processed"
from DBA_HIST_SQLSTAT ss,DBA_HIST_SNAPSHOT sn
where ss.sql_id = 'bjxwm53smzfjn'
and ss.snap_id=sn.snap_id
and executions_delta > 0
and ss.INSTANCE_NUMBER=sn.INSTANCE_NUMBER
order by ss.snap_id,ss.sql_id;

SQL_ID      PLAN_HASH_VALUE END_INTERVAL_TIME EXECUTIONS_DELTA Elapsed Average ms CPU Average ms IO Average ms Cluster Average ms Application Average ms Concurrency Average ms Average buffer gets Average disk reads Average rows processed
------------- --------------- ------------------------- ---------------- ------------------ -------------- ------------- ------------------ ---------------------- ---------------------- ------------------- ------------------ ----------------------
bjxwm53smzfjn   3241932711 21-NOV-13 11.06.17.602 PM    2603 11457.6083 1242.76082    8398.43699  0 0       18.4320926   101602.754       5548.3227     24.2708413
bjxwm53smzfjn   3241932711 22-NOV-13 12.00.43.481 AM    1430 38261.3023 1765.16249    10753.5862  0 0       178.180512   140427.258      6062.37692     16.3657343
bjxwm53smzfjn   3241932711 22-NOV-13 01.00.08.144 AM    1559 62753.3383 1648.73349    18714.1897  0 0       503.047884   114864.889      5246.56062     23.0667094
bjxwm53smzfjn   3241932711 22-NOV-13 02.00.39.527 AM    1997  51748.324 1763.35454    29884.9149  0 0 108.84675   103847.485      16511.4447      25.897346
bjxwm53smzfjn   3241932711 22-NOV-13 03.00.41.453 AM    9911 5908.77018 1121.02559    4629.14669  0 0       64.4795458   91980.3728      195.806881     7.65533246
bjxwm53smzfjn   3241932711 22-NOV-13 04.00.43.330 AM    7690 12101.7682 1191.67764    10476.0536  0 0       170.186179   92665.0322      370.703771     7.87412224

In general  If the number of executions for one week over the next were different that would indicate a change in query volume.  If the per execution times were different that would indicate a change in the way each query ran.

Thursday, November 21, 2013

2 node RAC Local listener parameter has auto-changed .

Today we notice One of our 2 node RAC db Local listener parameter has auto-changed  .

Application is behind firewall and for them both ports 2221(local listener) and Scan listener port(1621) is opened. So if local listener port changes to 1521, they are not able to access application.


Local_listener value we seted 2221 and it got automatically changed to  1521.

After checking all db and Cluster logfile did not find any clue how it got changed . so we raised Sr with oracle. oracle confirm this is bug .

Bug 11772838 - oraagent modifies LOCAL_LISTENER with an incorrect value, when the parameter was set in spfile (Doc ID 11772838.8)

Friday, November 15, 2013

ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1], [6141], [336116], [336119], [], [], [], [], [], [], []

Today we  were a power failure causing on db server  which lead logical corruption in controlfile .
using below step i solve corruption .


as per  db alert logfile.

ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1], [6141], [336116], [336119], [], [], [], [], [], [], []
Incident details in: _ora_2046_i528270.trc
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Aborting crash recovery due to error 600
Errors in file _ora_2046.trc:
ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1], [6141], [336116], [336119], [], [], [], [], [], [], []
Errors in file _ora_2046.trc:
ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1], [6141], [336116], [336119], [], [], [], [], [], [], []
ORA-600 signalled during: ALTER DATABASE OPEN...
Dumping diagnostic data in directory=[cdmp_20131114231835], requested by (instance=1, osid=2046), summary=[incident=528270].
Thu Nov 14 23:19:30 2013
Sweep [inc][528270]: completed
Sweep [inc2][528270]: completed

Startup mount ;

Show parameter control_files
Note down the name of the control files name and location.
select a.member,a.group#,b.status from v$logfile a ,v$log b where a.group#=b.group# and b.status='CURRENT'

Note down the name of the redo log
Shutdown abort ;

take controlfile  file backup ,
SQL>recover database using backup controlfile until cancel ;

Enter location of redo log shown as current in Query 1 when prompted for recovery

SQL> Startup mount ;
ORACLE instance started.

Total System Global Area 4275781632 bytes
Fixed Size                  2235208 bytes
Variable Size            2516583608 bytes
Database Buffers         1744830464 bytes
Redo Buffers               12132352 bytes
Database mounted.
SQL> recover database using backup controlfile until cancel ;
ORA-00279: change 1071851209 generated at 11/14/2013 18:00:54 needed for thread
1
ORA-00289: suggestion :
/Oracle/product/product/11.2.0/dbhome_11.2.0.3/dbs/arch/1_6141_817121922.dbf
ORA-00280: change 1071851209 for thread 1 is in sequence #6141


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/redo1/oracle/mstq2/redo/redo01g4.log  - this was my old redo logfile  name.
Log applied.
Media recovery complete.
SQL> Alter database open resetlogs ;

Database altered.


take immediately backup of db.

Friday, November 8, 2013

history inside VIM editor


~/..viminfo store history VIM editor  history.

[oracle@joshiv~]$ vim ~/.viminfo

# This viminfo file was generated by Vim 7.0.
# You may edit it if you're careful!

# Value of 'encoding' when this file was written
*encoding=utf-8


# hlsearch on (H) or off (h):
~H
# Last Search Pattern:
~MSle0/that

# Last Substitute Search Pattern:
~MSle0~&SHELL

# Last Substitute String:
$script

# Command Line History (newest to oldest):
:q!
:wq!
:%s/SHELL/script/g
:%s/shell/script/g
:c$
:c0
:/love
:!
:.,.+1!
:1g
:!pwd
:!date
:x!
:q1
:/alter
:wq1
:qq
:/LOG_ARCHIVE_DEST_2
:1
:/ALTER
:/control
:w!
:q~!

df not showing correct free space in linux

Last week i faced below issue-

When i did “df -h” and “du -sh /Mounted_parition_name” and find some difference output.

My sysadmin say it will solve/OK after server reboot.

Did some workaround on this my own i found  below.

After removing some file because of some reason the file is in open state means it is used by some process.
And in Unix every running process has some PID.

using  "lsof |grep /Mounted_parition_name" .

After  killing those process all set. 

How to lock and unlock user in Linux like Oracle RDBMS.

(1) Command for locking SO user in linux

passwd -l user_name

(2) Command for unlocking SO user in linux :

passwd -u user_name




Nohup in linux

When we run the command with ‘nohup’ and ‘&’
so that the command should run at background even the terminal get disconnected we have to press enter key 2 times. To overcome from this problem,use the below given method.

nohup joshiv.sh > joshiv.out 2> Error.err < /dev/null &

Or

nohup command_nam > command_nam.out 2> Error.err < /dev/null &


 It will crate two file Output.out and Error.err .
 It is good tip to use, in this way we can also get to know what was the output or if there was any error.

System load average in terminal with graphical

tload is the command through which we can find the load average of
system whereas it will show the load average in terminal with graphical representation.

tload

 7.97, 7.91, 8.31 ------                                                                                                                                                                         **      **                                                                                                                                                                   ********------**                                                                                                                                                                  *********      **                                                                                                                                                           ----============------==                                                                                                                                                              *************      **                                                                                                                                                            ***************      **                                                                                                                                                           ****************------**                                                                                                                                                           ****************      **                                                                                                                                                           ================------==                                                                                                                                                           ****************      **                                                                                                                                                           ****************      **                                                                                                                                                           ****************------**                                                                                                                                                           ****************      **                                                                                                                                                           ================------==                                                                                                                                                           ****************      **                                                                                                                                                           ****************      **                                                                                                                                                                                                

Different way to edit crontab

Crontab is like a task scheduler in unix operating system.I expect you are already aware about crontab edit using crontab -e.

In this post I am sharing the tips how to edit crontab without using “crontab -e” command.

As we know to edit the crontab there is a command
crontab -u username -e

In Redhat, crontab files are located at /var/spool/cron and similarly , the crontab of user will be with the name of file.
for eg. username is joshiv ,and you can see the filename with joshiv in ls -l /var/spool/cron/joshiv

Like below way we can edit cron.

vi /var/spool/cron/joshiv
10 * * * * touch /tmp/log_`date +%F-%s`

Friday, November 1, 2013

Is Exadata really needed ? for today market ?

Since 2 Year's i am working on  Exadata  Env. thought write something on is exadata  really needed  for today market ?-  

Consider first below point before saying anything on exadata.

The primary purpose of Exadata is to speed up full table scans. 
The speed comes from the massively parallel block elimination by applying Bloom filters. The fact remains: index blocks are searched in the SGA, Exadata speeds up the full table scan. Full table scans of large table is something that OLTP avoids like a plague. In other words, Exadata does nothing for OLTP. A good SAN like VMAX can do the same thing, using the very same elements that make Exadata fast: fast data transfer using 16GB HBA's, large IO cache on SAN itself for caching and very fast drives for faster IO. Nothing else is needed for OLTP.There is no secret sauce in the Exadata machine which would speed up OLTP.

Smart scan reduces the data sent back (filtering rows as well as columns) to DB servers, how important is that for you 
There are always more storage nodes than DB nodes,so more parallelism 
HCC is important reducing actual size of data on disk 
12c im-memory - everything cannot be kept in memory, what about persistence 
Exadata flashcache persists data when in write-back mode 
Building a reliable interconnect network - Exadata pre-built and tested

We are already processing at speeds that were unheard of 10-20 years ago. I haven't done the research lately, but I bet current servers are 1,000 times faster than they were 15 years ago. 
Business problems have grown too, but not 1,000x. 
So, why are applications slower than they were 10-12 years ago? 
as above i say A good SAN like VMAX can do the same thing as its doing for full table scan.
Here's what I'd like to say. remember the old days where database systems lived and died by the Transaction Processing Council (TPC) benchmarks? I haven't seen that very much anymore. 

Exadata would not give  you much  benefit.  You can achieve If you are  actually DBA  and well knowing  system and storage.



Let me know your experience  at joshi11.vinod@gmail.com -