Skip to main content

Welcome to DBA Master – Database Tips, Tricks, and Tutorials

Welcome to DBA Master ! This blog is dedicated to all things related to database administration , SQL optimization , and performance tuning . Whether you're a beginner or a seasoned DBA, you'll find practical guides, troubleshooting tips, and real-world tutorials to help you work smarter with data. What to Expect: SQL performance tuning tips Indexing strategies Backup and recovery best practices High availability and replication techniques Database creation, configuration, and setup Monitoring queries and scripts for proactive performance management Migration guides across different database platforms Security essentials and best practices Recommended tools for DBAs Real-world error fixes and how to solve them Stay tuned — exciting content is coming soon. Feel free to bookmark and share: www.dbamaster.com ! Thanks for visiting!

File Commands

ls     //listout directory and file name only
ls -l or ll     //long listing
ls -lrt or ll -rt     //reverse order use time
ls -lS or ll -S     //sort by file size
ls -la or ll -a     //list out the hidden files and directory

pwd     //current/working directory
cd     //default home directory
cd directory_name     //open directory
cd ..     //change back to one step
cd -     //change previous path
cd /dir_1/dir_2/dir_3/dir_4
vdir -l     /sample/ //list the directory

mkdir directory_name     //create a directory
makdir directory_1 directory_2 directory_3     //create a multiple directory in same location
mkdir -p /dir_1/dir_2/dir_3/     //create a Parental with Subdirectory

File Create and Edit:

  1. cat     //concatenate
  2. touch
  3. vi editor
  4. nano

cat command     //(only file create, add text and extra add text)

cat > file_name     //create a new file and add the text
cat file_name     //only view the file
cat >> file_name     //old file add text
cat file_1 > file_2     //copy the file
cat -n file_name     //number all output lines
tac file_name     //reverse print

touch command (create single,multiple empty file and change file timestamps)

touch file_empty
touch file1 file2 file3     // create multiple empty files
touch -t 2001011230 file_name     //use YYMMDDhhmm instead of current time

vi editor (vi Command)

vi editor modes:


insert mode
escape mode
command mode


Insert Mode:

vi file_name (press any one a,s,i,o letter to insert)

Escape Mode:

:w     //only save file
:q     //unsave and quit(exit file)
!     //force
:wq     //save and quit
:wq!     //force save and quit

Command Mode: (Press ESC Key)

gg     //cursor goes to first lines
shfit + g     //cursor goes to last line
10gg     //cursor goes to 10th line
yy     //current line copy
3yy     //3 line copy
pp     //paste
dd     //delete the line
5dd     //delete five lines
dw     //delete single word
d5w     //delete 5 words
x     //delete single letter
10x     //delete 10 letters

Find and Replace: (Press ESC Key)

%s/source_text/target_text/g

Copy Commands:

cp file1 file2     //copy file f1 to file f2
cp oldfile /home/siva/newfile
cp -rf file1 file2

cp -R /home/siva/d1 /home/muthu/d2
nohup cp -rf /zzz/ /xxx
cp -rf /zzz/ /xxx &     //background copy
jobs     //list background process

Move Commands:

mv old_file new_file
mv old_file /home/siva/newfile
mv /home/muthu/d1 /home/siva/d2


Remove Commands:

rm filename
rm -rf filename
rmdir dir_name
//remove empty directory
rm -rf dir_name //directory which have contents

Head and Tail Commands:

head file_name     //display first 10 lines
head -5 file_name     //display first 5 lines
tail file_name     //display last 10 lines
tail -5 file_name     //display lst 5 lines
head -6 file_name|tail -2     //display 5th and 6th line only
cat file_name|head -6|tail-2

Word Commands:

wc file_name     //list of lines,words,letters
wc -c filename     //show letters only
wc -l file_name     //show lines only
wc -w file_name     //show words only
less filename
more file_name

nl file_name     //number lines of file
sort file_name     //sort lines of text files
sort file_name|uniq     //remove duplicate text
comm file_1 file_2
diff file1 file2
diff3 file1 file2 file3
cmp file1 file2
    //compare two files byte by byte
dd if=file1 of=file2 conv=ucase or lcase     //Data duplicator and used for copying and converting data

Comments

Popular posts from this blog

Oracle Database 19C Performance Tunning - PART 1

Advantages: 1. Improved Query Performance •    Optimized SQL execution plans lead to faster query response times. •    Reduces unnecessary full table scans and improves indexing strategies. •    Parallel execution tuning speeds up large data processing tasks. 2. Better Resource Utilization •    Efficient use of CPU, memory, disk I/O, and network resources. •    Reduces contention on Redo Logs, Undo Tablespaces, and Buffer Cache. •    Helps in load balancing across multiple instances in RAC (Real Application Clusters). 3. Increased System Scalability •    Ensures that the database can handle a growing number of users and transactions. •    Proper tuning allows scaling without degrading performance. •    Optimized parallel processing ensures better performance on multi-core servers. 4. Lower Infrastructure Costs •    Reduces the need for add...

Oracle RMAN Backup And Restore

RMAN: (Oracle 8) RMAN (Recovery Manager) is a utility provided by Oracle Database to perform backup, restore, and recovery operations. It is a command line tool. Features of RMAN in Oracle 19c Comprehensive Backup Capabilities: Full and incremental backups. Block-level backups for efficient data storage. Archived redo log backups. Fast Recovery Area (FRA) integration for centralized backup storage. Efficient Recovery Options: Point-in-time recovery (PITR). Complete and incomplete recovery. Flashback database capabilities for quick undo of changes. Multitenant Database Support: RMAN fully supports container databases (CDBs) and pluggable databases (PDBs). Provides flexibility to back up and recover individual PDBs or entire CDBs. Automatic Space Management: Manages disk space in the FRA. Automatically deletes obsolete backups and archived logs. Data Deduplication and Compression: Backup optimization through block-level deduplication. Built-in compression algorithms to reduce storage req...

Oracle 19c Database Software Installation in OEL8

 Pre-requisites for OS level:            Set the static IP Address     Disable the Firewall (systemctl stop firewalld & systemctl disable firewalld)     set SELINUX=permissive on /etc/selinux/config  ##Need to restart the server use init 6 Oracle Installation Pre-requisites Methods     Automatic Setup     Manual Setup      Automatic requisites Setup: (avoid step 1 to step 5): dnf install -y oracle-database-preinstall-19c Install the dependencies: curl -o oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm dnf -y localinstall oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm Manual Setup: step 1: Add the karenl parameters and values vi /etc/sysctl.conf     fs.file-max = 6815744 kernel.sem = 250 32000 100 128 kernel....