Sunday 31 August 2014

Lyrics: Gulabi Aankhein Jo Teri Dekhi Md.Rafi

Gulabi Aankhein Jo Teri Dekhi (Md.Rafi)
Movie/Album: The Train (1970)
Music By: R. D. Burman
Lyrics By: Anand Bakshi
Performed By: Mohammed Rafi


Gulaabi Aankhen Jo Teri Dekhi
Sharaabi Yeh Dil Ho Gaya
Sambhaalo Mujhko O Mere Yaaron
Sambhalna Mushkil Ho Gaya

Dil Mein Mere Khwaab Tere
Bas Tere Jaise Ho Deewaar Pe
Tujhpe Fida Main Kyoon Hua
Aata Hai Gussa Mujhe Pyaar Pe
Main Lut Gaya Maanke Dil Ka Kaha
Main Kahin Tha Na Raha

Kya Kahoon Main Dilruba
Pura Yeh Jaadu Teri Aankhon Ka
Yeh Mera Kaatil Ho Gaya
Gulaabi Aankhen Jo Teri Dekhi
Sharaabi Yeh Dil Ho Gaya

Maine Sada Chaaha Yehi
Daaman Bacha Loon Haseenon Se Main
Teri Kasam Khwaabon Mein Bhi
Bachta Fida Naazneenon Se Main
Tauba Magar Mil Gayi Tujhse Nazar
Mil Gaya Dard-E-Jigar

Sun Zara O Bekhabar
Zara Sa Haske Jo Dekha Tune
Main Tera Bismil Ho Gaya
Gulaabi Aankhen Jo Teri Dekhi
Sharaabi Yeh Dil Ho Gaya
Sambhaalo Mujhko O Mere Yaaron
Sambhalna Mushkil Ho Gaya

---------------------------------------------------------------------------------

गुलाबी आँखें, जो तेरी देखी, शराबी ये दिल हो गया
सम्भालो मुझको, ओ मेरे यारों, सम्भलना मुश्किल हो गया

दिल में मेरे, ख़्वाब तेरे, तस्वीरें जैसे हों दीवार पे
तुझपे फ़िदा, मैं क्यूँ हुआ, आता है गुस्सा मुझे प्यार पे
मैं लुट गया, मान के दिल का कहा
मैं कहीं का ना रहा, क्या कहूँ मैं दिलरुबा
बुरा ये जादू तेरी आँखों का, ये मेरा क़ातिल हो गया
गुलाबी आँखें जो तेरी देखी...

मैंने सदा, चाहा यही, दामन बचा लूं हसीनों से मैं
तेरी क़सम, ख़्वाबों में भी, बचता फिरा नाज़नीनों से मैं
तौबा मगर, मिल गई तुझसे नज़र
मिल गया दर्द-ए-जिगर, सुन ज़रा ओ बेख़बर
ज़रा सा हँस के, जो देखा तूने, मैं तेरा बिस्मिल हो गया
गुलाबी आँखें जो तेरी देखी......

READ MORE ...

Saturday 30 August 2014

COMPUTER NETWORKS - VTU CSE/ISE CN LAB MANUAL

NETWORKS LABORATORY: CN LAB PROGRAMS FOR VTU CSE/ISE STUDENTS
Subject Code : 06CSL77
IA Marks : 25
No. of Practical Hrs./ Week : 03
Exam Hours : 03
Total No. of Practical Hrs. : 42
Exam Marks : 50


Note: Student is required to solve one problem from PART-A and one
problem from PART-B. The questions are allotted based on lots. Both
questions carry equal marks.




PART - A

SIMULATION EXERCISES

The following experiments shall be conducted using either NS / OPNET or
any other suitable simulator.
1. Simulate a three nodes point – to – point network with duplex links
between them. Set the queue size and vary the bandwidth and find the
number of packets dropped.

2. Simulate a four node point-to-point network with the links connected as
follows:
n0 – n2, n1 – n2 and n2 – n3. Apply TCP agent between n0-n3 and UDP
between n1-n3. Apply relevant applications over TCP and UDP agents
changing the parameter and determine the number of packets sent by
TCP / UDP.

3. Simulate the different types of Internet traffic such as FTP and TELNET
over a network and analyze the throughput.

4. Simulate the transmission of ping messages over a network topology
consisting of 6 nodes and find the number of packets dropped due to
congestion.

5. Simulate an Ethernet LAN using n nodes (6-10), change error rate and
data rate and compare throughput.


6. Simulate an Ethernet LAN using n nodes and set multiple traffic nodes
and determine collision across different nodes.

7. Simulate an Ethernet LAN using n nodes and set multiple traffic nodes
and plot congestion window for different source / destination.

8. Simulate simple ESS and with transmitting nodes in wire-less LAN by
simulation and determine the performance with respect to transmission
of packets.

PART - B

Implement the following in C/C++:
1. Write a program for error detecting code using CRC-CCITT (16- bits).

2. Write a program for frame sorting technique used in buffers.

3. Write a program for distance vector algorithm to find suitable path for
transmission.

4. Using TCP/IP sockets, write a client – server program to make the client
send the file name and to make the server send back the contents of the
requested file if present.

5. Implement the above program using as message queues or FIFOs as IPC
channels.

6. Write a program for simple RSA algorithm to encrypt and decrypt the
data.

7. Write a program for Hamming code generation for error detection and
correction.

8. Write a program for congestion control using leaky bucket algorithm.
READ MORE ...

Friday 29 August 2014

VTU: COMPUTER GRAPHICS LAB PROGRAMS FOR 6th SEM

COMPUTER GRAPHICS AND VISUALIZATION LABORATORY - VTU

Subject Code : 06CSL67 IA Marks : 25
No. of Practical Hrs./ Week : 03 Exam Hours : 03
Total No. of Practical Hrs. : 42 Exam Marks : 50










PART - A

IMPLEMENT THE FOLLOWING PROGRAMS IN C / C++

1. Program to recursively subdivide a tetrahedron to from 3D Sierpinski
gasket. The number of recursive steps is to be specified by the user.

2. Program to implement Liang-Barsky line clipping algorithm.

3. Program to draw a color cube and spin it using OpenGL transformation
matrices.

4. Program to create a house like figure and rotate it about a given fixed
point using OpenGL functions.

5. Program to implement the Cohen-Sutherland line-clipping algorithm.
Make provision to specify the input line, window for clipping and view
port for displaying the clipped image.

6. Program to create a cylinder and a parallelepiped by extruding a circle
and quadrilateral respectively. Allow the user to specify the circle and
the quadrilateral.

7 Program, using OpenGL functions, to draw a simple shaded scene
consisting of a tea pot on a table. Define suitably the position and
properties of the light source along with the properties of the properties
of the surfaces of the solid object used in the scene.

