Useful shortcuts for vi editor

Sunday 31 May 2015

How to use "for update" clause in Oracle?

You are able to lock a table to prevent executing Data Manupulation Language-DML commands like INSERT, UPDATE, DELETE by others users:

e.g.
SQL> SELECT * FROM employees FOR UPDATE;
-- in this way, other users could not execute DML command that hangs up until user sends COMMIT or ROLLBACK to release the table lock. However, other users are able to execute SELECT still.

Wednesday 27 May 2015

How to know total row number, word number and character number in Linux?

e.g.
$ wc myfile.txt
-> 5 13 56 myfile.txt 
5; total row number 
13; total word number
56; total character number

$ ls | wc -l
-> Total number of files in current directory

Monday 25 May 2015

How to configure auto reply e-mail in Office 2013?

To do that please follow the instructions:

To define auto reply;

1. define a message template

Home -> New Email-> Manage Rules & Alerts -> Enter your message -> File -> Save As "Outlook Template .oft"

2. define a rule for auto reply

Home -> Rules -> Manage Rules & Alerts ->  New Rule -> Select "Start from a blank rule-Apply rules on messages I receive" -> select own preferences -> Activate "reply using a specific template" -> Click "a specific template" by saved .oft file -> Define a name to rule -> Finish

To turn off auto reply;

Home -> Rules -> Manage Rules & Alerts -> Go Email Rules tab -> inactivate to desired rule

Sunday 24 May 2015

How to get instance name, database status and instance role in Oracle?

SQL> select instance_name, database_status, instance_role from v$instance; 

e..g.
INSTANCE_NAME    DATABASE_STATUS   INSTANCE_ROLE
---------------- ----------------- ------------------
xe               ACTIVE            PRIMARY_INSTANCE