Tuesday, November 8, 2011

Unix / Linux year wise History

Unix, Linux, and variant history

YearEvent
1957Bell Labs found they needed an operating system for their computer center that at the time was running various batch jobs. The BESYS operating system was created at Bell Labs to deal with these needs.
1965Bell Labs was adopting third generation computer equipment and decided to join forces with General Electric and MIT to create Multics (Multiplexed Information and Computing Service).
1969By April 1969, AT&T made a decision to withdraw Multics and go with GECOS. When Multics was withdrawn Ken Thompson and Dennis Ritchie needed to rewrite an operating system in order to play space travel on another smaller machine (a DEC PDP-7 [Programmed Data Processor 4K memory for user programs). The result was a system that a punning colleague called UNICS (UNiplexed Information and Computing Service)--an 'emasculated Multics'.
1969Summer 1969 Unix was developed.
1969Linus Torvalds is born.
1971First edition of Unix released 11/03/1971. The first edition of the "Unix PROGRAMMER'S MANUAL [by] K. Thompson [and] D. M. Ritchie." It includes over 60 commands like: b (compile B program); boot (reboot system); cat (concatenate files); chdir (change working directory); chmod (change access mode); chown (change owner); cp (copy file); ls (list directory contents); mv (move or rename file); roff (run off text); wc (get word count); who (who is one the system). The main thing missing was pipes.
1972Second edition of Unix released December 06, 1972.
1972Ritchie rewrote B and called the new language C.
1973Unix had been installed on 16 sites (all within AT&T/Western Electric); it was publically unveiled at a conference in October.
1973Third edition of Unix released February 1973
1973Forth edition of Unix released November 1973
1974Fifth edition of Unix released June 1974
1974Thompson went to UC Berkeley to teach for a year, Bill Joy arrived as a new graduate student. Frustrated with ed, Joy developed a more featured editor em.
1975Sixth edition of Unix released May 1975
1975Bourne shell is introduced begins being added onto.
19771BSD released late 1977
19782BSD released mid 1978
1979Seventh edition of Unix released January 1979
19793BSD released late 1979
1979SCO founded by Doug and Larry Michels as Unix porting and consulting company.
19804.0BSD released October 1980
1982SGI introduces IRIX.
1983SCO delivers its first packaged Unix system called SCO XENIX System V for Intel 8086 and 8088 processor-based PCs.
1983The GNU operating system is first announced by Richard Stallman September 27, 1983.
1984Ultrix 1.0 was released.
1985Eighth edition of Unix released February 1985
1985The GNU manifesto is published in the March 1985 issue of Dr. Dobb's Journal. The GNU project starts a year and a half later.
1986HP-UX 1.0 released.
1986Ninth edition of Unix released September 1986
1987Sun and AT&T lay the groundwork for business computing in the next decade with an alliance to develop Unix System V Release 4.
1988HP-UX 2.0 released.
1988HP-UX 3.0 released.
1989SCO ships SCO Unix System V/386, the first volume commercial product licensed by AT&T to use the Unix System trademark.
1989HP-UX 7.0 released.
1989Tenth edition of Unix released October 1989
1990AIX short for Advanced Interactive eXecutive was first entered into the market by IBM February 1990.
1991Sun unveils Solaris 2 operating environment, specially tuned for symetric multiprocessing.
1991Linux is introduced by Linus Torvalds, a student in Finland.
1991HP-UX 8.0 released.
1991BSD/386 ALPHA First code released to people outside BSDI 12/xx/1991
1992HP-UX 9.0 released.
1993NetBSD 0.8 released 04/20/1993
1993FreeBSD 1.0 released December of 1993
1994Red Hat Linux is introduced.
1994Caldera, Inc was founded in 1994 by Ransom Love and Bryan Sparks.
1994NetBSD 1.0 released 10/26/1994
1995FreeBSD 2.0 released 01/xx/1995
1995SCO acquires Unix Systems source technology business from Novell Corporation (which had acquired it from AT&T's Unix System Laboratories). SCO also acquires UnixWare 2 operating system from Novell.
1995HP-UX 10.0 released.
19954.4 BSD Lite Release 2 the true final distribution from the CSRG 06/xx/1995
1996KDE is started to be developed by Matthias Ettrich
1997HP-UX 11.0 released.
1997Caldera ships OpenLinux Standard 1.1 May 5, 1997, the second offering in Caldera's OpenLinux product line
1998IRIX 6.5 the fifth generation of SGI Unix is released July 6, 1998.
1998SCO delivers UnixWare 7 operating system.
1998Sun Solaris 7 operating system released.
1998FreeBSD 3.0 released 10/16/1998
2000FreeBSD 4.0 released 03/13/2000
2000Caldera Systems Inc. announces that Caldera Systems has entered into agreement to acquire the SCO Server Software Division and the Professional Services Division.
2001 Linus Torvalds releases version 2.4 of the Linux Kernel source code on January 4th.
2001Microsoft files a trademark suit against Lindows.com in December.
2004Lindows changes it's name to Linspire April 14, 2004.
2004The first release of Ubuntu is released October 20, 2004.

Features of UNIX

Main Features of UNIX

  • multi-user
    more than one user can use the machine at a time
    supported via terminals (serial or network connection)
  • multi-tasking
    more than one program can be run at a time
  • hierarchical directory structure
    to support the organisation and maintenance of files
  • portability
    only the kernel ( <10%) written in assembler
    tools for program development
    a wide range of support tools (debuggers, compilers)
The UNIX Operating System
Consists of
  • kernel
    schedules tasks
    manages data/file access and storage
    enforces security mechanisms
    performs all hardware access
  • shell
    presents each user with a prompt
    interprets commands types by a user
    executes user commands
    supports a custom environment for each user
  • utilities
    file management (rm, cat, ls, rmdir, mkdir)
    user management (passwd, chmod, chgrp)
    process management (kill, ps)
    printing (lpr)

Multi-User Operating Systems
A multi-user operating system allows more than one user to share the same computer system at the same time. It does this by time-slicing the computer processor at regular intervals between the various users.

In the above example, there are five users which share the processor hardware and main memory on a time basis.

We start off by giving the first user (which we will call Sophia) the processor hardware, and run Sophia's program for 1/5th of a second. When the time is up, we intervene, save Sophia's program state (program code and data) and then start running the second users program (for 1/5th of a second).

This process continues till we eventually get back to user Sophia. To continue running Sophia's program, we restore the programs code and data and then run for 1/5th of a second.

This switching between user programs is done by part of the kernel. To switch from one program to another requires,

  • a regular timed interrupt event (provided by a clock)
  • saving the interrupted programs state and data
  • restoring the next programs state and data
  • running that program till the next timed interrupt occurs

Main system memory is divided into portions for the operating system and user programs.

main memory

As you can see in the above diagram, the kernel space is kept separate from user programs.

In UNIX systems, each user is presented with a shell. This is a program which displays the users prompt, handles user input and displays output on the terminal. The shell program provides a mechanism for customizing each user's setup requirements, and storing this information for re-use (in a file called .profile).

When the UNIX system starts up, it also starts a system process which monitors the state of each terminal input line. Whenever a user logs in and their password is validated the UNIX system associates the shell program with that terminal.


Multi-Tasking OperatingSystems
Multi-tasking operating systems permit the use of more than one program to run at once. It does this in the same way as a multi-user system, by rapidly switching the processor between the various programs.

OS/2 and Windows 95 are examples of multi-tasking single-user operating system. UNIX is an example of a multi-tasking multi-user operating system.

A multi-user system is also a multi-tasking system. This means that a user can run more than one program at once, using key selection to switch between them.

Multi-tasking systems support foreground and background tasks. A foreground task is one that the user interacts directly with using the keyboard and screen. A background task is one that runs in the background (it does not have access to the keyboard). Background tasks are usually used for printing or backups.

The role of the operating system is to keep track of all the programs, allocating resources like disks, memory and printer queues as required.

Friday, October 21, 2011

STEPS TO CLONE A DATABASE ON A NEW SERVER WITH A NEW SID NAME USING HOT BACKUP

1) To use hot backup and clone the database the
production database has to be in archivelog mode.

2) Create a new init.ora from the production
database’s init.ora file and make the required
modifications like the location of bdump,udump,
cdump,log_archive_dest_1,instance_name,db_name and
also make sure the folders are physically present
at the OS level(i.e create them).