8. Program to draw a color cube and allow the user to move the camera
suitably to experiment with perspective viewing. Use OpenGL functions.

9. Program to fill any given polygon using scan-line area filling algorithm.
(Use appropriate data structures.)

10. Program to display a set of values { fij } as a rectangular mesh.

PART - B
Develop a suitable Graphics package to implement the skills learnt in the
theory and the exercises indicated in Part A. Use the OpenGL.
READ MORE ...

VTU CSE/ISE WEB PROGRAMMING LAB MANUAL

WEB PROGRAMMING LABORATORY 7th SEM


Subject Code : 06CSL78
IA Marks : 25
No. of Practical Hrs./ Week : 03
Exam Hours : 03
Total No. of Practical Hrs. : 42
Exam Marks : 50







1. Develop and demonstrate a XHTML document that illustrates the use
external style sheet, ordered list, table, borders, padding, color, and the
tag.

2. Develop and demonstrate a XHTML file that includes Javascript script
for the following problems:
a) Input: A number n obtained using prompt
Output: The first n Fibonacci numbers
b) Input: A number n obtained using prompt
Output: A table of numbers from 1 to n and their squares using alert

3. Develop and demonstrate a XHTML file that includes Javascript script
that uses functions for the following problems:
a) Parameter: A string
Output: The position in the string of the left-most vowel
b) Parameter: A number
Output: The number with its digits in the reverse order

4. a) Develop and demonstrate, using Javascript script, a XHTML
document that collects the USN ( the valid format is: A digit from 1 to 4
followed by two upper-case characters followed by two digits followed by
two upper-case characters followed by three digits; no embedded spaces
allowed) of the user. Event handler must be included for the form element
that collects this information to validate the input. Messages in the alert
windows must be produced when errors are detected.
b) Modify the above program to get the current semester also
(restricted to be a number from 1 to 8)

5. a) Develop and demonstrate, using Javascript script, a XHTML
document that contains three short paragraphs of text, stacked on top of
each other, with only enough of each showing so that the mouse cursor
can be placed over some part of them. When the cursor is placed over the
exposed part of any paragraph, it should rise to the top to become
completely visible.
b) Modify the above document so that when a paragraph is moved from
the top stacking position, it returns to its original position rather than to
the bottom.

6. a) Design an XML document to store information about a student in an
engineering college affiliated to VTU. The information must include
USN, Name, Name of the College, Brach, Year of Joining, and e-mail id.
Make up sample data for 3 students. Create a CSS style sheet and use it to
display the document.
b) Create an XSLT style sheet for one student element of the above
document and use it to create a display of that element.

7. a) Write a Perl program to display various Server Information like
Server Name, Server Software, Server protocol, CGI Revision etc.
b) Write a Perl program to accept UNIX command from a HTML form
and to display the output of the command executed.

8. a) Write a Perl program to accept the User Name and display a
greeting message randomly chosen from a list of 4 greeting messages.
b) Write a Perl program to keep track of the number of visitors visiting
the web page and to display this count of visitors, with proper headings.

9. Write a Perl program to display a digital clock which displays the
current time of the server.

10. Write a Perl program to insert name and age information entered by
the user into a table created using MySQL and to display the current
contents of this table.

11. Write a PHP program to store current date-time in a COOKIE and
display the ‘Last visited on’ date-time on the web page upon reopening of
the same page.

12. Write a PHP program to store page views count in SESSION, to
increment the count on each refresh, and to show the count on web page.

13. Create a XHTML form with Name, Address Line 1, Address Line 2,
and E-mail text fields. On submitting, store the values in MySQL table.
Retrieve and display the data based on Name.

14. Using PHP and MySQL, develop a program to accept book
information viz. Accession number, title, authors, edition and publisher
from a web page and store the information in a database and to search for
a book with the title specified by the user and to display the search results
with proper headings.
READ MORE ...

Sunday 24 August 2014

VTU CSE/ISE DBMS Lab Programs

 Database - DBMS Lab Manual - All Programs


VTU 5 th Sem 

Vtu Forum 


SQL> create user username identified by password;
SQL>create user santosh identified by manager

SQL> grant connect, resource to username;
 SQL> grant connect, resource to santosh;
login with same account




Program 1:

 Consider the Insurance database given below. The primary keys are underlined and the data types are specified:

PERSON (driver-id:string,name:string,address:string)
CAR (Regno:string,model:string,year:int)
ACCIDENT (report-number:int,date:date,location:string)
OWNS (driver-id:string,regno:string)
PARTICIPATED (driver-id:string,regno:string,report-number:int,damage-amount:int)


i)    create the above tables by properly specifying the primary keys and the foreign keys
ii)    Enter atleast five tuples for each relation
iii)    Demonstrate how you
a.    Update the damage amount for the car with a specific regno in accident with report number 12 to 25000
b.    Add a new accident to the database
iv)    Find the total number of people who owned cars that were involved in accidents in 2006.
v)    Find the number of accidents in which cars belonging to a specific model were involved.
vi)    Generation of suitable reports   
vii)    Create suitable front end for querying and display the results



SOLUTION:

i)    Create the above tables by properly specifying the primary keys and the foreign keys

create table person(driver_id char(4) primary key,
name varchar(30),
address varchar(30)
);

create table car(reg_no char(15) primary key,
model char(20),
year number(4)
);

create table accident(report_no number primary key,
acc_date date,
location varchar(30)
);

create table owns(driver_id references person,
reg_no references car
);

create table participated( driver_id references person,
reg_no references car,
report_no references accident,
damage_amt number(10,2)
);


ii)    Enter atleast five tuples for each relation

insert into person values('1234','amith','no a-1-12 koppal');
insert into person values('2345','anil','23 vijaya apts');
insert into person values('3412','john','no 3423 vicky apts');
insert into person values('4567','arun','kamal nivas koppal');
insert into person values('4522','sunil','no 54 ravi nagar');


insert into car values('ka37k32','hyundai',2004);
insert into car values('ka05d34','maruti 800',1998);
insert into car values('ka23j90','zen',2002);
insert into car values('ka35f45','fiat',2001);
insert into car values('ka36m78','benz',2000);

insert into accident values(12,'12-feb-1990','vit cross');
insert into accident values(34,'31-jan-1999','jayanagar');
insert into accident values(56,'12-dec-1998','btm layout');
insert into accident values(67,'07-jul-2003','jp nagar');
insert into accident values(87,'01-may-2001','allalsandra');

insert into owns values('1234','ka37k32');
insert into owns values('2345','ka05d34');
insert into owns values('3412','ka23j90');
insert into owns values('4567','ka35f45');
insert into owns values('4522','ka36m78');

insert into participated values('1234','ka37k32',12,12000);
insert into participated values('2345','ka05d34',34,13000);
insert into participated values('3412','ka23j90',56,14000);
insert into participated values('4567','ka35f45',67,12450);
insert into participated values('4522','ka36m78',87,10000);



