iSelfSchooling.com - Since 1999  References  |  Job Openings
    Home  | Search more  | Oracle Syntax  | Computer Institute   | (Login or Register to access to VIDEOS)
 

Copyright & User Agreement

   Suggestions Email2aFriendHomepage us! |  Bookmark

Services

  Vision/Mission

  Services

  Biography

  Contact Us

 FREE Training

  Start...

  SQL

  PL/SQL

  Forms 

  Reports

  DBA Fundamentals

  Performance

  Prepare for OCP

  ShareUrNotes

...

  Acknowledgement

  Who is who

  University Directory

  Links...

 

 

 

 

Subject:  Quick UNIX and LINUX notes for Oracle DBAs (Good to know)

 

More Resources by Google:

 

Quick UNIX and LINUX notes for Oracle DBAs

The following are the commands that you, as a DBA,

 do not need to know but it is good to know.

INDEX

 

Apache Web Server

 

 

 

 

 boot

cpio

devfsadm

format

groupadd

groupdel

init

isainfo

java

ln

mount

mt

 

 

 

patchadd

patchrm

prtconf

showrev

sync

symsm

sync

tar

ufsdump

ufsrestore

 

umount

uname

useradd

userdel

wget

psrinfo

Volume Manager

 

 

 

 

cpio

Copy file archives in and out.

Example:

$cd /etc                                                  #Go to directory that you want to have a backup.

$ls | cpio –oc > /u01/cpio_bkup                #Copy all files in /etc to the /u01/cpio_bkup file.

$mkdir /u01/copyhere                      #Make a directory.

$cd /u01/copyhere                      #Change directory to the created directory.

$cat /u01/cpio_bkup | cpio –ic  #Read cpio_bkup file and copy all data into the current directory.

$ls | cpio –oc > /dev/rmt/0                              #Copy all ls output files into tape device.

Back to index


devfsadm

Administration command  for  /dev  and    /devices.

Example;

$cd /dev/rmt                                          #Check the content of the /dev/rmt directory.

$devfsadm –c tape                        #A new tape device was added to the system.

$cd /dev/rmt                                          #Check the differences.

$mt status                                              #Check your magnetic tape status.

$dttape init /dev/rmt/0 –volume X                #Initialize the tape using datatools.

$obacktrack                                           #Use obacktrack if you have sqlback track.

Back to index


format

Disk partitioning and maintenance utility (Unix/Solaris only).

Example;

$format                                                   #Disk partitioning and maintenance utility.

Back to index

 


init

Initialize your server.

Example:

$su root

$init 0                                                     #Shutdown the server and have OK prompt.

$init 6                                                     #Reboot the server.

$reboot                                                  #Reboot the server.

Back to index

 


boot

On the OK prompt, you can boot.

Example:

$ok boot                                                #Boot from default disk.

$ok boot cdrom                                    #Boot from cdrom

$ok boot 2th_boot_disk                      #Boot from a different boot disk.

$ok nvalue /2th_boot_disk /…/….    #Define an alias for the second boot disk.

$ok nvstore                                           #Save the alias.

Back to index

 


groupadd

Add a Unix/Linux group account.

Example:

$more /etc/group|grep dba                         #Check to see if the group exists.

$groupadd –g dba                         #If not add a group.

$more /etc/group|grep dba                         #Check to see that the group was added.

Back to index

 


groupdel

Delete a Unix/Linux group account.

Example:

$more /etc/group|grep dba                         #Check to see if the group exists.

$groupdel dba                                      #Delete a group.

$more /etc/group|grep dba                         #Check to see that the group was deleted.

Back to index

 


isainfo

Describe instruction set architectures.

Example:

$isainfo –v                                            #Describe instruction set architectures (64bits or 32bits).

Back to index

 


java

Display java version or other information.

Example:

$java –version                                      #Display java full version.  

Back to index

 


ln

Assign a symbolic link.

Example:

$cd /u01                                                 #Change your directory.

$df –k > myfile                                      #Create a file that contains disk space allocation.

$more myfile                                          #Display the file content.

$mkdir mylinkdir                                   #Create a directory for all your links.

$ln –s /u01/myfile /u01/mylinkdir/mylink

                                                                #Create a link.

$more /u01/mylinkdir/mylink          #Display the link file content.

Back to index

 


mount

Mount a device.

Example:

$mount /dev/rmt/1 /mnt                     #Mount a second external tape device.

$mount /dev/dsk/c3t1d0s0 /mnt     #Mount a disk device.

$mount 127.0.0.1:/cdrom/cdrom0 /mnt

                                                                #Mount your disktop cdrom or if a server does not have cdrom.

Back to index

 


mt

A device status.

Example:

$mt -f /dev/rmt/0 status

Back to index

 


patchadd

Apply single patch to your O/S.

Example:

$patchadd patch_number                      #Add a single patch to your O/S.

Back to index

 


patchadd

Add multiple patches to your O/S.

Example:

$cd /../patches                                      #Change directory to downloaded patches.

$for i in ‘ls –l 1*’;do                    #For all patches that their numbers start from 9.

$patchadd $i                                         #Read each patch number.

$done                                                     #Apply patches.

Back to index

 


patchrm

Remove a single patch from your O/S.

Example:

$patchrm patch_number                      #Remove a single patch from your O/S.

Back to index

 


prtconf

Print system configuration.

Example:

$prtconf                                         #Print all system configuration.

$prtconf | grep Mem                       #Print the size of system memory.

 

$prtstat   #For memory usage

Back to index

 


psrinfo

Print process system configuration.

Example:

$psrconf -v                                                 #Print all process system configuration.

