Saturday, October 3, 2015

SYSTEM REFRESH/SYSTEM COPY using Export – Import

SYSTEM REFRESH


SYSTEM REFRESH using Export – Import
Required DVDs,
Master DVD:   51033208_11
The remaining DVDs you will get in the slides

Executing Sapinst in the source system NW2

 
 
   TRNG999 is the source system Host Name

                                                        
      Giving the location where the export file will be stored
 
 
 
IMPORTING THE EXPORTED FILE-

 
                                                
     NW3 is the target system name
 
 
 
 
 
 
 
 

 
 
 
                                                    
     I have done the system refresh in the same Host TRNG999
 
  
 
 

                                       
    Browse the exported file directory
 
System Copy Successfully Completed…. Now enjoy the new system. 
 ------------------------------------------------------------------------------------
Homogeneous System Copy using Online/Offline Database Backup
This guide is prepared for a Homogeneous System Copy using Online/Offline Database Backup. Steps for a Homogeneous system copy are briefly as below:
Preparations on Target System.
Restore Online/Offline Backup of Source System onto Target System.
Create CONTROLFILE creation script on Source System.
Modification of CONTROLFILE script and creation of CONTROLFILEs of Target System.
Recovery of Oracle Database on Target System.
Completion of System Copy


Prerequisites


Following conditions must be provided to copy a system:
Both Source and Target Systems must have Same Operating System and Database System. Also Patch levels must be same.
You have sufficient free space for sapdata directories on target system. For Windows systems, you have to create all drives where datafiles resides on source system.
Use most current database backup 
in order to shorten database creation time.

Procedure
1. Data and Log directories on target system must be cleaned before restoring source database.
Here below are the commands to clean directories. Before this, you have to stop all SAP and Oracle processes.

# su - <targetsid>adm
# stopsap all
# exit
# su – ora<targetsid>
# lsnrctl stop
# exit
# cd /oracle/<SID>/
# rm –rf sapdata?/*
# rm –rf origlog?/*
# rm –rf mirrlog?
# rm –rf sapreorg/*
# rm –rf saparch/*
# rm –rf saptrace/usertrace/*
# rm –rf saptrace/background/*
# rm –rf sapbackup/*
# rm –rf sapcheck/*

On Windows systems, SAP and Oracle services can be stopped via the following commandline program after logging as <sid>adm:
ntscmgr stop SAP<SID>_<SYSNO> ntscmgr stop SAPOSCOL
ntscmgr stop OracleService<SID>

2. You have to resize the following file systems before restore process. Take into account sizes of source system.
/oracle/<SID>/sapdata1
/oracle/<SID>/sapdata2
/oracle/<SID>/sapdata3
/oracle/<SID>/sapdata4
/oracle/<SID>/sapdata5
/oracle/<SID>/sapdata6
/oracle/<SID>/saparch

3. After cleaning necessary file systems/directories, you have to restore most current database backup to target system. For this, find the detail backup log (e.g. bdkxxsrh.anf) for that backup on source system. You can determine this from back<SID>.log summary backup log file or using DB12.
On Windows systems, while restoring source database on target system, you have to keep
same mount points for Oracle Data Directories.
For example if all of your source data directories resides on "d:>" disk
(d:\oracle\<SSID>\sapdatax), then you have to create data dirs. at target system on "d:>" disk.
After restore process, you can change the directories. For example you can distribute sapdatax
directories on many disks. This will be mentioned in CONTROLFILE creation step later.

3.a. Mount the necessary backup volume on target system.
3.b. Use the following command to begin restore:
# su - ora<tsid>
# cd sapbackup
# brrestore -m full -b <det_log_file> -c (det_log_file= for example bdkxxsrh.anf)
At the first step of restore, system will recognize that the Oracle SID is different on target machine (where the restore command executed) and in backup. Also, Oracle_Home parameters in backup and in current system will be different and recognized by brrestore. But the restore command will restore the datafiles to match current systems file system. Here is a sample log of a restore.