iii)    Demonstrate how you
a.    Update the damage amount for the car with a specific regno in accident with report number 12 to 25000
b.    Add a new accident to the database


Solution:

a.    Update participated set  damage_amt = 25000 where reg_no = ‘&reg_no’ and report_no = 12;
b.    Insert into accident values(93,’02-may-2002’,’allalsandra’);

iv)    Find the total number of people who owned cars that were involved in accidents in 2006.

SQL> Select  count(*)  from accident where to_char(acc_date,’yy’) = 02;
v)    Find the number of accidents in which cars belonging to a specific model were involved.

SQL> Select count(a.report_no) from accident a,participated p,car c where c.reg_no =                      
          p.reg_no and
          a.report_no = p.report_no and c.model = '&model' group by a.report_no

---------------------------------------------------------------------------


Program 2:


 Consider the following relations for an order processing database application in a company.

CUSTOMER (Cust #: int, Cname: string, City: string)
ORDER (Order #: int, Odate: date, Cust #: int, Ord-Amt: int)
ORDER-ITEM (Order #: int, Item #: int, qty: int)
ITEM (Item #: int, Unit Price: int)
SHIPMENT (Order #: int, Warehouse #: int, Ship-Date: date)
WAREHOUSE (Warehouse #: int, City: string)

i)    Create the above tables by properly specifying the primary keys and the foreign keys.
ii)    Enter at least five tuples for each relation.
iii)    Produce a listing: CUSTNAME, NO_OF_ORDERS, AVG_ORDER_AMT, where the middle column is the total number of orders by the customer and the last column is the average order amount for that customer.
iv)    List the Order# for the orders that were shipped from all the warehouses that the company has in a specific city.
v)    Demonstrate how you delete Item# 10 from the ITEM table and make that field null in the ORDER-ITEM table.
vi)    Generation of suitable reports.
vii)    Create a suitable front end for querying and displaying the results.



Solution:

i)    Create the above tables by properly specifying the primary keys and the foreign keys.


create table customer(cust_no number primary key,
cname varchar(30),
city varchar(30));

create table orders( order_no number primary key,
odate date,
cust_no references customer,
ord_amt number);

create table item( item_no number primary key,
unit_price number);

create table orders_item( order_no references orders,
item_no references item on delete cascade,
qty number);

create table warehouse(warehouse_no number primary key,
city varchar(30));

create table shipment(order_no references orders,
warehouse_no references warehouse,
ship_date date);
ii)    Enter at least five tuples for each relation.

insert into customer values(10,'ajay','bangalore');
insert into customer values(21,'arun','hyderabad');
insert into customer values(32,'ikram','hubli');
insert into customer values(45,'suraj','kanpur');
insert into customer values(78,'niraja','panji');

insert into orders values(12345,'25-mar-2005',10,0);
insert into orders values(12346,'26-mar-2005',21,0);
insert into orders values(12347,'30-mar-2005',32,0);
insert into orders values(12348,'01-apr-2005',45,0);
insert into orders values(12349,'01-apr-2005',78,0);

insert into item values(10,100);
insert into item values(20,60);
insert into item values(30,140);
insert into item values(40,35);
insert into item values(50,150);

insert into orders_item values(12345,10,4);
insert into orders_item values(12346,20,2);
insert into orders_item values(12347,30,5);
insert into orders_item values(12348,40,10);
insert into orders_item values(12349,50,18);

insert into warehouse values(1501,'bangalore');
insert into warehouse values(1502,'hyderabad');
insert into warehouse values(1503,'hubli');
insert into warehouse values(1504,'delhi');
insert into warehouse values(1505,'belgaum');

insert into shipment values(12345,1501,'5-mar-2005');
insert into shipment values(12346,1502,'28-mar-2005');
insert into shipment values(12347,1503,'01-apr-2005');
insert into shipment values(12348,1504,'04-apr-2005');
insert into shipment values(12349,1505,'05-apr-2005');

update orders set ord_amt = (select sum(oi.qty * i.unit_price) from orders_item oi,item I where oi.order_no = orders.order_no and I.item_no = oi.item_no);

commit;

iii)    Produce a listing: CUSTNAME, NO_OF_ORDERS, AVG_ORDER_AMT, where the middle column is the total number of orders by the customer and the last column is the average order amount for that customer.

SQL> select  cname “CustName”,count(*) “No of Orders”,avg(ord_amt) “Average order  
          amt” from orders o,customer c where o.cust_no = c.cust_no group by cname;

CustName                       No of Orders  Average amt
------------------------------  ------------        ---------------------------
ajay                                       1                         400
arun                                      1                         120
ikram                                    1                         700
niraja                                    1                        2700
suraj                                     1                         350


iv)    List the Order# for the orders that were shipped from all the warehouses that the company has in a specific city.


SQL> Select  order_no  from warehouse w,shipment s where w.warehouse_no =      
          s.warehouse_no and w.city = ‘&city’;

v)    Demonstrate how you delete item# 10 from the item table and make that field null in the order table.


SQL> Delete from item where item_no = 10;

-----------------------------------------------------------------------------------------------------

Program 3:


 Consider the following database of student enrollement in courses and books adopted for  each course .

STUDENT (regno :string , name : string , major : string , bdate : int)
COURSE (course# : int , cname : string , dept : string)
ENROLL ( regno : string , course#: int , sem : int , marks : int )
BOOK_ADOPTION ( course#: int , sem : int , book_isbn :int)
TEXT( book_isbn : int , book-title : string , publisher : string , author : string).

i)    Create the above tables by properly specifying the primary keys and the foreign key .
ii)    Enter atleast five tuples for each relation .
iii)    Demonstrate how you add a new text book to the database and make this book be adopted by some department.
iv)    Produce a list of text books( include course # ,book_isbn,book-title) in the alphabetical order for courses offered by the cs department that use more than 2 books.
v)    List any department that has all its adopted books published by specific publisher.
vi)    Generation of suitable reports.
Create suitable front end for querying and display the results



Solution:
i)    Create the above tables by properly specifying the primary keys and the foreign key .


create table student(reg_no char(10) primary key,
name varchar(30),
major char(1),
bdate date
);


create table course(course_no number primary key,
cname varchar(30),
dept varchar(30)
);

create table enroll(reg_no references student,
course_no references course,
sem number(1),
marks number(3),
primary key(reg_no,course_no,sem)
);

create table text(book_isbn number(4) primary key,
book_title varchar(30),
publisher varchar(30),
author varchar(30)
);

create table book_adoption(course_no references course,
sem number(1),
book_isbn references text
);


ii)    Enter atleast five tuples for each relation .