3) On the target machine (i.e where the clone database has been created)
we have to create a new service as well as the password file.

Commands for the same are:-
C:\oracle\ora92\bin>oradim -new -sid
C:\oracle\ora92\database>orapwd file=PWD.ora password=sys

4) Now on your production database fire the following command
to create a trace of the controlfile

SQL>alter database backup controlfile to trace;

This will create a trace file in your udump folder
(kindly check the time to make sure it is the latest trace file).

5) Open the trace file which was created in step 4 and
make the following modifications

a) Change the
CREATE CONTROLFILE REUSE DATABASE “” NORESETLOGS
TO
CREATE CONTROLFILE SET DATABASE “” RESETLOGS ARCHIVELOG

b) Change all directories in the create controlfile clause
to point to the correct directories for the new target database, if necessary

c) Leave “only” the CREATE CONTROLFILE clause. The other statements,
like the recover command, will be done manually.

Be sure you also remove the STARTUP NOMOUNT command.
So remove all the other statements other then the script starting
with CREATE CONTROLFILE …and ending with CHARACTER SET WE8MSWIN1252;

After making the modifications save the changed script
as a sql file (i.e for example like create_contol.sql)
and send it to the target machine.

6) Now on the produstion database
we begin the hot backup procedure

To find out the datafile associated with each tablespace
fire the following query

