Thursday, September 10, 2009

Natural hair care through Exercise

Healthy hair is everybody's desire. It gives the greatest of looks adding to the confidence of a person, while also giving a certain definition to the features of every person. Taking care of your hair needs some extra care. Here are few tips that help you.

Natural hair care through Exercise
Well, you are not the only one who will be surprised if asked to give your body simple exercises for healthy hair. As already mentioned above, hair generally reflects your health. Only a healthy body can have healthy hair. So we suggest you to do regular exercise to get healthy hair.

Exercises need not be very strenuous nor do they need to include lifting weights with your hair. All you will need is a jog or walk for around 20 minutes per day followed by some stretching exercises to keep your body fit and fine. Not only these exercises increase the flexibility in your body, they make sure that your body performs its functions properly.

Diet
Though DIET for your hair needs to be mentioned at the top of the list, here exercise is given the top priority because you can do it early in the morning. However diet is as important as exercise. People need to understand that diet and exercise are a combination that effects the growth of healthy hair.

Take a balanced-diet whenever you take food. A Balanced diet is a diet that contains all the necessary vitamins and minerals apart from proteins, carbohydrates and fats.

Almost 97% of the hair is made of something called keratin, which is mainly a protein. Hence protein is an important part of growing healthy hair. Protein food, especially with shampoos and other hair products having amino proteins, gives strength to your hair.

Water is such an important part of our life that we almost ignore it or take it for granted. Hair has and needs certain moisture in the scalp for it to grow healthily. Drink at least 10 glasses of water per day. You will not only find healthy hair, you will find improved skin texture too.

If you have oily hair try avoiding fatty foods.

Some other general tips for healthy hair :

■KNOW THY HAIR is the key factor to take care of your hair. This has been told and mentioned in every other article on this site. Knowing the behavior of your hair helps a lot in taking care of it.
■Get regular oil massage. Oil massage soothes your hair and scalp, while making the skin on your head active. Massages help in relieving all kinds of pressures, and make the body parts function properly again.
■Choose all hair products with great care. With the dawn of too much of information available on various websites, the confusion of a general reader has only increased. But with some time and patience, it will always be possible to differentiate a fake product and a product that works.
■Understand that it is normal to loose 50-100 hair regularly. You need not panic at the very first sight of hair going down your bathroom drain. Take time to analyze if you are really losing hair
■A product that has worked for your sibling or a friend need not work for you. Every person is different from the other, hence find a product that works for you and you only.
■One easy way for Natural Hair Care - do not comb wet hair..
■Do not use strong dryers or blowers.
■Do not leave massaged oil on your head for more than 30 min.
■Do not tie your hair for too long. Leave them freely for as long as possible. However take care that you keep a balance between letting them loose and tying them up.
■For women, it is advised not to try styles that need their hair to be tied for longer periods of time.

Wednesday, September 9, 2009

Vitamins Good for Hair