insert into student values('1mv02is033','prasanna','y','24-oct-84');
insert into student values('1mv02is050','sunil','y','22-may-84');
insert into student values('1mv02cs001','aditya','y','11-jan-83');
insert into student values('1mv02mca22','raju','n','30-mar-83');
insert into student values('1mv02mba33','vishal','y','02-apr-82');

insert into course values(1,'be','ise');
insert into course values(2,'be','cse');
insert into course values(3,'be','ece');
insert into course values(4,'mca','ca');
insert into course values(5,'mba','hr');

insert into enroll values('1mv02is033',1,6,97);
insert into enroll values('1mv02is050',2,5,66);
insert into enroll values('1mv02cs001',3,4,45);
insert into enroll values('1mv02mca22',4,1,77);
insert into enroll values('1mv02mba33',5,2,88);

insert into text values(1234,'dbms','bpb','navathe');
insert into text values(2345,'cn','lpe','tanenbaum');
insert into text values(3456,'ds','galgotia','padmareddy');
insert into text values(4567,'cpp','pearson','herbert');
insert into text values(5678,'unix','bpb','das');
insert into text values(1333,'cn','pearson','tanenbaum');
insert into text values(1444,'cn','pearson','tanenbaum');

insert into book_adoption values(1,6,1234);
insert into book_adoption values(2,5,2345);
insert into book_adoption values(3,4,3456);
insert into book_adoption values(5,1,5678);
insert into book_adoption values(4,2,1234);
insert into book_adoption values(2,6,4567);
insert into book_adoption values(2,1,5678);
insert into book_adoption values(2,6,1333);
insert into book_adoption values(2,6,1444);


commit;

iii)    Demonstrate how you add a new text book to the database and make this book be adopted by some department.

SQL> insert into text values(1222,’maths’,’DSC’,’KSC’);
SQL> insert into book_adoption values(4,6,1222);

iv)    Produce a list of text books( include course # ,book_isbn,book-title) in the alphabetical order for courses offered by the cs department that use more than 2 books.

SQL> select b.course_no,b.book_isbn,t.book_title from book_adoption b,text t where b.book_isbn=t.book_isbn and b.course_no in(select course_no from book_adoption where course_no in(select course_no from course where dept like 'cse') group by course_no having count(course_no)>=2);


v)    List any department that has all its adopted books published by specific publisher.


SQL>  select c.dept,t.publisher from course c,book_adoption b,text t where
           c.course_no = b.course_no and
           b.book_isbn = t.book_isbn and
           t.publisher = '&publisher'
           group by c.dept,t.publisher;

Enter value for publisher: bpb
old   4:  t.publisher = '&publisher'
new   4:  t.publisher = 'bpb'

DEPT                           PUBLISHER
------------------------------ ------------------------------
ca                             bpb
cse                            bpb
hr                             bpb
ise                            bpb

--------------------------------------------------------------------------------------


Program 4:  

Consider the following relations for the details maintained by a book dealer.

AUTHOR (Author-id: int, Name: string, City: string, Country: string)
PUBLISHER (Publisher-id: int, Name: string, City: string, Country: string)
CATALOG (Book-id: int, title: string, author-id: int, Publisher-id: int, Category-id: int, Year: int, Price: int)
CATEGORY (Category-id: int, Description: string)
ORDER-DETAILS (Order-no : int, Book-id: int, Quantity: int)
i.    Create the above tables by properly specifying the primary keys and the foreign keys.
ii.    Enter at least five tuples for each relation.
iii.    Give the details of the authors who have 2 or more books in the catalog and the price of the books is greater than the average price of the books in the catalog and the year of publication is after 2000.
iv.    Find the author of the book which has maximum sales.
v.    Demonstrate how you increase the price of books published by a specific publisher by 10%.
vi.    Generation of suitable reports.
vii.    Create a suitable front end for querying and displaying the results.



Solution:…
i)    Create the above tables by properly specifying the primary keys and the foreign keys.

create table author(author_id number(4) primary key,
aname varchar(30),
acity varchar(30),
acountry varchar(30)
);

create table publisher(pub_id number(4) primary key,
pname varchar(30),
pcity varchar(30),
pcountry varchar(30)
);

create table category(cat_id number(4) primary key,
description varchar(30)
);

create table catalog(book_id number(4) primary key,
title varchar(30),
author_id references author,
pub_id references publisher,
cat_id references category,
year number(4),
price number(6,2)
);

create table order_details(order_no number(4) primary key,
book_id references catalog,
qty number(5)
);

ii)    Enter at least five tuples for each relation.

insert into author values(1001,'balaguruswamy','hyderabad','india');
insert into author values(1002,'tenanbaum','california','usa');
insert into author values(1003,'padma reddy','bangalore','india');
insert into author values(1004,'godse','pune','india');
insert into author values(1005,'oppenham','los angeles','usa');

insert into publisher values(3001,'suhas','bangalore','india');
insert into publisher values(3002,'bpb','delhi','india');
insert into publisher values(3003,'prentice','delhi','india');
insert into publisher values(3004,'pearson','california','usa');
insert into publisher values(3005,'subhas','bangalore','india');

insert into category values(4001,'programming');
insert into category values(4002,'os');
insert into category values(4003,'database');
insert into category values(4004,'networks');
insert into category values(4005,'logic design');

insert into catalog values(1,'let us c',1001,3001,4001,1999,375);
insert into catalog values(2,'database',1002,3002,4003,2002,450);
insert into catalog values(3,'network',1003,3003,4002,1998,500);
insert into catalog values(4,'logic design',1004,3004,4004,2004,750);
insert into catalog values(5,'c++',1005,3005,4005,2005,450);
insert into catalog values(6,'c',1001,3002,4002,2003,880);
insert into catalog values(7,'cn',1001,3004,4002,2005,750);

insert into order_details values(1,1,34);
insert into order_details values(2,1,45);
insert into order_details values(3,2,45);
insert into order_details values(4,2,75);
insert into order_details values(5,3,69);

commit;

iii)    Give the details of the authors who have 2 or more books in the catalog and the price of the books is greater than the average price of the books in the catalog and the year of publication is after 2000.

SQL> select * from author where author_id in
(select author_id from catalog c where c.year>2000 and c.price>(select avg(price) from catalog) group by author_id having count(*)>=2);

Find the author of the book which has maximum sales.

SQL> Select a.author_id,a.aname from author a,catalog c,max_sales m where
          a.author_id = c.author_id and
          c.book_id = m.book_id and
          m.book_id in (select book_id from max_sales where quantity =
          (select max(quantity) from max_sales));

iv)    Demonstrate how you increase the price of books published by a specific publisher by 10%.


SQL> update catalog set price = price*1.1 where pub_pd = &publisher_id;

----------------------------------------------------------------------------------

Program 5

Consider the following database for a banking enterprise

