- vi myfile.txt
to open file with vi editor - vi + myfile.txt
cursor goes to end of the file - vi +200 myfile.txt
cursor goes to 200th row - :set list
:set nolist
see hidden characters or not - :set number
:set nonumber
see number of lines or not - :set paste
activate paste option before get into insert mode (to resolve the commented lines problem) - :set nopaste
deactivate paste option before get into insert mode - :[line_number]
cursor goes to desired line - l, k, h, j
cursor goes to right, up, left, down - w
cursor goes to next word - b
cursor goes to start of the current word - gg
go top - shift + g
go bottom - dd
remove row - p
paste the clipboard data - x
remove one char - yy
copy the row - u
undo last operation - o
add new row - :%d
delete all lines - /hello
find "hello" word
n
go to next searched word
N
go to previous searched word
Saturday, 22 November 2014
Useful shortcuts for vi editor
How to unlock database user account?
Please run the sql lines in SQL Editor as "sys" user;
SQL> ALTER USER "alper" ACCOUNT UNLOCK;
SQL> ALTER USER "alper" ACCOUNT UNLOCK;
Labels:
oracle
Wednesday, 19 November 2014
What are RAID levels 0/1/5/10?
Level | Minimum Disk Req. | Performance | Redundancy | Suggestions |
0 | 2 | Excellent | None | Not recommended for critical systems |
1 | 2 | Good | Excellent | |
5 | 3 | Good | Good | Best cost effective option providing both performance and redundancy. Use this for DB that is heavily read oriented. Write operations will be slow. |
10 | 4 | Excellent | Excellent | If you can afford the dollar, this is the BEST option for any mission critical applications (especially databases). |
Ref: http://www.thegeekstuff.com/2010/08/raid-levels-tutorial/
Friday, 14 November 2014
What is Oracle doing when you run commit?
The basic flow like that;
- Oracle writes that "Commit has been executed" in related table from UNDO tablespace.
- SGA buffer cache - calling LGWR (Log Writer)
- LGWR writes changed data (delta) to REDO log files
- Tables' locks are released and marked as "TRANSACTION is completed" by Oracle
Labels:
oracle
Wednesday, 12 November 2014
How to use Intersect function?
For instance, you want to see same jobs for employees that belong to different manager in employees table.
Please run the sql lines in SQL Editor as "hr" user;
SELECT job_id FROM employees
WHERE manager_id = 121
INTERSECT
SELECT job_id FROM employees
WHERE manager_id = 122;
Used Database User: HR
Please run the sql lines in SQL Editor as "hr" user;
SELECT job_id FROM employees
WHERE manager_id = 121
INTERSECT
SELECT job_id FROM employees
WHERE manager_id = 122;
Used Database User: HR
Wednesday, 5 November 2014
Linux date function examples
e.g.
date -d now
date -d today
date -d yesterday
date -d mon
date -d tue
date -d wed
date -d thu
date -d fri
date -d sat
date -d sun
date --date="1 day ago"
date --date="1 week ago"
date --date="1 month ago"
date --date="1 year ago"
date -d "+10 days"
date -d "+10 weeks"
date -d "+10 months"
date -d "+10 years"
date -d now
date -d today
date -d yesterday
date -d mon
date -d tue
date -d wed
date -d thu
date -d fri
date -d sat
date -d sun
date --date="1 day ago"
date --date="1 week ago"
date --date="1 month ago"
date --date="1 year ago"
date -d "+10 days"
date -d "+10 weeks"
date -d "+10 months"
date -d "+10 years"
Labels:
linux
[CONCAT] How to merge two strings as a single string?
Please run the sql lines in SQL Editor as "hr" user;
e.g.
select CONCAT('Bilgi havuzu ','at ozsoyler.blogspot.com') from dual;
result
Bilgi havuzu at ozsoyler.blogspot.com
Used database user: hr
Used database server: oracle xe
e.g.
select CONCAT('Bilgi havuzu ','at ozsoyler.blogspot.com') from dual;
result
Bilgi havuzu at ozsoyler.blogspot.com
Used database user: hr
Used database server: oracle xe
Monday, 3 November 2014
[INITCAP] How to make uppercase the first character of each word in a string?
Please run the sql lines in SQL Editor as "hr" user;
e.g.
select INITCAP('ozsoyler.blogspot.com') from dual;
result
ozsoyler.Blogspot.Com
Used database user: hr
Used database server: oracle xe
e.g.
select INITCAP('ozsoyler.blogspot.com') from dual;
result
ozsoyler.Blogspot.Com
Used database user: hr
Used database server: oracle xe
Tuesday, 28 October 2014
[ADVICE] Free Windows Disk Defragmenter Alternative
I strongly recommend to use Smart Defrag tool instead of classical Windows Defragmenter tool.
Labels:
defrag
Sunday, 26 October 2014
How to check NTFS file system in CMD?
Only you need to run this command.
e.g. chkntfs C:
C:\Windows\system32>chkntfs C:
The type of the file system is NTFS.
C: is not dirty.
e.g. chkntfs C:
C:\Windows\system32>chkntfs C:
The type of the file system is NTFS.
C: is not dirty.
How to define a tablespace in Windows?
Please execute the commands as "sys";
To define the tablespace:
SQL> CREATE TABLESPACE ALPER_DATA
DATAFILE 'C:\tablespaces\data_01.dbf' SIZE 128M
To alter the tablespace:
SQL> ALTER TABLESPACE ALPER_DATA ADD DATAFILE 'C:\tablespaces\data_new_02.dbf' size 128m;
To drop the datafile from the tablespace:
SQL> ALTER TABLESPACE ALPER_DATA DROP DATAFILE 'C:\tablespaces\data_new_02.dbf';
To drop the tablespace:
SQL> DROP TABLESPACE ALPER_DATA
INCLUDING CONTENTS AND DATAFILES;
To check tablespace's database files:
SQL> SELECT NAME, FILE#, STATUS FROM V$DATAFILE;
Used Oracle Version and OS: Oracle XE and Win7
To define the tablespace:
SQL> CREATE TABLESPACE ALPER_DATA
DATAFILE 'C:\tablespaces\data_01.dbf' SIZE 128M
To alter the tablespace:
SQL> ALTER TABLESPACE ALPER_DATA ADD DATAFILE 'C:\tablespaces\data_new_02.dbf' size 128m;
To drop the datafile from the tablespace:
SQL> ALTER TABLESPACE ALPER_DATA DROP DATAFILE 'C:\tablespaces\data_new_02.dbf';
To drop the tablespace:
SQL> DROP TABLESPACE ALPER_DATA
INCLUDING CONTENTS AND DATAFILES;
To check tablespace's database files:
SQL> SELECT NAME, FILE#, STATUS FROM V$DATAFILE;
Used Oracle Version and OS: Oracle XE and Win7
How to know hostname from IP in Command Prompt?
Press Windows button + R and press cmd then click "OK".
Then, write down "below command" and press enter
nbtstat -a <IP>
e.g. nbtstat -a 10.10.10.10
Then, write down "below command" and press enter
nbtstat -a <IP>
e.g. nbtstat -a 10.10.10.10
Wednesday, 22 October 2014
How to delete linux user?
# sudo userdel -r alper
-r -> Remove home directory and mail spool
-r -> Remove home directory and mail spool
Labels:
linux
Tuesday, 21 October 2014
How to run sql query in shell script?
Please add these codes into your .sh file then you can run .sh file
e.g.
ssh -q -T oracle@192.168.2.2 << EOF
sqlplus / as sysdba << EOFSQL
drop user ALPER_DB_USER cascade;
exit;
EOFSQL
EOF
e.g.
ssh -q -T oracle@192.168.2.2 << EOF
sqlplus / as sysdba << EOFSQL
drop user ALPER_DB_USER cascade;
exit;
EOFSQL
EOF
Labels:
linux,
oracle,
shell script,
sql
How to know file format description in CMD?
Please you run this command in CMD.
e.g. assoc .rar
.rar=WinRAR
e.g. assoc .txt
.txt=txtfile
e.g. assoc .rar
.rar=WinRAR
e.g. assoc .txt
.txt=txtfile
Monday, 20 October 2014
What are testing types and methods?
There are two test methods which are Black Box Testing and White Box Testing
Basically, there are two test types which are Functional and Non-functional.
For example, White & Black
Box (Mostly), Unit, Interface &
Usability, System, Regression and User Acceptance testing are Functional testing
types.
Likewise, Load & Performance,
Stress, Installation and Compatibility
& Migration testing are Non-functional testing types.
White
& Black Box Testing
White Box Testing (we know codes and are able to debug testing in
codes)
Black Box Testing (we do not know codes and act as a customer)
Black
Box Testing Types & Methods
- Equivalence partitioning (keyword is clustering)
- Boundary Value Analysis (keyword is looking boundary conditions)
- Cause Effect Graphing (keyword is causes -> intermediate nodes -> effects and reduced decision table)
Labels:
testing,
testing method,
testing type
What is the goal of testing?
The goal of testing is to reach minimum bug number and using time effectively
as person/day.
Labels:
testing
Subscribe to:
Posts (Atom)