It is the deficiency of B vitamins (especially B6, biotin, inositol and folic acid) in your diet that lead to hair loss. The body needs plenty of vitamins for promoting health fitness, but there are some specific natural vitamins for hair growth like B5 (pantothenic acid and B3 (niacin). Read further to explore information about healthy hair vitamins…

Here is a list of vitamins good for hair:
Vitamin A: it is an antioxidant that aids in the making of healthy sebum in the scalp. Food sources rich in Vitamin A are fish liver oil, meat, milk, cheese, eggs, spinach, broccoli, cabbage, carrots, apricots and peaches.
Vitamin C: they work towards maintaining hair health. Sources of vitamin C are citrus fruits, strawberries, kiwi, cantaloupe, pineapple, tomatoes, and dark green vegetables.
Vitamin E: it helps in improving the scalp circulation. Food sources rich in vitamin E are vegetable oils, wheat germ oil, soybeans, raw seeds and nuts, dried beans, and leafy green vegetables.
Biotin: it works as an anti aging agent by preventing graying of hair and hair loss. Sources of biotin are: whole grains, egg yolks, liver, rice and milk.
Inositol: it helps in keeping hair follicles healthy. Rich food sources include whole grains, liver and citrus fruits.
Niacin (Vitamin B3): it aids in promoting scalp circulation. Rich food sources include wheat germ, fish, chicken, turkey and meat.
Pantothenic Acid (Vitamin B5): it helps in preventing graying and hair loss. Rich food sources encompass whole grain cereals, organ meats and egg yolks.
Vitamin B6: Prevents hair loss. Food sources include brewer's yeast, liver, whole grain cereals, vegetables, organ meats and egg yolk.
Vitamin B12: Prevents hair loss. Rich food sources include chicken, fish, eggs and milk.

Regrow your hair with banana mask

November 21, 2008 on 9:00 am | In regrow hair |
Don’t you know that bananas are actively used to prevent hair loss and regrow hair? They are also very useful in general hair care for both dry and greasy hair. So why not try hair restoration with banana mask?

In case you have dry and lifeless hair this recipe will surely bring good results. Take a banana, peel it, put it in an enamel saucepan and knead it with a plug. Add a whipped yolk, 2 spoonfuls of sour cream and 1 teaspoon of honey. Mix it all thoroughly and put it on your scalp and hair before washing. Keep it about 40 minutes, holding your head in a warm bandage. Wash up your head with a shampoo and rinse it with acidified water. After such procedures your hair will surely become softer and more shiny.

There’s a bit different recipe for greasy hair. Peel one large ripe banana, knead it with a plug. Take its peel and blend or pass it through the meat grinder. Add 2 teaspoons of citric juice and mix all components. Take fresh milk and put it on your scalp and hair with a tampon. Then aplly the mix in the same manner and wrap your head with a warm kerchief or towel. Leave it for 30-40 minutes, then wash up your hair with a soft shampoo. Your hair will restore elasticity, softness and tenderness.

Monday, September 7, 2009

Great Ashoka Maurya

Ashok Bindusara Maurya was born to the Mauryan emperor Bindusara and his Queen 'Dharma' (although she was a Brahmin or Shubhadrangi, she was undervalued as she wasn't of royal blood). Mauryas were the Muras or rather Mors, and another view of a Jat origin of Indo-Scythian lineage. Ashoka had several elder siblings (all half-brothers from other wives of Bindusara). He had just one younger sibling, Vitthashoka (a much loved brother from the same mother). Because of his exemplary intellect and warrior skills, he was said to have been the favorite of his grandfather Chandragupta Maurya. As the legend goes, when Chandragupta Maurya left his empire for a Jain living, he threw his sword away. Ashoka found the sword and kept it, in spite of his grandfather's warning.


Chandragupta Maurya,who was founder of Maurya dynasty,and grandfather to AshokaAshoka, in his adolescence, was rude and naughty. He was a fearsome hunter. He was a kshatriya and was given all royal military trainings and other Vedic knowledge. According to a legend, he killed a Lion with just a wooden rod. Ashoka was known for his sword fighting. He was very adventurous and this made him a terrific fighter. Ashoka was a frightening warrior and a heartless general. Because of this quality he was sent to destroy the riot of Avanti. Many historians assert that he might have killed his own brothers who came against his way to power.
[edit] Rise to Power

Maurya Empire at the age of Ashoka the Great. The empire stretched from Iran to Bangladesh/Assam and from Central Asia (Afganistan) to Tamil Nadu/South India.Developing into an impeccable warrior general and a shrewd statesman, Ashoka went on to command several regiments of the Mauryan army. His growing popularity across the empire made his elder brothers wary of his chances of being favored by Bindusara to become the next emperor. The eldest of them, Susima, the traditional heir to the throne, persuaded Bindusara to send Ashoka to quell an uprising in Taxshila, a city in the north-west District of Pakistani Punjab region, for which Prince Susima was the Governor. Taxshila was a highly volatile place because of the war-like Indo-Greek population and mismanagement by Susima himself. This had led to the formation of different militias causing unrest. Ashoka complied and left for the troubled area. As news of Ashoka's visit with his army trickled in, he was welcomed by the revolting militias and the uprising ended without a conflict. (The province revolted once more during the rule of Ashoka, but this time the uprising was crushed with an iron fist)

Ashoka's success made his stepbrothers more wary of his intentions of becoming the emperor and more incitements from Susima led Bindusara to send Ashoka into exile. He went into Kalinga and stayed there incognito. There he met a fisher woman named Kaurwaki, with whom he fell in love. Recently found inscriptions indicate that she would later become either his second or third queen.

Meanwhile, there was again a violent uprising in Ujjain. Emperor Bindusara summoned Ashoka out of exile after two years. Ashoka went into Ujjain and in the ensuing battle was injured, but his generals quelled the uprising. Ashoka was treated in hiding so that loyalists of the Susima group could not harm him. He was treated by Buddhist monks and nuns. This is where he first learned the teachings of the Buddha, and it is also where he met Devi, who was his personal nurse and the daughter of a merchant from adjacent Vidisha. After recovering, he married her. It was quite unacceptable to Bindusara that one of his sons should marry a Buddhist, so he did not allow Ashoka to stay in Pataliputra but instead sent him back to Ujjain and made him the governor of Ujjain.

The following year passed quite peacefully for him, and Devi was about to deliver his first child. In the meanwhile, Emperor Bindusara died. As the news of the unborn heir to the throne spread, Prince Susima planned the execution of the unborn child; however, the assassin who came to kill Devi and her child killed his mother instead. As the folklore goes, in a fit of rage, Prince Ashoka attacked Pataliputra (modern day Patna), and beheaded all his brothers, including Susima, and threw their bodies in a well in Pataliputra. At that stage of his life, many called him Chanda Ashoka (Sanskrit word chanda means cruel, Chandi-devi being associated with Kali) meaning fierce, rude, passionate and heartless Ashoka . In this phase of life he was known for his unquenched thirst for wars and campaigns launched to conquer the lands of other rulers made him called as Chandashok(the terrible Ashok).


Most of the Indian currencies including coins contain the symbol of Lion capital of AshokaAscending the throne, Ashoka expanded his empire over the next eight years expanding it from the present-day boundaries and regions of Burma–Bangladesh and the state of Assam in India in the east to the territory of present-day Iran / Persia and Afghanistan in the west; from the Pamir Knots in the north to the almost peninsular part of southern India (i.e. Tamilnadu / Andhra pradesh).


[edit] Conquest of Kalinga
Main article: Kalinga War
While the early part of Ashoka's reign was apparently quite bloodthirsty, he became a follower of the Buddha's teaching after his conquest of Kalinga (India) on the east coast of India in the present-day state of Orissa. Kalinga was a state that prided itself on its sovereignty and democracy. With its monarchical parliamentary democracy it was quite an exception in ancient Bharata where there existed the concept of Rajdharma. Rajdharma means the duty of the rulers, which was intrinsically entwined with the concept of bravery and Kshatriya dharma.

The pretext for the start of the Kalinga War (265 BC or 263 BC) is uncertain. One of Susima's brothers might have fled to Kalinga and found official refuge there. This enraged Ashoka immensely. He was advised by his ministers to attack Kalinga for this act of treachery. Ashoka then asked Kalinga's royalty to submit before his supremacy. When they defied this diktat, Ashoka sent one of his generals to Kalinga to make them submit.

The general and his forces were, however, completely routed through the skilled tact of Kalinga's commander-in-chief. Ashoka, baffled at this defeat, attacked with the greatest invasion ever recorded in Indian history until then. Kalinga put up a stiff resistance, but they were no match for Ashoka's brutal strength. The whole of Kalinga was plundered and destroyed. Ashoka's later edicts state that about 100,000 people were killed on the Kalinga side and 10,000 from Ashoka's army. Thousands of men and women were deported



Ashoka Chakra

The Ashoka Chakra, "the wheel of Righteousness" (Dharma in Sanskrit or Dhamma in Pali)"
Ashoka Chakra on the Indian National Flag.The Ashoka Chakra (the wheel of Ashok the Great) is a depiction of the Dharmachakra or Dhammachakka in Pali, the Wheel of Dharma (Sanskrit: Chakra means wheel). The wheel has 24 spokes. The Ashoka Chakra has been widely inscribed on many relics of the Mauryan Emperor, most prominent among which is the Lion Capital of Sarnath and The Ashoka Pillar. The most visible use of the Ashoka Chakra today is at the centre of the National flag of the Republic of India (adopted on 22 July 1947), where it is rendered in a Navy-blue color on a White background, by replacing the symbol of Charkha (Spinning wheel) of the pre-independence versions of the flag. Ashoka Chakra can also been seen on the base of Lion Capital of Ashoka which has been adopted as the National Emblem of India.

The Ashoka chakra was built by Ashoka during his reign. Chakra is a Sanskrit word which also means cycle or self repeating process. The process it signifies is the cycle of time as how the world changes with time. The horse means accuracy and speed while the bull means hardwork.

A few days before India became independent on August 1947, the specially constituted Constituent Assembly decided that the flag of India must be acceptable to all parties and communities.[4] A flag with three colours, Saffron, White and Green with the Ashoka Chakra was selected. Sarvepalli Radhakrishnan, who later became India's first Vice President, clarified the adopted flag and described its significance as follows:

Bhagwa or the saffron color denotes renunciation or disinterestedness. Our leaders must be indifferent to material gains and dedicate themselves to their work. The white in the center is light, the path of truth to guide our conduct. The green shows our relation to (the) soil, our relation to the plant life here, on which all other life depends. The "Ashoka Chakra" in the center of the white is the wheel of the law of dharma. Truth or satya, dharma or virtue ought to be the controlling principle of those who work under this flag. Again, the wheel denotes motion. There is death in stagnation. There is life in movement. India should no more resist change, it must move and go forward. The wheel represents the dynamism of a peaceful change. It also represents 24 hours in a day.


Source :http://en.wikipedia.org/wiki/Ashoka_the_Great

Monday, August 3, 2009

Recovering oracle database using old control file

I had to use an old control file in a restore scenario, and I was told
to issue this command "RECOVER DATABASE USING BACKUP CONTROLFILE" then
"ALTER DATABASE OPEN RESETLOGS".

Friday, July 31, 2009

Smart Phones: A Tutorial

1. INTRODUCTION

Pervasive Computing integrates computation in the environment rather than having computers which are distinct objects. Other terms for pervasive computing include ubiquitous computing, calm technology, things that think and everyware. In other words, pervasive computing means computers everywhere, making them available throughout the physical environment while making them effectively invisible to the user. Instead of having a desktop or a laptop machine, the technology pervasive computing uses is embedded in the environment. Ubiquitous technology is often wireless, mobile or networked making its users more connected to the world around them and the people in it. Through pervasive computing, users use today's digital tools like laptops, mobile phones, PDAs, smartphones to communicate and exchange information in different ways and conceive and use the geographical and temporal spaces differently. In addition of being an aspect of information dissemination, pervasive or ubiquitous computing is global and local, social and personal, invisible and visible at the same time.


2. COMPONENTS OF PERVASIVE COMPUTING

It consists of three major components: pervasive devices, pervasive networking, pervasive middleware and pervasive applications. Each of these components works in synergy to give pervasive computing its unique qualities.

2.1 Devices

An intelligent environment is likely to contain many different device types:
traditional input devices, such as mice or keyboards, and output devices, such as speakers or light-emitting diodes;
wireless mobile devices, such as pagers, personal digital assistants, cell phones, palmtops, and so on;
smart devices, such as intelligent appliances, floor tiles with embedded sensors, and biosensors.
Ideally, pervasive computing should encompass every device worldwide that has built-in active and passive intelligence.

2.2 Pervasive networking

The number of pervasive devices is expected to multiply rapidly over the next few years. There will be more than 300 million PDAs; two billion consumer electronic devices, such as wireless phones, pagers, and settop boxes; and five billion additional everyday devices, such as vending machines, refrigerators, and washing machines embedded with chips and connected to a pervasive network. As a consequence of this proliferation, many current technologies must be revamped. In addition to extending the backbone infrastructure to meet the anticipated demand, global networks like the Internet also must modify existing applications to completely integrate these pervasive computing devices into existing social systems.

2.3 Pervasive middleware

Like distributed computing and mobile computing, pervasive computing requires a middleware "shell" to interface between the networking kernel and the end-use applications running on pervasive devices. This pervasive middleware will mediate interactions with the networking kernel on the user’s behalf and will keep users immersed in the pervasive computing space. The middleware will consist mostly of firmware and software bundles executing in either client-server or peer-to-peer mode. User interfaces are another aspect of middleware. Standard Web browsers represent the high end of interface sophistication. They use more color, graphics, and controls than users typically expect on pervasive devices. Mobile computing has already introduced microbrowsers.

2.4 Pervasive applications

Pervasive computing is more environment-centric than either Web-based or mobile computing. This means that applications will guide the middleware and networking issues to a large extent. Consider a heart patient wearing an implanted monitor that communicates wirelessly with computers trained to detect and report abnormalities. The monitor should know when to raise the alarm, based on its knowledge about the environment. So this is much more than simple wireless communication.


3. SMART PHONES AND PERVASIVE COMPUTING

A smartphone is an electronic handheld device that integrates the functionality of a mobile phone, personal digital assistant (PDA) and other information devices. Imagine the number of pockets a person would need if he would have to carry a cell phone, a calculator, address book, music player, camera etc. A smart phone provides a solution to this problem. A smart phone can be developed by adding telephone features to an existing PDA or adding ‘smart’ functionalities of a PDA to a mobile phone. A key feature of a smart phone is that additional applications can be installed on the device. These applications can be developed by the manufacturer, the operator or any other third party like the user or any software developer. Thus unlike the conventional cell phones, a user can install, configure or run applications of their interests on the smart phone. Consider a standard cell phone with a built-in calculator application. A user has to use this calculator whether or not its helpful for him or not. But if that phone were a smartphone, the user could have installed any compatible calculator application he likes. Thus using a smart phone a user can make and receive phone calls, can interact with laptop and desktop computers, access internet, send and receive emails, manage personal information, instant messaging, data synchronization with applications like Microsoft outlook, play audio and video files and install applications of his choice. Additionally smart phones features also include GPS navigation tools and the ability to read business documents in a variety of formats like PDF.

Mobile phones have become a pervasive part of everyday life. People have mobile phones, smart phones or PDAs with them nearly always and anywhere. The primary aim of pervasive computing is providing information to the users anywhere anytime and on any device. Due to the proliferation of smart phones and PDAs and since they provide end to end communication in mobile networks, smart phones serve as important pervasive devices in ubiquitous environments. These smart phones can send and receive information via GPRS or bluetooth and can even provide the user location via GPS (Global Positioning System). Today’s mobile phone networks provide global ubiquitous wireless environments, satisfying most requirements of the pervasive computing information service delivery. Thus along with smart phones, pervasive computing brings the power of broadband communication to the shoppers, travelers, businessmen and others on the go. Smart phones also support many advanced interactive user interfaces. Many projects have been developed to build interactive user interfaces like the MyGrocer project.


4. VARIOUS PLATFORMS FOR SMART PHONES

An Application Development Platform or Framework is basically a collection of tools and libraries which enable developers to develop application targeting a hardware of software platform. Some of the well known application development platforms like Java, .NET framework target and get ported on various software platforms or operating systems. BREW is a application development platform or framework which targets and get ported on various hardware platforms.

4.1. Binary Runtime Environment for Wireless (BREW)

BREW is an application development platform created by Qualcomm for mobile phones. It is air-interface independent, i.e. it can support GSM/GPRS, UMTS, and CDMA. However, when BREW was first introduced it was solely developed for CDMA handsets. Standing for Binary Runtime Environment for Wireless, it is a software platform that can download and run small programs for playing games, sending messages, sharing photos, etc. The main advantage of BREW platform is that the application developers can easily port their applications between all the Qualcomm ASICs (Application Specific Integrated Circuits). The BREW runs between the application and the wireless device's chip operating system; therefore BREW enables a programmer to develop applications without needing to code for system interface or understand wireless applications.

Software for the BREW-enabled handsets can be developed in C or C++ using the BREW SDK. The SDK includes a BREW Emulator which can be used for testing during the development process. Unlike the Java ME platform, where any developer can upload and execute software on any supported handset, BREW applications must be digitally signed. Because BREW gives complete control over the handset hardware, only content providers or authenticated BREW developers have the tools necessary to create a digital signature.

The BREW API is more standard across supported phones than the J2ME API, which can be considerably different depending on the phone model. Also graphics tricks are easier with Brew and have direct access to the screen buffer.

4.2. Java 2 Micro Edition (J2ME)

Java is becoming a standard across wireless devices because of its application portability, endorsement by virtually all wireless technology vendors, integrated safeguards for network delivery, sandboxing, and it’s a powerful object oriented programming language. Java runtime environments are standard or readily available for Symbian (e.g. Nokia Communicator 9200), embedded Linux (Sharp Zaurus), PocketPC (Compaq's iPAQ), Palm (KVMs from Sun, Esmertec, Kada, IBM) and real-time operating systems.

The modular design of the J2ME architecture enables an application to be scaled based on constraints of a small computing device. J2ME architecture doesn’t replace the operating system of a small computing device. Instead, J2ME architecture consists of layers located above the native operating system, collectively referred to as the Connected Limited Device Configuration (CLDC). The CLDC, which is installed on top of the operating system, forms the run-time environment for small computing devices.

The J2ME architecture comprises three software layers. The first layer is the configuration layer that includes the Java Virtual Machine (JVM), which directly interacts with the native operating system. The configuration layer also handles interactions between the profile and the JVM. The second layer is the Profile layer, which consists of the minimum set of application programming interfaces (APIs) for the small computing devices. The third layer is the Mobile Information Device Profile (MIDP). The MIDP layer consists Java APIs for user network connections, persistence storage, and the user interface. It has access to CLDC libraries and MIDP libraries.

Small Computing Device Requirements

There are minimum resource requirements for a small computing device to run a J2ME application. First the device must have a minimum of 96 X 54 pixel display that can handle bitmapped graphics and have a way of users to input information, such as a keypad, keyboard or touch screen. At least 128 kilobytes (KB) of nonvolatile memory is necessary to run Mobile Information Device (MID), and 8 KB of nonvolatile memory is needed for storage of persistent application data. To run JVM, 32KB of volatile memory must be available. The device must provide two way connectivity.

A MIDlet is an application that requires a device that implements Java ME, MIDP to run. Like other Java programs, MIDlets have a "compile once, run anywhere" potential. All the files necessary to implement a MIDlet must be contained within a production package called the Java Archive (JAR) file. These files include MIDlet classes, graphic images and the manifest file. The manifest file contains a list of attributes and related definitions that are used by the application manager to install the files contained in the JAR file onto the small computing device. Along with this, a Java Application Descriptor (JAD) file can also be included within the JAR file. A JAD file is used to provide the application manager with additional content information about the JAR file to determine whether the MIDlet suite can be implemented on the device.

Servlets are modules of java code that run in a server application to answer client requests. Since servlets are written in the highly portable Java language and follow a standard framework, they provide a means to create sophisticated server extensions in a server and operating system independent way. To create a wireless mobile application, the midlets are deployed on a mobile phone (client) which supports java applications and the servlets are deployed on a server. The client application is then tied into the server via an HTTP connection. The application will send requests to the server for data and receive fgresponses that will be mapped into the appropriate fields of the client application.


5. ARCHITECTURAL FRAMEWORK FOR SMART PHONES

Client Server Architecture

Most of the pervasive computing projects involving smart phones follow client server architecture. The term client/server was first used in the 1980s in reference to personal computers (PCs) on a network. The actual client/server model started gaining acceptance in the late 1980s. The client/server software architecture is a versatile, message-based and modular infrastructure that is intended to improve usability, flexibility, interoperability, and scalability as compared to centralized, mainframe, time sharing computing.



Fig.1. Client Server Architecture

Client server architecture is an architecture of a computer network in which many clients (remote processors) request and receive service from a centralized server (host computer). Client computers provide an interface to allow a computer user to request services of the server and to display the results the server returns. Servers wait for requests to arrive from clients and then respond to them. Ideally, a server provides a standardized transparent interface to clients so that clients need not be aware of the specifics of the system (i.e., the hardware and software) that is providing the service. Today clients are often situated at workstations or on personal computers, while servers are located elsewhere on the network, usually on more powerful machines. This computing model is especially effective when clients and the server each have distinct tasks that they routinely perform. In hospital data processing, for example, a client computer can be running an application program for entering patient information while the server computer is running another program that manages the database in which the information is permanently stored. Many clients can access the server's information simultaneously, and, at the same time, a client computer can perform other tasks, such as sending e-mail. Because both client and server computers are considered intelligent devices, the client-server model is completely different from the old "mainframe" model, which utilized a centralized mainframe computer that performed all the tasks for its associated "dumb" terminals.


6. SELECTIVE APPLICATIONS

6.1. MyGrocer Project [1]

The IST (Information Society Technologies)-funded MyGrocer project has developed an innovative software application addressing the retail sector. Its solution combines radio frequency product identification, wireless network communications techniques (i.e. WLAN) and information technology resources using actual database technologies and protocols (OLAP, XML, HTML, WAP). This combination will transform current shopping methods by offering the customer accurate information about each and every product in the shopping trolley. Unlike barcodes, RF-tags uniquely identify each product. In addition, they do not require physical scanning; the RF-Tags are constantly transmitting their presence to the RF Receiver positioned on the shopping trolley or in the vicinity.

When the customer enters a shop, he/she logs onto the MyGrocer application via the trolley's terminal. The system identifies the user and displays the shopping list on the shopping trolley's display. The trolley's system can identify the placing of the products in (or out of) the trolley, access pricing information, display promotions, and relates to other in-shop applications. At the check-out, the smart shopping trolley system transmits the list of items to the cashier. It transmits the purchased item list, helps generate the receipt and tells the cashier the amount to be paid. The customer's shopping list is kept in the local system to be used in future promotions. Meanwhile, the data are transmitted to the supermarket IT system and can help update the shop's inventory in real-time and initiate the necessary measures to replenish the stock.

At home, providing the goods are stored in an identified location equipped with a RFReceiver, a local server (PC, Personal Digital Assistant (PDA), set-top box, etc.) can keep track of the local inventory of goods. If the system is used, a 'restock' notice can be generated and transmitted over the Internet, for items that aren't put back in place after a predetermined period of time. It contributes to producing a 'shopping list'. The consumer can electronically retrieve his/her shopping list (PC, PDA, mobile phone) and conduct remote/ mobile shopping transactions.

6.2. mExpress Project [2]

mExpress (Mobile in Exhibition Provision for Electronics Support Services) project exploits location sensing and tracking through smart phone technology and wireless LAN systems to provide route assistance within an exhibition space. The system uses the visitor's PDA or smartphone to locate his position at any time during the exhibition. Also, the information when a visitor approaches a particular stand can be known. In addition, visitors can also create a personal profile using their smart phones or PDAs either in advance or directly on-site, which will point them directly to the site or the stand they are interested in the exhibition.

6.3. E-Care Project [3]

The E-Care Project is a comprehensive monitoring system to capture, transmit and distribute vital health data to doctors, carers and family. E-Care's system dynamically produces data depending who accesses a patient's record. A doctor will see all the health information, a system or medical administrator will see data relevant to them, while patients, their friends or family, will see another set of data, all coming from the one file. Also, it can acquire vital information about a patient who lives far away from medical support, and it can alert medical staff if there is a dangerous change in patient's status.

The E-Care system comprises of wireless intelligent sensors network, biomedical sensors and a radio terminal to monitor various activities of a patient like his pulse rate, blood pressure, temperature, glucose levels, drug conformance etc. Data collected by the sensors are sent to the central repository system via the transmitters.

SMS are sent to the drug conformance device like a PDA installed near the patient's bed to remind when they have to take the medication and the patients send a conformation once they take the drugs. The Medical Data Manager (MDM) module of the central repository system checks the patient's data against the patient's records and any doctor's notes. If there is any change in the patient's vital signs like blood pressure, an alarm is sent immediately to the patient's physician on his smart phone or PDA. Also, the MDM can alert the doctor if the patient's data fails to arrive.

6.4. TellMaris [4], [5]

The TellMaris project provides 3D navigation and vital information to the sailors about the entrance of the harbors and regular weather forecasts. It provides the tourists with route and location based services and information on city attractions, restaurants and other tourists highlights on their PDAs or smart phones.

6.5 The Virtual Blood Bank Project [6]

The VBB project in India’s National Capital Region of Delhi uses smart phones to build a pervasive network that gives people instantaneous information about available blood donors in their vicinity.

6.6 The Interactive Traffic Beat Project [7]

The Interactive Traffic Beat Project uses a Web-based service to deliver vehicle traffic information to people through their cell phones at the right time so that valuable time can be saved and the chaos on the roads can be managed.

7. REFERENCES

1. www.eltrun.gr/mygrocer
2. http://mexpress.intranet.gr/
3. A. Marsh, "The E-CARE Project: Removing the Wires," Proc. Int’l Conf. Computer Science, vol. 2, Elsevier Science Publishers, 2002, pp. 1012–1018.
4. A. Schilling et al., "Introducing 3D GIS for the Mobile Community: Technical Aspects in the case of TellMaris," Proc. IMC Workshop 2003, Fraunhofer IRB Verlag, 2003, pp. 86–92.
5. www.tellmaris.com
6. Ramesh Singh, Preeti Bhargava, Samta Kain, "Smart Phones to the Rescue: The Virtual Blood Bank Project," IEEE Pervasive Computing, vol. 6, no. 4, pp. 86-89, Oct-Dec, 2007
7. Singh, R.; Bhargava, P.; Kain, S., "Smart phones and interactive reports leave traffic in the rearview mirror," Potentials, IEEE , vol.27, no.2, pp.33-38, March-April 2008


Source: Ubiquity Volume 9, Issue 14 (April 8, 2008 - April 14, 2008)

Thursday, July 30, 2009

7th House -Husband

In stree jataka[female horoscopy] ,the planet in the seventh navamsa or the lord of seventh navamsha decides the quality of the Husband.

if sun is in the seventh or sun is the lord of the seventh then the husband will be of very tender body or quiet spoken ,mild man. He will be a very hard worker . [atimrudu ,ati karmi]
If moon be similarly placed or if seventh house is cancer in the amsha , the husband will be one who will hanker after other women , he will also look after his wife well , he will be kind hearted soft personality.
If mars is present in the seventh house the husband will be very loving towards women , he will be easily given to anger and rash personality.
If mercury is in the seventh amsha or virgo/gemini is the seventh house then he husband will be a scholar , he will have a good sense of humour ,if well placed he may a trader or accountant , when in the amsha of the venus it will give persons well versed in arts.
if jupiter becomes the owner of the seventh navamsha ,the husband will be highly educated ,blessed with many good qualities , and will have his senses and under control , will never look at other woman .
If saturn happens to be lord of seventh then the husband will either be a fool or the age difference between husband and wife will very high. he will be a old man. if it is ketu then he will be impotent .if with Rahu he will be already married to someone else.
If Venus is the lord of the seventh navamsha then husband will be very handsome and will be very fortunate person. He will have excellent attractive features and a pompous style and blessed personality.
Amba was determined to Kill BHeeshma ,she undertook severe penace to shiva to be born as man to kill Bheeshma . Shiva said woman cannot be born as Man ,however he gave her a boon to become the cause of death of Bheeshma. She insisted she wanted to become Man. Shiva said she would be assisted in becoming Man.

Drupad prayed Lord Shiva for a son, soon Shiva appeared and said a son would be born . But a Drupad’s wife gave birth to a daughter , amused Drupad thought for a while , Shiva’s words cannot be futile , this must be some test of his faith.

So he raised the girl child as a male ,he dressed her like a man and even taught her all the warfare and named as Shikhandi. When the child came of age , it was decided to marry the Prince[ss] . So neighbouring Kingdom’s King had a beautiful daughter , her hand was proposed in the marriage , Marraige took place grandly ,but later bride found that Groom was actually a woman. Upset she left for her Parent’s House. Parent furious addessed Drupad [ Drupad said he has raised as son and Shiva had told HIM that his child is male ] and agreed for a Angapariksha or war.

Shikhandi fearing insult to her Father that night went deep into the forest ,deciding never to return . As she was contemplating suicide with heavy sobbing and cursing her destiny . Tumbur[ Gandharva ] was passing by ,He was cursed by the rishi to become a woman . He was also unhappy .But seeing the plight of the Shikhandi , he offered, He would lend his body [male] to her .But the problem is a female cannot control a male body , [but a male can take a female body and control it and live in it] this is nature’s law. So Tumbur offered to control her body and she be just present in it[ Tumbur offered to be present in the manner devils possess the human body]

Thus overnight Shikhandi acquired a Male body , she would desire , Tumbur would carry it out for her. She came back to palace , During Angapariksha , In laws were very happy to see a man for her daughter ,They scolded her for unusually doubting the groom[handsome gandharva] . Drupad thanked Shiva for a great miracle and happy to see his faith in Shiva honoured.

The 7th house decides when you marry? But what if the 7th house lord is saturn?

The 7th House is the house of partnerships and relationship in total. Specifically, marriage - in total... not just the timing of it. In addition to the 7th House, the planet who rules the sign that creates the 7th House represents the same in an individuals chart. Finally, each planet has a house they inherently represent. Venus in inherently represents marriage.

The planet ruling the 7th house will represent marriage regardless if that planet is Venus, Saturn, Jupiter, whomever... But it is true that the planet will slightly give some of his or her natural energy to the sign it rules - which is why you can make some general blanket statements about the potentials of various rising signs without even knowing the rest of the chart.

There must be a delaying influence or a power drain upon your 7th House ruler.

The 4th house rules domestic happiness, and the 2nd tells of every day family affairs. So they are secodarily connected to marriage - but are not primary indicators of it.

Astrology Gemstone

What is gemstone? Does it really work anyway? How is it possible to change our life through gem? These are the common questions that rise in our mind most of the time. We want a satisfactory answer to it. This topic is my true effort to give those answers to you.

Any object in our neighbor affects us, more or less. What about gems or metal ring which touch on our finger or body? It also works in similarly. Yes, it really works.

Now, here is the one basic fact. How much can it change our life? Every gem has its own limitation. They can work only up-to 20%. If anybody wear a genuine stone, he will get almost 20% result from it. At first, it starts to affect biologically. Means, it influence on body, hormones. And than, influence on our behavior and mind. Our works are controlled by our mind. Thus, we can say that a gemstone is able to change our life, up-to little extent. Else that, everything is depends upon us. Normally, we expect more from a gemstone. We used to hope that gem can give us anything we want. It is not. Moreover, there are duplicate stones available in the market. In addition, Astrologer’s inability to choose the correct gemstone is another side. So if everything happens correctly, a gemstone will increase your potential to some extent, no doubt. So, you need to wear a real gem, not a duplicate one which is available in open market. Please test the gem in a GSI laboratory after buying it.– If you want to get more information, open this website.

The importance of seventh house in Vedic astrology

Seventh House:
In the seventh house of Vedic astrology Saptama ; Jamitra ; Chittottha (desire) ; Kama ; Dvuna (love) ; Madha (passion) ; Gamana (cohabitation) ; Astha (setting ; Advan (a way or road ) ; Loka (public) ; Kalathra (wife or husband) ; Pathni; pathi; Kalathrasampat (dowry).

The seventh house is the “House of union or earthy ties”. The seventh house represents legal bondage; it is through this that one ought to divine about marriage. Although marriage is principally the concern of the seventh houses, it is necessary to consider the houses 2 and 11 also in this respect.

By marriage, it is meant that there is an addition to the family. The second house includes father, mother, wife, children, etc.The married partner brings permanent tie of friendship for progeny and pleasure which is influenced by the 11th house. Therefore, one has to examine not only the seventh house but also the houses 2nd 11. Houses 2, 7 and 11 connected with benefic planets either by association or by aspect denote that the partner in life will come of a respectable family, be virtuously disposed and will possess good qualities to enable one to lead a happy and harmonious wedded life.

Besides the life partner, the partner in trade or business and the degree of success achieved through such partnership is also shown by this house. The seventh house also refers to all those with whom the native is engaged in quarrels and comes into conflict in the open through arguments, those with whom the native is engaged in quarrels and comes into conflict in the open through arguments, litigation, duels, etc., in a nut shell; the seventh house may be said to indicate all those with whom the native transacts or deals in any manner- the engineer or contractor who builds ; the doctor attending on the native or the patient on whom the native attends if he happens to be a medical practitioner ; the person who lends the native money or he who borrows from the native; and so on. Good aspects to the planet in the seventh house or to the cusp or to the cusp of the seventh house portray good relationship with the public and favor from them. During the period of the planer in evil aspect, one ought to be careful in undertaking any public activity.

This house shows break of journey. The third house signifies short journeys and the ninth hose denotes long journeys. The seventh house indicates visits to various places in one and the same trip.One’s influence in foreign countries and the honour and reputation achieved there, depends on the planet in the 7th house and the aspect it receives.

The first house of Vedic astrology denotes longevity while the 7th house opposes and is a maraka house; i.e., danger to longevity. Houses 8, 3 and 1infiunce longevity and one has to examine these three houses to determine whether one will be long-lived, or will live up to the middle age, or only up to the adult age, or die in infancy. The twelfth house to any bhava is said to be negation of that particular bhava, that is to say, it spoils the matters signified by that bhava. Therefore the houses 7, 2 and 12 which are respectively in 12 to houses 8, 3 and I prove inimical to longevity and are so termed ‘marakasthanas’.

In prasna or Horary Astrology, this house answers queries relating to the recovery of lost property, describes the thief, pickpockets, etc. the lagna represents the owner of stolen property. The fourth bhava denotes the place of the stolen article. The 7th shows thief. The 8th bhava being 2 to the 7th indicates the thief’s wealth. So when the planet in 7 or the lord of 7 is eclipsed or weak, the thief will be caught.The lagna represents one’s routine life and thereby permanent place of residence; the seventh house which is the opposite to it shows change of residence. One ought to see the seventh house as will as the third for the change of residence.

In Mundane or politics in Vedic Astrology, the seventh house is considered in matters pertaining to international relationships and arbitrations; war and foreign affairs, international trade, general condition of women and laws relating to marriage and divorce, public reaction to national policies, public meetings, etc. westerners call this the house of open warfare and enmity as well as of treaties and alliances.

The seventh house is also regarded as dealing with the native’s third brother or sister. The third house from the lagna indicates the first younger brother or sister; the house which is the third to the third sows the second younger brother; the house which is the third to the 5th house represents the third younger brother or sister. It is also the house of self acquisition of the native’s servant or employee, being the 2nd house counted from the 6th representing servants. Because the 5th house shows the first child or conception, the7th which is the 3rd to the 5th represents the first child’s younger brother or sister or the native’s second child; the 9th denotes the third child and so on in this manner. Being in 4 to the 4th house indicating mother, the 7th house deals with mother’s immovable property, vehicle, etc .According to Uttara Kalamritam, the 7th house rules the adopted child. This is understandable because one who is issueless may take his younger brother’s child in adoption. This is not uncommon.

The seventh house of Vedic astrology also denotes the secret enemy’s danger, difficulties, death etc., being in to the 12th house; the religion, long journeys, higher education of friends or elder brother being the 9th reckoned from the 11th house; the honour and credit of the Governments being in 10 to 10; associates and friends of father being the 11th house to the 9th. The native might enter into partnership with his father’s friend.

Wednesday, July 29, 2009

REMEDIES from Vedic Astrology for each PLANET

All living beings on earth are nourished by Sunlight. The light we receive from our Sun is the ultimate source of Energy for us all. SUNLIGHT is composed of SEVEN colours - Violet, Indigo, Blue, Green, Yellow, Orange and Red ( VIBGYOR ) and each one of the Seven planets is responsible for bringing the rays of one colour from the Sun to the earth.
Cosmic energy from the Sun therefore reaches us through the medium of the Planets.
These cosmic rays which come down as rays of a particular colour, enter our body and act on the seven chakras or energy-centres that lie along our Spine.
Here they perform several functions that result in the body's maintenance, growth, health and metabolism by influencing and regulating the Endocrine System of an individual.
The Endocrine System produces Hormones, which in turn act on all the organs of our body and so it is the endocrine system that is in ultimate control of life and all the functions of a living Being.
So you can see how closely the Planets are related to our Bodies (and to our minds).
It is hardly surprising, therefore, that we can tap the potential of astrological remedies to solve our problems of health and wellbeing, so that we live a life in complete harmony with the Universe.

SUN
In the visible part of the spectrum, it governs the colour orange-red.
Its cosmic planetary energy comes to Earth in the RED rays of Sunlight.
Gems Ruby or Garnet.
Herbs (general, not specific) cayenne, black pepper, dry ginger, long pepper, cardamom, saffron, calamus, bayberry and cinnamon.
Aromatic oils and fragrances camphor, cinnamon, eucalyptus, saffron.
Mantras -
"OM SURYAYA NAMAHA"
"OM ADITYAYA NAMAHA"
"OM RAVAYE NAMAHA"
"OM SAVITRE NAMAHA"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MOON
In the visible spectrum, it governs the colour pale white.
Its cosmic planetary energy comes to Earth in the ORANGE rays of Sunlight.
Gems Pearl, set in silver.
Herbs (general, not specific) marshmallow, slippery elm, comfrey root, solomon's seal, shatavari, white musali, bala, rehmannia ( particularly taken in milk decoctions ).
Aromatic oils and fragrances white flowers like jasmine, gardenia, lotus and lily. Sandalwood oil. They can be applied over the heart or the third eye.
Mantras :
"OM SOMAYA NAMAHA"
"OM CHANDRAYA NAMAHA"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MARS
In the visible spectrum, it governs the colour RED.
Its cosmic energy reaches Earth in the YELLOW rays of Sunlight..
Gems Red coral, pink coral.
Herbs (general, not specific) ginseng, astragalus, ashwagandha, guugul, myrrh, turmeric, garlic, onions, asafoetida.
Mantras :
"OM KUJAYA NAMAHA"
"OM ANGARAKAYA NAMAHA"
"OM MANGALAYA NAMAHA"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MERCURY
In the visible spectrum, it governs the colour GREEN.
Its cosmic planetary energy comes to Earth in the GREEN rays of sunlight.
Gems Emerald, peridot, jade, green zircon, green tourmaline.
Herbs (general, not specific) gotu kola, bhringaraj, skullcap, passion flower, betony, jatamansi, zizyphus, chamommile, mint, sage and holy basil.
Aromatic oils and fragrances frankincense
Mantras :
"OM BUDHAYA NAMAHA"
"OM VISHNAVE NAMAHA"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
JUPITER
In the visible spectrum, it governs the colour yellow-orange.
Its cosmic planetary energy comes to Earth in the BLUE rays of Sunlight.
oGems Yellow sapphire, yellow topaz, citrine, set in gold.
Herbs (general, not specific) ashwagandha, bala, liquorice, ginseng, astralagus ( especially taken with ghee or clarified butter ). Nuts like almonds, walnuts, cashews. Aromatic oils and fragrances ghee, sesame oil, almond oil.
Mantras :
"OM BRISHASPATAYE NAMAHA"
"OM SHREEM"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
VENUS
In the visible spectrum it governs the colour pure white.
Its cosmic planetary energy comes to Earth in the INDIGO rays of Sunlight.
Gems Diamond, clear zircon, quartz crystal.
Herbs (general, not specific) rose, saffron, jasmine, lotus, lily, iris ( flowers ). Shatavari, white musali, amalaki, aloe gel, rehmannia, dang gui, red raspberry.
Mantras :
"OM SHUKRAYA NAMAHA"
"OM HREEM"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SATURN
In the visible spectrum it governs the colour Black.
Its cosmic planetary energy reaches Earth in the VIOLET rays of Sunlight.
Gems Blue sapphire, lapis lazuli, malachite or amethyst.
Herbs (general, not specific) myrrh, frankincense, guggul, ashwagandha, shilajit, haitaki, comfrey root. Triphala.
Aromatic oils and fragrances sandalwood, frankincense, cedar, juniper.
Mantras :
"OM SHANAISHCHARAYA NAMAHA"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RAHU
Gems - Gomedha ( hessonite garnet ).
Herbs - (general, not specific) camphor, bayberry, sage, eucalyptus. Aromatic oils and fragrances - calamus, sandalwood, lotus, frankincense.
It is a shadow planet and has no physical mass. It is associated with Smoky colour. Mantras :
"OM RAHAVE NAMAHA"
"OM RAHM"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KETU
Gems - Cat's eye ( chrysoberyl family ).
Herbs - (general, not specific) sage, calamus, bayberry, wild ginger, juniper, gotu kola, bhringaraj, skullcap, passion flower.
Aromatic oils and fragrances - camphor, cedar, myrrh, frankincense.
It is a shadow planet and has no physical mass.
Mantras :
"OM NAMAHA KETAVE"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Runing more than 1 instances of yahoo messanger

You can run multiple yahoo messenger with different ids at the same time. Just follow the steps.
It works in most of the cases.

* Click start then run
* Write regedit, press enter
* Goto “HKEY_CURRENT_USER\Software\Yahoo\Pager\Test”
* Create a DWORD registry value named “Plural” by right clicking the right hand side window.
* Double click the new DWORD entry and set the value to 1

Now you remain online with two or more different yahoo ids at the same time.

Visit To see our New Web Site .

www.BuzzIT.hpage.com

Monday, July 27, 2009

Some Important Diffrences between MSSQL2005 and 2008

In sql server 2005,There is no option to compress backup files, but in sql server 2008,there you find it.

storing backup file takes 5 minutes without compression in sqlserver 2005,but it takes only 3 minutes in sql server 2008 for storing backup files with compression.

cpu is used to compress the data before it is written to disk,so less data is written to disk.

The new features are summarized on https://connect.microsoft.com/SQLServer/content/content.aspx?ContentID=5470

There are many new features, so it depends on what you need. If you store large files in SQL Server, migrated from Oracle and want to use date and time data types, need to encrypt your databases, etc you will definitely want to look at 2008. The nice thing is that it upgrading should be much easier from 2005 to 2008 than it was from 2000 to 2005.


During the compilation of applications for .NET 1.x, Visual Studio 2003 would automatically compile only certain file types such as ASP.NET pages, Web services, user controls, HTTP handlers, Resource files, and Global.asax class files. The rest of the files needed to be explicitly compiled before finally publishing your code to the web server.

For modifying an application, you need to open the entire project, make changes, and need to recompile again to publish the code to the web server.


sql server 2005

In Visual Studio 2005, you no longer need to compile all the files into an assembly. The ASP.NET dynamic compilation engine allows to automatically compile applications, that includes .aspx, .cs, .vb files. That means, simply create an application and publish it.

A shared class consists of reusable source components in the code folder.

The new code-separation model extends the Compile-on-Demand feature to the classes bound to a Web page, but it does not stop there; helper classes can also take advantage of it. You can keep your helper classes and business objects in the App_Code folder. ASP.NET monitors the folder and compiles any new class file that is added or edited. The resulting assembly is automatically referenced in the application and shared between all pages participating in the site.

You should put only components into the App_Code folder. Do not put pages, Web user controls, or other non-code files containing non-code elements, into the App_Code subdirectory. All the files in the App_Code folder are dynamically compiled to a single assembly, named code.dll. The assembly has an application scope and is created in the Temporary ASP.NET Files folder, well outside the Web application space.

You just need to open the individual file which you want to make the changes, and publish the code to the web server without having to recompile.



Some Difference between SQL server 2000 and SQL server 2005

Generally TOP clause is used to perform SELECT on top n results. This feature of TOP is extended in SQL 2005 so that we can also use expression apart from int, bigint and percent to perform query and also extended to be used in UPDATE and DELETE statements.

In SQL 2000

syntax: select Top N [Percent]

EX:

select Top 10 * from TableName

or

select Top 10 Percent * from TableName




n specifies how many rows are returned. If PERCENT is not specified, n is the number of rows to return. If PERCENT is specified, n is the percentage of the result set rows to return

Drawbacks:

We could not parameterize.

It will work only for select statements.

If we want to restrict the number of rows affected by a select at runtime, or restrict the rows affected by an update or delete you had to explicitly describe the rows using a join or where clause, or you could cheat a bit by using ROWCOUNT, like this

set rowcount 10 delete from table where payratefieldname=1 set rowcount 0It will work but the risk is if for some reason rowcount is not set to 0 then the other statements will also restricted to 10.




All these drawbacks are overcome in SQL 2005 by introducing Expression in syntax.

In SQL 2005

syntax: select Top (Expression) [Percent]

EX:

Is the numeric expression that specifies the number of rows to be returned. expression is implicitly converted to a float value if PERCENT is specified; otherwise, it is converted to bigint.

Ex:

select Top 10 * from TableName

or

select Top 10 Percent * from TableName

or we can set at runtime as




Declare @ int

SET @topNum = 10

select TOP (@topNum) * from



For select statements you must specify parentheses if you are passing a parameter, otherwise they are optional

Select Top (@topNum) * from TableName Select Top 10 * from TableNameWhen doing an update or delete, you have to use the parentheses in both cases:

Delete Top (@topNum) from employeesDelete Top (10) from TableName update Top (@topNum) TableName set fieldname = @fieldvalue update Top (10) from employees set fieldname = @fieldvalue This is nice tricky change introduced in SQL 2005

A suggested exercise and dietary strategy for optimising human growth hormone (hGH).

  • Exercise – three sessions per week, each involving at least 10 minutes’ work above lactate threshold or a number of sprints, with a 1:3 work-rest ratio;
  • Before exercise – no fat for 60 minutes before, 2g glutamine 60-90 minutes before;
  • During exercise – plenty of plain water (ie 200 ml every 10-15 minutes if training in 18-21°C);
  • After exercise – avoid sugar for two hours post exercise but take 25g protein immediately afterwards in the form of either a protein shake, protein bar, lean meat or eggs (although you should limit your consumption of eggs to avoid too much cholesterol).

Creating database in oracle Manually

Creating Database:

Create the following directories in a folder where u want to create database:

Example:

-- c:\oracle\admin\dbname
-- c:\oracle\oradata\dbname
-- c:\oracle\admin\dbname\pfile
-- c:\oracle\admin\dbname\cdump
-- c:\oracle\admin\dbname\bdump
-- c:\oracle\admin\dbname\udump
c:\oracle\admin\dbname\create

Copy the default pfile from C:oracle\ora90\admin\sample\pfile\initsmpl.ora to -- c:\oracle\admin\dbname\pfile\initdbname.ora
Type the following at command prompt
copy C:oracle\ora90\admin\sample\pfile\initsmpl.ora c:\oracle\admin\dbname\pfile\initdbname.ora

Edit the pfile c:\oracle\admin\dbname\pfile\initdbname.ora as per the following:

-- db_name = dbname
-- control_files = ("C:\oracle\oradata\dbname\control01.ctl")
-- background_dump_dest = c:\oracle\admin\dbname\bdump
-- core_dump_dest = c:\oracle\admin\dbname\cdump
-- user_dump_dest = c:\oracle\admin\dbname\udump
-- remote_login_passwordfile = exclusive
-- undo_management=AUTO
-- undo_tablespace=ts_tbs
-- db_create_file_dest='C:\oracle\oradata\dbname'


Copy the initdbname.ora from ur database to C:oracle\ora90\DATABASE\initdbname.ora.
Or create the target file directly in Notepad and save in C:oracle\ora90\DATABASE with name as initdbname.ora. The file should have only one entry as follows:

ifile=c:\oracle\admin\dbname\pfile\initdbname.ora


Creating the Idle Instance of your Database

-- oradim -new -sid dbname -startmode a -pfile c:\oracle\admin\dbname\pfile\initdbname.ora


This command is to be executed from the Cmd prompt
Creating the external Password file for your Database, which will contain the Password entries for DBA logins
Execute this command from the direcory where you should create this file i.e. the default directory is %ORACLE_HOME%\database directory.


-- cd C:\oracle\ora92\bin
-- orapwd.exe file=C:\oracle\ora92\database\PWDdbname.ora password=change_on_install entries=5


Getting connected.

Go to Command Prompt and set the Oracle_SID to the value same as the DB_NAME
Here in this script it is dbname so type in the command as
-- set oracle_sid=dbname

Start SQL*Plus.
-- sqlplusw /nolog

-- connect sys/oracle as sysdba

Creating / Starting Database

-- startup nomount pfile=c:\oracle\admin\dbname\pfile\initdbname.ora

CREATE DATABASE dbname
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE 'C:\oracle\oradata\dbname\system01.dbf' SIZE 250M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE 'C:\oracle\oradata\dbname\temp01.dbf' SIZE 40M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
UNDO TABLESPACE UNDOTBS1 DATAFILE 'C:\oracle\oradata\dbname\undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
LOGFILE GROUP 1 ('C:\oracle\oradata\dbname\redo01.log') SIZE 102400K,
GROUP 2 ('C:\oracle\oradata\dbname\redo02.log') SIZE 102400K,
GROUP 3 ('C:\oracle\oradata\dbname\redo03.log') SIZE 102400K;



After creating the datbase run the following two scripts
To create the Data Dictionary Views
-- @c:\oracle\ora90\rdbms\admin\catalog.sql

To run the scripts for PL/SQL Procedures
@c:\ORACLE\ora90\rdbms\admin\catproc.sql

connect system/manager

@c:\oracle\ora90\sqlplus\admin\pupbld.sql

Query the DUAL table to check wheather the database is created properly or not.
-- Select * from dual;

Shutting down the database
-- shutdown


Restarting database cleanly.

At the command prompt give the following commands:

-- set oracle_sid=dbname
-- sqlplusw /nolog

In SQL*Plus:

-- connect sys/oracle as sysdba


-- startup nomount pfile=c:oracle\admin\dbname\pfile\initdbname.ora;

An insatnce is started in the NOMOUNT stage only during database creation or the re-creation of control file.

-- alter database mount;

To perform specific maintenance operations tha database must be mounted but do not open the database.
Eg: Renaming Datafiles, Enable/Disable Redo log archiving options and performing full database recovery.

In mount state control file mentioned in the parameter file is located and the control file is read to obtain the name and status of datafiles and redo log files. No checking of Datafiles and Redo log files are done at this stage.

-- alter database open;

In open state all the datafiles and log files will come into existence and if they are not found then oracle server returns an error.


OR

-- startup ( Parameter file checking spfileSID.ora --> default spfile.ora --> initSID.ora --> default pfile.ora )

*************************************************************************************************

Creating SPFILE: Requires SYSDBA privilege.

-- Create spfile = 'c:\oracle\ora90\database\spfiledbname.ora' from pfile = 'c:\oracle\admin\dbname\pfile\initdbname.ora'

or

-- Create spfile from pfile OR Create spfile from pfile = 'c:\oracle\admin\dbname\pfile\initdbname.ora'

(In this case oracle will use the default pfile to create spfile with a system generated name)


Spfile is an binary file. if u try to edit spfile then it will become invalid.
So if u want to see the parameters set using spfile u use the view V&PARAMETER view or convert the SPFILE back to PFILE by using the following syntax:

-- Create pfile = 'c:\oracle\ora90\database\initdbname.ora' from spfile = 'c:dbname\database\spfiledbname.ora'


DESC V$PARAMETER
SELECT * FROM V$PARAMETER


If you want to start the instance with the spfile in a non-default location then spfile must be placed in the pfile.

-- spfile=c:\dbname\pfile\spfiledbname.ora (If u dont want then u can comment it)


Modifying Parameters of SPFILE:

-- alter system set undo_tablespace='UNDO2';

-- alter system set undo_suppress_errors=true scope=both


If you want to check wheather the instance started with spfile or pfile then :

-- show parameter pfile
-- show parameter spfile

Important parameters of Parameter File:

BACKGROUND_DUMP_DEST
COMPATIBLE
CONTROL_FILES
DB_CACHE_SIZE
DB_NAME
SHARED_POOL_SIZE
USER_DUMP_DEST



Commonly Modified Parameters:

IFILE
LOG_BUFFER
MAX_DUMP_FILE_SIZE
PROCESSES
SQL_TRACE
TIMED_STATISTICS



Starting Up a Database:

Nomount --> Mount --> Open


Syntax of Startup command:

STARTUP [FORCE] [RESTRICT] [PFILE=filename] [OPEN [RECOVER] [database] | MOUNT | NOMOUNT]
----

OPEN: Enables user to access database

MOUNT: Mounts the database for certain DBA activities but does not provide user access to the database.

NOMOUNT: Creates the SGA and starts up the background processes but does not provide access to the database.

PFILE=parfile: Enables a nondefault parameter file to be used to configure the insatance.

FORCE: Aborts the running insatnce before performing a normal startup.

RESTRICT: Enables only users with RESTRICTED SESSION privilege to access the database.

RECOVER: Begins media recovery when the database starts.



STARTUP and SHUTDOWN commands are SQL *Plus commands and not SQL commands.


ALTER DATABASE command is used for changing the state of the database from NOMOUNT to MOUNT or OPEN or OPEN READ ONLY.

-- ALTER DATABASE DB01 MOUNT;
-- ALTER DATABASE DB01 OPEN;
-- ALTER DATABASE DB01 OPEN READ ONLY; \\ Prevents data modification.


Opening Database in Restricted Mode :

-- STARTUP RESTRICT;
-- ALTER SYSTEM ENABLE RESTRICTED SESSION;

It is useful when you perform structure maintenance or a database export and import.
Database is available to only those users who have RESTRICTED SESSION privilege.

We can also open database in restricted by using SQL command:

-- ALTER SYSTEM [ {ENABLE | DISABLE} RESTRICTED SESSION ]


If we want to KILL the current sessions the command will be :

-- ALTER SYSTEM KILL SESSION 'integer1,integer2'

Where integer1 is the value of the SID column in the V$SESSION view and integer2 is the value of the SERIAL# column in the V$SESSION view.

Opening Database in Read-Only Mode :

-- STARTUP MOUNT
-- ALTER DATABASE OPEN READ ONLY;

Can be used to
Execute queries
Execute disk sorts using locally managed tablespaces
Takes datafiles offline and online, but not tablespaces
Perform recovery of offline datafiles and tablespaces


Shutting down the Database:

-- SHUTDOWN ABORT
It wont allow new connectios, wont wait until current session end, wont wait until current transaction end, wont force a checkpoint and close files. Database Recovery required when we start the database again.

-- SHUTDOWN IMMEDIATE
It wont allow new connectios, wont wait until current session end, wont wait until current transaction end, forceS a checkpoint and close files. Database Recovery not required when we start the database again.

-- SHUTDOWN TRANSACTIONAL
It wont allow new connectios, wont wait until current session end, will wait until current transactionS end, forceS a checkpoint and close files. Database Recovery not required when we start the database again.

-- SHUTDOWN NORMAL
It wont allow new connectios, waits until current sessions end, will wait until current transactionS end, forceS a checkpoint and close files. Database Recovery not required when we start the database again.


Monitoring an Instance using Diagnostic Files:

Diagnostic files contain
* Information about significant events encountered
* Used to resolve problems
* Used to better manage the database on a day-to-day basis

Some of the Diagnostic files are:
* alertSID.log [ Location: BACKGROUND_DUMP_DEST ]
* Background trace files [ Location: BACKGROUND_DUMP_DEST ]
* User trace files [ Location: USER_DUMP_DEST ]

Size defined by : [ MAX_DUMP_FILE_SIZE ]

Enabling or Disabling User Tracing :

-- ALTER SESSION SET SQL_TRACE = TRUE
-- SQL_TRACE = TRUE
-- dbms_system.SET_SQL_TRACE_IN_SESSION

How to Get Truncated data in oracle

Get back data from truncated table without backup

Tables are truncated by human error, if there’s no backup,
can these data be got back?

We know truncating table just update dictionary tables,
table segment header and file header information and
the actual data don’t be removed. If we can reverse these control data, it’s possible to get data back.
But there’s one condition that blocks allocated in the truncated table do not be reused.

I illuminate it by the following demo. I test it on Oracle 9204 under Intel platform,
manual LMT tablespace.

@>create table test.t1(id number, a char(2000),b char(2000));
Table created.

@>insert into test.t1 select rownum,'A','B' from dual connect by level < 1001; 1000 rows created.
@>commit;
Commit complete.

@>truncate table test.t1;
Table truncated.

@>select * from test.t1;
no rows selected

The demonstrated table just contains one segment and single free list group,
if it’s a multi-segments or it has indexes, it’ll be more complex.

Now we dump redo log data which contains the data of truncating table.
From the redo, we can find that it update dictionary tab$, seg$, obj$ and tsq$.
It changes data object id and time stamp in the first three tables. Every extent
excluding the first one will be removed from segment header, from bottom to above,
one extent every time, and update tsq$, update file header bitmap data to free these blocks.

If the redo log/archived log which contains the truncating table information is overwritten/lost,
what should we do? We can find old data object id from the first extent of this table.
Then we use this id to scan all data files in the tablespace which contains this table
to find out blocks which are allocated to this table. Then we reconstruct the extents
according to the space management algorithm.

We extract the following items from redo log, it can be used to rebuild the extent information.

DBA:0x00c00002
Begin: 1033, Length: 128, Instance: 0
Begin: 905, Length: 128, Instance: 0
Begin: 777, Length: 128, Instance: 0
Begin: 649, Length: 128, Instance: 0
Begin: 521, Length: 128, Instance: 0
Begin: 393, Length: 128, Instance: 0
Begin: 265, Length: 128, Instance: 0
Begin: 257, Length: 8, Instance: 0
Begin: 249, Length: 8, Instance: 0
Begin: 241, Length: 8, Instance: 0
Begin: 233, Length: 8, Instance: 0
Begin: 225, Length: 8, Instance: 0
Begin: 217, Length: 8, Instance: 0
Begin: 209, Length: 8, Instance: 0
Begin: 201, Length: 8, Instance: 0
Begin: 193, Length: 8, Instance: 0
Begin: 185, Length: 8, Instance: 0
Begin: 177, Length: 8, Instance: 0
Begin: 169, Length: 8, Instance: 0
Begin: 161, Length: 8, Instance: 0
Begin: 153, Length: 8, Instance: 0
Begin: 145, Length: 8, Instance: 0

DBA:0x00c00003
Begin: 128, Length: 16
Begin: 112, Length: 16
Begin: 96, Length: 16
Begin: 80, Length: 16
Begin: 64, Length: 16
Begin: 48, Length: 16
Begin: 32, Length: 16
Begin: 31, Length: 1
Begin: 30, Length: 1
Begin: 29, Length: 1
Begin: 28, Length: 1
Begin: 27, Length: 1
Begin: 26, Length: 1
Begin: 25, Length: 1
Begin: 24, Length: 1
Begin: 23, Length: 1
Begin: 22, Length: 1
Begin: 21, Length: 1
Begin: 20, Length: 1
Begin: 19, Length: 1
Begin: 18, Length: 1
Begin: 17, Length: 1


The following data indicates changing dictionary. I omit tsq$, there’re 22 $tsq records here.

TAB$
---------------------
undo
col 0: [ 3] c2 41 1d
...
col 35: [ 7] 78 6c 02 19 14 28 2a

redo
col 0: [ 3] c2 41 1f
...
col 35: [ 7] 78 6c 02 19 15 09 05
-----------------------


SEG$
------------------------
undo
col 14: [ 3] c2 41 1d

redo
col 14: [ 3] c2 41 1f
------------------------


OBJ$
------------------------
undo
col 1: [ 3] c2 41 1d
...
col 8: [ 7] 78 6c 02 19 14 28 2a


redo
col 1: [ 3] c2 41 1f
...
col 8: [ 7] 78 6c 02 19 15 09 05
-----------------------


After we get this information, now we can rebuild the table segment header. The highlighted data with --> symbol is reverted data.


Start dump data blocks tsn: 3 file#: 3 minblk 137 maxblk 137
buffer tsn: 3 rdba: 0x00c00089 (3/137)
scn: 0x0000.000bba9a seq: 0x01 flg: 0x04 tail: 0xba9a1001
frmt: 0x02 chkval: 0x5f6a type: 0x10=DATA SEGMENT HEADER - UNLIMITED
Extent Control Header
-----------------------------------------------------------------
Extent Header:: spare1: 0 spare2: 0 #extents: 1 --> 23 #blocks: 7 --> 1023
last map 0x00000000 #maps: 0 offset: 4128
Highwater:: 0x00c0008a --> 0x00c00472 ext#: 0 --> 22 blk#: 0 --> 105 ext size: 7 --> 128
#blocks in seg. hdr's freelists: 0 --> 1
#blocks below: 0 --> 1000
mapblk 0x00000000 offset: 0 --> 22
Unlocked
Map Header:: next 0x00000000 #extents: 1 --> 23 obj#: 6430 --> 6428 flag: 0x40000000
Extent Map
-----------------------------------------------------------------
0x00c0008a length: 7
--> add the following items
0x00c00091 length: 8
0x00c00099 length: 8
0x00c000a1 length: 8
0x00c000a9 length: 8
0x00c000b1 length: 8
0x00c000b9 length: 8
0x00c000c1 length: 8
0x00c000c9 length: 8
0x00c000d1 length: 8
0x00c000d9 length: 8
0x00c000e1 length: 8
0x00c000e9 length: 8
0x00c000f1 length: 8
0x00c000f9 length: 8
0x00c00101 length: 8
0x00c00109 length: 128
0x00c00189 length: 128
0x00c00209 length: 128
0x00c00289 length: 128
0x00c00309 length: 128
0x00c00389 length: 128
0x00c00409 length: 128

nfl = 1, nfb = 1 typ = 1 nxf = 0 ccnt = 0 --> 213
SEG LST:: flg: UNUSED --> USED lhd: 0x00000000 --> 0x00c00471 ltl: 0x00000000 --> 0x00c00471
End dump data blocks tsn: 3 file#: 3 minblk 137 maxblk 137


#blocks: 1023 (15*8 + 7*128 + 7)
Highwater: 0x00c00472 (0x00c00471 + 1)
blk#: 105 (1137 - 1033 + 1)
#blocks below: 1000 (1137 - 137)
ccnt: 213
1. Ext0 7 blocks --> 5 + ceil(2/5) --> 6
2. Ext1 -- Ext15 8 blocks --> ceil(8/5) * 15 --> 30
3. Ext16 -- Ext21 128 blocks --> ceil(128/5) * 6 --> 156
4. Ext22 105 (1137 - 1033 + 1) blocks --> ceil(105/5) --> 21
Total: 6 + 30 + 156 + 21 --> 213

We can use the following method to dump block to decide which/how many blocks are in the free list.

1033 + 128/2 --> 1097 --> 1097 + 64/2 --> 1129 --> 1129 + 32/2 --> 1145 (<) --> 1145 - 16/2 --> 1137 --> 1137 + 8/2 --> 1141 (<) --> 1141 - 4/2 --> 1139 (<) --> 1138 (<) --> 1137 --> only 1137 in free list

We have rebuilt the previous table segment header data, now we use bbed to change it.

BBED> p ktech
struct ktech, 72 bytes @20
ub4 spare1_ktech @20 0x00000000
word tsn_ktech @24 0
ub4 lastmap_ktech @28 0x00000000
ub4 mapcount_ktech @32 0x00000000
ub4 extents_ktech @36 0x00000001 --> 0x00000017 modify /x 17000000 dba 3,137 offset 36
ub4 blocks_ktech @40 0x00000007 --> 0x000003ff modify /x ff030000 dba 3,137 offset 40
ub2 mapend_ktech @44 0x1020
struct hwmark_ktech, 32 bytes @48
ub4 extno_ktehw @48 0x00000000 --> 0x00000016 modify /x 16000000 dba 3,137 offset 48
ub4 blkno_ktehw @52 0x00000000 --> 0x00000069 modify /x 69000000 dba 3,137 offset 52
ub4 extsize_ktehw @56 0x00000007 --> 0x00000080 modify /x 80000000 dba 3,137 offset 56
ub4 blkaddr_ktehw @60 0x00c0008a --> 0x00c00472 modify /x 7204c000 dba 3,137 offset 60
ub4 mapblk_ktehw @64 0x00000000
ub4 offset_ktehw @68 0x00000000 --> 0x00000016 modify /x 16000000 dba 3,137 offset 68
ub4 flblks_ktehw @72 0x00000000 --> 0x00000001 modify /x 01000000 dba 3,137 offset 72
ub4 blkcnt_ktehw @76 0x00000000 --> 0x000003e8 modify /x e8030000 dba 3,137 offset 76
struct locker_ktech, 8 bytes @80
ub2 kxidusn @80 0x0000
ub2 kxidslt @82 0x0000
ub4 kxidsqn @84 0x00000000
ub4 flag_ktech @88 0x00000000 (NONE)


BBED> p ktemh
struct ktemh, 16 bytes @92
ub4 count_ktemh @92 0x00000001 --> 0x00000017 modify /x 17000000 dba 3,137 offset 92
ub4 next_ktemh @96 0x00000000
ub4 obj_ktemh @100 0x0000191e --> 0x0000191c modify /x 1c190000 dba 3,137 offset 100
ub4 flag_ktemh @104 0x40000000


BBED> p ktetb
struct ktetb[0], 8 bytes @108
ub4 ktetbdba @108 0x00c0008a
ub4 ktetbnbk @112 0x00000007

--> add the following items
struct ktetb[1], 8 bytes @116
ub4 ktetbdba @116 --> 0x00c00091 modify /x 9100c000 dba 3,137 offset 116
ub4 ktetbnbk @120 --> 0x00000008 modify /x 08000000 dba 3,137 offset 120
struct ktetb[2], 8 bytes @124
ub4 ktetbdba @124 --> 0x00c00099 modify /x 9900c000 dba 3,137 offset 124
ub4 ktetbnbk @128 --> 0x00000008 modify /x 08000000 dba 3,137 offset 128
struct ktetb[3], 8 bytes @132
ub4 ktetbdba @132 --> 0x00c000a1 modify /x a100c000 dba 3,137 offset 132
ub4 ktetbnbk @136 --> 0x00000008 modify /x 08000000 dba 3,137 offset 136
struct ktetb[4], 8 bytes @140
ub4 ktetbdba @140 --> 0x00c000a9 modify /x a900c000 dba 3,137 offset 140
ub4 ktetbnbk @144 --> 0x00000008 modify /x 08000000 dba 3,137 offset 144
struct ktetb[5], 8 bytes @148
ub4 ktetbdba @148 --> 0x00c000b1 modify /x b100c000 dba 3,137 offset 148
ub4 ktetbnbk @152 --> 0x00000008 modify /x 08000000 dba 3,137 offset 152
struct ktetb[6], 8 bytes @156
ub4 ktetbdba @156 --> 0x00c000b9 modify /x b900c000 dba 3,137 offset 156
ub4 ktetbnbk @160 --> 0x00000008 modify /x 08000000 dba 3,137 offset 160
struct ktetb[7], 8 bytes @164
ub4 ktetbdba @164 --> 0x00c000c1 modify /x c100c000 dba 3,137 offset 164
ub4 ktetbnbk @168 --> 0x00000008 modify /x 08000000 dba 3,137 offset 168
struct ktetb[8], 8 bytes @172
ub4 ktetbdba @172 --> 0x00c000c9 modify /x c900c000 dba 3,137 offset 172
ub4 ktetbnbk @176 --> 0x00000008 modify /x 08000000 dba 3,137 offset 176
struct ktetb[9], 8 bytes @180
ub4 ktetbdba @180 --> 0x00c000d1 modify /x d100c000 dba 3,137 offset 180
ub4 ktetbnbk @184 --> 0x00000008 modify /x 08000000 dba 3,137 offset 184
struct ktetb[10], 8 bytes @188
ub4 ktetbdba @188 --> 0x00c000d9 modify /x d900c000 dba 3,137 offset 188
ub4 ktetbnbk @192 --> 0x00000008 modify /x 08000000 dba 3,137 offset 192
struct ktetb[11], 8 bytes @196
ub4 ktetbdba @196 --> 0x00c000e1 modify /x e100c000 dba 3,137 offset 196
ub4 ktetbnbk @200 --> 0x00000008 modify /x 08000000 dba 3,137 offset 200
struct ktetb[12], 8 bytes @204
ub4 ktetbdba @204 --> 0x00c000e9 modify /x e900c000 dba 3,137 offset 204
ub4 ktetbnbk @208 --> 0x00000008 modify /x 08000000 dba 3,137 offset 208
struct ktetb[13], 8 bytes @212
ub4 ktetbdba @212 --> 0x00c000f1 modify /x f100c000 dba 3,137 offset 212
ub4 ktetbnbk @216 --> 0x00000008 modify /x 08000000 dba 3,137 offset 216
struct ktetb[14], 8 bytes @220
ub4 ktetbdba @220 --> 0x00c000f9 modify /x f900c000 dba 3,137 offset 220
ub4 ktetbnbk @224 --> 0x00000008 modify /x 08000000 dba 3,137 offset 224
struct ktetb[15], 8 bytes @228
ub4 ktetbdba @228 --> 0x00c00101 modify /x 0101c000 dba 3,137 offset 228
ub4 ktetbnbk @232 --> 0x00000008 modify /x 08000000 dba 3,137 offset 232
struct ktetb[16], 8 bytes @236
ub4 ktetbdba @236 --> 0x00c00109 modify /x 0901c000 dba 3,137 offset 236
ub4 ktetbnbk @240 --> 0x00000080 modify /x 80000000 dba 3,137 offset 240
struct ktetb[17], 8 bytes @244
ub4 ktetbdba @244 --> 0x00c00189 modify /x 8901c000 dba 3,137 offset 244
ub4 ktetbnbk @248 --> 0x00000080 modify /x 80000000 dba 3,137 offset 248
struct ktetb[18], 8 bytes @252
ub4 ktetbdba @252 --> 0x00c00209 modify /x 0902c000 dba 3,137 offset 252
ub4 ktetbnbk @256 --> 0x00000080 modify /x 80000000 dba 3,137 offset 256
struct ktetb[19], 8 bytes @260
ub4 ktetbdba @260 --> 0x00c00289 modify /x 8902c000 dba 3,137 offset 260
ub4 ktetbnbk @264 --> 0x00000080 modify /x 80000000 dba 3,137 offset 264
struct ktetb[20], 8 bytes @268
ub4 ktetbdba @268 --> 0x00c00309 modify /x 0903c000 dba 3,137 offset 268
ub4 ktetbnbk @272 --> 0x00000080 modify /x 80000000 dba 3,137 offset 272
struct ktetb[21], 8 bytes @276
ub4 ktetbdba @276 --> 0x00c00389 modify /x 8903c000 dba 3,137 offset 276
ub4 ktetbnbk @280 --> 0x00000080 modify /x 80000000 dba 3,137 offset 280
struct ktetb[22], 8 bytes @284
ub4 ktetbdba @284 --> 0x00c00409 modify /x 0904c000 dba 3,137 offset 284
ub4 ktetbnbk @288 --> 0x00000080 modify /x 80000000 dba 3,137 offset 288



BBED> p ktsfs_seg
struct ktsfs_seg[0], 20 bytes @4156
ub2 ktsfsflg @4156 0x0000 (NONE) --> 0x0001 modify /x 0100 dba 3,137 offset 4156
struct ktsfsxid, 8 bytes @4160
ub2 kxidusn @4160 0x0000
ub2 kxidslt @4162 0x0000
ub4 kxidsqn @4164 0x00000000 --> 0x000000d5 modify /x d5000000 dba 3,137 offset 4164
ub4 ktsfslhd @4168 0x00000000 --> 0x00c00471 modify /x 7104c000 dba 3,137 offset 4168
ub4 ktsfsltl @4172 0x00000000 --> 0x00c00471 modify /x 7104c000 dba 3,137 offset 4172


After rebuild the table segment header, we should check whether the blocks allocated in
this table have been reused by other objects.

We use sql statement to change dictionary tables, here I just update object data id.

@>select DATAOBJ# from tab$ where OBJ#=6428;
DATAOBJ#
----------
6430

@>update tab$ set DATAOBJ#=6428 where OBJ#=6428;
1 row updated.

@>select DATAOBJ# from obj$ where OBJ#=6428;
DATAOBJ#
----------
6430

@>update obj$ set DATAOBJ#=6428 where OBJ#=6428;
1 row updated.

@>select "HWMINCR" from "SYS"."SEG$" where "HWMINCR"=6430;
HWMINCR
----------
6430

@>update "SYS"."SEG$" set "HWMINCR" =6428 where "HWMINCR"=6430;
1 row updated.

@>commit;
Commit complete.

@>select count(*) from test.t1;
COUNT(*)
----------
1000

[oracle@chen ~]$ exp test/test tables=t1 file=t1.dmp log=t1.log
Export: Release 9.2.0.4.0 - Production on Thu Feb 28 06:40:14 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table T1 1000 rows exported
Export terminated successfully without warnings.



Because bbed can’t modify file allocated bitmap data, so the file usage status doesn’t be
refreshed. But we can use package dbms_space_admin to rebuild the bitmap data.
To avoid the unexpected things, we should export data immediately. Now I take a
cold full backup, it will be used late.

@>@dumpf 3 2 3
PL/SQL procedure successfully completed.

@>@trace
/opt/app/oracle/admin/chen/udump/chen_ora_3728.trc
...
Start dump data blocks tsn: 3 file#: 3 minblk 2 maxblk 3
buffer tsn: 3 rdba: 0x00c00002 (3/2)
scn: 0x0000.000bba87 seq: 0x01 flg: 0x04 tail: 0xba871d01
frmt: 0x02 chkval: 0x1b2e type: 0x1d=KTFB Bitmapped File Space Header
File Space Header Block:
Header Control:
RelFno: 3, Unit: 8, Size: 1280, Flag: 1
AutoExtend: NO, Increment: 0, MaxSize: 0
Initial Area: 7, Tail: 1280, First: 17, Free: 127
Header Opcode:
Save: No Pending Op
buffer tsn: 3 rdba: 0x00c00003 (3/3)
scn: 0x0000.000bba87 seq: 0x01 flg: 0x04 tail: 0xba871e01
frmt: 0x02 chkval: 0x6f2c type: 0x1e=KTFB Bitmapped File Space Bitmap
File Space Bitmap Block:
BitMap Control:
RelFno: 3, BeginBlock: 9, Flag: 0, First: 17, Free: 63456
FFFF010000000000 0000000000000000 0000FF7F00000000 0000000000000000


@>exec dbms_space_admin.TABLESPACE_REBUILD_BITMAPS('TEST');
PL/SQL procedure successfully completed.

@>@dumpf 3 2 3
PL/SQL procedure successfully completed.

@>@trace
/opt/app/oracle/admin/chen/udump/chen_ora_3834.trc
...
Start dump data blocks tsn: 3 file#: 3 minblk 2 maxblk 3
buffer tsn: 3 rdba: 0x00c00002 (3/2)
scn: 0x0000.000c0b6e seq: 0x01 flg: 0x00 tail: 0x0b6e1d01
frmt: 0x02 chkval: 0x0000 type: 0x1d=KTFB Bitmapped File Space Header
File Space Header Block:
Header Control:
RelFno: 3, Unit: 8, Size: 1280, Flag: 1
AutoExtend: NO, Increment: 0, MaxSize: 0
Initial Area: 7, Tail: 1280, First: 159, Free: 0
Header Opcode:
Save: No Pending Op
buffer tsn: 3 rdba: 0x00c00003 (3/3)
scn: 0x0000.000c0b6e seq: 0x01 flg: 0x00 tail: 0x0b6e1e01
frmt: 0x02 chkval: 0x0000 type: 0x1e=KTFB Bitmapped File Space Bitmap
File Space Bitmap Block:
BitMap Control:
RelFno: 3, BeginBlock: 9, Flag: 0, First: 159, Free: 63329
FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF FFFFFF7F00000000 0000000000000000


I illuminate how to use bbed and package to rebuild block structure above. Until now,
this table can be operated as common tables, such as DML, allocate new extents.


Now I introduce OS commands to achieve the same aim. These OS commands are echo,
dd and od, they’re all ordinary, but they’re very powerful.
I restore the cold backup files did just now. Here I just demonstrate how to modify
file header information.

Start dump data blocks tsn: 3 file#: 3 minblk 2 maxblk 3
buffer tsn: 3 rdba: 0x00c00002 (3/2)
scn: 0x0000.000bba87 seq: 0x01 flg: 0x04 tail: 0xba871d01
frmt: 0x02 chkval: 0x1b2e type: 0x1d=KTFB Bitmapped File Space Header
File Space Header Block:
Header Control:
RelFno: 3, Unit: 8, Size: 1280, Flag: 1
AutoExtend: NO, Increment: 0, MaxSize: 0
Initial Area: 7, Tail: 1280, First: 17 --> 159, Free: 127 --> 0
Header Opcode:
Save: No Pending Op
buffer tsn: 3 rdba: 0x00c00003 (3/3)
scn: 0x0000.000bba87 seq: 0x01 flg: 0x04 tail: 0xba871e01
frmt: 0x02 chkval: 0x6f2c type: 0x1e=KTFB Bitmapped File Space Bitmap
File Space Bitmap Block:
BitMap Control:
RelFno: 3, BeginBlock: 9, Flag: 0, First: 17 --> 159, Free: 63456 --> 63329
FFFF010000000000 0000000000000000 0000FF7F00000000 0000000000000000 --> FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF FFFFFF7F00000000 0000000000000000


dba 3,2:
chkval: see below
First: 128 + 16 + 15 --> 159 --> x9f
-- according to FFFF01, the last bitmap is 17th, and the truncated table space allocated start
from 17th and all space (16*7 + 1*15) is conterminous. The truncated table’s last bitmap
is 144th, the first bitmap is 145th within FF7F.

Free: 127 – (16*7 + 1*15) --> 0

dba 3,3
Free: 63456 – 127 --> 63329 --> f761


[oracle@chen 9204]$ dd if=test01.dbf bs=8192 skip=2 count=2|od -x
0000000 021d 0000 0002 00c0 ba87 000b 0000 0401 -- dba 3,2
0000020 1b2e 0000 0003 0000 0008 0000 0500 0000 -- 1b2e --> ?
0000040 0001 0000 0000 0000 0000 0000 0007 0000
0000060 0500 0000 0011 0000 007f 0000 0000 0000 -- 11 --> 9f 7f --> 00
0000100 0000 0000 0000 0000 0000 0000 0000 0000
0000120 0091 0000 0008 0000 0000 0000 0000 0000
0000140 0000 0000 0000 0000 0000 0000 0000 0000
*
0017760 0000 0000 0000 0000 0000 0000 1d01 ba87
2+0 records in
2+0 records out
0020000 021e 0000 0003 00c0 ba87 000b 0000 0401 -- dba 3,3
0020020 6f2c 0000 0003 0000 0009 0000 0000 0000 -- 6f2c --> ?
0020040 0011 0000 f7e0 0000 0000 0000 0000 0000 -- 11 --> 9f f7e0 --> f761
0020060 0000 0000 0000 0000 ffff 0001 0000 0000 -- 0001 0000 0000 --> ffff ffff ffff
0020100 0000 0000 0000 0000 0000 7fff 0000 0000 -- 0000 0000 0000 0000 0000 --> ffff ffff ffff ffff ffff
0020120 0000 0000 0000 0000 0000 0000 0000 0000
*
0037760 0000 0000 0000 0000 0000 0000 1e01 ba87
0040000


According to the above value, we run the following OS commands to change it, but these
commands don’t contain the one of changing checksum, it will be explained at last.

11 --> 9f
echo -ne "\x9f\x00"|dd of=test01.dbf bs=1 seek=16436 count=2 conv=notrunc

7f --> 00
echo -ne "\x00\x00"|dd of=test01.dbf bs=1 seek=16440 count=2 conv=notrunc

11 --> 9f
echo -ne "\x9f\x00"|dd of=test01.dbf bs=1 seek=24608 count=2 conv=notrunc

f7e0 --> f761
echo -ne "\x61\xf7"|dd of=test01.dbf bs=1 seek=24612 count=2 conv=notrunc

0001 0000 0000 0000 0000 0000 0000 0000 --> ffff ffff ffff ffff ffff ffff ffff ffff
echo -ne "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"|dd of=test01.dbf bs=1
seek=24634 count=16 conv=notrunc

The following is the new content of the two blocks.

[oracle@chen 9204]$ dd if=test01.dbf bs=8192 skip=2 count=2|od -x
0000000 021d 0000 0002 00c0 ba87 000b 0000 0401
0000020 1b2e 0000 0003 0000 0008 0000 0500 0000
0000040 0001 0000 0000 0000 0000 0000 0007 0000
0000060 0500 0000 009f 0000 0000 0000 0000 0000
0000100 0000 0000 0000 0000 0000 0000 0000 0000
0000120 0091 0000 0008 0000 0000 0000 0000 0000
0000140 0000 0000 0000 0000 0000 0000 0000 0000
*
0017760 0000 0000 0000 0000 0000 0000 1d01 ba87
2+0 records in
2+0 records out
0020000 021e 0000 0003 00c0 ba87 000b 0000 0401
0020020 6f2c 0000 0003 0000 0009 0000 0000 0000
0020040 009f 0000 f761 0000 0000 0000 0000 0000
0020060 0000 0000 0000 0000 ffff ffff ffff ffff
0020100 ffff ffff ffff ffff ffff 7fff 0000 0000
0020120 0000 0000 0000 0000 0000 0000 0000 0000
*
0037760 0000 0000 0000 0000 0000 0000 1e01 ba87
0040000

We now consider computing the checksum. The checksum is the XOR of all the other
2-byte pairs in the block. Here create one function to compute the checksum.

@>create or replace function checksum(p_str varchar2)
2 return varchar2 as
3 v_str varchar2(2000);
4 v_raw1 varchar2(4);
5 v_raw2 varchar2(4);
6 begin
7
8 v_str:=rtrim(ltrim(p_str));
9 v_raw1:=substr(v_str,1,4);
10 v_str:=rtrim(ltrim(substr(v_str,5)));
11
12 while length(v_str)>0 loop
13 v_raw2:=substr(v_str,1,4);
14 v_raw1:=utl_raw.bit_xor(v_raw1,v_raw2);
15 v_str:=rtrim(ltrim(substr(v_str,5)));
16 end loop;
17
18 return 'check sum :'||lower(v_raw1);
19 end;
20 /
Function created.

First, compute the checksum of original blocks to validate the function, then compute the new checksum.

@>select checksum('021d 0000 0002 00c0 ba87 000b 0000 0401 0000 0000 0003 0000 0008 0000 0500
0000 0001 0000 0000 0000 0000 0000 0007 0000 0500 0000 0011 0000 007f 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0091 0000 0008 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1d01 ba87')
check_sum from dual;
CHECK_SUM
---------------------------------------------------------------------------------------
check sum :1b2e

@>select checksum('021e 0000 0003 00c0 ba87 000b 0000 0401 0000 0000 0003 0000 0009
0000 0000 0000 0011 0000 f7e0 0000 0000 0000 0000 0000 0000 0000 0000 0000 ffff 0001
0000 0000 0000 0000 0000 0000 0000 7fff 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 1e01 ba87') check_sum from dual;
CHECK_SUM
---------------------------------------------------------------------------------------
check sum :6f2c

@>select checksum('021d 0000 0002 00c0 ba87 000b 0000 0401 0000 0000 0003 0000
0008 0000 0500 0000 0001 0000 0000 0000 0000 0000 0007 0000 0500 0000 009f 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0091 0000 0008
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 1d01 ba87') check_sum from dual;
CHECK_SUM
---------------------------------------------------------------------------------------
check sum :1bdf

@>select checksum('021e 0000 0003 00c0 ba87 000b 0000 0401 0000 0000 0003
0000 0009 0000 0000 0000 009f 0000 f761 0000 0000 0000 0000 0000 0000 0000
0000 0000 ffff ffff ffff ffff ffff ffff ffff ffff ffff 7fff 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 1e01 ba87') check_sum from dual;
CHECK_SUM
---------------------------------------------------------------------------------------
check sum :6f22


1b2e --> 1bdf
echo -ne "\xdf\x1b"|dd of=test01.dbf bs=1 seek=16400 count=2 conv=notrunc

6f2c --> 6f22
echo -ne "\x22\x6f"|dd of=test01.dbf bs=1 seek=24592 count=2 conv=notrunc


Appendix

kcbh.flg
value Comment
0x00
0x01 New block – zero data area
0x02 last change to the block was for a cleanout operation
0x04 checksum value is set
0x05
0x06
0x08 Temporary block




References
Disassembling the Oracle Data Block
Advanced Backup, Restore, and Recover Techniques
Recovery architecture Components