BRANCH (branch_name: string, branch_city: string, assets: real)
ACCOUNT (accno: int, branch_name: string, balance: real)
CUSTOMER (customer_name: string, customer_street: string, city:string)
DEPOSITOR (customer_name: string, accno: int)
LOAN (loan_number: int, branch_name: string, amount: real)
BORROWER (customer_name: string, loan_number: int) 

i)    Create the above tables by properly specifying the primary keys and the foreign keys.   
ii)    Enter atleast five tuples for each relation.
iii)    Find all the customers who atleast two accounts at the MAIN branch.
iv)    Find all the customers who have an account at all branches located in a specific city.
v)    Demonstrate how you delete all account tuples at every branch located in a specific city.
vi)    Generation of suitable reports.
vii)    Create suitable front end for querying and displaying the results.



Solution:

i)    Create the above tables by properly specifying the primary keys and the foreign keys.


create table branch(br_name varchar(30) primary key,
br_city varchar(30),
assets number(10,2)
);

create table account(acc_no number(4) primary key,
br_name references branch,
balance number(10,2)
);

create table customers(c_name varchar(30) primary key,
c_street varchar(30),
c_city varchar(30)
);

create table depositor(c_name references customers,
acc_no references account,
qty number
);

create table loan(loan_no number(4) primary key,
br_name references branch,
amt number(10,2)
);

create table borrower(c_name references customers,
loan_no references loan
);

ii)    Enter atleast five tuples for each relation.

insert into branch values('rajaji nagar','bangalore',1000000);
insert into branch values('jayanagar','bangalore',50000);
insert into branch values('mvit','bangalore',10000);
insert into branch values('jawahar nagar','bangalore',100000);
insert into branch values('rajbhavan','bangalore',23566);

insert into account values(1000,'rajaji nagar',2500);
insert into account values(2000,'rajaji nagar',8996);
insert into account values(3000,'rajaji nagar',7415);
insert into account values(4000,'jayanagar',2121);
insert into account values(5000,'mvit',8596);
insert into account values(6000,'jawahar nagar',9999);
insert into account values(7000,'rajbhavan',235);

insert into customers values('prasanna','patel road','raichur');
insert into customers values('harish','indiranagar','bangalore');
insert into customers values('sunil','ring road','bangalore');
insert into customers values('srinivas','woc road','bangalore');
insert into customers values('rudre','maruti galli','belgaum');

insert into depositor values('prasanna',1000,2000);
insert into depositor values('prasanna',2000,3000);
insert into depositor values('harish',3000,5000);
insert into depositor values('sunil',4000,1520);
insert into depositor values('srinivas',5000,1120);
insert into depositor values('rudre',6000,1250);
insert into depositor values('prasanna',7000,1250);

insert into loan values(100,'rajaji nagar',5000);
insert into loan values(200,'rajaji nagar',4000);
insert into loan values(300,'jayanagar',6323);
insert into loan values(400,'mvit',4512);
insert into loan values(500,'jawahar nagar',1235);
insert into loan values(600,'rajbhavan',9632);
insert into loan values(700,'rajbhavan',3456);

insert into borrower values('prasanna',100);
insert into borrower values('harish',200);
insert into borrower values('sunil',300);
insert into borrower values('srinivas',400);
insert into borrower values('rudre',500);

iii)    Find all the customers who atleast two accounts at the MAIN branch.


SQL>Select c_name from depositor d,account a where
         a.acc_no = d.acc_no and
         a.br_name = 'rajaji nagar’
         group by c_name
         having count(*) > 2;

iv)    Find all the customers who have an account at all branches located in a specific city.

SQL> select distinct c_name from depositor where acc_no in
(select acc_no from account where br_name in
(select br_name from branch where br_city='bangalore'));

Demonstrate how you delete all account tuples at every branch located in a specific city.


