Linux Commands

       Linux commands can be  used configure and interact with Linux OS. The linux commands can be used at the shell prompt, or command prompt (Terminal). If you are using  linux in a GUI, try with the shell programming icon. If you do not have GUI then  you should be working with the shell prompt, and if you are signing through remote then you will be at the prompt. The two types of commands are shell commands and linux commands.

Linux Commands:

The Linux commands are not  shell commands. Each linux command is a individual executable program, thats written in  C-programming language. These executable programmes are stored in various physical directories such as /bin.The $PATH variable defines  the location of the directories. These linux commands differ from the linux distrubutions, and remains similar in any shell they are being used.

 Shell Commands:

The shell program consists of the shell commands. There are different kind of shells likely  bash shell, C shell, bourne shell etc. Each shells have variance in them. The commands structure vary between shells, but each shell is same among different linux platforms.

 The Command Prompt:

The prompts look is depend on the shell you use, and the settings you have for that shell.
The bash shell have the prompt set up like the following

[adm@cric home]#

Here the user logged is adm, and the computer name is  cric where the folder is home. The password file(pwd) is to be used to get full path.


Your prompt is bound to look different, so for the purpose of this section I will just use the > to represent the prompt.
>

Linux Commands:

Some linux commands are very simple and need nothing more than the command itself.
For example the command ls (list) will simply list the names of the directories and files in the current directory...
>ls
files/
images/
index.txt
>
In this instance ls shows there are two directories, called files and images, and a text file called index.
However you can often add options or parameters, which are usually added to the command after a '-'.
Adding the option -l will give you a long listing which includes the permissions, ownership, size, date/time, and name of the files and directories...
>ls -l
drwx------ 2 bob bob 4096 Aug 22 10:31 files/
drwx------ 3 bob bob 4096 Mar 19 11:17 images/
-rwx------ 1 bob bob 284 Mar 18 10:23 index.txt
>
Another example would be adding -a (ls -a) to list ALL the files in the current directory, including hidden files.
>ls -a
.hiddenfile
files/
images/
index.txt
>
This shows there is a hidden file (hidden files have a '.' before the filename) called '.hiddenfile', as well as the two directories and index file.
You can use more that one option at a time...
>ls -la would produce a long listing format of ALL (including hidden) directories and files in the current working directory.
There are many options for some linux commands, and the best place to find out about then all is the 'man' pages. These man pages show you how to format the command, and what options and parameters there are to use with each command.

 Few Basic commands

#free  -shows free RAM space
#date -current date
#time -shows system time
#cp
-to copy a file or directory#mkdir dir1   -to create directory
#rmdir dir1    -to remove a directory


Locate command is works only on linux kernel. It displays the absolute path for the search term.locate reads from the database created by the updatedb command. Locate does not check the existance of the file. Here is the usage for the locate command.

$ locate -h
Usage: locate [OPTION]... [PATTERN]...
Search for entries in a mlocate database.

  -b, --basename         match only the base name of path names
  -c, --count            only print number of found entries
  -d, --database DBPATH  use DBPATH instead of default database (which is
                         /var/lib/mlocate/mlocate.db)
  -e, --existing         only print entries for currently existing files
  -L, --follow           follow trailing symbolic links when checking file
                         existence (default)
  -h, --help             print this help
  -i, --ignore-case      ignore case distinctions when matching patterns
  -l, --limit, -n LIMIT  limit output (or counting) to LIMIT entries
  -m, --mmap             ignored, for backward compatibility
  -P, --nofollow, -H     don't follow trailing symbolic links when checking file
                         existence
  -0, --null             separate entries with NUL on output
  -S, --statistics       don't search for entries, print statistics about each
                         used database
  -q, --quiet            report no error messages about reading databases
  -r, --regexp REGEXP    search for basic regexp REGEXP instead of patterns
      --regex            patterns are extended regexps
  -s, --stdio            ignored, for backward compatibility
  -V, --version          print version information
  -w, --wholename        match whole path name (default)

updatedb - can be run only as root. This updates or creates a database for locate utility.