All the datafiles and online redolog files (only for Offline DB Backup) must be successfully restored. At this step, there are 3 probability that must be take into account for the following steps. You are using an online database backup of source system to create target system. You have to find and put all archive files created during online backup into target systems archive directory to be able to recover database. You can also apply all the archives created from the online backup start time to latest available. You are using an offline database backup of source system which is running in ARCHIVELOG mode to create target system. You may find the archive files created after offline backup on source system to make database current on target system via applying during recovery. You are using an offline database backup of source system which is running in NOARCHIVELOG mode to create target system. You don't have any archive files created on source system so you don't need anything.
Those differences will be detailed in recovery step.
4. After restoring datafiles and redolog files, a scripts must be prepared on source system to create CONTROLFILE of target system. For this you have 2 option.
4.a. You can use R3COPY program which is under "/kernel/UNIX/COMMON" directory of Kernel CD. This program can be used only on UNIX systems. For Windows systems, "4.b" option must be used.
Run this program by ora<sid> user on source system. After some confirmations, execute
step "(a) Source system: Generating the script CONTROL.SQL".
This will create a script named CONTROL.SQL under /oracle/<SSID>/sapreorg directory.
Copy this script into target system (any directory). This file is ready for execution and doesn't
require any modification.


4.b. SVRMGRL or SQLPLUS can create a scrpit to create controlfile using current CONTROLFILE content. Login to source system as ora<sid> user and execute the following SVRMGRL/SQLPLUS commands. To be able to execute following commands, database must be at least in MOUNT mode..
# svrmgrl
SVRMGR> connect internal
SVRMGR> alter database backup controlfile to trace;
SVRMGR> exit
As a result of this command, a trace file (e.g. ora_54764_hvd.trc ) will be created under /oracle/<SSID>/saptace/usertrace directory. File can be determined by sorting according to modification/creation dates (UNIX: # ls –ltr). Most current file must be cheched.
You have to edit this file to be able to use for CONTROLFILE creation on target system.
Rename file name as CONTROL.SQL. Open file to edit using VI (UNIX) or NOTEPAD (WIN).
Remove all lines before "STARTUP MOUNT" line. Delete all commented "#" lines. Also remove all lines after CHARACTER SET WE8DEC;" line. Change all Source SID's to Target SID via following commands.
UNIX (VI): :%s/<SSID>/<TSID>/g
WIN (NOTEPAD): CTRL+H
Change the line CREATE CONTROLFILE REUSE DATABASE ‘SSID’ NORESETLOGS ARCHIVELOG;
as follow
CREATE CONTROLFILE REUSE SET DATABASE ‘TSID’ RESETLOGS ARCHIVELOG;
If you want to change datafile or redolog file destinations, first move the files on target destination at OS level, then edit CONTROL.SQL file for new destinations.

5. After CONTROL.SQL script preparation, following commands must be run to create
CONTROLFILE of target system:
# su – ora<targetsid>

# svrmgrl
SVRMGR> connect internal
SVRMGR> @/<path_to_file>/control.sql
You have to guarantee the successful completion of this command as follow:
SVRMGR> @control.sql
Statement processed.
SVRMGR>
6. Database will be in inconsistent status after creation of CONTROLFILE. This can be viewed by trying to open the database.
SVRMGR> alter database open;
alter database open
*
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SVRMGR> alter database open resetlogs;
alter database open resetlogs
*
ORA-01195: online backup of file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/oracle/<hedefSID>/sapdata1/system_1/system.data1'
At this step, a recovery must be made in order to be able to use the database.
7. 3 type of recovery can be made, according to your status mentioned at the end of STEP-3. all the
recovery types must be used by "USING BACKUP CONTROLFILE" as CONTROLFILE is created manually.
7.a. If your source system is runnig in NOARCHIVELOG mode, then you have to use the following command to recover database.
SVRMGR> recover database using backup controlfile until cancel;
7.b. If you restored an online backup on target system and put all the archive files created since online backup start time, use the following commands.
SVRMGR> recover database using backup controlfile;
After execution of this command, Oracle will ask for archive files to be consistent. As archive files contains only database changes commands, you will use source system archive file on new systems database recovery. Copy all archive files created since online backup on source system to archive directory of target system. Archive file names are different from asked during recovery session. You can change archive file names for target system via the
following script.
cd /oracle/<TSID>/saparch
for i in `ls|grep <SSID>`;
do
file_name=`echo $i |cut -dD -f2`;
mv $i <TSID>${file_name};
done
Alternatively you can enter file names manually as required by recovery session as follow:
SVRMGR> recover database using backup controlfile;
ORA-00279: change 44138924 generated at 03/26/2003 00:00:24 needed for thread 1
ORA-00289: suggestion : /oracle/HVS/saparch/HVSarch1_22746.dbf

ORA-00280: change 44138924 for thread 1 is in sequence #22746
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/oracle/HVS/saparch/HVDarch1_22746.dbf
Log applied.
After application of all necessary archives (at least all the archives created during online backup must be applied. Archives from this point can be applied to make database current), next request for archive is cancelled via CANCEL command.
ORA-00279: change 44164157 generated at 03/26/2003 01:58:29 needed for thread 1
ORA-00289: suggestion : /oracle/HVS/saparch/HVSarch1_22754.dbf
ORA-00280: change 44164157 for thread 1 is in sequence #22754
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
Media recovery cancelled.
SVRMGR>
But recovery session must be started with the following command and cancelled again to be able to start database.
SVRMGR> recover database using backup controlfile until cancel;
ORA-00279: change 44164157 generated at 03/26/2003 01:58:29 needed for thread 1
ORA-00289: suggestion : /oracle/HVS/saparch/HVSarch1_22754.dbf
ORA-00280: change 44164157 for thread 1 is in sequence #22754
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
Media recovery cancelled.
SVRMGR>
Otherwise following error will arise during database opening.
SVRMGR> alter database open resetlogs;
alter database open resetlogs
*
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/oracle/HVS/sapdata1/system_1/system.data1'
To open database, use the following command:
SVRMGR> alter database open resetlogs;
Statement processed.
SVRMGR>
7.c. If you restored an offline backup on target system, you can recover database to the time of backup completed or you can recover database to the most current status using archive files. The archive application and statup of database is same as an online backed up database copy in "7.b".
8. after opening database, LISTENER process must be started.
# su – ora<targetsid>
# lsnrctl start

9. To open SAP system, use the following commands.
# su - <targetsid>adm
# startsap

10. As your Hardware Key is not changed, you don't have to get additional License Key from
SAPNET. You can use previous systems (on target system, if SID is not changed) License in new
system created on target system.
11. Logon to the SAP R/3 System and goto TCODE SE06. Select "Database Copy or Migration" and
execute "Post Installation Processing".

Change all of the Source System Objects to Target System Objects as asked.
12. Delete old TMS configuration and make new configuration for TMS via STMS TCODE.
13. After all of above steps, you have completed a System Copy using Online/Offline Database
Backup.

Unix + AIX Commands for Basis consultant + Oracle

Unix and AIX Commands for Basis and Oracle DBA consultant

This quick reference lists commands, including a syntax diagram and brief description. […] indicates an optional part of the command. For more detail, use: man command
These command are more then enough for Oracle DBA and SAP BASIS Consultant. If you can remember these commands then no need to refer any fat fat books of Unix and AIX.
1. Files
1.1. Filename Substitution
Wild Cards                                                                    ? *
Character Class (c is any single character)                       [c…]
Range                                                                          [c-c]
Home Directory                                                             ~
Home Directory of Another User                                     ~user
List Files in Current Directory ls                                      [-l]
List Hidden Files                                                           ls -[l]a
1.2. File ManipulationDisplay File Contents                                                     cat filename
Copy                                                                           cp source destination
Move (Rename)                                                            mv oldname newname
Remove (Delete)                                                           rm filename
Create or Modify file                                                     pico filename
1.3. File Properties
Seeing Permissions                                                       ls -l filename
Changing Permissions                                                   chmod nnn filename
Setting Default Permissions                                            umask ugo
ugo is a (3-digit) number. Each digit restricts the default
permissions for the user, group, and others, respectively.
Changing Modification Time                                           touch filename
Making Links                                                                ln [-s] oldname newname
Seeing File Types                                                          ls -F
1.4. Displaying a File with less
Run less                                                                       less filename
                                                                                        Next line RETURN
                                                                                        Next Page SPACE
                                                                                        Previous line k
                                                                                        Previous Page b
1.5. Directories
Change Directory                                                          cd directory
Make New Directory                                                      mkdir directory
Remove Directory                                                         rmdir directory
Print Working (Show Current) Directory                           pwd
 2. Commands
2.1. Command-line Special CharactersQuotes and EscapeJoin Words                                                                       "…"
Suppress Filename, Variable Substitution                            '…'
Escape Character                                                              \
Separation, Continuation
Command Separation                                                        ;Command-Line Continuation (at end of line)                        \
2.2. I/O Redirection and Pipes
Standard Output                                                                >
(overwrite if exists)                                                             >!
Appending to Standard Output                                            >>
Standard Input                                                                   <
Standard Error and Output                                                  >&
Filters
Word/Line Count                                                                wc [-l]
Last n Lines                                                                       tail [-n]
Sort lines                                                                           sort [-n]
Multicolumn Output                                                            pr -t
List Spelling Errors                                                             ispell
2.3. Searching with grep
grep Command                                                                 grep "pattern" filename
                                                                                       command | grep "pattern"
Search Patterns
beginning of line                                                              ^
end of line                                                                       $
any single character                                                          .
single character in list or range                                         […]
character not in list or range                                             [^…]
zero or more of preceding char. or pattern                        *
zero or more of any character                                           .*
escapes special meaning                                                  \
3. C-Shell Features.
3.1 History Substitution
Repeat Previous Command                                             !!
Commands Beginning with str                                          !str
Commands Containing str                                               !?str[?]
All Arguments to Prev. Command                                    !*
Word Designators
All Arguments                                                               :*
Last Argument                                                              :$
First Argument                                                              :^
n'th Argument                                                               :n
 4. Processes
Listing                                                                          ps [-[ef]]Terminating                                                                  kill [-9] PID
 5. Users
Seeing Who is Logged In                                                 who
Seeing Your User Name                                                  whoami
6. Managing Files
6.1. Looking Up Files
Standard Commands                                                    whereis file
Aliases and Commands                                                 which commandDescribe Command                                                      whatis command
Searching Out Files                                                       find dir -name name -print                                                       dir is a directory name within which to search.
                                                       name is a filename to search for.
6.2. Finding Changes
Comparing Files                                                           diff leftfile rightfile                                               diff prefixes a less-than (<) to selected lines from leftfile
                                               and a greater-than (>) to lines from rightfile.
6.3. Managing Disk Usage
Check Quota                                                                quota -vSeeing Disk Usage                                                        df                                                                                  du -s6.5. Combining and Compressing Files
Create a tarfile                                                            tar cf file.tar file1 file2 … fileN
                                                       tar combines files but does not compress
Create a zipfile                                                            zip filename
Unzip a file                                                                  unzip filename

Common UNIX Commands
These are the common UNIX commands Oracle DBAs would use. I have provided brief explanation of commands and examples. In UNIX, most commands have a lot of options available. For a complete list of options, see the UNIX online manual pages. All UNIX commands and file names are case sensitive. This page is to let you know the commands in UNIX, which might give you a start to learn more about the command using the manual pages or from UNIX books.

manman commandManual Pages - Help with any UNIX command
man psHelp on the UNIX ps command
clearclearTo clear the screen
pwdpwdPresent / Current Working Directory
cdcd [directoryname]Change directory, without argument will change your working directory to your home directory.
cd workChange working directory to "work"
cd ..Change working directory to parent directory (.. is parent and . is current directory)


lsls [-options] [names]List files. [names] if omitted, will list all files and subdirectories in the directory. Wild cards can be specified.
ls -lList files with date and permissions
-rw-rw-r-- 1 oracle dba 706 Sep 23 17:26 storparms.sql  -rwxrwx--- 1 oracle dba 377 Aug 28 15:00 sysdelstat.sql  drwxrwxr-- 2 oracle dba 2048 Oct 22 16:12 work 
[column1]      [2]   [3] [4] [5]     [6]     [7] 
Column1 - Permissions of the file or directory; r-read, w-write, x-execute
Position 1 indicates if it is a directory
Positions 2-4 is the permission for owner
Positions 5-7 is the permission for group
Positions 8-10 is the permission for others
Column2 - Owner of the file/directory
Column3 - Group which the owner belogs to
Column4 - Size of the file in bytes
Column5 - Last Modified Date
Column6 - Last Modified Time
Column7 - Name of the file/directory
ls -alList files with date and permissions including hidden files
ls -ltList files with date, sorted in the date modified
ls -ltr bt*List files with date, sorted in the date modified, oldest first, with filenames starting with bt


Wildcards*Any character, any number of positions
?Any character, one position
[]A set of characters which match a single character position.
-To specify a range within []
ls *x*List all files which contains an x in any position of the name.
ls x*List all files which start with x
ls *T0[1-3]ZZList all files which contain T0 followed by 1,2 or 3 followed by ZZ. The following files match this condition:
analyzeall.AAAT01ZZ
dbaoc_err.AAAT03ZZ
dbstart_log.AAAT03ZZ
calerterr.AAAT01ZZ
dbaoc_log.AAAT01ZZ
ls job?.sqlList files which start with job followed by any single character followed by .sqlExample: jobd.sql jobr.sql
ls alert*.???[0-1,9]
alert_AAAT01ZZ.1019
alert_AAAD00ZZ.1020
alert_AAAI09ZZ.1021
touch -touch filenameCreate a 0 byte file or to change the timestamp of file to current time (wild cards as above can be used with the file names)
mkdirmkdir directorynameCreate Directory


mkdir -p directorypathCreate directory down many levels in single passmkdir -p /home/biju/work/yday/tday


rmdirrmdir directorynameRemove directory
rmrm filenameRemove file
rm -rf directorynameRemove directory with files. Important - There is no way to undelete a file or directory in UNIX. So be careful in deleting files and directories. It is always good to have rm -i filename for deletes
cpcp filename newfilenameCopy a file
cp -r * newlocTo copy all files and subdirectories to a new location, use -r, the recursive flag.
mvmv filename newfilenameRename (Move) a file. Rename filename to newfilename.
mv filename directorynameMove filename under directoryname with the same file name.
mv filename directoryname/newfilenameMove filename to directoryname as newfilename.
mv * destinationIf you use a wildcard in the filename, mv catenates all files to one sigle file, unless the destination is a directory.
cp -i file1 file2
mv -i file1 file2
rm -i file*
Use the -i flag with rm, mv and cp to confirm before destroying a file.
filefile filenameTo see what kind of file, whether editable. Executable files are binary and you should not open them.
file d*dbshut: ascii text
dbsnmp: PA-RISC1.1 shared executable dynamically linked -not stripped
dbstart: ascii text
dbv: PA-RISC1.1 shared executable dynamically linked -not stripped
demobld: commands text
demodrop: commands text
vivi filenameEdit a text file. Vi is a very powerful and "difficult to understand" editor. But once you start using, you'll love it! All you want to know about vi are here. More vi tricks later!!
catcat filenameSee contents of a text file. cat (catenate) will list the whole file contents. Cat is mostly used to catenate two or more files to one file using the redirection operator.
cat file1 file2 file3 > filesCatenate the contents of file1, file2 and file3 to a single file called files. If you do not use the redirection, the result will be shown on the standard output, i.e., screen.


more
page
more filename
page filename
Show the contents of the file, one page at a time. In more/page, use space to see next page and ENTER to see next line. If you wish to edit the file (using vi), press v; to quit press q.
tailtail -n filenameTo see the specified number of lines from the end of the file.


headhead -n filenameTo see the specified number of lines from the top of the file


envenvTo see value of all environment variables.
To set an environment variable:In ksh or sh "export VARIABLENAME=value", Note there is no space between =.
In csh "setenv VARIABLENAME value"
echo $VARIABLENAMESee value of an environment variable
echoecho stringTo print the string to standard output
echo "Oracle SID is $ORACLE_SID"Will display "Oracle SID is ORCL" if the value of ORACLE_SID is ORCL.
lplp filenameTo print a file to system default printer.
chmodchmod permission filenameChange the permissions on a file - As explained under ls -l, the permissions are read, write, execute for owner, group and others.
You can change permissions by using numbers or the characters r,w,x. Basically, you arrive at numbers using the binary format.Examples:
rwx = 111 = 7
rw_ = 110 = 6
r__ = 100 = 4
r_x = 101 = 5
chmod +rwx filenamechmod 777 filenameGive all permissions to everyone on filename
chmod u+rwx,g+rx,o-rwx filenamechmod 750 filenameRead, write, execute for owner, read and execute for group and no permission for others
chownchown newuser filenameChange owner of a file
chgrpchgrp newgroup filenameChange group of a file


chown newuser:newgroup filenameChange owner and group of file
compresscompress filenameCompress a file - compressed files have extention .Z. To compress file you need to have enough space to hold the temporary file.
uncompressuncompress filenameUncompress a file
dfdf [options] [moutpoint]Freespace available on the system (Disk Free); without arguments will list all the mount points.
df -k /ora0Freespace available on /ora0 in Kilobytes. On HP-UX, you can use "bdf /ora0".
df -k .If you're not sure of the mount point name, go to the directory where you want to see the freespace and issue this command, where "." indicates current directory.
dudu [-s] [directoryname]Disk used; gives operating system blocks used by each subdirectory. To convert to KB, for 512K OS blocks, divide the number by 2.
du -sgives the summary, no listing for subdirectories
findFind files.find is a very useful command, searches recursively through the directory tree looking for files that match a logical expression. It has may options and is very powerful.
find /ora0/admin -name "*log" -printSimple use of find - to list all files whose name end in log under /ora0/admin and its subdirectories
find . -name "*log" -print -exec rm {} \;to delete files whose name end in log. If you do not use the "-print" flag, the file names will not be listed on the screen.
grepGlobal regular expression printto search for an expression in a file or group of files. grep has two flavours egrep (extented - expands wild card characters in the expression) and frep (fixed-string - does not expand wild card characters). This is a very useful command, especially to use in scripts.
grep oracle /etc/passwdto display the lines containing "oracle" from /etc/passwd file.
grep -i -l EMP_TAB *.sqlto display only the file names (-l option) which contains the string EMP_TAB, ignore case for the string (-i option), in all files with sql extention.
grep -v '^#' /etc/oratabdisplay only the lines in /etc/oratab where the lines do not (-v option; negation) start with # character (^ is a special character indicating beginning of line, similarly $ is end of line).
ftpftp [hostname]File Transfer Protocol - to copy file from one computer to another
ftp AAAd01hpinvoke ftp, connect to server AAAd01hp.
Connected to AAAd01hp.com.
220 AAAd01hp.com FTP server (Version 1.1.214.2 Mon May 11 12:21:14 GMT 1998) ready.
Name (AAAd01hp:oracle):BIJU
program prompts for user name, enter the login name to AAAd01hp.
331 Password required for BIJU.
Password:
enter password - will not be echoed.
230 User BIJU logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ascii
Specifying to use ASCII mode to transfer files. This is used to transfer text files.
200 Type set to A.
ftp> binary
Specifying to use binary mode to transfer files. This is used for program and your export dump files.
200 Type set to I.
ftp> ls
To see the files in the remote computer.
200 PORT command successful.
150 Opening ASCII mode data connection for /usr/bin/ls.
total 8
-rw-rw-rw- 1 b2t dba 43 Sep 22 16:01 afiedt.buf
drwxrwxrwx 2 b2t dba 96 Jul 9 08:47 app
drwxrwxrwx 2 b2t dba 96 Jul 9 08:49 bin
-rw-rw-rw- 1 b2t dba 187 Jul 30 14:44 check.sql
226 Transfer complete.
ftp> get check.sql
transfer the file check.sql from the remote computer to the local computer. The file will be copied to the present directory with the same name. You can optionally specify a new name and directory location.
200 PORT command successful.
150 Opening BINARY mode data connection for check.sql (187 bytes).
226 Transfer complete.
187 bytes received in 0.02 seconds (7.79 Kbytes/s)
ftp> !ls
! runs commands on the local machine.
AAAP02SN a4m08.txt tom3.txt
a4m01.txt
ftp> put a4m01.txt/tmp/test.txt
transfer file from local machine to remote machine, under /tmp directory with name test.txt.
mailmail "xyz@abc.com" < message.logMail a file to internet/intranet address. mail the contents of message.log file to xyz@abc.com
mail -s "Messages from Me" "xyz@abc.com" "abc@xyz.com" < message.logmail the contents of message.log to xyz and abc with a subject.
whowho [options]to see who is logged in to the computer.
who -TShows the IP address of each connection
who -rShows when the computer was last rebooted, run-level.
pspsprocess status - to list the process id, parent process, status etc. ps without any arguments will list current sessions processes.
ps -full listing of my processes, with time, terminal id, parent id, etc.
ps -efas above for all the processes on the server.
killkill [-flag] processidto kill a process - process id is obtained from the ps command or using the v$process table in oracle.
kill 12345Kill the process with id 12345
kill -9 12345To force termination of process id 12345
scriptscript logfilenameto record all your commands and output to a file. Mostly useful if you want to log what you did, and sent to customer support for them to debug. start logging to the logfilename. The logging is stopped when you do "exit".
hostnamehostnamedisplays the name of the computer.
unameuname -ato see the name of the computer along with Operating system version and license info.
datedatedisplays the current date and time.
date "+%m%d%Y"displays date in MM/DD/YYYY format