SQL> Delete from account where br_name in
          (select br_name from branch where br_city = 'bangalore);
READ MORE ...

Sunday 17 August 2014

How to Increase Internet Speed using Google public DNS server

Very slow internet connection speed is common now a days, but you can make it faster using some DNS settings of your internet connection. Generally for connectivity we use Dynamic Host Protocol Configuration (DHCP) which assign dynamic IP address to every devices connected to the network by establishing connection with available DNS during start up of your PCs.




 Steps For Speed Up Your Internet Speed

 Step 1: 

Open control panel and click on Network and Internet which is located in the left side of the panel.

Step 2:


A new Network and Sharing Center will appear. Now click on "Change adapter settings" located on the top left side of the panel.

 Step 3:

 Select the type of network adapter for which you want to configure.
For example: you can select Ethernet if you are connected to cable, wi-fi if you are connected to this n/w.




 









 Step 4:
 
Right click on the selected n/w and goto properties.
Drop down the configuration menu and select "Internet Protocol Version4 (TCP/IPv4)".





























Step 5:
Select "Use the following DNS server address"
Preferred DN Server 8.8.8.8
Alternet DNS Server 8.8.4.4 




























Step 6: 

 Finally click on OK to save changes and test the connection.

 Test Connection



READ MORE ...

Friday 15 August 2014

How to Renew a Godaddy Domain Name before Expire

You must renew your domain name before it expire because after grace period Godaddy place your domain name in parked areas and it will cost much more than usual rates.





Here you will learn how to renew domain step-by-step.



  • Log in to your Godaddy Account Manager.
  • Go to the Renewals tab, where you will see a list of domain to renew.

  • Click on expand that containing an items you want to renew.





  • Select the domains or products you want to renew along with the type of registration and renewal length.
  • Click to Continue.

  • You can also Customize your order to add other products or services to your order and finally click on continue.
  • Select Payment details and finally click on place your order.
  • Check your billing details that includes your address and type of transaction.
  • Regarding payment details: 
  • Select Payment mode. For example you can select online banking, debit card, cash card etc and proceed further.

  • This will open a new window where you have to enter your card details and finally click on submit.
  • Regarding transaction verification you will receive OTP on your registered mobile number which you have to enter.
  • At the end you will get a final receipt of your transaction. 

READ MORE ...

Thursday 14 August 2014

Lyrics: Tum Hi Ho by Arijit Singh - Aashiqui 2

Tum Hi Ho Lyrics

Movie / Album: Aashiqui-2
Singer(s): Arijit Singh
Lyricist(s): Mithoon
Music composer: Ankit Tiwari, Mithoon, Jeet Ganguly,
Music © T-Series






Tum Hi Ho Lyrics

Hum tere bin ab reh nahi sakte
Tere bina kya wajood mera (x2)

Tujhse juda gar ho jaayenge
Toh khud se hi ho jaayenge judaa

Kyunki tum hi ho
Ab tum hi ho
Zindagi ab tum hi ho
Chain bhi, mera dard bhi
Meri aashiqui ab tum hi ho

Tera mera rishta hai kaisa
Ik pal door gawara nahi
Tere liye har roz hai jeete
Tujh ko diya mera waqt sabhi
Koi lamha mera na ho tere bina
Har saans pe naam tera

Kyunki tum hi ho
Ab tum hi ho
Zindagi ab tum hi ho
Chain bhi, mera dard bhi
Meri aashiqui ab tum hi ho

Tumhi ho... Tumhi ho...
Tere liye hi jiya main
Khud ko jo yun de diya hai
Teri wafa ne mujhko sambhala
Saare ghamon ko dil se nikala
Tere saath mera hai naseeb juda
Tujhe paake adhoora naa raha hmm..

Kyunki tum hi ho
Ab tum hi ho
Zindagi ab tum hi ho..
Chain bhi, mera dard bhi
Meri aashiqui ab tum hi ho (x2)


 ------------------------------------------------

हम तेरे बिन अब रह नहीं सकते
तेरे बिना क्या वजूद मेरा  (x2)
 
तुझसे जुदा गर हो जाएँगे
तो खुद से ही हो जाएंगे जुदा

क्योंकि तुम ही हो
अब तुम ही हो
ज़िन्दगी अब तुम ही हो
चैन भी, मेरा दर्द भी
मेरी आशिकी अब तुम ही हो

तेरा मेरा रिश्ता है कैसा
इक पल दूर गंवारा नहीं
तेरे लिए हर रोज़ हैं जीते
तुझको दिया मेरा वक़्त सभी
कोई लम्हा मेरा न हो तेरे बिना
हर सांस पे नाम तेरा
क्योंकि तुम ही हो...

तेरे लिए ही जिया मैं
खुद को जो यूँ दे दिया है
तेरी वफ़ा ने मुझको संभाला
सारे ग़मों को दिल से निकाला
तेरे साथ मेरा है नसीब जुड़ा
तुझे पा के अधूरा ना रहा
क्योंकि तुम ही हो...

क्योंकि तुम ही हो
अब तुम ही हो
ज़िन्दगी अब तुम ही हो
चैन भी, मेरा दर्द भी
मेरी आशिकी अब तुम ही हो -(x2)



READ MORE ...

Oracle: Recover Database Using RMAN Until a Log Sequence Number

In this scenario we will recover database using RMAN until a log sequence number SCN.

First create a table called customers and count the number of rows.

SQL> select count(*) from customers;

  COUNT(*)
----------
         4

SQL> alter system switch logfile;

System altered.

Check whether database is in archivelog mod or not.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            D:\app\SantoshTiwari\oradata\arc
Oldest online log sequence     1
Next log sequence to archive   2
Current log sequence           2

Now delete table customers.

SQL> delete customers;

4 rows deleted.

SQL> commit;

Commit complete.


SQL> select count(*) from customers;

  COUNT(*)
----------
         0

Now check the sequence no to apply so that we can recover table as it was before deletion.

SQL> select sequence#,first_change#, to_char(first_time,'HH24:MI:SS') from v$log order by
3;

 SEQUENCE# FIRST_CHANGE# TO_CHAR(
---------- ------------- --------
         1       1025275 18:31:53
         2       1025651 18:34:56
         3        1025944 18:37:59

Shut down the database and start in mount state.


SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.

Total System Global Area  606806016 bytes
Fixed Size                  1376268 bytes
Variable Size             398462964 bytes
Database Buffers          201326592 bytes
Redo Buffers                5640192 bytes
Database mounted.


Recover using SQL prompt.

SQL> recover database UNTIL CHANGE 2;
Media recovery complete.

-----------------------------------------------
Recover using RMAN

RMAN> run {
2> set until sequence=2;
3> restore database;
4> recover database;
5>alter database open resetlogs;
6> }
-------------------------------------

SQL> select count(*) from customers;

  COUNT(*)
----------
         4

READ MORE ...

Wednesday 13 August 2014

Oracle: How to Get the DBID in NOMOUNT State

DBID is the most important parameter to restore and recover controlfile using Rman. You can easily find DBID in open state but what you will do in nomount stat.

Steps to find DBID in NOMOUNT state:

First, start the database in nomount state:

SQL>startup nomount;

Now set the label for identification of tracefile that will be generated during this process. 

SQL>alter session set tracefile_identifier =santosh;


Get datafile name and location using v$datafile and dump some blocks of that datafile.

SQL> select name from v$datafile;

NAME
----------------------------------------------------
D:\APP\SANTOSH\ORADATA\TEST11\SYSTEM01.DBF
D:\APP\SANTOSH\ORADATA\TEST11\SYSAUX01.DBF
D:\APP\SANTOSH\ORADATA\TEST11\UNDOTBS01.DBF
D:\APP\SANTOSH\ORADATA\TEST11\USERS01.DBF
D:\APP\SANTOSH\ORADATA\TEST11\USERS02.DBF


SQL> alter system dump datafile 'D:\APP\SANTOSH\ORADATA\TEST11\USERS02.DBF' 
          2  block min 1 block max10;

                System altered.


Now, check trace file using tracefile_identifier(Label) in my case it is santosh. To see the the trace file location we have:

SQL> show parameter user_dump_dest

Now open the trace file and you will get Db ID =XXXXX

 Start dump data block from file D:\APP\SANTOSHTIWARI\ORADATA\TEST11\USERS02.DBF minblk 1 maxblk 10
 V10 STYLE FILE HEADER:
Compatibility Vsn = 186646528=0xb200000
Db ID=3561501508=0xd4483344, Db Name='TEST11'
Activation ID=0=0x0
Control Seq=932=0x3a4, File size=1280=0x500
File Number=5, Blksiz=8192, File Type=3 DATA


Note: Take sufficient backup before dumping blocks because you may loose data, so perform this operation on your own risk.
READ MORE ...

Tuesday 12 August 2014

RMAN-05541: No Archived Logs Found in Target Database

Issue: RMAN-05541: no archived logs found in target database.

When performing a RMAN Database duplication, I get the following error:

RMAN-03002: failure of Duplicate Db command at 07/30/2013 09:39:05
RMAN-05501: aborting duplication of target database
RMAN-05541: no archived logs found in target database

Cause:


  • Target database may not be in the archivelog mode before taking backup so first check it.
  • Sometimes Database in archived log mode, but control file did not have any archived log records. 

Solution:

Enable archivelog mode and perform log switch before backup.

 no archive logs found in target database


sql> alter database archivelog;


SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            D:\app\SantoshTiwari\oradata\arc
Oldest online log sequence  
Next log sequence to archive  
Current log sequence        


SQL> alter system archive log current;
System altered.




READ MORE ...

Oracle: Find Default Permanent Tablespace using Database_Properties

To prevent people from accidentally having their own database objects in the SYSTEM tablespace Oracle introduced a default permanent tablespace because it is not healthy in terms of usability point of view to keep your own objects in SYSTEM tablespace.

Every database users allocated a default permanent tablespace as USERS to store their own objects like tables and indexes.

Sometimes Default Permanent Tablespace Set to a System Tablespace, it means that default tablespace for newly created user will assign this tablespace.

To find Default Permanent Tablespace:


SQL> select PROPERTY_VALUE from database_properties
  2  where PROPERTY_NAME='DEFAULT_PERMANENT_TABLESPACE';

PROPERTY_VALUE
---------------
USERS

 If it is system tablespace then change it as:

sql>alter database default tablespace users;



READ MORE ...

Oracle: How to Find the Table Size

There are different ways to find table size in oracle, views associated to check size of tables are:

  • DBA_EXTENTS
  • USER_EXTENTS
  • DBA_SEGMENTS

Method 1:

To find size of tables using view DBA_SEGMENTS:

SQL> SELECT SEGMENT_NAME, SEGMENT_TYPE, BYTES/1024/1024 MB, TABLESPACE_NAME
  2  FROM DBA_SEGMENTS
  3  WHERE SEGMENT_TYPE='TABLE' AND SEGMENT_NAME='CUSTOMERS';

SEGMENT_NAME    SEGMENT_TY         MB TABLESPACE_NAME
--------------- ---------- ---------- ------------------------------
CUSTOMERS       TABLE           .0625 SYSTEM














Method 2:

To find size of tables using view DBA_EXTENTS:


SQL>  SELECT SEGMENT_NAME, SEGMENT_TYPE, BYTES/1024/1024 MB, TABLESPACE_NAME
  2   FROM DBA_EXTENTS
  3   WHERE SEGMENT_TYPE='TABLE' AND SEGMENT_NAME='CUSTOMERS';

SEGMENT_NAME    SEGMENT_TY         MB TABLESPACE_NAME
--------------- ---------- ---------- -------------------
CUSTOMERS       TABLE           .0625 SYSTEM


As a user you can also use user_extents.


READ MORE ...

Saturday 9 August 2014

Oracle: Find Total Size of The Database

The size of the oracle database is the total size of the data files, redo log files and temp files that make up the tablespaces of the database. These details are found in the dba_extents view. Type the following lines at the SQL prompt:

Total-size-of-oracle-database


Method 1: To find used space within the database.

SQL>select sum(bytes/1024/1024/1024) as SIZE from   dba_extents;

Method 2: To find overall database size:

The biggest portion of a database's size comes under the datafiles.
To get size of all datafiles in MB:

SQL>select sum(bytes)/1024/1024 "Meg" from dba_data_files;
To get the size of all TEMP files:

select nvl(sum(bytes),0)/1024/1024 "Meg" from dba_temp_files;
To get the size of the on-line redo-logs:

select sum(bytes)/1024/1024 "Meg" from sys.v_$log;


Combining all together we will get overall size: 

SQL> select ( select sum(bytes)/1024/1024/1024 data_size from dba_data_files ) +
( select nvl(sum(bytes),0)/1024/1024/1024 temp_size from dba_temp_files ) +
( select sum(bytes)/1024/1024/1024 redo_size from sys.v_$log ) +
( select sum(BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024/1024 controlfile_size from v$controlfile) "Size in GB"
from
dual


Check Oracle database faq:
http://www.orafaq.com/ 
READ MORE ...

Sunday 3 August 2014

Tere Hoke Rahenge Lyrics - Raja Natwarlal | Arijit Singh

Tere Hoke Rahenge Lyrics from movie Raja Natwarlal: The song Tere Hoke Rehengay is sung by Arijit Singh and music by uvan Shankar Raja.

Song: Tere Hoke Rehengay
Movie: Raja Natwarlal (2014)
Singer: Arijit Singh
Music: Yuvan Shankar Raja
Lyrics: Irshad Kamil
Star Cast: Emraan Hashmi, Humaima Malick
Music Label: Junglee Music

Tere Hoke Rahenge Lyrics

Tere Hoke Rahenge Lyrics

Kal the miley, phir kyun lage aise
Tumse miley... arsaa hua jaise
Ab tu bataa.. jo ho pataa..
Tere bina lamha lamha jiyenge kaise?

Teri baahon ka ghera
Badaa mehfooz lage hai
Badi bekhauf jagah hai ye.. oo ooo..
Inme hi rehna chaahein, teri panaahein

Jab tak hai jeena chahenge, oo ooo..
Tere hoke rahenge, oo ooo..
Dil zid pe adaa hai, oo ooo..
Tere hoke rahenge, oo ooo..
Tera shauq chadha hai, oo.. oo ooo..

Aankhon mein sapno ko rakh le mere
Inko naa jag tod de
Phir meri kismat ko jaise ho dil
Waisa hi tu mod de
Tu hi toh hai hausla
Chaahat ka tu hai sila
Jeete jee na jee sakein
Kahin ab jo tu naa mila..

Oo ooo.. Tere hoke rehengay
Oo ooo.. Dil zidd pe adaa hai
Oo ooo.. Tere ho ke rahenge..
Oo ooo.. Tera shauq chadha hai
Oo oo oo ooo..

=====================================

 कल थे मिले
फिर क्यों लगे ऐसे
तुमसे मिले अरसा हुआ जैसे
अब तू बता जो हो पता
तेरे बिना लम्हा लम्हा जिएंगे कैसे

तेरी बाहों का घेरा
बड़ा मेहफ़ूज़ लगे है
बड़ी बेख़ौफ़ जगह है ये… ओ…
इनमे ही रहना चाहें
तेरी पनाहें
जब तक है जीना चाहेंगे
ओ… ओ…
तेरे होके रहेंगे ओ… ओ…
दिल ज़िद पे अड़ा है ओ… ओ…
तेरे होके रहेंगे ओ… ओ… 
तेरा शौक़ चढ़ा
ओ… ओ…

आँखों में सपनों को रख ले मेरे
इनको ना जग तोड़ दे
फिर मेरी क़िस्मत को जैसे हो दिल
वैसा ही तू मोड़ दे
तू ही तो है हौसला
चाहत का तू है सिला
जीते जी ना जी सकें
कहीं अब जो तू ना मिला

ओ… ओ… तेरे होके रहेंगे
ओ… ओ… दिल ज़िद पे अड़ा है
ओ… ओ… तेरे होके रहेंगे
ओ… ओ… तेरा शौक़ चढ़ा
ओ… ओ…
READ MORE ...

Saturday 2 August 2014

How to Make all Windows Version OS genuine using CMD

It is good prescription that you should always try to avoid pirated version of windows OS like WIN 7, 8, 8.1 etc., you must buy and use genuine operating system. Yes, there is no doubt that it cost much but after and all, it's all features and support will be accessible to you.

Few days back one of my friend was using downloaded windows 8 OS and found that some of it's features was not working well and a message was there on his laptop screen that make it genuine. So if you are not able to buy original product, here is a best method to make all version of windows operating system like original.

Make all windows version OS Genuine

 Steps to make Windows OS (any version- 7/8/8.1) Genuine

Step1: Open Command Prompt (CMD) in Administrative mode:
  • Go to  start menu
  • Type "CMD"
  • Right click on "CMD" and choose "Run as administrator.

Step 2: On "CMD" type SLMGR -REARM as shown below, wait for few seconds until it process the request.





Step3: After few seconds a message window will popup having message "Restart your computer" press OK.

Step4: After reboot you will see that there is no message regarding "make windows genuine error"or "Fix WGA" error.

NOTE: This activation is only for a months. So after one months you will have to do this again.

If you run the command SLMGR -REARM for more than 3 time you will get an error.
Error: 0xC004D307 The maximum allowed number of re-arms has been exceeded. You must re-install the OS before trying to re-arm again.

Simple steps to Reset Windows 7 Rearm:

  • Just open the "command prompt" or run.
  • Type "Regedit" on Command prompt and press enter.
  • Windows Registry Window would open .
  • Now search for Registry Key
HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/SoftwareProtectionPlatform
–>“SkipRearm”=dword:00000000

Just change 00000000 to 00000001.

After 3 attempts windows OS Rearm key would change to 00000000, So you need to change the value to enable Rearm once again. Using this method you can make windows legal for lifetime.
READ MORE ...

Friday 1 August 2014

How to Enable/Disable Archive Log Mode in 10g/11g

By default when you enter CREATE DATABASE statement, it is in noarchive log mode, to change the archiving mode of the database, use the ALTER DATABASE statement with the ARCHIVELOG or NOARCHIVELOG clause using administrator privileges (AS SYSDBA).


By default, Oracle database store archive logs data into the flash recovery area. If you want to set  new location for archive logs, you can set using the parameter LOG_ARCHIVE_DEST_n to the location in which you wish to write archive logs.

SQL> show parameter recovery_file_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /u01/app/oracle/flash_recovery
                                                 _area
db_recovery_file_dest_size           big integer 2782M
SQL>




SQL> alter system set log_archive_dest_1='LOCATION=/u02/app/oracle/oradata/orcl01/arch01' scope = both;

System altered.

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u02/app/oracle/oradata/orcl01/arch01
Oldest online log sequence     26
Current log sequence           28
SQL> 

How to Enable Archive log Mode

Shut down the database instance and startup in mount stage:

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.

Total System Global Area  606806016 bytes
Fixed Size                  1376268 bytes
Variable Size             394268660 bytes
Database Buffers          205520896 bytes
Redo Buffers                5640192 bytes
Database mounted.


SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u02/app/oracle/oradata/orcl01/arch01
Oldest online log sequence     26
Next log sequence to archive   28
Current log sequence           28

How to Disable Archive log Mode

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u02/app/oracle/oradata/orcl/arch
Oldest online log sequence     26
Next log sequence to archive   28
Current log sequence           28

Shut down the oracle database instance and start in mount stage.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.

Total System Global Area  606806016 bytes
Fixed Size                  1376268 bytes
Variable Size             394268660 bytes
Database Buffers          205520896 bytes
Redo Buffers                5640192 bytes
Database mounted.

SQL> alter database noarchivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u02/app/oracle/oradata/orcl01/arch01
Oldest online log sequence     26
Current log sequence           28

You can also check official oracle docs for enabling/disabling archivelog mode here:

Controlling Archive
READ MORE ...

Oracle: How to Find the Database ID (DBID)

Every Oracle database has it's unique identifier called DBID which is necessary in most critical situations like recovery from loss of all control file using rman autobackup.

How to Find Oracle DBID

How to find Oracle DBID ?


Method 1:

You can easily find using V$database view:


SQL> select dbid from v$database;

      DBID
----------
3561501577

Method 2:

Find using RMAN:


C:\windows\system32>rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Aug 1 18:06:14 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TEST11 (DBID=3561501508)



READ MORE ...

How to Restore/Recover Lost of Control File Using Rman

Oracle database maintain three copies of Controlfile at three different locations. There are some situations arises when you loses all your controlfile. So in this case how to restore and recover controlfile using RMAN autobackup option.

One day when I tried to mount the Database I encountered with an error code:
ORA-00205: error in identifying control file, check alert log for more info

SQL> startup mount
ORACLE instance started.

Total System Global Area  606806016 bytes
Fixed Size                  1376268 bytes
Variable Size             394268660 bytes
Database Buffers          205520896 bytes
Redo Buffers                5640192 bytes
ORA-00205: error in identifying control file, check alert log for more info
=============================================================
How to restore control file using RMAN

C:\windows\system32>rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Aug 1 15:45:17 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TEST11 (not mounted)

RMAN> restore controlfile from autobackup;

Starting restore at 01-AUG-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 device type=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 08/01/2014 15:46:27
RMAN-06495: must explicitly specify DBID with SET DBID command

RMAN> restore controlfile;

Starting restore at 01-AUG-14
using channel ORA_DISK_1

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 08/01/2014 15:47:03
RMAN-06563: control file or SPFILE must be restored using FROM AUTOBACKUP














STEP 1: You need to set DBID before recovery

 SQL> host rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Aug 1 17:26:13 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TEST11 (DBID=3561501508)

SQL> select dbid from v$database;

      DBID
----------

3561501508

But if your database is not mounted, you cannot find DBID. So set ID to any number you want.
ex: 

RMAN> set DBID=3561501508


executing command: SET DBID

STEP2: Restore control file from autobackup:

RMAN> restore controlfile from autobackup;

Starting restore at 01-AUG-14
using channel ORA_DISK_1

channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140801
channel ORA_DISK_1: AUTOBACKUP found: c-3561501508-20140801-00
channel ORA_DISK_1: restoring control file from AUTOBACKUP c-3561501508-20140801-00
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=D:\APP\SANTOSHTIWARI\ORADATA\TEST11\CONTROL01.CTL
Finished restore at 01-AUG-14

STEP3: 

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

STEP4
RMAN> recover database;

Starting recover at 01-AUG-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 device type=DISK

starting media recovery

archived log for thread 1 with sequence 3 is already on disk as file D:\APP\SANTOSHTIWARI\ORADATA\TEST11\REDO03.LOG
archived log file name=D:\APP\SANTOSHTIWARI\ORADATA\TEST11\REDO03.LOG thread=1 sequence=3
media recovery complete, elapsed time: 00:00:01
Finished recover at 01-AUG-14

RMAN> alter database open resetlogs;

database opened

READ MORE ...