# updatedb -h
Usage: updatedb [OPTION]...
Update a mlocate database.

  -f, --add-prunefs FS           omit also FS
  -e, --add-prunepaths PATHS     omit also PATHS
  -U, --database-root PATH       the subtree to store in database (default "/")
  -h, --help                     print this help
  -o, --output FILE              database to update (default
                                 `/var/lib/mlocate/mlocate.db')
      --prunefs FS               filesystems to omit from database
      --prunepaths PATHS         paths to omit from database
  -l, --require-visibility FLAG  check visibility before reporting files
                                 (default "true")
  -v, --verbose                  print paths of files as they are found
  -V, --version                  print version information

The lists of paths and filesystems to omit default to values read from
`/etc/updatedb.conf'.

The Oracle 11g Database Administrator

           The Oracle Database 11g is designed for administrators to provide an effective curriculum syllabus. You people learn and get knowledge to configure, install and maintenance of the database. When you learn the essentials of administrating the oracle database, you can develop knowledge in any of the following key focus areas of oracle database. They are

  1. Performance Management
  2. Manageability
  3. Linux Administration
  4. Security management
  5. High Availability
  6. Data Warehousing
  7. Grid maintenance
  8. Storage Server maintenance
The Oracle University curriculum is framed in the way to meet the DBA's challenges faced today.

Oracle indexes tuning

Indexes in Oracle database.

The indexes are

  • B-Tree indexes or balanced tree indexes;
  • bitmap indexes
  • partitioned indexes
  • domain indexes
  • function-based indexes

The B-Tree Indexes
  
          B-Tree Indexes are the most convenient thing when querying for a small amount of data from a large table. Indexes help out the most in reducing the i/o in this case.The bigger the table and lower the number of rows that you want to get them, then the more effective way is the index.
         
          Even if you see a book it has an index, this shows the importance of index. Even a book needs a index then think of the case of a terabyte oracle database. The reasons are a lot. When searching an article it would take huge time to find the particular area of interest but without using the index then it would to read the whole book. It's similar when you're querying against a database. so by working on the index, the database would have to read more data.
         
          The indexes improves read and update operations using sub-queries. However when updates are performed often in a table with index then every time the index has to get updated regarding the change in the oracle database. Sincethe amount of i/o is drastically increased causing burden to the DB server. So having indexes for read only table is recommended by oracle.The oracle dba should ensure the usage of the index. Otherwise its going to be a performance degrading for the oracle database.

Oracle Interview FAQ's.

  1. Explain about Oracle Catalog and  Archive log? 
           The Oracle  catalog contains tables and views which allows the oracle user to obtain the information about  database, such as what other tables and views are available, data dictionary views their attributes, constraints, etc. Oracle has hundreds of  system catalog relations, only some of which are available to the limited user.
  

     2. Give some of the  views in RMAN catalog which contains the catalog information?

           RC_DATABASE_INCARNATION
           RC_BACKUP-DATAFILE_SUMMARY
           RC_BACKUP_CORRUPTION 
           RC_BACKUP_COPY_DETAILS


3. How to find alert log file location?
   
SQL> show parameter background

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
background_core_dump                 string      partial
background_dump_dest                 string      c:\app\user\diag\rdbms\rev\rev\trace








Oracle RMAN

RMAN is a recovery management utility of oracle database. RMAN is recommended by oracle for backup and recovery. It makes the job easier for a DBA and gives flexibility to work on the database. RMAN optimizes the performance and space occupied while backup with file multiplexing and backup set compression.




Syntax for RMAN Command-line
RMAN 
[ TARGET connectStringSpec 
| { CATALOG connectStringSpec } 
| LOG ['] filename ['] [ APPEND ]
.
. 
]..
1.First create a tablespace for RMAN
 
CREATE TABLESPACE "RMAN" DATAFILE 'E:\app\solomon\oradata\revolt\rman.dbf' SIZE 100M REUSE AUTOEXTEND ON NEXT 2M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCALSEGMENT SPACE MANAGEMENT AUTO;
 
2.Create a user for rman CREATE USER rman IDENTIFIED BY rmanDEFAULT TABLESPACE rman QUOTA UNLIMITED ON rman;3. Grant privileges for the user GRANT connect, resource, recovery_catalog_owner TO rman;
4. Assign catalog
C:\>rman catalog=rman/rman

RMAN> create catalog tablespace "RMAN";
RMAN> register database;

Oracle Version Releases

Oracle Database released till now

  • Oracle 5 Database
  • Oracle 6 Database
  • Oracle 7: 7.0.16—7.3.4 Database
  • Oracle 8 Database: 8.0.3—8.0.6
  • Oracle 8i Database Release 1: 8.1.5.0—8.1.5.1
  • Oracle 8i Database Release 2: 8.1.6.0—8.1.6.3Oracle8i Database Release 3: 8.1.7.0—8.1.7.4
  • Oracle 9i Database Release 1: 9.0.1.0—9.0.1.5 (patchset as of December 2003[update])
  • Oracle 9i Database Release 2: 9.2.0.1—9.2.0.8 (patchset as of April 2007[update])
  • Oracle Database 10g Release 1: 10.1.0.2—10.1.0.5 (patchset as of February 2006[update])
  • Oracle Database 10g Release 2: 10.2.0.1—10.2.0.4 (patchset as of April 2008[update])
  • Oracle Database 11g Release 1: 11.1.0.6—11.1.0.7 (patchset as of September 2008[update])
  • Oracle Database 11g Release 2: 11.2.0.1 (released 2009-09-01)
  • Oracle Database 11g Release 2: 11.2.0.3 (by 2011)
The Latest release of Oracle is 12c the cloud control for DB console(Enterprise Manager)

Oracle 11g Overview

oracle 11g
   Oracle 11g Database is highly flexible database. The 11g is upgraded from the previous versions, by configuring the hardwares and softwares related to provide good efficiency, and employ high security in the system. The automation of the backup and recovery process, provides transparent failover capability.The auditing and performance tuning  circulates your enterprise databases with Oracle Net.

  Here are some of the features of Oracle 11g discussed here.
  • To Plan and deploy the permanent, temporary, and huge tablespaces.
  • Optimizing the disk allocation, Memory usage, and SQL queries.
  • Able to develop a powerful database management system.
  • Oracle Flashback prevents against human errors.
  • Oracle Automatic Undo Management.
  • Oracle Automatic Workload Repository and SQL Tuning are used to Diagnose and tune system performance.
  • Implementing robust security by using authorization, authentication, fine-grained auditing, and  access control
  • Maintaining high availability by using Oracle(RAC) Real Application Clusters and Oracle Active Data Guard.
  • Responding more efficiently to failure circumstances by using the Oracle Automatic Diagnostic Repository and the Oracle Repair Advisor.
  • Back up and restoring tables, tablespaces, and databases with Oracle (RMAN)Recovery Manager  and Oracle Data Pump Utilities Export and Import
  • Working with network databases, data warehouses, and VLDBs
hits count
Database | Oracle PartnerNetwork Blog