SQL>select file_name,tablespace_name from dba_data_files;
SQL>alter tablespace begin backup;

Copy all the datafiles associated with this tablespace
to the required location as specified in the CREATE CONTROLFILE script.
After copying is over fire the following command to end the backup

SQL>alter tablespace end backup;
Do this for all the tablespaces.

7) After all the datafiles have been copied and no more tablespace
is in backup mode fire the following query to archive the current logfile;

SQL>alter system archive log current;

These were the steps to be performed on the production database
except for step 3 which needs to be performed on the target machine.

The following steps needs to be performed on the target machine.

8) On the target machine log into SQL with the following commands

C:\>set oracle_sid=
C:\>sqlplus
and then enter the username and password.

9) Ater logging into the sql prompt startup the database in nomount phase
with the modified init file.

SQL>startup nomount pfile=

10) After the instance is started then we have to run the script
to create the controlfile.

SQL>@

11) After the command has been executed successfully and
the controlfile is created then we have to recover the database
using the following command.

SQL>recover database until cancel using backup controlfile;

It will ask for the archives which were generated in the production database
during the hot backup and till the latest archive.Kindly copy those
archives to the target machine at the loaction
specified by the log_archive_dest_1 parameter in init file
.

12) After recovery is completed then open the database with resetlogs option.

SQL>alter database open resetlogs;

Now after this command completed successfully your clone database is ready.

Thursday, October 20, 2011

Shell Script To Take RMAN Cold,Hot and Export Backup

#!/bin/bash
ORACLE_SID=OTM;export ORACLE_SID
echo $ORACLE_SID

echo “Please Specify the kind of backup you want to take”
echo “1) COLD BACKUP”
echo “2) HOT BACKUP”
echo “3) EXPORT BACKUP”
echo “Enter your option”

read option

while [ $option -gt 3 ]||[ $option -le 0 ]
do
echo “Please Enter the correct option”
read option
done

case $option in
1|2) echo “You are taking rman backup of DB”
rman target sys/sys @/oracle/product/11g/rman_backup_$option.txt;exit;;
3) echo “You are taking export backup of DB”
exp system/sys file=/oracle/exp_dat.dmp log=/oracle/exp_dat.log full=y;
exit;;
esac

exit

The above script can call anyone of the following rman script depending upon the user who wants take cold or hot backup

The content of rman_backup_1.txt

run {
shutdown immediate;
startup mount;
allocate channel dup1 device type disk;
allocate channel dup2 device type disk;
backup format ‘/oracle/%U’ database;
release channel dup1;
release channel dup2;
alter database open;
}

The content of rman_backup_2.txt

run {
allocate channel dup1 device type disk;
allocate channel dup2 device type disk;
backup format ‘/oracle/%U’ database;
backup format ‘/oracle/arch_%U’ archivelog all;
backup format ‘/oracle/ctl_%U’ current controlfile;
release channel dup1;
release channel dup2;
}



Saturday, October 15, 2011

SP2-1503 when starting sqlplus (privilege problem)

Solution:
IF you have error like:
SP2-1503: Unable to initialize Oracle call interface
SP2-0152: ORACLE may not be functioning properly
or
SP2-0642: SQL*Plus internal error state 2165, context 4294967295:0:0
Unable to proceed

pleas check first Environment variables that you have
LD_LIBRARY_PATH=/oracle_path/client/lib
ORACLE_HOME=/oracle_path/client

NOT
LD_LIBRARY_PATH=/oracle_path/client/lib/ <-- WRONG !!!
ORACLE_HOME=/oracle_path/client/
Remember without slash ('/') at the end !!!!!!

and also check the User Account Control (UAC) in control pannel




Change the UAC from Default to Never Notify me



















-M.N.V Sudhakar

Retrieving the forgotten "root" Password

1. the first step is to reboot server.

2. Since the server i inherit has GRUB, wait until the grub splash screen comes on and hit the letter 'e' on your keyboard. this will stop grub.
post picture
3. hit 'e' again and this will take you to another screen

4. you should see one of the choices has "kernel" select the one with "kernel

5. hit 'e' on your keyboard

6. type ' single' (make sure to include a space before "single") and hit enter. then enter 'b' to boot.

7. your system should boot up in single mode as root

8. now that you are logged in single mode you can chage the root password by sending this command:
Code:
passwd


9. after you have changed the root password, reboot server and you should be able to login with the new password.

DONE

Friday, November 20, 2009