Search This Blog

Sunday 9 December 2012

Send email from Linux with the Mutt e-mail client.

Sometimes due to security policy you won't be able to use SMTP relay with sendmail service. The better way in this situation or in some other situation use Mutt 1.5.21 since in this version you can specify your SMTP server.

Steps:
1. Download and unpack Mutt 1.5.21
2. Configure it with SMTP option (root):
    # ./configure --enable-smtp
    # ./make install
3. Create .muttrc file (root or another user that you want to use):
    $ cat /usr/local/etc/Muttrc > .muttrc
4. Find and update the following lines in .muttrc file:
    set from="someuser@anydomain.com"  - doesn't metter what will be here but something should be for correct work.
    set smtp_url="smtp://mail.yourdomain.com:25"  - here should be your SMTP server

NOTE!!!: if your SMTP is not pingable due to some security reasons then you should add it to /etc/hosts.

5. Create some file with any text.txt file that you want to send
6. Now send an email:
    /usr/local/bin/mutt -s "Test e-mail" yourname@yourdomain.com < test.txt  

That is all!

Tuesday 20 November 2012

RDA AWR Report

Here is a simple example how to generate RDA report that will include AWR report for specific time.

The commands:

PRF_START=$(date +"%d-%h-%Y_%H:%M" --date="yesterday")
PRF_END=$(date +"%d-%h-%Y_%H:%M")
./rda.sh -vCRP -e PERF_START_TIME=$PRF_START,PERF_END_TIME=$PRF_END OS DB DBA INST ONET PROF PERF

so if you will schedule a crontab task let's say to 1AM with the above commands then the RDA report would be include AWR report for last the 24 hours period.

That's it.

Tuesday 13 November 2012

Parallel execution in RAC

Wrong usage of parallelism it is a strong enemy for query performance in Oracle RAC.
If you use RAC with two or more nodes and some of your TABLES or INDEXES have a "DEFAULT" value for DEGREE and INSTANCES parameters then you have troubles :).

To check if you have "DEFAULT" values for tables / indexes:

SELECT TABLE_NAME, OWNER, DEGREE, INSTANCES 
FROM DBA_TABLES WHERE INSTANCES = 'DEFAULT';

SELECT INDEX_NAME,TABLE_NAME, OWNER, DEGREE, INSTANCES 
FROM DBA_INDEXES WHERE INSTANCES = 'DEFAULT'; 

Oracle calculates DEFAULT degree of parallelism for a query by multiply the following instance parameters:

for 3 nodes RACs with 16 cores per node:
parallel_server_instances = 3
cpu_count=16
parallel_threads_per_cpu=2

So we have DEGREE= 16* 2 * 3 = 96 !!!

Here is the example of performance difference for simple query:

SQL> select degree,instances from user_indexes where index_name='IDX_TEST_2312';

   DEGREE         INSTANCES
--------------        -----------------
DEFAULT             DEFAULT

1. The query use degree with level 96.












2. The same query but with the hint to set the degree to 1.
So keep an eye the "DEFAULT" value for your tables / indexes if you use RAC with more then one node. 

That is all!

Why we live in the Universe


  Our Universe has ability to create trillions of stars, planets, galaxies, life and looks we can just say that everything were create by Universe and it will be true but won't be the full true!
I understood that on some step the Universe had realized that it needs some equipment to make something new, something that could not be created directly even with all power that it has.
WE ARE that equipment, we are its children. We can create things which would not be created without us. I'm talking about buildings, computers, dresses, pillows, aircrafts and everything that you can see each time around of you.
   We filling up the Universe with a new sense that it could not have without us. And during the millions of years it follow us and changing something to make us better.

Saturday 10 November 2012

Torus Energy World

It is not about the Oracle today :)

but this is a very investigation about all of us and I hope it will be interesting for you as well:


Friday 9 November 2012

Slow connection to Oracle


   About two years ago I was investigating a request from DEV team about slow connection to the database. The problem looked strange for me since we had two databases in one RAC and one had a version 10.2.0.4 and the other one was 11.1.0.7. The issue with slow connection was only for 11.1.0.7 database.
After long digging I found that one of two DNS servers in /etc/resolv.conf was unreachable. I had commented the bad DNS and the issue with slow connection has gone.
   Two months later the same problem was reported on the support.oracle.com like a bug that fixed in version 11.2.0.2. Note ID 561429.1.

So if you experiencing the same problem then just do the same!

Wednesday 7 November 2012

Speed up TEXT search.

My friends were searching the better solution to speed up search engine for text data and asked me about any recommendations regarding that. I did research and found very nice project Scotas. It is a realization of Solr/Lucene search engine inside the Oracle RDBMS.

This very interesting solution has the following features:
OJVM integrated
Partitioning support
Encrypted/Compressed Storage
Sarbanes Oxley (SOX)/HIPAA/PCI
IOT Tables
Solr Query Syntax
Highlighting, faceting, etc
Multiple tables-columns definition
Complex data types
Complex Text Analysis
Parallel Indexing
Rich Composite Domain Index
Transactional storage
On-line backup
NRT Updates/ RT deletes
Per index isolated storage

I hope it will be useful for you.