Back to index

 


showrev

Display the latest release of your applied patches.

Example:

$showrev –p |grep patch_number                #Display the latest information about your patches.

Back to index

 


symsm  

Symplicity Storage Manager Tool

Example:

$/usr/lib/symsm/bin/symsm &     #Execute the Symplicity Storage Manager Tool.

Back to index

   


sync

Synchronize your system. Do this before your shutdown.

Example:

$sync;sync;sync;halt                         #Before halting your system, synchronize the system.

Back to index

 


tar

Tar to a tape.

Example:

$cd /u01/app/oracle                    #Change to a directory that you want to tar all information to a tape.

$tar –cvf  /dev/rmt/0 .                            #Copy all the current information to a tape.

$tar –tvf /dev/rmt/0                              #Display the tape table of contents.

$tar –xvf /dev/rmt/0                              #Extract files from tape.

Back to index

 


umount

Un-mount the file system device.

Example:

$cd /                                                       #Go to route sub-directory.

$mkdir u01                                             #Make a directory.

$mount /dev/dsk/c3t1d0s5 /u01     #Mount it.

$cd /u01                                                 #Change your current directory to /u01. Add files to it.

$cd /                                                       #Go back to route directory (make sure you are not using /u01 device).

$umount                                                                #umount it.

$cd /u01                                                 #Change your current directory to /u01 (what do you see?).

Back to index

 


uname

Print name of current system.

Example:

$uname –a                                             #Print name of current system with all information (-a).

Back to index

 


ufsdump

Dump a system file incrementally.

Example:

$umount                  /u01                                        #Un-mount the device that you want to do a dump.

$ufsdump 0uf /dev/rmt/0 /dev/rdsk/c3t1d0s0

                                                                #Dump un-mounted device into a tape.

$ufsdump 0uf /u01dump /dev/rdsk/c3t1d0s0

                                                                #Dump un-mounted device into a disk.

                                                                # 0 – all files, u – update the dump record, f – file system device.

$mount /dev/rdsk/c3t1d0s0 /u01     #Mount the device that you have dumped.

#Don’t forget when you un-mount and mount a file system, change the vfstab file also if needed.

Back to index

 


ufsrestore

Restore a system file.

Example:

$mount /dev/rdsk/c3t1d0s0 /u01     #Mount the device that you want to restore a file system.

$cd /u01                                                 #Change the directory to the mounted device.

$ufsrestore tvf /dev/rmt/0                              #Show the table of contents from tape.

$ufsrestore rvf /dev/rmt/0                              #Restore recursively from tape to /u01.

                                                                # r – restore recursively, v – verbose, and f - file system device.

Back to index

 


useradd

Add a Unix/Linux user account.

Example:

$more /etc/shadow|grep oracle     #Check to see the Oracle user exists.

$userdel –r oracle                                 #Delete it and also its default directory.

$mkdir /home/app                                #Make the Oracle default directory.

$chown oracle /home/app                             #Change its owner to the ‘oracle’ user.

$useradd –u 1001 –d /home/app –s /bin/ksh oracle

                                                                #Create oracle user with default directory /home/app and

                                                                #user id 1001, password ‘pass’ and default shell (korn shell).

$more /etc/shadow|grep oracle     #Check to see the user was added.

Back to index

 


userdel

Delete a Unix/Linux user account.

Example:

$more /etc/shadow|grep oracle     #Check to see the Oracle user exists.

$userdel –r oracle                                 #Delete it and also its default directory (-r remove the default directory).

$mkdir /home/app                                #Make the Oracle default directory.

$chown oracle /home/app                             #Change its owner to the ‘oracle’ user.

$useradd –u 1001 –d /home/app –s /bin/ksh –p pass oracle

                                                                #Create oracle user with default directory /home/app and

                                                                #user id 1001, password ‘pass’ and default shell (korn shell).

$more /etc/shadow|grep oracle     #Check to see the user was added.

$userdel –r oracle                                 #Delete it and also its default directory (-r remove the default directory).

Back to index

 


SQL Backtrack

To backup your Oracle data, you may have sql-backtrack. Remember the following function.

Example:

$obacktrack                                           #Run SQL backtrack interactively.

Back to index

 


Networker

Quick and simple commands.

Example:

$/usr/bin/nsr/networker start                #Start networker.

$/usr/bin/nsr/networker stop                #Stop networker.

$/usr/sbin/nsr/nsrjb –Hev                 #Diagnose networker.

$tail /usr/logs/messages                            #Check error messages.

$tail -100 /usr/logs/daemon.log         #Check logs.

Back to index

 


Managing your disk (Unix/Solaris only):

 

Disksuite (Things to remember)

Volume Manager (Things to remember)

$metastat

$metastat –p

$metadb

(/dev/md/dsk/dxx, df –k, format)

$vxdisk list

$vxprint –ht

 

(/dev/vx/dsk/assetdg/assetdgvol04, df –k, format)

 

System Prameters

$ifconfig –a    #Display network interface configuration parameters

$arp –a    #Address resolution display and control

$drvconfig   #drvconfig - configure the /devices directory

$disks  #disks - creates /dev entries for hard disks attached to  the system

$devlinks   #devlinks - adds /dev entries for miscellaneous  devices  and pseudo-devices

 

New device:

$init 0

$ok printenv

$ok setenv auto_boot? False

$ok reset_all

$ok probe_scsi_all

$ok set auto_boot? True

$ok boot

$format

$newfs /dev/rdsk/c3t2d0s4

$newfs /dev/md/dsk/d15

$fsck /dev/md/dsk/d15

Back to index


 
 
Google
 
Web web site