<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C0YDQ3c8eyp7ImA9WhRbGU0.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695</id><updated>2012-02-11T00:42:52.973+05:30</updated><category term="MYSQL" /><category term="C++" /><category term="Oracle DBA" /><category term="Teradata" /><category term="SAP-ABAP" /><category term="DB2" /><category term="Networking" /><category term="SharePoint" /><category term="Interview Tips" /><category term="Apache" /><category term="GD Topics" /><category term="AIX" /><category term="Weblogic Server" /><title>Tutorials</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://venkat-freetutorials.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>351</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/blogspot/bCpN" /><feedburner:info uri="blogspot/bcpn" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;AkEDRns7eip7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-1583140419867948440</id><published>2011-03-03T16:57:00.006+05:30</published><updated>2011-03-05T20:54:37.502+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T20:54:37.502+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MYSQL" /><title>MYSQL User Password Modification</title><content type="html">&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;To modify the password of an existing user we use the following syntax:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SET PASSWORD [FOR user] = PASSWORD('some password')&lt;br /&gt;
&lt;br /&gt;
The SET PASSWORD statement assigns a password to an existing MySQL user account. &lt;br /&gt;
&lt;br /&gt;
With no FOR clause, this statement sets the password for the current user. Any client that has connected to the server using a non-anonymous account can change the password for that account. &lt;br /&gt;
&lt;br /&gt;
With a FOR clause, this statement sets the password for a specific account on the current server host. Only clients that have the UPDATE privilege for the mysql database can do this. The user value should be given in user_name@host_name format, where user_name and host_name are exactly as they are listed in the User and Host columns of the mysql.user table entry. For example, if you had an entry with User and Host column values of 'bob' and '%.loc.gov', you would write the statement like this: &lt;br /&gt;
&lt;br /&gt;
SET PASSWORD FOR &lt;a href="mailto:'tom'@'localhost'"&gt;'tom'@'localhost'&lt;/a&gt; = PASSWORD('newpass');&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #e06666;"&gt;That is equivalent to the following statements: &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
UPDATE mysql.user SET Password=PASSWORD('newpass')&lt;br /&gt;
&lt;br /&gt;
WHERE User='bob' AND Host='%.loc.gov';&lt;br /&gt;
&lt;br /&gt;
FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Note&lt;/u&gt;: &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
You can see which account the server authenticated you as by executing&lt;br /&gt;
&lt;br /&gt;
SELECT CURRENT_USER()&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-1583140419867948440?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9YIHyJVNjIMC5kd0nf5_UdKKYy4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9YIHyJVNjIMC5kd0nf5_UdKKYy4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9YIHyJVNjIMC5kd0nf5_UdKKYy4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9YIHyJVNjIMC5kd0nf5_UdKKYy4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/yBl0J4BzOtI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/1583140419867948440/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/mysql-user-password-modification.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/1583140419867948440?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/1583140419867948440?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/yBl0J4BzOtI/mysql-user-password-modification.html" title="MYSQL User Password Modification" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/mysql-user-password-modification.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAESX49eSp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-7333626443601455604</id><published>2011-03-03T16:52:00.001+05:30</published><updated>2011-03-05T20:55:08.061+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T20:55:08.061+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MYSQL" /><title>Dropping a User in MYSQL Database</title><content type="html">&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;PROCEDURE OF DROPPING A USER&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #e06666;"&gt;&lt;u&gt;Syntax&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DROP USER user [, user] ... &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #e06666;"&gt;&lt;u&gt;Example&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; drop user gsmc_monitor;&lt;br /&gt;
Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
The DROP USER statement removes one or more MySQL accounts. To use it, you must have the DELETE privilege for the mysql database. Each account is named using the same format as for the GRANT statement; for example, 'jeffrey'@'localhost'. If you specify only the username part of the account name, a hostname part of '%' is used.. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To remove a MySQL account completely (including all of its privileges), you should use the following procedure, performing the steps in the order shown: &lt;br /&gt;
&lt;br /&gt;
1.Use SHOW GRANTS to determine what privileges the account has. &lt;br /&gt;
&lt;br /&gt;
2.Use REVOKE to revoke the privileges displayed by SHOW GRANTS. This removes rows for the account from all the grant tables except the user table, and revokes any global privileges listed in the user table. &lt;br /&gt;
&lt;br /&gt;
3.Delete the account by using DROP USER to remove the user table row. &lt;br /&gt;
&lt;br /&gt;
In MySQL 5.0.2 and up, DROP USER removes the account row in the user table and also revokes the privileges held by the account. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Important&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
DROP USER does not automatically close any open user sessions. Rather, in the event that a user with an open session is dropped, the statement does not take effect until that user's session is closed. Once the session is closed, the user is dropped, and that user's next attempt to log in will fail.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-7333626443601455604?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IAqv4hcN_Q8sVwpMtzsgqc5lWn4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IAqv4hcN_Q8sVwpMtzsgqc5lWn4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IAqv4hcN_Q8sVwpMtzsgqc5lWn4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IAqv4hcN_Q8sVwpMtzsgqc5lWn4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/TW9PKIP3qUU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/7333626443601455604/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/dropping-user-in-mysql-database.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/7333626443601455604?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/7333626443601455604?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/TW9PKIP3qUU/dropping-user-in-mysql-database.html" title="Dropping a User in MYSQL Database" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/dropping-user-in-mysql-database.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAHQHgyfyp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-8787735191022644645</id><published>2011-03-03T16:34:00.002+05:30</published><updated>2011-03-05T20:55:31.697+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T20:55:31.697+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MYSQL" /><title>MySQL Frequeently Asked Questions -2</title><content type="html">&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;11). How to setup admin user for MYSQL ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Login as super user 'root' in mysql and execute the following commands. &lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; use mysql;&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; create user 'tom'@'%' identified by 'tom';&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; grant all on *.* to 'tom'@'%' with grant option;&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; flush privileges;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;12). What types of privileges are there in MySQL ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
There are 4 types of privileges.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #e06666;"&gt;i .Global privileges like *.* (all hosts connecting to Mysql db server)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Ex: GRANT SELECT, INSERT ON *.* TO 'someuser'@'somehost';&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #e06666;"&gt;ii. Database privileges like &lt;dbname&gt;.*&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Ex: GRANT SELECT, INSERT ON mydb.* TO 'someuser'@'somehost';&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #e06666;"&gt;iii. Table privileges like SELECT, INSERT, UPDATE, DELETE&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Ex: GRANT SELECT, INSERT ON mydb.mytbl TO 'someuser'@'somehost';&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #e06666;"&gt;iv. Column privileges like &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Ex: GRANT SELECT (col1), INSERT (col1,col2) ON mydb.mytbl TO 'someuser'@'somehost';&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;13). How to find the version of MySQL ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; select version();&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;14). How do I limit the number of rows I get out of my database?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
SELECT name FROM table LIMIT &lt;from range=""&gt;[, &lt;to range=""&gt;] ;&lt;br /&gt;
&lt;br /&gt;
if you want to get the rows between 10 and 20 do the following:&lt;br /&gt;
SELECT name FROM table LIMIT 10, 20 ;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;15). Is it possible to insert multiple rows using single command in MySQL ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Yes. Please see below example.&lt;br /&gt;
&lt;br /&gt;
INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9) ;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;16). I am getting the following error while logging into “sras” database.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
ERROR 1044 (42000): Access denied for user 'srini'@'localhost' to database 'sras'.&lt;br /&gt;
&lt;br /&gt;
Please refer the error to DBA asking for granting the privilege to “sras” database.&lt;br /&gt;
&lt;br /&gt;
mysql &amp;gt; grant all on sras.* to 'user_name' @ 'host_name' ;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;17). What is null value in MySQL ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
In MySQL NULL is only equal to NULL, but NULL is not equal to ' ' ( blank value ) or 0(zero) &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;18). How can I check if a table in MySQL database already exists?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Command : SHOW TABLES LIKE '&lt;db_name&gt;%';&lt;br /&gt;
&lt;br /&gt;
Mysql &amp;gt; SHOW TABLES LIKE 'mytab%';&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #38761d;"&gt;19). I am getting below error when application tries to execute any procedure say sras_purge etc.,&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Caused by: java.sql.SQLException: User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with "noAccessToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types.&lt;br /&gt;
&lt;br /&gt;
Solution : Remove the grants to particular user using following command: &lt;br /&gt;
&lt;br /&gt;
delete from mysql.user where host like '&lt;hostname&gt;%';&lt;br /&gt;
&lt;br /&gt;
grant ALL on &lt;db name=""&gt;.* to '&lt;username&gt;'@'&lt;hostname&gt;' identified by '&lt;password&gt;';&lt;br /&gt;
&lt;br /&gt;
grant ALL on mysql.proc to '&lt;username&gt;'@'&lt;hostname&gt;' identified by '&lt;password&gt;';&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;&lt;span style="color: #e06666;"&gt;Eg: &lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
delete from mysql.user where host like 'sustain-73%';&lt;br /&gt;
&lt;br /&gt;
grant ALL on sras25_qa01.* to 'sras_app'@'sustain-73.central.sun.com' identified by 'sras_app';&lt;br /&gt;
&lt;br /&gt;
grant ALL on mysql.proc to 'sras_app'@'sustain-73.central.sun.com' identified by 'sras_app';&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;20). Convert datetime from MST (db servers timezone) into GMT returns NULL value, how to solve it?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #e06666;"&gt;&lt;u&gt;Solution&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; DB should be updated with timezone value from os otherwise Mysql will return null. &lt;br /&gt;
&lt;br /&gt;
To load the timezone value from os into db&lt;br /&gt;
&lt;br /&gt;
Command : mysql_tzinfo_to_sql /usr/share/lib/zoneinfo &lt;br /&gt;
mysql -u root mysql -p&lt;password&gt;&lt;br /&gt;
&lt;br /&gt;
eg. mysql_tzinfo_to_sql /usr/share/lib/zoneinfo &lt;br /&gt;
mysql -u root mysql -pmysql&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6aa84f;"&gt;&lt;strong&gt;21). Column alias not displaying for tables column but with function it is displaying for driver mysql-connector-java-5.1.6-bin.jar, how to solve it?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #e06666;"&gt;&lt;u&gt;Solution&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; This is issue with this driver, so please use mysql-connector-java-5.0.7-bin.jar since SRAS DB version is Mysql 5.0.68 enterprise version&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;22). How to make MySQL database &amp;amp; table names are case in-sensitive?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #e06666;"&gt;&lt;u&gt;Solution&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; Change lower_case_table_names=1 in my.cnf and restart the instance&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;23). How to make MySQL character data are case in-sensitive?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #e06666;"&gt;&lt;u&gt;Solution&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; Recreated db with COLLATION=utf8_bin option instead of utf8_general_ci&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;&lt;span style="color: #e06666;"&gt;Eg:&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt; CREATE DATABASE IF NOT EXISTS &lt;db_name&gt;&lt;br /&gt;
&lt;br /&gt;
CHARACTER SET utf8 COLLATE utf8_general_ci;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-8787735191022644645?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cmmgDWY1R3DCxAgjOIrGA9ne7PA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cmmgDWY1R3DCxAgjOIrGA9ne7PA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cmmgDWY1R3DCxAgjOIrGA9ne7PA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cmmgDWY1R3DCxAgjOIrGA9ne7PA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/w_kWUXkC3sQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/8787735191022644645/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/mysql-frequeently-asked-questions-2.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/8787735191022644645?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/8787735191022644645?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/w_kWUXkC3sQ/mysql-frequeently-asked-questions-2.html" title="MySQL Frequeently Asked Questions -2" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/mysql-frequeently-asked-questions-2.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UNQHc8fip7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-5603929589183886352</id><published>2011-03-03T16:17:00.001+05:30</published><updated>2011-03-05T21:04:51.976+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:04:51.976+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MYSQL" /><title>MySQL Frequeently Asked Questions -1</title><content type="html">&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;1). What is the minimum hardware requirement for MySQL to be installed ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the minimum hardware requirement for MySQL installation.&lt;br /&gt;
&lt;br /&gt;
Minimum Disk Space 80GB &lt;br /&gt;
&lt;br /&gt;
Minimum RAM 4G&lt;br /&gt;
&lt;br /&gt;
Server with Multiple CPU processor&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;2). How do I login in MySQL Database ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;From Mysql DB server:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysql -u &lt;username&gt;&lt;database&gt;-p&lt;password&gt;&lt;br /&gt;
&lt;br /&gt;
eg : mysql -u root srasdev -pmysql&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;From Mysql client: (Client hostname should be granted from Mysql DB server)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysql -u &lt;username&gt;&lt;database&gt;-p&lt;password&gt; -h &lt;hostname&gt;&lt;br /&gt;
&lt;br /&gt;
eg : mysql -u root srasdev -pmysql -h gssie-4200-4.central&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;3). How do I startup/shutdown the MySQL database ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Run the following command in $ prompt.&lt;br /&gt;
&lt;br /&gt;
Startup : $MYSQL_HOME/bin/mysqld_safe --user=&lt;user&gt; --datadir=&lt;path data="" of=""&gt; &amp;amp;&lt;br /&gt;
&lt;br /&gt;
eg: $MYSQL_HOME/bin/mysqld_safe --user=mysql --datadir=/mysql/mysql/data &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Shutdown : $MYSQL_HOME/bin/mysqladmin -u &lt;username&gt;-p shutdown&lt;br /&gt;
&lt;br /&gt;
eg: $MYSQL_HOME/bin/mysqladmin -u root -p shutdown &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Note&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; Mysql(db) root user's password required&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;4). How do to change user password ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Run the following command in mysql prompt&lt;br /&gt;
&lt;br /&gt;
UPDATE mysql.user SET Password=PASSWORD('newpass')&lt;br /&gt;
&lt;br /&gt;
WHERE User='bob' AND Host='%.loc.gov';&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
GRANT all ON *.* TO 'user'@'host' IDENTIFIED BY 'password';&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
SET PASSWORD FOR 'user_name'@'host_name' = PASSWORD('newpass');&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Note&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; In some cases above commands may fails, so login as root and delete entry from mysql.user &lt;br /&gt;
&lt;br /&gt;
and grant with new password.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;For eg:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
delete from mysql.user where host='&lt;hostname&gt;';&lt;br /&gt;
&lt;br /&gt;
GRANT all ON *.* TO 'user'@'host' IDENTIFIED BY 'password';&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;5). How do I see MYSQL process ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Command : SHOW [FULL] PROCESSLIST;&lt;br /&gt;
&lt;br /&gt;
Eg: MYSQL&amp;gt;SHOW PROCESSLIST;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;6). How to grant privileges to a user ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Command: GRANT &lt;privelege&gt;/ALL ON &lt;objects&gt;/*.* TO ' someuser ' @ ' somehost ';&lt;br /&gt;
&lt;br /&gt;
Eg: GRANT ALL ON *.* TO 'srasapp'@'sustain-42.central';&lt;br /&gt;
&lt;br /&gt;
GRANT SELECT ON sras.* TO 'srasapp'@'sustain-42.central';&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;7). How do I grant permission to a specific host ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Command: GRANT ALL ON *.* TO 'user_name'@'host_name' IDENTIFIED BY 'password' ;&lt;br /&gt;
&lt;br /&gt;
Eg: GRANT ALL ON *.* TO 'sras_app'@'sustain-75.central' IDENTIFIED BY 'srasapp123';&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;8). How do I grant permission for all hosts ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Command : GRANT ALL ON *.* TO ' user_name ' @ ' %' IDENTIFIED BY 'password' ;&lt;br /&gt;
&lt;br /&gt;
Eg: GRANT ALL ON *.* TO 'sras_app'@'%' IDENTIFIED BY 'srasapp123';&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;9). How do I run SQL command through command line ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Login in MySQL using the command below and you can run sql queries in mysql prompt.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&lt;br /&gt;
mysql -u root -p &lt;br /&gt;
&lt;br /&gt;
mysql &amp;gt; use mysql ;&lt;br /&gt;
&lt;br /&gt;
mysql &amp;gt; select * from user ;&lt;br /&gt;
&lt;br /&gt;
mysql &amp;gt; \. &amp;lt; file name.sql &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;10). How do I resolve access denied error ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Grant access to the user with password&lt;br /&gt;
&lt;br /&gt;
Command: GRANT &lt;privelege&gt;/ALL ON &lt;objects&gt;/*.* TO ' someuser ' @ ' somehost ' IDENTIFIED BY '&lt;password&gt;';&lt;br /&gt;
&lt;br /&gt;
eg: GRANT ALL ON *.* TO 'sras_app'@'sustain-75.central' IDENTIFIED BY 'srasapp321';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-5603929589183886352?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/HVz3A4aLMOjCGb7y082GdyQLILc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HVz3A4aLMOjCGb7y082GdyQLILc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/HVz3A4aLMOjCGb7y082GdyQLILc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HVz3A4aLMOjCGb7y082GdyQLILc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/8Piisw3z1Zg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/5603929589183886352/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/mysql-frequeently-asked-questions-1.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/5603929589183886352?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/5603929589183886352?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/8Piisw3z1Zg/mysql-frequeently-asked-questions-1.html" title="MySQL Frequeently Asked Questions -1" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/mysql-frequeently-asked-questions-1.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QGQXg-fyp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-2705799356928770439</id><published>2011-03-03T15:57:00.002+05:30</published><updated>2011-03-05T21:05:20.657+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:05:20.657+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MYSQL" /><title>MySql Tools &amp; Utilities</title><content type="html">&lt;strong&gt;&lt;span style="color: #e06666;"&gt;Following is the list of some tools which support MySql:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Tools to Monitor Queries and Transactions&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;1). &lt;u&gt;mytop&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; tool for monitoring queries. It is a Perl program that runs in a terminal and displays information about all connections in a tabular layout, similar to the Unix top program's process display. Columns include the connection ID, the connection's status, and the text of the current query. From this display you can select a query to EXPLAIN, kill a query, and a few other tasks.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;2). &lt;u&gt;mtop&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; (MySQL top) monitors a MySQL server showing the queries which are taking the most amount of time to complete. Features include 'zooming' in on a process to show the complete query, 'explaining' the query optimizer information for a query and 'killing' queries. In addition, server performance statistics, configuration information, and tuning tips are provided. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;3). &lt;u&gt;mkill&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; (MySQL kill) monitors a MySQL server for long running queries and kills them after a specified time interval. Queries can be selected based on regexes on the user, host, command, database, state and query. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;4). &lt;u&gt;innotop&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; a powerful text-mode MySQL and InnoDB monitoring tool. It has lots of features, is fast and configurable, and it’s easy to use.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;5). &lt;u&gt;phpMyTop&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; It is a web based mytop clone. It is useful when we don't have shell access and can't connect remotely to our database server, but can connect from a web server. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;6). &lt;u&gt;ajaxMyTop&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; it’s function is similar to phpMyTop. It also feels more like a traditional GUI program, the entire page does not constantly refresh itself.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;7). &lt;u&gt;phpMyAdmin&lt;/u&gt; :&lt;/span&gt;&lt;/strong&gt; It is also a web based tool with features to design tables, run queries, manage users and more. Its focus isn't on monitoring queries and processes, but it has some of the features such as showing a process list. &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style="color: #e06666;"&gt;&lt;strong&gt;&lt;u&gt;Tools to Monitor a MySQL Server&lt;/u&gt;:&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&amp;nbsp; &lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;1). &lt;u&gt;mysqlreport&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; It is a well-designed program that turns MySQL status information into knowledge. It prints out a report of relevant variables, sensibly arranged for an experienced MySQL user. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;2). &lt;u&gt;Nagios&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; Nagios is an open source host, service and network monitoring program. Its task is setting up automated systems to monitor your server and let you know if it's alive&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;3). &lt;u&gt;mysqlmonitor&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; It monitors a Mysql database server. It is designed to be used as a monitor for the mon package. As such if any host's Mysql server is dead it returns 1 and outputs the hostnames that failed. If all hosts' servers are alive 0 is returned. &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style="color: #e06666;"&gt;&lt;strong&gt;&lt;u&gt;Following is the list of some MySql Utilities&lt;/u&gt;:&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;1). &lt;u&gt;isamchk&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
isamchk [options]table [table...]&lt;br /&gt;
&lt;br /&gt;
Performs operations on the database table files themselves (called ISAM files for Indexed Sequential Access Method). This utility is used to check and repair the files, as well as report information about them. You must provide the correct path to the ISAM file you wish to examine. The default location for the ISAM files is /usr/local/var/databasename/tablename.ISM.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;2). &lt;u&gt;isamlog&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
isamlog [options] [logfile] [table]&lt;br /&gt;
&lt;br /&gt;
Displays information about ISAM logs. An ISAM log is generated if the MySQL server is started with the -log-isam option. The information in the ISAM log can be used to recover damaged tables using the -r option. However, modifying the data files directly can be dangerous and you should always back up your data before doing so.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;3). &lt;u&gt;mysql&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysql [options] [database]&lt;br /&gt;
&lt;br /&gt;
The MySQL command line monitor. This program is the most basic way to communicate with the MySQL server. SQL commands can be typed directly on the command line and the results are displayed on the screen. If database is supplied, it is automatically selected as the current database.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;4). &lt;u&gt;mysqlaccess&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysqlaccess [options] [host] user database&lt;br /&gt;
&lt;br /&gt;
Displays and modifies access rights for the MySQL server. You may examine the rights of users for any database and in connection with any host. Unix shell wildcards `*' and `?' may be used to match multiple hosts, users and databases. All actions are performed on a copy of the actual grant tables until a mysqlaccess --commit command is sent.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;5). &lt;u&gt;mysqladmin&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysqladmin [options] command [command...]&lt;br /&gt;
&lt;br /&gt;
Performs operations that affect the database server as a whole. This utility is used to shutdown the database server, add and delete entire databases, and other administrative functions.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;6). &lt;u&gt;mysqlbug&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysqlbug&lt;br /&gt;
&lt;br /&gt;
Reports a bug in a MySQL program or utility. This program collects information about your MySQL installation and sends a detailed problem report to the MySQL team.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;7). &lt;u&gt;mysqld&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysqld [options]&lt;br /&gt;
&lt;br /&gt;
The MySQL server daemon. All other programs interact with the database through this server, so it should be left running at all times (except when down for maintenance). The daemon is usually started from a script called safe_mysqld. This script sets the appropriate environment variables and launches mysqld with the necessary arguments.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;8). &lt;u&gt;mysqldump&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysqldump [options] database[table]&lt;br /&gt;
&lt;br /&gt;
Outputs the contents of the given database (or table within a database) as a series of ANSI SQL commands. This command is handy for breaking up a database; use the -1 and -opt options.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;9). &lt;u&gt;mysqlimport&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysqlimport [options] database [file]&lt;br /&gt;
&lt;br /&gt;
Reads a file of data in a variety of common formats (such as comma delimited or fixed width) and inserts the data into a database. A table with the same name as the file must exist in the database with enough columns of the appropriate type to store the data.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;10). &lt;u&gt;mysqlshow&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysqlshow [options] [database] [table] [field]&lt;br /&gt;
&lt;br /&gt;
Displays the layout of the requested database, table or field. If no argument is given, a list of all of the databases is given. With one argument the layout of the given database is displayed. With two arguments, a table within the database is displayed. If all three arguments are present, the information about a specific field within a table is presented.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-2705799356928770439?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/z61zYo3BH2rdVNsUpXPs2dO5T9o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/z61zYo3BH2rdVNsUpXPs2dO5T9o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/z61zYo3BH2rdVNsUpXPs2dO5T9o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/z61zYo3BH2rdVNsUpXPs2dO5T9o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/jDdFbBKZ820" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/2705799356928770439/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/mysql-tools-utilities.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/2705799356928770439?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/2705799356928770439?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/jDdFbBKZ820/mysql-tools-utilities.html" title="MySql Tools &amp; Utilities" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/mysql-tools-utilities.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QHRH4-eyp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-958498104239519461</id><published>2011-03-03T13:32:00.001+05:30</published><updated>2011-03-05T21:05:35.053+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:05:35.053+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MYSQL" /><title>Mysql Questions &amp; Answers - 2</title><content type="html">&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;6). How to delete a table?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DROP TABLE command is used to delete a table.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Syntax&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
DROP [TEMPORARY] TABLE [IF EXISTS] tbl_name [, tbl_name] ...&lt;br /&gt;
[RESTRICT CASCADE]&lt;br /&gt;
&lt;br /&gt;
DROP TABLE removes one or more tables. You must have the DROP privilege for each table. All table data and the table definition are removed, so be careful with this statement! If any of the tables named in the argument list do not exist, MySQL returns an error indicating by name which non-existing tables it was unable to drop, but it also drops all of the tables in the list that do exist.&lt;br /&gt;
&lt;br /&gt;
Important: When a table is dropped, user privileges on the table are not automatically dropped. See [HELP GRANT].&lt;br /&gt;
&lt;br /&gt;
IF EXISTS is used to prevent an error from occurring if the table does not exist.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6aa84f;"&gt;&lt;strong&gt;&lt;u&gt;Example&lt;/u&gt;:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
mysql&amp;gt; drop table t1;&lt;br /&gt;
Query OK, 0 rows affected (0.05 sec)&lt;br /&gt;
&lt;br /&gt;
This deletes the table t1;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;7). How to delete a database?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Syntax&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
DROP {DATABASE&amp;nbsp; SCHEMA} [IF EXISTS] db_name&lt;br /&gt;
&lt;br /&gt;
DROP DATABASE drops all tables in the database and deletes the database. Be very careful with this statement! To use DROP DATABASE, you need the DROP privilege on the database. DROP SCHEMA is a synonym for DROP DATABASE.&lt;br /&gt;
&lt;br /&gt;
Important: When a database is dropped, user privileges on the database are not automatically dropped. See [HELP GRANT].&lt;br /&gt;
&lt;br /&gt;
IF EXISTS is used to prevent an error from occurring if the database does not exist.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6aa84f;"&gt;&lt;strong&gt;&lt;u&gt;Example&lt;/u&gt;:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
mysql&amp;gt; drop database sig;&lt;br /&gt;
Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
This deletes the database sig.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;8). How to display all databases present?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SHOW DATABASES is used to display all the databases in the system.&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; show databases;&lt;br /&gt;
&lt;br /&gt;
+--------------------+&lt;br /&gt;
Database&amp;nbsp; &lt;br /&gt;
+--------------------+&lt;br /&gt;
information_schema &lt;br /&gt;
mysql &lt;br /&gt;
test &lt;br /&gt;
+--------------------+&lt;br /&gt;
3 rows in set (0.16 sec)&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;9).How to create users in a system?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The CREATE USER command is used to create new users on mysql.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Syntax&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CREATE USER user [IDENTIFIED BY [PASSWORD] 'password']&lt;br /&gt;
&lt;br /&gt;
[, user [IDENTIFIED BY [PASSWORD] 'password']] ... &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
The CREATE USER statement creates new MySQL accounts. To use it, you must have the global CREATE USER privilege or the INSERT privilege for the mysql database. For each account, CREATE USER creates a new row in the mysql.user table that has no privileges. An error occurs if the account already exists. Each account is named using the same format as for the GRANT statement; for example, 'jeffrey'@'localhost'. If you &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
specify only the username part of the account name, a hostname part of '%' is used. For additional information about specifying account names, see [HELP GRANT].&lt;br /&gt;
&lt;br /&gt;
The account can be given a password with the optional IDENTIFIED BY clause. The user value and the password are given the same way as for the GRANT statement. In particular, to specify the password in plain text, omit the PASSWORD keyword. To specify the password as the hashed value as returned by the PASSWORD() function, include the PASSWORD keyword. See [HELP GRANT].&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;10). How to display all users in a system ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All the users are stored as different rows in the user table in the mysql databse.&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; use mysql&lt;br /&gt;
&lt;br /&gt;
Database changed&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; select user from user;&lt;br /&gt;
&lt;br /&gt;
+--------+&lt;br /&gt;
user &lt;br /&gt;
+--------+&lt;br /&gt;
testuser1&lt;br /&gt;
testuser2&lt;br /&gt;
root &lt;br /&gt;
sig &lt;br /&gt;
+--------+&lt;br /&gt;
4 rows in set (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;11).How to Grant permissions to users?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All the permissions to users created on mysql are given using the grant commands. All the grants to a particular user can be viewed in the user table.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Syntax&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
GRANT priv_type [(column_list)] [, priv_type [(column_list)]] ...&lt;br /&gt;
ON [object_type] {tbl_name * *.* db_name.*}&lt;br /&gt;
TO user [IDENTIFIED BY [PASSWORD] 'password']&lt;br /&gt;
[, user [IDENTIFIED BY [PASSWORD] 'password']] ...&lt;br /&gt;
[REQUIRE&lt;br /&gt;
NONE &lt;br /&gt;
[{SSL&lt;br /&gt;
X509}]&lt;br /&gt;
[CIPHER 'cipher' [AND]]&lt;br /&gt;
[ISSUER 'issuer' [AND]]&lt;br /&gt;
[SUBJECT 'subject']]&lt;br /&gt;
[WITH with_option [with_option] ...]&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; grant all on *.* to&amp;nbsp;testuser1 identified by 'testuser1' with grant option;&lt;br /&gt;
&lt;br /&gt;
Query OK, 0 rows affected (0.09 sec)&lt;br /&gt;
&lt;br /&gt;
This will grant all rights to the user testuser1 having password testuser1. We can also grant the specific privileges by appropriately setting the different columns in the user table.&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; update user set Create_priv='Y' where user = 'testuser1';&lt;br /&gt;
Query OK, 1 row affected (0.05 sec)&lt;br /&gt;
&lt;br /&gt;
Rows matched: 1 Changed: 1 Warnings: 0&lt;br /&gt;
&lt;br /&gt;
This grants the create privilege to the user testuser1.&lt;br /&gt;
&lt;br /&gt;
ALSOLOOK http://www.devarticles.com/c/a/MySQL/Creating-Users-and-Setting-Permissions-in-MySQL/&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;12). How to get help in mysql?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The HELP command is used to get help on mysql. &lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; help contents&lt;br /&gt;
&lt;br /&gt;
You asked for help about help category: "Contents"&lt;br /&gt;
For more information, type 'help &lt;item&gt;', where &lt;item&gt;is one of the following categories:&lt;br /&gt;
&lt;br /&gt;
Account Management&lt;br /&gt;
Administration&lt;br /&gt;
Data Definition&lt;br /&gt;
Data Manipulation&lt;br /&gt;
Data Types&lt;br /&gt;
Functions&lt;br /&gt;
Functions and Modifiers for Use with GROUP BY&lt;br /&gt;
Geographic Features&lt;br /&gt;
Language Structure&lt;br /&gt;
Plugins&lt;br /&gt;
Storage Engines&lt;br /&gt;
Stored Routines&lt;br /&gt;
Table Maintenance&lt;br /&gt;
Transactions&lt;br /&gt;
Triggers&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-958498104239519461?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XN6UD1o3XDCWETXk4_ZKRZspLi4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XN6UD1o3XDCWETXk4_ZKRZspLi4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XN6UD1o3XDCWETXk4_ZKRZspLi4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XN6UD1o3XDCWETXk4_ZKRZspLi4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/3oubO2jsvOw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/958498104239519461/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/mysql-questions-answers-2.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/958498104239519461?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/958498104239519461?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/3oubO2jsvOw/mysql-questions-answers-2.html" title="Mysql Questions &amp; Answers - 2" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/mysql-questions-answers-2.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QBQX84fyp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-4142357476035619085</id><published>2011-03-03T13:16:00.002+05:30</published><updated>2011-03-05T21:05:50.137+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:05:50.137+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MYSQL" /><title>Mysql Questions &amp; Answers - 1</title><content type="html">&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;1. How to create a new database?&lt;/span&gt;&lt;/strong&gt; &lt;br /&gt;
&lt;br /&gt;
CREATE DATABASE creates a database with the given name. To use this statement, you need to have the CREATE privilege for the database. CREATE SCHEMA is a synonym for CREATE DATABASE.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Syntax&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
CREATE {DATABASE SCHEMA} [IF NOT EXISTS] db_name &lt;br /&gt;
[create_specification [create_specification] ...] create_specification:&lt;br /&gt;
[DEFAULT] CHARACTER SET charset_name&lt;br /&gt;
[DEFAULT] COLLATE collation_name&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Example&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; create database sig;&lt;br /&gt;
&lt;br /&gt;
Query OK, 1 row affected (0.01 sec)&lt;br /&gt;
&lt;br /&gt;
This creates a new database sig.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;2). How to set a database as the active database?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The USE command is used to select a database as the active database.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Syntax&lt;/u&gt;:&lt;/span&gt; &lt;/strong&gt;USE db_name&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; use sig;&lt;br /&gt;
&lt;br /&gt;
Database changed&lt;br /&gt;
&lt;br /&gt;
This sets the databse sig as the current database,&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;3). How to create new tables on a database ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The CREATE TABLE command is used to create a new table.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Syntax&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name&lt;br /&gt;
&lt;br /&gt;
(create_definition,...)&lt;br /&gt;
&lt;br /&gt;
[table_option ...]&lt;br /&gt;
&lt;br /&gt;
[partition_options]&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Example&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; create table t1(a int);&lt;br /&gt;
Query OK, 0 rows affected (0.08 sec)&lt;br /&gt;
&lt;br /&gt;
This creates the table t1 with a integer column labeled a.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;4). How to insert rows into a table?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The INSERT command is used to add rows to a table.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Syntax&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
INSERT [LOW_PRIORITY &lt;br /&gt;
DELAYED &lt;br /&gt;
HIGH_PRIORITY] [IGNORE]&lt;br /&gt;
[INTO] tbl_name [(col_name,...)]&lt;br /&gt;
VALUES ({expr &lt;br /&gt;
DEFAULT},...),(...),...&lt;br /&gt;
[ ON DUPLICATE KEY UPDATE col_name=expr, ... ]&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Example&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; insert t1 set a= 1;&lt;br /&gt;
Query OK, 1 row affected (0.03 sec)&lt;br /&gt;
&lt;br /&gt;
This adds a new rown with a = 1 to table t1.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;5). How to display the contents of a table?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SELECT command is used to display the rows of the table.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #6aa84f;"&gt;&lt;u&gt;Syntax&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
SELECT&lt;br /&gt;
[ALL &lt;br /&gt;
DISTINCT &lt;br /&gt;
DISTINCTROW ]&lt;br /&gt;
[HIGH_PRIORITY]&lt;br /&gt;
[STRAIGHT_JOIN]&lt;br /&gt;
[SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]&lt;br /&gt;
[SQL_CACHE &lt;br /&gt;
SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]&lt;br /&gt;
&lt;br /&gt;
select_expr, ...&lt;br /&gt;
[FROM table_references&lt;br /&gt;
[WHERE where_condition]&lt;br /&gt;
[GROUP BY {col_name &lt;br /&gt;
expr &lt;br /&gt;
position}&lt;br /&gt;
[ASC &lt;br /&gt;
DESC], ... [WITH ROLLUP]]&lt;br /&gt;
[HAVING where_condition]&lt;br /&gt;
[ORDER BY {col_name &lt;br /&gt;
expr &lt;br /&gt;
position}&lt;br /&gt;
[ASC &lt;br /&gt;
DESC], ...]&lt;br /&gt;
[LIMIT {[offset,] row_count &lt;br /&gt;
row_count OFFSET offset}]&lt;br /&gt;
[PROCEDURE procedure_name(argument_list)]&lt;br /&gt;
[INTO OUTFILE 'file_name' export_options&lt;br /&gt;
INTO DUMPFILE 'file_name'&lt;br /&gt;
INTO @var_name [, @var_name]]&lt;br /&gt;
[FOR UPDATE &lt;br /&gt;
LOCK IN SHARE MODE]]&lt;br /&gt;
&lt;br /&gt;
SELECT is used to retrieve rows selected from one or more tables, and n include UNION statements and subqueries. See [HELP UNION], and ttp://dev.mysql.com/doc/refman/5.1/en/subqueries.html.&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; select * from t1;&lt;br /&gt;
&lt;br /&gt;
+------+&lt;br /&gt;
a &lt;br /&gt;
+------+&lt;br /&gt;
1 &lt;br /&gt;
2 &lt;br /&gt;
3 &lt;br /&gt;
4 &lt;br /&gt;
+------+&lt;br /&gt;
&lt;br /&gt;
4 rows in set (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
Note: sel * from t1; wouldn’t work on MYSQL.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-4142357476035619085?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8a7n11RIbn0fU45Das99xVRDvbc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8a7n11RIbn0fU45Das99xVRDvbc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8a7n11RIbn0fU45Das99xVRDvbc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8a7n11RIbn0fU45Das99xVRDvbc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/RYcIKjxFPvc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/4142357476035619085/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/mysql-questions-answers.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/4142357476035619085?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/4142357476035619085?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/RYcIKjxFPvc/mysql-questions-answers.html" title="Mysql Questions &amp; Answers - 1" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/mysql-questions-answers.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MFRXwycCp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-8120722885772368650</id><published>2011-03-02T23:53:00.004+05:30</published><updated>2011-03-05T21:06:54.298+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:06:54.298+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Oracle DBA" /><title>Automatic Shared Memory Management in Oracle 10g ( ASMM)</title><content type="html">&lt;b&gt;&lt;u&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;OVERVIEW&lt;/span&gt;&lt;/u&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;It used to be a challenge to size the various memory pools that comprise the Oracle system global area (SGA) for optimal performance. In real world most of the Oracle Databases are of Hybrid type. They are OLTP in day time when the accessibility is high and in the night time, many batch jobs run on the same database to extract data or to run big reports. This will be a combination of the OLTP, OLAP, DSS and HYBRID type of database. Since various types of applications require the underlined memory pools differently, and since the workload can vary minute by minute, manually resizing the SGA components could feel like a never-ending task.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;If there is not enough free SGA to allocate for a specific pool when needed, the database will give out-of-memory error, such as&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;ORA-04031: unable to allocate …&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;The requirement for the database varies from time to time. During OLTP operation (when most of the users accessing the data) the response time should be minimum. During night time the turn around time should be short when response time is not so important.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;The combination of these kinds of requirement makes the task of the DBA a little bit tougher. DBA needs to set the SGA in such a way that demands meet in a balance. But this is tough job. To ease such issue, Oracle has come up with Automatic Shared Memory Management feature in Oracle 10g which will adjust the requirement of the memory component as per demand of the system.&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116274566"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273783"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273721"&gt;&lt;/a&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;&lt;b&gt;&lt;u&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Advantage of ASMM&lt;/span&gt;&lt;/u&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273109"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;Oracle Database 10g, ASMM automatically sizes many of the memory pools while the database is running, allocating and de-allocating memory as needed. As the workload composition changes, Oracle Database 10g enlarges the appropriate pools and reduces the sizes of other automatically sized pools accordingly. In short, ASMM can save the DBA a lot of trouble—and improve overall performance as well.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;a href="http://www.blogger.com/goog_1692626488"&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;The main advantage ASMM is that Oracle Database server itself will adjust the following SGA parameters as per the requirement of the system.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.75in; mso-list: l0 level1 lfo2; tab-stops: list .75in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;·&lt;span style="font-family: 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;DB_CACHE&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;_&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;SIZE&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.75in; mso-list: l0 level1 lfo2; tab-stops: list .75in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;·&lt;span style="font-family: 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;JAVA_POOL_SIZE&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.75in; mso-list: l0 level1 lfo2; tab-stops: list .75in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;·&lt;span style="font-family: 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;LARGE_POOL_SIZE&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.75in; mso-list: l0 level1 lfo2; tab-stops: list .75in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;·&lt;span style="font-family: 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;SHARED_POOL_SIZE&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;Remaining components of the SGA are not adjustable by this method. They need to be manually adjusted. They are&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;LOG_BUFFER &lt;/span&gt;&lt;/li&gt;
&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;a href="http://www.blogger.com/goog_1692626488"&gt;&lt;/a&gt;&lt;/span&gt;
&lt;li class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;DB_KEEP_CACHE_SIZE &lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;DB_RECYCLE_CACHE_SIZE &lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;DB_nK_CACHE_SIZE (n = 2, 4, 8, 16, 32, and&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt; nk is non-standard Data block size.)&lt;/span&gt;) &lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;STREAMS_POOL_SIZE (In Oracle 10g Release 2. STEAMS_POOL_SIZE can be automatically managed.) &amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif; font-size: 12pt;"&gt;The ASSM feature will lessen the involvement of DBA to set the different SGA components from time to time based on the demand of the workload. It will improve the performance of the database also reduce the cost factor by elimination of adding additional System resource (Memory, etc).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273109"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;b&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116274567"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273784"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273722"&gt;&lt;/a&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;&lt;u&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;How to setup ASMM&lt;/span&gt;&lt;/u&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273109"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;b&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273110"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273109"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273110"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;The STATISTICS_LEVEL initialization parameter must be set to TYPICAL (the default) or ALL. That sets the statistics collection level of the database. (The other value of this parameter is BASIC, which will not allow changing the memory pools automatically.) &lt;/span&gt;&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273110"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273110"&gt;&lt;span class="Apple-style-span" style="font-family: 'Arial Narrow', sans-serif; font-size: small;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273110"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="display: inline! important;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;Oracle 10g has introduced a new parameter by name SGA_TARGET.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;DBA has to set up the SGA_TARGET to a non-zero value that will enable the automatic memory allocation. The SGA_TARGET can be configured dynamically by issuing “Alter system” command or by setting that in Parameter file.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;DBA needs to set the below mentioned memory parameters to 0 in the parameter file or remove them completely from the parameter file.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;DB_CACHE&lt;/span&gt;&lt;b&gt;&lt;i&gt;_&lt;/i&gt;&lt;/b&gt;SIZE = 0&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;JAVA_POOL_SIZE = 0&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;LARGE_POOL_SIZE = 0&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;SHARED_POOL_SIZE =0&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;DBA can also do resizing of the autotuned pools to 0, as follows:&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;SQL&amp;gt; alter system set sga_target=160M scope=both;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;System altered.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;SQL&amp;gt; alter system set db_cache_size=0;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;System altered.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;SQL&amp;gt; alter system set shared_pool_size=0;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;System altered.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;……..&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;The ORACLE database will share that memory into separate component as mentioned below. The individual pools within the SGA will be dynamically configured based on the workload.&amp;nbsp; From time to time, based on the composition of the work load, the pools will expand to accommodate the increase in demand or shrink to accommodate the expansion in another pool. This expansion or contraction occurs automatically without the DBA's intervention.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Arial Narrow', sans-serif; font-weight: bold;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold; margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font-family: 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;DB_CACHE_SIZE&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold; margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font-family: 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;JAVA_POOL_SIZE&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold; margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font-family: 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;LARGE_POOL_SIZE&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold; margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;·&lt;span style="font-family: 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;SHARED_POOL_SIZE&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif; font-weight: bold; margin-left: 0.5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="font-family: 'Times New Roman', serif;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;There are few components of SGA that can’t be automatically tuned; those components need to be set manually.&amp;nbsp; Manually sized components consume memory from the target value first, and then the remainder of SGA memory is spread across the various auto sized pools. In other words, if DBA sets parameter values for any of these below mentioned manually tuned pools, Oracle Database 10g subtracts their sizes from SGA_TARGET first, before allocating memory to the automatically allocated pools. &lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul style="font-family: 'Times New Roman', serif;" type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;DB_KEEP_CACHE_SIZE &lt;/b&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="font-weight: bold;"&gt;DB_RECYCLE_CACHE_SIZE &lt;/li&gt;
&lt;li class="MsoNormal" style="font-weight: bold;"&gt;DB_nK_CACHE_SIZE (n = 2, 4, 8, 16, 32 and &lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;nk is non-standard Data block size&lt;/span&gt;) &lt;/li&gt;
&lt;li class="MsoNormal" style="font-weight: bold;"&gt;LOG_BUFFER &lt;/li&gt;
&lt;li class="MsoNormal" style="font-weight: bold;"&gt;STREAMS_POOL_SIZE (In Oracle 10g Release 2. STEAMS_POOL_SIZE can be automatically managed.)&amp;nbsp; &lt;/li&gt;
&lt;/ul&gt;&lt;div class="MsoNormal" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Arial Narrow', sans-serif; font-weight: normal;"&gt;The SGA_TARGET can’t cross the size of SGA_MAX_SIZE. SGA_MAX_SIZE can’t be resized dynamically. To reset the SGA_MAX_SIZE, the Oracle Instance needs to be renounced.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: 'Times New Roman', serif;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;h1 style="margin-left: 0.25in; mso-list: l0 level1 lfo1; tab-stops: list .25in; text-indent: -0.25in;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116274568"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;u&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Setting a Minimum Value for variable pools&lt;/span&gt;&lt;/u&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;If DBA doesn't set the values for each of the automatically tuned pools to zero after switching to ASMM, whatever value DBA had set for a parameter will function as a lower threshold value for that pool—ASMM won't go below a nonzero value, even if it needs the memory for another automatically tuned pool. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="mso-line-height-alt: 10.5pt;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;Suppose, DBA has set up the following parameters in parameter file after switching to ASSM feature.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;b&gt;LARGE_POOL_SIZE = 16M&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;&lt;b&gt;JAVA_POOL_SIZE = 8 M&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="mso-line-height-alt: 10.5pt;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;In that case, LARGE_POOL_SIZE will never go below 16 MB and JAVA_POOL_SIZE will never go below 8MB.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="mso-line-height-alt: 10.5pt;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="mso-line-height-alt: 10.5pt;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif;"&gt;DBA can also do that by dynamically using ALTER SYSTEM as shown below. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre style="mso-line-height-alt: 10.5pt;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif; font-size: 12pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif; font-size: 12pt;"&gt;&lt;b&gt;alter system set large_pool_size = 16M;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif; font-size: 12pt;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;pre&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif; font-size: 12pt;"&gt;&lt;b&gt;alter system set java_pool_size = 8M;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273111"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif; font-size: 12pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;
&lt;div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=8120722885772368650" name="_Toc116273111"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="font-family: 'Arial Narrow', sans-serif; font-size: 12pt;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;Of course, these pools are still governed by Automatic Shared Memory Management—their sizes will shrink or expand based on demand. The values DBA has specified explicitly put a lower limit on the pool size; they will never sink below this limit.&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-8120722885772368650?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MIfpxLL8pKviEgP5ZrxFdfnz6_4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MIfpxLL8pKviEgP5ZrxFdfnz6_4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MIfpxLL8pKviEgP5ZrxFdfnz6_4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MIfpxLL8pKviEgP5ZrxFdfnz6_4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/Y6GZcEg59KA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/8120722885772368650/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/automatic-shared-memory-management-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/8120722885772368650?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/8120722885772368650?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/Y6GZcEg59KA/automatic-shared-memory-management-in.html" title="Automatic Shared Memory Management in Oracle 10g ( ASMM)" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/automatic-shared-memory-management-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MGSXY_eCp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-642123595136219566</id><published>2011-03-02T23:42:00.001+05:30</published><updated>2011-03-05T21:07:08.840+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:07:08.840+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Oracle DBA" /><title>Oracle DBA FAQs - 2</title><content type="html">&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Differentiate between TRUNCATE and DELETE. &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
The Delete command will log the data changes in the log file where as the truncate will simply remove the data without it. Hence Data removed by Delete command can be rolled back but not the data removed by TRUNCATE. Truncate is a DDL statement whereas DELETE is a DML statement. &lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What is the maximum buffer size that can be specified using the DBMS_OUTPUT.ENABLE function? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
1000000 &lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Can you use a commit statement within a database trigger? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Yes, if you are using autonomous transactions in the Database triggers. &lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What is an UTL_FILE? What are different procedures and functions associated with it? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The UTL_FILE package lets your PL/SQL programs read and write operating system (OS) text files. It provides a restricted version of standard OS stream file input/output (I/O).&lt;br /&gt;
Subprogram -Description&lt;br /&gt;
FOPEN function-Opens a file for input or output with the default line size.&lt;br /&gt;
IS_OPEN function -Determines if a file handle refers to an open file.&lt;br /&gt;
FCLOSE procedure -Closes a file.&lt;br /&gt;
FCLOSE_ALL procedure -Closes all open file handles.&lt;br /&gt;
GET_LINE procedure -Reads a line of text from an open file.&lt;br /&gt;
PUT procedure-Writes a line to a file. This does not append a line terminator.&lt;br /&gt;
NEW_LINE procedure-Writes one or more OS-specific line terminators to a file.&lt;br /&gt;
PUT_LINE procedure -Writes a line to a file. This appends an OS-specific line terminator.&lt;br /&gt;
PUTF procedure -A PUT procedure with formatting.&lt;br /&gt;
FFLUSH procedure-Physically writes all pending output to a file.&lt;br /&gt;
FOPEN function -Opens a file with the maximum line size specified.&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Difference between database triggers and form triggers? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Database triggers are fired whenever any database action like INSERT, UPATE, DELETE, LOGON LOGOFF etc occurs. Form triggers on the other hand are fired in response to any event that takes place while working with the forms, say like navigating from one field to another or one block to another and so on. &lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What is OCI. What are its uses? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
OCI is Oracle Call Interface. When applications developers demand the most powerful interface to the Oracle Database Server, they call upon the Oracle Call Interface (OCI). OCI provides the most comprehensive access to all of the Oracle Database functionality. The newest performance, scalability, and security features appear first in the OCI API. If you write applications for the Oracle Database, you likely already depend on OCI. Some types of applications that depend upon OCI are: &lt;br /&gt;
&lt;br /&gt;
· PL/SQL applications executing SQL&lt;br /&gt;
· C++ applications using OCCI&lt;br /&gt;
· Java applications using the OCI-based JDBC driver&lt;br /&gt;
· C applications using the ODBC driver&lt;br /&gt;
· VB applications using the OLEDB driver&lt;br /&gt;
· Pro*C applications&lt;br /&gt;
· Distributed SQL&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What are ORACLE PRECOMPILERS? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
A precompiler is a tool that allows programmers to embed SQL statements in high-level source programs like C, C++, COBOL, etc. The precompiler accepts the source program as input, translates the embedded SQL statements into standard Oracle runtime library calls, and generates a modified source program that one can compile, link, and execute in the usual way. Examples are the Pro*C Precompiler for C, Pro*Cobol for Cobol, SQLJ for Java etc. &lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What is syntax for dropping a procedure and a function? Are these operations possible? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Drop Procedure/Function ; yes, if they are standalone procedures or functions. If they are a part of a package then one have to remove it from the package definition and body and recompile the package. &lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;How to check if Apps 11i System is Autoconfig enabled ? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Under $AD_TOP/bin check for file adcfginfo.sh and if this exists use adcfginfo.sh contextfile=&lt;context&gt; show=enabled &lt;br /&gt;
&lt;br /&gt;
If this file is not there , look for any configuration file under APPL_TOP if system is Autoconfig enabled then you will see entry like &lt;/context&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;How to check if Oracle Apps 11i System is Rapid Clone enabled ? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
For syetem to be Rapid Clone enabled , it should be Autoconfig enabled (Check above How to confirm if Apps 11i is Autoconfig enabled). You should have Rapid Clone Patches applied , Rapid Clone is part of Rapid Install Product whose Family Pack Name is ADX. By default all Apps 11i Instances 11.5.9 and above are Autoconfig and Rapid Clone enabled. &lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Whats is difference between two env files in &lt;context&gt;.env and APPS&lt;context&gt;.env under $APPL_TOP ? &lt;/context&gt;&lt;/context&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
APPS&lt;context&gt;.env is main environment file which inturn calls other environment files like &lt;context&gt;.env under $APPL_TOP, &lt;context&gt;.env under 806 ORACLE_HOME and custom.env for any Customized environment files. &lt;/context&gt;&lt;/context&gt;&lt;/context&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Whats main concurrent Manager types. &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
# ICM - Internal Concurrent Manager which manages concurrent Managers&lt;br /&gt;
# Standard Managers - Which Manage processesing of requests.&lt;br /&gt;
# CRM - Conflict Resolution Managers , resolve conflicts in case of incompatibility.&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Whats &lt;st1:place w:st="on"&gt;&lt;st1:country-region w:st="on"&gt;US&lt;/st1:country-region&gt;&lt;/st1:place&gt; directory in $AD_TOP or under various product TOP's . &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;st1:country-region w:st="on"&gt;&lt;st1:place w:st="on"&gt;&lt;br /&gt;
&lt;/st1:place&gt;&lt;/st1:country-region&gt;&lt;br /&gt;
&lt;st1:country-region w:st="on"&gt;&lt;st1:place w:st="on"&gt;US&lt;/st1:place&gt;&lt;/st1:country-region&gt; directory is defauly language directory in Oracle Applications. If you have multiple languages Installed in your Applications then you will see other languages directories besides US, that directory will contain reports, fmx and other code in that respective directory like FR for &lt;st1:place w:st="on"&gt;&lt;st1:country-region w:st="on"&gt;France&lt;/st1:country-region&gt;&lt;/st1:place&gt;, AR for arabic, simplifies chinese or spanish. &lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Where is Concurrent Manager log file location. &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
By default standard location is $APPLCSF/$APPLLOG , in some cases it can go to $FND_TOP/log as well. &lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Where would i find .rf9 file, and what execatly it dose ? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
These files are used during restart of patch in case of patch failure because of some reason. &lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Where is appsweb.cfg or appsweb_$CONTEXT.cfg stored and why its used ? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This file is defined by environment variable FORMS60_WEB_CONFIG_FILE This is usually in directory $OA_HTML/bin on forms tier. &lt;br /&gt;
&lt;br /&gt;
This file is used by any forms client session. When a user try to access forms , f60webmx picks up this file and based on this configuration file creates a forms session to user/client. &lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What is Multi Node System ? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Multi Node System in Oracle Applications 11i means you have Applications 11i Component on more than one system. Typical example is Database, Concurrent Manager on one machine and forms, Web Server on second machine is example of Two Node System. &lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Can a function take OUT parameters. If not why? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
yes, IN, OUT or IN OUT. &lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Can the default values be assigned to actual parameters? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Yes. In such case you don’t need to specify any value and the actual parameter will take the default value provided in the function definition. &lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What is difference between a formal and an actual parameter? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The formal parameters are the names that are declared in the parameter list of the header of a module. The actual parameters are the values or expressions placed in the parameter list of the actual call to the module. &lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What are different modes of parameters used in functions and procedures? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There are three different modes of parameters: IN, OUT, and IN OUT.&lt;br /&gt;
&lt;br /&gt;
IN - The IN parameter allows you to pass values in to the module, but will not pass anything out of the module and back to the calling PL/SQL block. In other words, for the purposes of the program, its IN parameters function like constants. Just like constants, the value of the formal IN parameter cannot be changed within the program. You cannot assign values to the IN parameter or in any other way modify its value.&lt;br /&gt;
&lt;br /&gt;
IN is the default mode for parameters. IN parameters can be given default values in the program header.&lt;br /&gt;
&lt;br /&gt;
OUT - An OUT parameter is the opposite of the IN parameter. Use the OUT parameter to pass a value back from the program to the calling PL/SQL block. An OUT parameter is like the return value for a function, but it appears in the parameter list and you can, of course, have as many OUT parameters as you like.&lt;br /&gt;
&lt;br /&gt;
Inside the program, an OUT parameter acts like a variable that has not been initialised. In fact, the OUT parameter has no value at all until the program terminates successfully (without raising an exception, that is). During the execution of the program, any assignments to an OUT parameter are actually made to an internal copy of the OUT parameter. When the program terminates successfully and returns control to the calling block, the value in that local copy is then transferred to the actual OUT parameter. That value is then available in the calling PL/SQL block.&lt;br /&gt;
&lt;br /&gt;
IN OUT - With an IN OUT parameter, you can pass values into the program and return a value back to the calling program (either the original, unchanged value or a new value set within the program). The IN OUT parameter shares two restrictions with the OUT parameter: &lt;br /&gt;
&lt;br /&gt;
An IN OUT parameter cannot have a default value.&lt;br /&gt;
&lt;br /&gt;
An IN OUT actual parameter or argument must be a variable. It cannot be a constant, literal, or expression, since these formats do not provide a receptacle in which PL/SQL can place the outgoing value.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-642123595136219566?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/atqmU2uHKUGyg_jS7r1xPpK16wo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/atqmU2uHKUGyg_jS7r1xPpK16wo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/atqmU2uHKUGyg_jS7r1xPpK16wo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/atqmU2uHKUGyg_jS7r1xPpK16wo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/mwFVA9wIRZs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/642123595136219566/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/oracle-dba-faqs-2.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/642123595136219566?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/642123595136219566?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/mwFVA9wIRZs/oracle-dba-faqs-2.html" title="Oracle DBA FAQs - 2" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/oracle-dba-faqs-2.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MMRHc9cCp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-9117401622469198886</id><published>2011-03-02T21:05:00.001+05:30</published><updated>2011-03-05T21:08:05.968+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:08:05.968+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Oracle DBA" /><title>Locks Script in ORACLE</title><content type="html">&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-size: 12.0pt; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;&lt;u&gt;LOCKS&lt;/u&gt;:&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 12.0pt; line-height: 115%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-bidi-font-style: italic;"&gt;Locks&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt; are mechanisms that prevent destructive interaction between transactions accessing the same resource. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Oracle has several views for showing lock status, some of which show the username:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;DBA_BLOCKERS – Shows non-waiting sessions holding locks      being waited-on &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;DBA_DDL_LOCKS – Shows all DDL locks held or being      requested &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;DBA_DML_LOCKS&amp;nbsp; - Shows all DML locks held or being      requested &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;DBA_LOCK_INTERNAL – Displays 1 row for every lock or      latch held or being requested with the username of who is holding the      lock&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;DBA_LOCKS&amp;nbsp; - Shows all locks or latches held or      being requested &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;DBA_WAITERS&amp;nbsp; - Shows all sessions waiting on, but      not holding waited for locks&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;The following script is commonly used by Oracle professionals who need to quickly find out all database objects that are locked within their system.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Most Oracle professionals use of the v$locked_object view in order to gather information about objects that are locked within the Oracle database.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;The v$locked_object view can also be joined into the v$session view in order to gather session level information (SID, PID, status, machine) , and also joined into the dba_objects view in order to get the owner, the object name, and the type of objects that is currently being locked within the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;The following script can be used in order quickly identify all lock objects within your Oracle system.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;select&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; c.owner,&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; c.object_name,&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; c.object_type,&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; b.sid,&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; b.serial#,&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; b.status,&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; b.osuser,&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; b.machine&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;from&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; v$locked_object a ,&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; v$session b,&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; dba_objects c&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;where&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; b.sid = a.session_id&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;and&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; a.object_id = c.object_id;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 6.0pt; margin-right: 6.0pt; margin-top: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-size: 12.0pt; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;&lt;u&gt;DEADLOCK&lt;/u&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;Oracle automatically detects deadlock situations and resolves them by rolling back one of the statements involved in the deadlock.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;This releases one set of the conflicting row locks. A corresponding message also is returned to the transaction that undergoes the rollback. &lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="border-bottom: solid windowtext 1.0pt; border: none; margin-left: .5in; margin-right: 0in; mso-border-bottom-alt: solid windowtext .75pt; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;"&gt;&lt;div class="MsoNormal" style="border: none; mso-border-bottom-alt: solid windowtext .75pt; mso-padding-alt: 0in 0in 1.0pt 0in; padding: 0in;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Below the script is useful for identify&amp;nbsp; – “ Who is blocking to whom ”&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;select s1.username || '@' || s1.machine&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;|| ' ( SID=' || s1.sid || ' )&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;is blocking '&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;|| s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;from v$lock l1, v$session s1, v$lock l2, v$session s2&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;where s1.sid=l1.sid and s2.sid=l2.sid&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;and l1.BLOCK=1 and l2.request &amp;gt; 0&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;and l1.id1 = l2.id1&lt;/div&gt;&lt;div style="border-bottom: solid windowtext 1.0pt; border: none; margin-left: .5in; margin-right: 0in; mso-border-bottom-alt: solid windowtext .75pt; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;"&gt;&lt;div class="MsoNormal" style="border: none; mso-border-bottom-alt: solid windowtext .75pt; mso-padding-alt: 0in 0in 1.0pt 0in; padding: 0in;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;and l2.id2 = l2.id2 ;&lt;/div&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="border-bottom: solid windowtext 1.0pt; border: none; margin-left: .5in; margin-right: 0in; mso-border-bottom-alt: solid windowtext .75pt; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;"&gt;&lt;div class="MsoNormal" style="border: none; mso-border-bottom-alt: solid windowtext .75pt; mso-padding-alt: 0in 0in 1.0pt 0in; padding: 0in;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;below script is useful&amp;nbsp; for&amp;nbsp; “who’s Holder and Who’s Waiter” to query.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="border: none; mso-border-bottom-alt: solid windowtext .75pt; mso-padding-alt: 0in 0in 1.0pt 0in; padding: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;SELECT&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;/*+ FIRST_ROWS ORDERED */ DECODE(request,0,'Holder: ','Waiter: ')||sid sess,&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;id1, id2, lmode, request, type&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;FROM V$LOCK&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;WHERE (id1, id2, type) IN&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(SELECT id1, id2, type FROM V$LOCK WHERE request&amp;gt;0)&lt;/div&gt;&lt;div style="border-bottom: solid windowtext 1.0pt; border: none; margin-left: .5in; margin-right: 0in; mso-border-bottom-alt: solid windowtext .75pt; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;"&gt;&lt;div class="MsoNormal" style="border: none; mso-border-bottom-alt: solid windowtext .75pt; mso-padding-alt: 0in 0in 1.0pt 0in; padding: 0in;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ORDER BY id1, request;&lt;/div&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="border-bottom: solid windowtext 1.0pt; border: none; margin-left: .5in; margin-right: 0in; mso-border-bottom-alt: solid windowtext .75pt; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;"&gt;&lt;div class="MsoNormal" style="border: none; mso-border-bottom-alt: solid windowtext .75pt; mso-padding-alt: 0in 0in 1.0pt 0in; padding: 0in;"&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;Below the scriprt is Useful for identify &lt;b&gt;Database level locks.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;select&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;nvl(S.USERNAME,'Internal') username, &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;nvl(S.TERMINAL,'None') terminal, &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;L.SID||','||S.SERIAL# Kill, b.spid,&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;U1.NAME||'.'||substr(T1.NAME,1,20) tab, &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;decode(L.LMODE,1,'No Lock', &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;2,'Row Share', &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;3,'Row Exclusive', &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;4,'Share', &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;5,'Share Row Exclusive', &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;6,'Exclusive',null) lmode, &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;decode(L.REQUEST,1,'No Lock', &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;2,'Row Share', &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;3,'Row Exclusive', &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;4,'Share', &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;5,'Share Row Exclusive', &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;6,'Exclusive',null) request &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;from&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;V$LOCK L,&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;V$SESSION S, &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SYS.USER$ U1, &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SYS.OBJ$ T1 ,&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;v$process b&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;where&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;L.SID = S.SID&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;and&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;T1.OBJ# = decode(L.ID2,0,L.ID1,L.ID2)&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;and&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;U1.USER# = T1.OWNER# &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;and&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;S.TYPE != 'BACKGROUND' &lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: .5in;"&gt;and &lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;s.paddr = b.addr&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;order by 1,2,5 ;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-9117401622469198886?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/T8FHrAh4X-qa1Sx7cVou46ltI9E/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/T8FHrAh4X-qa1Sx7cVou46ltI9E/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/T8FHrAh4X-qa1Sx7cVou46ltI9E/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/T8FHrAh4X-qa1Sx7cVou46ltI9E/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/ZNKxrw0wW7A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/9117401622469198886/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/locks-script-in-oracle.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/9117401622469198886?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/9117401622469198886?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/ZNKxrw0wW7A/locks-script-in-oracle.html" title="Locks Script in ORACLE" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/locks-script-in-oracle.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IER3w6fSp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-2021152731330089517</id><published>2011-03-02T21:00:00.002+05:30</published><updated>2011-03-05T21:08:26.215+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:08:26.215+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Oracle DBA" /><title>Oracle DBA FAQs - 1</title><content type="html">&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_Oracle"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is Oracle?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;Oracle is a company.  Oracle is also a database server, which manages data in a very structured way.  It allows users to store and retrieve related data in a multiuser environment so  that many users can concurrently access the same data. All this is accomplished  while delivering high performance. A database server also prevents unauthorized  access and provides efficient solutions for failure  recovery.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_an_Oracle_Database"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is an Oracle  Database?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;An Oracle database is  a collection of data treated as a big unit in the database  server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_an_Oracle_Instance"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is an Oracle  Instance?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;Every running Oracle  database is associated with an Oracle instance. When a database is started on a  database server (regardless of the type of computer), Oracle allocates a memory  area called the System Global Area (SGA) and starts one or more Oracle  processes. This combination of the SGA and the Oracle processes is called an  Oracle instance. The memory and processes of an instance manage the associated  database's data efficiently and serve the one or multiple users of the  database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_a_Parameter_File"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is a Parameter  File?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;A parameter file is a  file that contains a list of initialization parameters and a value for each  parameter. You specify initialization parameters in a parameter file that  reflect your particular installation. Oracle supports the following two types of  parameter files:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style="color: black; margin-top: 3pt;"&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;Server Parameter Files - Binary  version. Persistent. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li class="MsoNormal" style="color: black; margin-top: 3pt;"&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;Initialization Parameter Files -  Text version. Not persistent. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_a_Server_Parameter_File"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is a Server Parameter  File?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;A server parameter  file is a binary file that acts as a repository for initialization parameters.  The server parameter file can reside on the machine where the Oracle database  server executes. Initialization parameters stored in a server parameter file are  persistent, in that any changes made to the parameters while an instance is  running can persist across instance shutdown and startup.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_a_Initialization_Parameter_File"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is &lt;span class="GramE"&gt;a&lt;/span&gt; Initialization Parameter File?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;An initialization  parameter file is a text file that contains a list of initialization parameters.  The file should be written in the client's default character set. Sample  initialization parameter files are provided on the Oracle distribution medium  for each operating system. A sample file is sufficient for initial use, but you  will probably want to modify the file to tune the database for best performance.  Any changes will take effect after you completely shut down and restart the  instance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_is_System_Global_Area_SGA"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What is System Global Area  (SGA)?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;The System Global Area  (SGA) is a memory area that contains data shared between all database users such  as buffer cache and a shared pool of SQL statements. The SGA is allocated in  memory when an Oracle database instance is started, and any change in the value  will take effect at the next startup.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_is_Program_Global_Area_PGA"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What is Program Global Area  (PGA)?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;A Program Global Area  (PGA) is a memory buffer that is allocated for each individual database session  and it contains session specific information such as SQL statement data or  buffers used for sorting. The value specifies the total memory allocated by all  sessions, and changes will take effect as new sessions are  started.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_a_User_Account"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is a User  Account?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;A user account is  identified by a user name and defines the user's attributes, including the  following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style="color: black; margin-top: 3pt;"&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;Password for database authentication  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li class="MsoNormal" style="color: black; margin-top: 3pt;"&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;Privileges and roles  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li class="MsoNormal" style="color: black; margin-top: 3pt;"&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;Default tablespace for database  objects &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li class="MsoNormal" style="color: black; margin-top: 3pt;"&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;Default temporary tablespace for  query processing work space &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_the_Relation_of_a_User_Account"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is the Relation of a User  Account and a Schema?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;User accounts and  schemas have a one-to-one relation. When you create a user, you are also  implicitly creating a schema for that user. A schema is a logical container for  the database objects (such as tables, views, triggers, and so on) that the user  creates. The schema name is the same as the user name, and can be used to  unambiguously refer to objects owned by the user.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_a_User_Role"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is a User Role?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;A user role is a group  of privileges. Privileges are assigned to users through user roles. You create  new roles, grant privileges to the roles, and then grant roles to  users.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_is_a_Database_Schema"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What is a Database  Schema?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;A schema is a  collection of logical structures of data, or schema objects. A schema is owned  by a database user and has the same name as that user. Each user owns a single  schema. Schema objects can be created and manipulated with SQL and include:  tables, views, and other types of data objects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_a_Database_Table"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is a Database  Table?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;A database table is a  basic unit of data logical storage in an Oracle database. Data is stored in rows  and columns. You define a table with a table name, such as employees, and a set  of columns. You give each column a column name, such as employee_id, last_name,  and job_id; a datatype, such as VARCHAR2, DATE, or NUMBER; and a width. The  width can be predetermined by the datatype, as in DATE. If columns are of the  NUMBER datatype, define precision and scale instead of width. A row is a  collection of column information corresponding to a single  record.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_a_Table_Index"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is a Table Index?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;Index is an optional  structure associated with &lt;span class="GramE"&gt;a table that allow&lt;/span&gt; SQL  statements to execute more quickly against a table. Just as the index in this  manual helps you locate information faster than if there were no index, an  Oracle Database index provides a faster access path to table data. You can use  indexes without rewriting any queries. Your results are the same, but you see  them more quickly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_an_Oracle_Tablespace"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is an Oracle  Tablespace?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;An Oracle tablespace  is a big unit of logical storage in an Oracle database. It is managed and used  by the Oracle server to store structures data objects, like tables and  indexes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;Each tablespace in an  Oracle database consists of one or more files called datafiles, which are  physical structures that conform to the operating system in which Oracle is  running.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_an_Oracle_Data_File"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is an Oracle Data  File?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;An Oracle data file is  a big unit of physical storage in the OS file system. One or many Oracle data  files are organized together to provide physical storage to a single Oracle  tablespace.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_a_Static_Data_Dictionary"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is a Static Data  Dictionary?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;Data dictionary tables  are not directly accessible, but you can access information in them through data  dictionary views. To list the data dictionary views available to you, query the  view DICTIONARY. Many data dictionary tables have three corresponding  views:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style="color: black; margin-top: 3pt;"&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;An ALL_ view displays all the  information accessible to the current user, including information from the  current user's schema as well as information from objects in other schemas, if  the current user has access to those objects by way of grants of privileges or  roles. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li class="MsoNormal" style="color: black; margin-top: 3pt;"&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;A DBA_ view displays all relevant  information in the entire database. DBA_ views are intended only for  administrators. They can be accessed only by users with the SELECT ANY TABLE  privilege. This privilege is assigned to the DBA role when the system is  initially installed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li class="MsoNormal" style="color: black; margin-top: 3pt;"&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;A USER_ view displays all the  information from the schema of the current user. No special privileges are  required to query these views. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="MsoNormal" style="margin-top: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Arial; font-size: 11pt;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5358832114629268695&amp;amp;postID=2021152731330089517" name="What_Is_a_Dynamic_Performance_View"&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;What Is a Dynamic Performance  View?&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-top: 9pt;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 11pt;"&gt;Oracle contains a set  of underlying views that are maintained by the database server and accessible to  the database administrator user SYS. These views are called dynamic performance  views because they are continuously updated while a database is open and in use,  and their contents relate primarily to performance. Although these views appear  to be regular database tables, they are not. These views provide data on  internal disk structures and memory structures. You can select from these views,  but you can never update or alter them.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-2021152731330089517?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RX5Yirt7_yjzFcxsX-GPl976Kww/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RX5Yirt7_yjzFcxsX-GPl976Kww/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RX5Yirt7_yjzFcxsX-GPl976Kww/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RX5Yirt7_yjzFcxsX-GPl976Kww/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/iY6U8RAJX1k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/2021152731330089517/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/oracle-dba-faqs-1.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/2021152731330089517?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/2021152731330089517?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/iY6U8RAJX1k/oracle-dba-faqs-1.html" title="Oracle DBA FAQs - 1" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/oracle-dba-faqs-1.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UHRng4cCp7ImA9Wx9aEEs.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-3992755608944921543</id><published>2011-03-02T16:57:00.000+05:30</published><updated>2011-03-02T16:57:17.638+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-02T16:57:17.638+05:30</app:edited><title>Developing custom portlets using Eclipse --&gt; Creating a dynamic web project in eclipse</title><content type="html">&lt;strong&gt;&lt;span style="color: #38761d;"&gt;&lt;u&gt;Creating a dynamic web project in eclipse&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
1). To create a Dynamic Web Project, go to File &amp;gt; New &amp;gt; Dynamic Web Project if you are in the Web&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Perspective or File &amp;gt; New &amp;gt;Other &amp;gt; Web &amp;gt; Dynamic Web Project in any other Perspective.&lt;br /&gt;
&lt;br /&gt;
2). Fill in the name of the project. Next, click on the New... button in the Target Runtime section to specify a&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new Target Runtime. Click Jboss 4.2 Runtime and press Next.&lt;br /&gt;
&lt;br /&gt;
3). On the next page we should give a name to the runtime. Example:JBoss Portal 2.7 Runtime,and then point &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; it to the location of your JBoss AS + Portal installation&lt;br /&gt;
&lt;br /&gt;
4). Click on Finish. It returns the New Dynamic Web Project wizard where it's also necessary to set the &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; project Configuration.&lt;br /&gt;
&lt;br /&gt;
5). The last wizard page is for configuring web modules. Here all values are set, so we can leave everything &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;as it is.&lt;br /&gt;
&lt;br /&gt;
6). Press Finish.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #38761d;"&gt;&lt;u&gt;Adding a Java Portlet to the Project&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt; &lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&amp;nbsp; &lt;br /&gt;
1). Call the New Java Portlet wizard by selecting New &amp;gt; Other &amp;gt; JBoss Tools Web &amp;gt; Portlet &amp;gt; JavaPortlet. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2). The wizard fills in The Web Project and Source Folder fields .Then we need to specify the Java package &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and the Class name and click Next .&lt;br /&gt;
&lt;br /&gt;
3). On the other page we will be able to set the display name of the Portlet, a title, a description, the &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; supported modes and init parameters.&lt;br /&gt;
&lt;br /&gt;
4). On the next screen we can define which methods from GenericPortlet you want to override.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5). The last screen lets us build JBoss Portal specific descriptors to create an instance during the deployment &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and place it directly on the Portal.&lt;br /&gt;
&lt;br /&gt;
Once Java Portlet is created, new resources have been added to the project structure.It adds a Java Portlet class, defaultobject. xml and portlet-instances.xml files and updates portlet.xml as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus the Project is ready to be built and deployed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-3992755608944921543?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JdsrtdB5W5nGqhbbqqIvw3doOkc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JdsrtdB5W5nGqhbbqqIvw3doOkc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JdsrtdB5W5nGqhbbqqIvw3doOkc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JdsrtdB5W5nGqhbbqqIvw3doOkc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/1j-Fv7ykW_4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/3992755608944921543/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/developing-custom-portlets-using_02.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/3992755608944921543?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/3992755608944921543?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/1j-Fv7ykW_4/developing-custom-portlets-using_02.html" title="Developing custom portlets using Eclipse --&gt; Creating a dynamic web project in eclipse" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/developing-custom-portlets-using_02.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4ARXw5fCp7ImA9Wx9aEEs.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-7732433573968928754</id><published>2011-03-02T16:31:00.001+05:30</published><updated>2011-03-02T16:35:44.224+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-02T16:35:44.224+05:30</app:edited><title>Developing custom portlets using Eclipse -&gt; Building the setup</title><content type="html">&lt;strong&gt;&lt;span style="color: #38761d;"&gt;&lt;u&gt;Introduction&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Custom portlets for JBoss portal can be developed using in two ways:&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&amp;gt; By using JBoss Developer Studio&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&amp;gt; By installing JBoss tools in eclipse&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;JBoss Developer Studio is not freely available.&lt;/li&gt;
&lt;li&gt;This presentation showcases developing custom portlets for JBoss portal using Eclipse IDE.&lt;/li&gt;
&lt;li&gt;JBoss set of plug-in’s extends JBoss Portal features.&lt;/li&gt;
&lt;li&gt;JBoss Tools provide to ease the development with JBoss Portal. &lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="color: #38761d;"&gt;&lt;u&gt;Building the setup&lt;/u&gt;:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Installing Eclipse version 3.4.x(Eclipse Ganymede)&lt;/li&gt;
&lt;li&gt;Installing JBoss Tools through Eclipse software updates&lt;/li&gt;
&lt;li&gt;Manual installation of JBoss Tools&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="color: #38761d;"&gt;Installing Eclipse version 3.4.x(Eclipse Ganymede):&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Before installing JBoss Tools,we’ll need to download and install the Eclipse IDE.&lt;/li&gt;
&lt;li&gt;It is recommended to use Eclipse version 3.4.x&lt;/li&gt;
&lt;li&gt;The quickest way to download the Eclipse IDE, from &lt;a href="http://www.eclipse.org/downloads"&gt;http://www.eclipse.org/downloads&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="color: #38761d;"&gt;Installing JBoss Tools through Eclipse software updates:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The quickest and simplest way to install the JBoss Tools consists of using a facility of Eclipse, named Software Updates.&lt;/li&gt;
&lt;li&gt;This is a graphical wizard that will guide us through the search/install process of the latest plug-ins/add-ons for Eclipse.&lt;/li&gt;
&lt;li&gt;JBoss Tools 3.0 for Eclipse 3.4 "Ganymede”&lt;/li&gt;
&lt;li&gt;To use JBoss Tools with Eclipse 3.4, start Eclipse, then do the following:&lt;/li&gt;
&lt;/ul&gt;1). Launch the Eclipse IDE. &lt;br /&gt;
&lt;br /&gt;
2). From the Help menu, select Software Updates. &lt;br /&gt;
&lt;br /&gt;
3). Switch to the Available Software tab. &lt;br /&gt;
&lt;br /&gt;
4). Click on the Manage Sites button. &lt;br /&gt;
&lt;br /&gt;
5). Add these URLs, or, if they're already listed, make sure they're enabled (checked)&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://download.jboss.org/jbosstools/updates/nightly/trunk/"&gt;http://download.jboss.org/jbosstools/updates/nightly/trunk/&lt;/a&gt; &lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://download.eclipse.org/releases/ganymede/"&gt;http://download.eclipse.org/releases/ganymede/&lt;/a&gt; &lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="http://download.eclipse.org/birt/update-site/2.3/"&gt;http://download.eclipse.org/birt/update-site/2.3/&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;br /&gt;
6). Click OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7).Expand the JBoss Tools Update Site and select any or all of the available features listed there under. &lt;br /&gt;
&lt;br /&gt;
8).Click Install... then Next and/or Finish. Restart when prompted &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #38761d;"&gt;Installing JBoss Tools Manually:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Instead of using the Update Manager, we can download the archive of the JBoss Tools plugins and incorporate them into our Eclipse installation manually .&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="color: #38761d;"&gt;Obtaining a JBoss Tools release:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The latest release of JBoss Tools can be found on the JBoss Tools download page.&lt;/li&gt;
&lt;li&gt;Once the download completes, we need to decide what type of installation we are going to use before extracting it.&lt;/li&gt;
&lt;li&gt;We can either install it directly into your Eclipse installation or we can link the plugins to our Eclipse installation.&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="color: #38761d;"&gt;Installing the plugins directly into your Eclipse installation:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Install the JBoss Tools plugins directly into the Eclipse installation. &lt;/li&gt;
&lt;li&gt;The directory structure inside the archive is as follows:&lt;/li&gt;
&lt;/ul&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Eclipse/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; features/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; plugins/&lt;br /&gt;
&lt;br /&gt;
If we are using the commandline and the Eclipse installation directory is named "eclipse“:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Navigate to the directory above the Eclipse installation and extract the archive using the unzip command.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;unzip JBossTools-2.1.2.GA-ALL-linux-gtk.zip&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;If we prefer to extract using an archive manager or your Eclipse installation directory is not named "eclipse",:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Extract the features and plugins folders in the archive into your Eclipse installation. &lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;&lt;span style="color: #38761d;"&gt;Linking the plugins to the Eclipse installation:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1). Extract the JBoss Tools release anywhere outside of your Eclipse installation. &lt;br /&gt;
&lt;br /&gt;
2). It‘s convenient to put this eclipse folder inside of a directory with the name of the plugin (i.e., /home/max/eclipse-addons/jbosstools) &lt;br /&gt;
&lt;br /&gt;
3). Create the file jbosstools.link in the links folder (Eclipse &amp;lt; 3.4) or dropins folder (Eclipse &amp;gt;= 3.4) of your Eclipse installation &lt;br /&gt;
&lt;br /&gt;
4). The contents of jbosstools.link should consist of a single line that defines the path where you extracted the JBoss Tools plugins .&lt;br /&gt;
&lt;br /&gt;
path=/home/max/eclipse-addons/jbosstools &lt;br /&gt;
&lt;br /&gt;
The links or dropins folder can contain any number of .link files that point to Eclipse extension directories.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Refreshing the plugin cache&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
eclipse –clean&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-7732433573968928754?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9v_pArrme7iWjp41MW8VcsTO_DA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9v_pArrme7iWjp41MW8VcsTO_DA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9v_pArrme7iWjp41MW8VcsTO_DA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9v_pArrme7iWjp41MW8VcsTO_DA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/Nia447nhv6E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/7732433573968928754/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/developing-custom-portlets-using.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/7732433573968928754?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/7732433573968928754?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/Nia447nhv6E/developing-custom-portlets-using.html" title="Developing custom portlets using Eclipse -&gt; Building the setup" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/developing-custom-portlets-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EBQ3k7eSp7ImA9Wx9aFE0.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-3706300599348080817</id><published>2011-03-01T21:55:00.004+05:30</published><updated>2011-03-06T15:30:52.701+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-06T15:30:52.701+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Teradata" /><title>Teradata SQL Assistant</title><content type="html">&lt;b&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;u&gt;&lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;How SQL Assistant Can Help You:&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;SQL Assistant is a Web-based query tool that enables you to compose a query,&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;submit it to the Teradata database, view the results from a Web browser, and&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;save the data on your PC for analysis.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;Using SQL Assistant, you can save the data retrieved from Teradata databases&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;to create consolidated reports or to analyze the data. SQL Assistant gives you&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;SQL activity, complete with source identification, timings, row counts, and&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;your notes. This is useful because you can use the historical record to build SQL&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;scripts and then modify the scripts to gather more specific results.&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;b&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;u&gt;&lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;Key Features &lt;/span&gt;&lt;/u&gt;&lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;Using SQL Assistant, you can:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;• Send queries to any Teradata database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;• View and sort the results by column and save them to a file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;• Save queries to a file so you can run them automatically from the same file&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;in the future.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;• Load queries from a file and make changes before submitting them to the&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;• View historical records of the queries you have submitted with timings and&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;status information. You can sort the history rows by column, update them&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;with your notes, and save the records to a file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;• View a hierarchical listing of databases with object names to reduce the&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;time required to create SQL statements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;• Use the browser’s built-in find features to do a string search on a query, an&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;answer set, or any information in the historical table visible in the browser&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;window.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;• Abort a query in progress if you change your mind about running a query&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;or if a query is taking longer than you expected.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;Also, to maintain security and help maximize your server’s resources, your&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Sylfaen,serif;"&gt;&lt;span style="font-family: Sylfaen,serif;"&gt;browser’s connection ends after 30 minutes of inactivity.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="font-family: Sylfaen,serif; font-size: 13pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-3706300599348080817?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0ShN9FZtO1NgxUQWqeZ8fRnsP10/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0ShN9FZtO1NgxUQWqeZ8fRnsP10/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0ShN9FZtO1NgxUQWqeZ8fRnsP10/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0ShN9FZtO1NgxUQWqeZ8fRnsP10/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/1AckIIpebSI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/3706300599348080817/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/teradata-sql-assistant.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/3706300599348080817?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/3706300599348080817?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/1AckIIpebSI/teradata-sql-assistant.html" title="Teradata SQL Assistant" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/teradata-sql-assistant.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EDSH0zeip7ImA9Wx9aFE0.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-3136074496531866454</id><published>2011-03-01T20:51:00.001+05:30</published><updated>2011-03-06T15:31:19.382+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-06T15:31:19.382+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Teradata" /><title>TeraData Performance Analysis Tips</title><content type="html">&lt;div class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;u&gt;&lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;Key Points&lt;/span&gt;&lt;/u&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start="1" style="margin-top: 0in;" type="1"&gt;&lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1; tab-stops: list .5in;"&gt;Stat      Collection&lt;/li&gt;
&lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1; tab-stops: list .5in;"&gt;Pack      Disk&lt;/li&gt;
&lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1; tab-stops: list .5in;"&gt;Data      Skew Analysis&lt;/li&gt;
&lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1; tab-stops: list .5in;"&gt;Lock      monitoring (Locking Logger)&lt;/li&gt;
&lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1; tab-stops: list .5in;"&gt;Session      tuning (DBS Control parameters) &lt;/li&gt;
&lt;/ol&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in; mso-list: l1 level1 lfo2; tab-stops: list .5in; text-indent: -.25in;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;1.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;Stat Collection :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .25in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: justify; text-indent: 1.0in;"&gt;Statistics on the loaded tables are very important from the performance perspective. Statistics helps optimizer to generate the accurate &amp;amp; faster query plans. An old statistics in warehouse can lead to wrong query plans which may take time in query processing. Hence it is much required to refresh the statistics periodically at least in the warehousing environment. We can identify the tables which are frequently accessed &amp;amp; modified with inserts, updates, deletes etc.&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: justify; text-indent: 1.0in;"&gt;It is recommended to refresh the stats after every 10% of data change. We can collect the statistics at column level or at index level.&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: justify;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;Syntax:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: justify;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;Collect statistics on &lt;table_name&gt; column (column_name 1,.., column_name n); OR&lt;o:p&gt;&lt;/o:p&gt;&lt;/table_name&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: justify;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;Collect statistics on &lt;table_name&gt; index (column_name 1,.., column_name n);&lt;o:p&gt;&lt;/o:p&gt;&lt;/table_name&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in; mso-list: l1 level1 lfo2; tab-stops: list .5in; text-indent: -.25in;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;2.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;Pack Disk :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1.0in;"&gt;Pack disk is an utility that free up the cylinder space on the database, this&lt;/div&gt;&lt;div class="MsoNormal"&gt;utility must be run periodically as in the warehouse environment large amount of data inserts, updates are happening which causes the physical memory to disorder due to frequent data manipulation. Pack disk utility allows us to restructure &amp;amp; physically reorder the data, free up space same as defragmentation. Teradata also run mini CYLPACKs automatically, if cylinder space goes below the prescribed limit. Cylinder space is required for the merge operation while the data Insert, Deletes Updates etc.&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; To run a pack disk we use Ferret utility provided by Teradata can be run through Teradata Manager Tool or through telnet on node session.&lt;/div&gt;&lt;div class="MsoNormal"&gt;The set of commands that starts packdisk utility are given below one can create a kron job to schedule the same &amp;amp; run it periodically.&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;Commands to run pack defrag &amp;amp; packdisk utilities :&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;~ferret&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;defrag&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;packdisk fsp=8&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in; mso-list: l1 level1 lfo2; tab-stops: list .5in; text-indent: -.25in;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;3.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;Skew Analysis :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1.5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1.5in;"&gt;Primary index of a table in Teradata is responsible for the data&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;&lt;div class="MsoNormal"&gt;distribution on all the AMPs. Proper data distribution is required for the parallel processing in the system. As Teradata system follows shared nothing architecture, all the AMPs works in parallel. If data is evenly distributed amongst the AMPs then the amount of the work done by every AMP would be equal &amp;amp; time required for particular job would obviously be lesser. In contrast to this if only one/two AMPs are flooded with the data&amp;nbsp; i.e. data skew then while running that job the two AMPs would be working &amp;amp; others will be idle. In this case we won’t be utilizing the parallel processing power of the system. &lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; To avoid such data skew need to analyze the primary index of the tables in Teradata database over the period of time it might happen that data is getting accumulate at the few AMPs, which can have a adverse effect on the ETL as well as the system performance. &lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; To analyze the data distribution for the table we can use the inbuilt HASH functions provided by the Teradata. To check the data distribution for a table one can use a query:&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;&lt;span style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;SELECT &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;&lt;span style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;HASHAMP (HASHBUCKET (HASHROW (Column 1,.., column n))) AS AMP_NUM, count(*) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;&lt;span style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;From Table_Name &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;&lt;span style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;Group by 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .25in;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This query will provide the distribution of records on each AMP&lt;/div&gt;&lt;div class="MsoNormal"&gt;we can also analyze the probable PIs with this query which will predict the data distribution on the AMPs&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .25in;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .25in;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;4.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;Lock monitoring :&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 2.0in;"&gt;Locking Logger is an utility that enables us to monitor the&lt;/div&gt;&lt;div class="MsoNormal"&gt;locking on the tables. Using this utility we can create a table that has the entries for the locks which have been applied to the tables while processing. This utility allows us to analyze the regular ETL process, jobs being blocked at particular time when there is no one to monitor the locking. By analyzing such locking situations we can modify the jobs &amp;amp; avoid the waiting period due to such situations. &lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: .5in;"&gt;To apply this locking loggers First, we need to enable locking logger via the DBS console window or the cnsterm subsystem. The setting does not take effect until the database is restarted. &lt;/div&gt;&lt;ol start="5" style="margin-top: 0in;" type="1"&gt;&lt;ol start="9" style="margin-top: 0in;" type="1"&gt;&lt;li class="MsoNormal" style="mso-list: l0 level2 lfo1; tab-stops: list 1.0in;"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;LockLogger -&lt;/i&gt; This Field defines       the system default for the locking logger. &lt;/li&gt;
&lt;/ol&gt;&lt;/ol&gt;&lt;div class="MsoNormal" style="margin-left: .75in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: .5in;"&gt;This allows the DBA to log the delays caused by database locks to help in identifying lock conflicts. To enable this feature set the field to TRUE. To disable the feature set the field to FALSE. &lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: .5in;"&gt;After a database restart with the LockLogger flag set to true, the Locking Logger will begin to accumulate lock information into a circular memory buffer of 64KB. Depending on how frequently the system encounters lock contention, this buffer will wrap, but it will usually span a several day period. Following a period of lock contention, to analyze the lock activity, you need to run the dumplocklog utility which moves the data from the memory buffer to a database table where it can be accessed.&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .5in; mso-list: l1 level1 lfo2; tab-stops: list .5in; text-indent: -.25in;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;5.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;Session Tuning:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .25in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: 14pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/b&gt;Session tuning is done for the running the load utilities in parallel&lt;/div&gt;&lt;div class="MsoNormal"&gt;this requires to analyze some DBScontrol parameters &amp;amp; tune the same to provide the best parallel processing of the load utilities. There are two parameters MaxLoadAWT &amp;amp; MaxLoadTasks that enables the parallel job management a short note on the same:&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: .25in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: .5in;"&gt;&amp;nbsp;&amp;nbsp; The &lt;i style="mso-bidi-font-style: normal;"&gt;MaxLoadAWT&lt;/i&gt; internal field serves two purposes: &lt;/div&gt;&lt;div class="MsoNormal"&gt;1) Enabling a higher limit for the MaxLoadTasks field beyond the default limit of 15.&lt;/div&gt;&lt;div class="MsoNormal"&gt;2) Specifying the AMP Worker Task (AWT) limit for concurrent FastLoad and MultiLoad jobs when a higher limit is enabled. &lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: .5in;"&gt;In effect, this field allows more FastLoad, MultiLoad, and FastExport utilities running concurrently while controlling AWT usage and preventing excessive consumption and possible AWT exhaustion. &lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: .5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: .5in;"&gt;• The default value is zero: When MaxLoadAWT is zero, concurrency limit operates in the same manner as prior to V2R6.1 MaxLoadTasks specifies the concurrency limit for all three utilities: FastLoad, MultiLoad, and FastExport. The valid range for MaxLoadTasks is from 0 to 15. &lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: .5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: .5in;"&gt;• When MaxLoadAWT is non-zero (higher limit enabled): It specifies the maximum number of AWTs that can be used by FastLoads and MultiLoads. Maximum allowable value is 60% of the total AWTs. The valid range for MaxLoadTasks is from 0 to 30. &lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: .5in;"&gt;A new FastLoad/MultiLoad job is allowed to start only if BOTH MaxLoadTasks AND MaxLoadAWT limits are not reached. Therefore, jobs may be rejected before MaxLoadTasks limit is exceeded. MaxLoadTasks specifies the concurrency limit for the combination of only two utilities: FastLoad and MultiLoad. FastExport is managed differently; FastExport is no longer controlled by the MaxLoadTasks field.&lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: .5in;"&gt;A FastExport job is only rejected if the total number of active utility jobs is 60. At least 30 FastExport jobs can run at any time. A FastExport job may be able to run even when FastLoad and MultiLoad jobs are rejected.&amp;nbsp; When a Teradata Dynamic Workload Manager (TDWM) utility throttle rule is enabled, the MaxLoadAWT field is overridden. TDWM will use the highest allowable value which is 60% of total AWTs. Update to MaxLoadAWT becomes effective after the DBS control record has been written. No DBS restart is required. Note that when the total number of AWTs (specified by the internal field MaxAMPWorkerTasks) has been modified but a DBS restart has not occurred, then there may be a discrepancy between the actual number of AWTs and the DBS control record. The system may internally reduce the effective value of MaxLoadAWTs to prevent AWT exhaustion. &lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-indent: .5in;"&gt;• AWT Usage of Load Utilities: All load/unload utilities require and consume AWTs at different rates depending on the execution phase: FastLoad: - Phase 1 (Loading): 3 AWT's - Phase 2 (End Loading): 1 AWT's MultiLoad*: - Acquisition Phase (and before): 2 AWT's. Application Phase (and after): 1 AWT's FastExport: - All.&lt;/div&gt;&lt;div class="MsoNormal"&gt;This description is for the single target table case which is the most common.&amp;nbsp; &lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The above explained parameters can be analyzed &amp;amp; tuned accordingly to achieve the expected performance on the Teradata system. Also need to have some maintenance/ House keeping activities in place to avoid the performance implications due to some physical data parameters like data skew, less cylinder space etc.&amp;nbsp;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-3136074496531866454?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/HvksZB3AkEGYrFh2e-n990WXBqY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HvksZB3AkEGYrFh2e-n990WXBqY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/HvksZB3AkEGYrFh2e-n990WXBqY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HvksZB3AkEGYrFh2e-n990WXBqY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/mFhl1Gz0CVw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/3136074496531866454/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/03/teradata-performance-analysis-tips.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/3136074496531866454?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/3136074496531866454?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/mFhl1Gz0CVw/teradata-performance-analysis-tips.html" title="TeraData Performance Analysis Tips" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/03/teradata-performance-analysis-tips.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0ENSHw_fip7ImA9Wx9aFE0.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-568091573789420390</id><published>2011-02-28T12:16:00.001+05:30</published><updated>2011-03-06T15:31:39.246+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-06T15:31:39.246+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="AIX" /><title>AIX Tips</title><content type="html">&lt;b&gt;&lt;u&gt;Adjusting the AIX kernel parameters&lt;/u&gt;:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Unlike many other UNIX operating systems, AIX does not provide the ability to directly configure most kernel parameters. Instead, the AIX kernel dynamically allocates and reallocates resources as they are needed (up to a predefined limit). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For calendar server installations, the only kernel parameter that should be altered is maxuproc (maximum number of processes per user-ID), which can be modified via SMIT (AIX's menu-based system administration utility) or the command line utility chdev. &lt;br /&gt;
&lt;br /&gt;
To see a complete list of the parameters and their current values, run the lsattr command: &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;% /etc/lsattr -E -l sys0 &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To see the current values assigned to a particular kernel parameter, use the lsattr command with the parameter name. For example: &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;% /etc/lsattr -E -l sys0 -a maxuproc &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To change the value of the maxuproc parameter, use the chdev command. For example: &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;% /etc/chdev -l sys0 -a maxuproc = 200 &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
As stated above, the AIX kernel dynamically allocates and reallocates resources as they are needed up to a predefined limit. The known limits of the parameters are as follows: &lt;br /&gt;
&lt;br /&gt;
Table C 8 • AIX kernel parameters&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Kernel Parameter Description&lt;/u&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;u&gt;Upper Limit&lt;/u&gt; &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
soft file limit per process&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000 &lt;br /&gt;
&lt;br /&gt;
hard file limit per process&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000 &lt;br /&gt;
&lt;br /&gt;
max. number of concurrent processes per user-id:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;configurable, cannot exceed 131,072 &lt;br /&gt;
&lt;br /&gt;
max. number of concurrent processes on the system&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 131,072 &lt;br /&gt;
&lt;br /&gt;
max. number of open files&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;200000 &lt;br /&gt;
&lt;br /&gt;
max. number of message queue identifiers&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4096 &lt;br /&gt;
&lt;br /&gt;
max. number of message headers unlimited;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8192 per message queue. &lt;br /&gt;
&lt;br /&gt;
max. number of semaphore identifiers&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4096 &lt;br /&gt;
&lt;br /&gt;
max. number of semaphores unlimited;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 65535 per semaphore id. &lt;br /&gt;
&lt;br /&gt;
The practical limits of the server, defined as the maximum number of concurrent users on a system, are effectively determined by the upper limits of the maximum number of open files. Assuming there are no other activity or resource requirements on the system, the maximum number of concurrent users (lck_users) under AIX is approximately 10000*20+60=200060. &lt;br /&gt;
&lt;br /&gt;
At least as of version 5.1, it should not be necessary to do any special configuration for such parameters as SHMMAX, as it appears this is configured to allow all memory to be used as shared memory. That is the sort of configuration commonly used for other databases such as DB/2.&lt;br /&gt;
&lt;br /&gt;
It may, however, be necessary to modify the global ulimit information in /etc/security/limits, as the default hard limits for file sizes (fsize) and numbers of files (nofiles) may be too low. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;(ii) &lt;u&gt;Reset an Unknown Root Password&lt;/u&gt;:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The following procedure describes how to recover access to root privileges when the system's root password is unavailable or unknown. The following procedure requires some system downtime. If possible, schedule your downtime when it least impacts your workload to protect yourself from a possible loss of data or functionality.&lt;br /&gt;
&lt;br /&gt;
1. Insert the product media for the same version and level as the current installation into the appropriate drive. &lt;br /&gt;
&lt;br /&gt;
2. Power on the machine. &lt;br /&gt;
&lt;br /&gt;
3. When the screen of icons appears, or when you hear a double beep, press the F1 key repeatedly until the System Management Services menu appears. &lt;br /&gt;
&lt;br /&gt;
4. Select Multiboot. &lt;br /&gt;
&lt;br /&gt;
5. Select Install From. &lt;br /&gt;
&lt;br /&gt;
6. Select the device that holds the product media and then select Install. &lt;br /&gt;
&lt;br /&gt;
7. Select the AIX version icon. &lt;br /&gt;
&lt;br /&gt;
8. Define your current system as the system console by pressing the F1 key and then press Enter. &lt;br /&gt;
&lt;br /&gt;
9. Select the number of your preferred language and press Enter. &lt;br /&gt;
&lt;br /&gt;
10. Choose Start Maintenance Mode for System Recovery by typing 3 and press Enter. &lt;br /&gt;
&lt;br /&gt;
11. Select Access a Root Volume Group. A message displays explaining that you will not be able to return to the Installation menus without rebooting if you change the root volume group at this point. &lt;br /&gt;
&lt;br /&gt;
12. Type 0 and press Enter. &lt;br /&gt;
&lt;br /&gt;
13. Type the number of the appropriate volume group from the list and press Enter. &lt;br /&gt;
&lt;br /&gt;
14. Select Access this Volume Group and start a shell by typing 1 and press Enter. &lt;br /&gt;
&lt;br /&gt;
15. At the # (number sign) prompt, type the passwd command at the command line prompt to reset the root password. For example: &lt;br /&gt;
&lt;br /&gt;
16. # passwd&lt;br /&gt;
&lt;br /&gt;
17. Changing password for "root"&lt;br /&gt;
&lt;br /&gt;
18. root's New password: &lt;br /&gt;
&lt;br /&gt;
Enter the new password again:&lt;br /&gt;
&lt;br /&gt;
19. To write everything from the buffer to the hard disk and reboot the system, type the following: &lt;br /&gt;
&lt;br /&gt;
sync;sync;sync;reboot&lt;br /&gt;
&lt;br /&gt;
When the login screen appears, the password you set in step 15 should now permit access to root privileges.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;(iii) &lt;u&gt;Steps for breaking the mirror and replacing the failed HDD&lt;/u&gt;:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
unmirrorvg workvg hdisk7&lt;br /&gt;
&lt;br /&gt;
reducevg workvg hdisk7&lt;br /&gt;
&lt;br /&gt;
rmdev -l hdisk7 -d&lt;br /&gt;
&lt;br /&gt;
chpv –c &lt;hdiskn&gt;--- if the VG is rootvg to clear boot record before unmirroing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Replace the failed disk drive with a new one, and name it hdisk7 by executing&lt;br /&gt;
&lt;br /&gt;
the following commands:&lt;br /&gt;
&lt;br /&gt;
extendvg workvg hdisk7&lt;br /&gt;
&lt;br /&gt;
mirrorvg workvg&lt;br /&gt;
&lt;br /&gt;
Rootvg mirroring:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;When the rootvg mirroring performed:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
1. Run the bosboot&lt;br /&gt;
&lt;br /&gt;
The bosboot command&lt;br /&gt;
&lt;br /&gt;
Access Memory)&lt;br /&gt;
&lt;br /&gt;
required to customize&lt;br /&gt;
&lt;br /&gt;
2. Run the bootlist&lt;br /&gt;
&lt;br /&gt;
The bosboot command&lt;br /&gt;
&lt;br /&gt;
does not update&lt;br /&gt;
&lt;br /&gt;
access memory).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;To Migrate Particular logical volume to some other location :&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
migratepv -l loglv00 hdisk1 hdisk0&lt;br /&gt;
&lt;br /&gt;
Command to sync the ODM :&lt;br /&gt;
&lt;br /&gt;
synclvodm -v rootvg&lt;/hdiskn&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-568091573789420390?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bZ6yBpXmz9W98fhfVIepN_-bg0U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bZ6yBpXmz9W98fhfVIepN_-bg0U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bZ6yBpXmz9W98fhfVIepN_-bg0U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bZ6yBpXmz9W98fhfVIepN_-bg0U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/SO8G77JA1P4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/568091573789420390/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2011/02/aix-tips.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/568091573789420390?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/568091573789420390?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/SO8G77JA1P4/aix-tips.html" title="AIX Tips" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2011/02/aix-tips.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EBQ3Y9fCp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-125942830904124049</id><published>2010-09-26T01:09:00.001+05:30</published><updated>2011-03-05T21:10:52.864+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:10:52.864+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Weblogic Server" /><title>Weblogic Server Health checking Script</title><content type="html"># Modify classpath to as per the weblocic server location in your environment&lt;br /&gt;
# The script takes 3 parameters&lt;br /&gt;
# The first parameter is the admin url&lt;br /&gt;
# The second parameter is the Username of admin server&lt;br /&gt;
# The third parameter is the password of admin server&lt;br /&gt;
&lt;br /&gt;
CLASSPATH="/usr/java/lib/tools.jar:/apps/weblogic/server/lib/weblogic_sp.jar:/apps/weblogic/server/lib/weblogic.jar:/apps/weblogic/server/lib/ojdbc14.jar:"&lt;br /&gt;
export CLASSPATH&lt;br /&gt;
PATH="/apps/weblogic/server/bin:/usr/java/jre/bin:/usr/java/bin:/osmf/mgmt/condir/cft/BT/BTOPUT/bin/SSOL2:/usr/bin:/usr/ucb:/etc::/osmf/mgmt/condir/cft/cft/filexe:/osmf/mgmt/condir/cft/cft/filusr:/osmf/mgmt/condir/cft/cft/filexit:/osmf/mgmt/condir/cft/cft/filapi:/u01/app/oracle/product/8.1.7/bin:/apps/abinitio/bin"&lt;br /&gt;
export PATH&lt;br /&gt;
java weblogic.Admin -adminurl $1 -username $2  -password $3 GET -pretty -type ServerRuntime&lt;br /&gt;
java weblogic.Admin -adminurl $1 -username $2  -password $3 GET -pretty -type JVMRuntime&lt;br /&gt;
java weblogic.Admin -adminurl $1 -username $2  -password $3 GET -pretty -type JDBCConnectionPoolRuntime&lt;br /&gt;
java weblogic.Admin -adminurl $1 -username $2  -password $3 GET -pretty -type ExecuteQueueRuntime&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-125942830904124049?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BUtecoVrHx_ZlmtYpOBN16y5voM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BUtecoVrHx_ZlmtYpOBN16y5voM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BUtecoVrHx_ZlmtYpOBN16y5voM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BUtecoVrHx_ZlmtYpOBN16y5voM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/DOKL0TAso1U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/125942830904124049/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2010/09/weblogic-server-health-checking-script.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/125942830904124049?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/125942830904124049?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/DOKL0TAso1U/weblogic-server-health-checking-script.html" title="Weblogic Server Health checking Script" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2010/09/weblogic-server-health-checking-script.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0ECSH8zeip7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-4417599149804853560</id><published>2010-09-26T01:06:00.003+05:30</published><updated>2011-03-05T21:11:09.182+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:11:09.182+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Weblogic Server" /><title>Script to restart the weblogic server using crontab in unix without any manual intervention</title><content type="html">&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:"Table Normal";  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-parent:"";  mso-padding-alt:0in 5.4pt 0in 5.4pt;  mso-para-margin:0in;  mso-para-margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:10.0pt;  font-family:"Times New Roman";  mso-ansi-language:#0400;  mso-fareast-language:#0400;  mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;table class="MsoNormalTable" style="width: 100%;" border="0" cellpadding="0" width="100%"&gt;&lt;tbody&gt;
&lt;tr style=""&gt;   &lt;td style="padding: 0in 0in 0in 5.25pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; color: rgb(18, 90, 149);"&gt;Problem   Description&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt;"&gt;This script can be used to   restart the weblogic server using crontab in unix without any manual   intervention. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=""&gt;   &lt;td style="padding: 0in 0in 0in 5.25pt;" valign="top"&gt;   &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; color: rgb(18, 90, 149);"&gt;Solution   Description&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt;"&gt;This script can be used to   restart the weblogic server without any manual intervention. It also sends   email to the list of people once the restart is done.We can add few more   manipulations if you need before restarting the weblogic server. This can be   enabled through crontab in the unix. &lt;/span&gt;&lt;/p&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=""&gt;   &lt;td style="width: 100%; padding: 0in 0in 0in 5.25pt;" valign="top" width="100%"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;&lt;span style="font-size: 9pt;"&gt;&lt;br /&gt;
&lt;span class="searchresultheading2"&gt;Code Snippet &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;#! /bin/ksh    &lt;p class="MsoNormal"&gt;#This script is used for restarting the Weblogic server using CRONTAB&lt;/p&gt;&lt;p class="MsoNormal"&gt;#-------------------------------------------------------------------&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;# Mail list is used to email the list of users once the restart is done&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Maillist=" "&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;# Mail file is the file which will get emailed to the mail list users&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Mailfile= " "&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;#This is the temporary log file where stopWeblogic.sh result will be stored&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&gt; Stop_log&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;# Stopping the Server&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;echo "Stopping Weblogic server"&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;. ./stopWebLogic.sh &gt; Stop_log 2&gt;&amp;amp; 1&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;sleep 90&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;echo "Confirming that the Weblogic server stopped"&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;. ./stopWebLogic.sh &gt;&gt; Stop_log 2&gt;&amp;amp; 1&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;# Searching for the exception when you shut down the weblogic server for the second time&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;egrep '[Destination unreachable | "OPUSServer" was shutdown successfully]' Stop_log &gt; /dev/null&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;if [ $? -eq 0 ]&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;then&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;echo "Weblogic server stopped successfully"&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;# Starting the Server&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;echo "Trying to start Weblogic server"&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;#. ./startWebLogic.sh &gt; Start_log 2&gt;&amp;amp; 1 &amp;amp;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;. ./startWebLogic.sh &gt; /dev/null&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;#Getting the process id for startWebLogic.sh process&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;id=$!&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;i=0&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;until [ $i -gt 1 ]&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;do&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;sleep 90&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;grep "Server started in RUNNING mode" /prod/opus/OPUS_CONS1/logs/wl-domain.log&lt;span style=""&gt;  &lt;/span&gt;&gt; /dev/null&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;if [ $? -eq 0 ]&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;then&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;echo "Weblogic server started successfully"&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;#Killing the process startWebLogic.sh using process id&lt;/p&gt;&lt;p class="MsoNormal"&gt;#kill -9 $id&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;#echo "Killed startweb"&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;break&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;fi&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;i=`expr $i + 1`&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;done&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;if [ $i -ne 2 ]&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;then&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                        &lt;/span&gt;echo "Weblogic server restarted successfully"&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                        &lt;/span&gt;mailx -s "Weblogic_server name Restarted Succesfully" -r &lt;from&gt; $Maillist &lt; $Mailfile&lt;/p&gt;&lt;br /&gt;
&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;else&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;echo "Weblogic server failed to start"&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;mailx -s "Weblogic_server name failed to start" -r &lt;from&gt; $Maillist&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;        &lt;/span&gt;fi&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;else&lt;/p&gt;&lt;p class="MsoNormal"&gt;echo "Failed to stop Weblogic server"&lt;/p&gt;&lt;p class="MsoNormal"&gt;mailx -s "Failed to stop Weblogic server" -r &lt;from&gt; $Maillist&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;fi&lt;/p&gt;&lt;p class="MsoNormal"&gt;echo "Completed the script"&lt;/p&gt;&lt;p class="MsoNormal"&gt;exit&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-4417599149804853560?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eWXnFKiRZa-2HT-kIwjc7_fWIAE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eWXnFKiRZa-2HT-kIwjc7_fWIAE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eWXnFKiRZa-2HT-kIwjc7_fWIAE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eWXnFKiRZa-2HT-kIwjc7_fWIAE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/To03hNTeD3A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/4417599149804853560/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2010/09/script-to-restart-weblogic-server-using.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/4417599149804853560?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/4417599149804853560?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/To03hNTeD3A/script-to-restart-weblogic-server-using.html" title="Script to restart the weblogic server using crontab in unix without any manual intervention" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2010/09/script-to-restart-weblogic-server-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EGR3s7fSp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-8047124231988395512</id><published>2010-09-26T00:59:00.002+05:30</published><updated>2011-03-05T21:10:26.505+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:10:26.505+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Oracle DBA" /><title>SCRIPT TO MONITOR MEMORY USAGE BY DATABASE SESSIONS</title><content type="html">=============================================================================&lt;br /&gt;
SCRIPT TO MONITOR MEMORY USAGE BY DATABASE SESSIONS&lt;br /&gt;
=============================================================================&lt;br /&gt;
REM Created: 21/march/2003&lt;br /&gt;
REM Last update: 28/may/2003&lt;br /&gt;
REM&lt;br /&gt;
REM NAME&lt;br /&gt;
REM ====&lt;br /&gt;
REM MEMORY.sql&lt;br /&gt;
REM&lt;br /&gt;
REM&lt;br /&gt;
REM DISCLAIMER&lt;br /&gt;
REM ==========&lt;br /&gt;
REM This script is provided for educational purposes only. It is NOT supported by&lt;br /&gt;
REM Oracle World Wide Technical Support. The script has been tested and appears&lt;br /&gt;
REM to work as intended. However, you should always test any script before&lt;br /&gt;
REM relying on it.&lt;br /&gt;
REM&lt;br /&gt;
REM PURPOSE&lt;br /&gt;
REM =======&lt;br /&gt;
REM Retrieves PGA and UGA statistics for users and background processes sessions.&lt;br /&gt;
REM&lt;br /&gt;
REM EXECUTION ENVIRONMENT&lt;br /&gt;
REM =====================&lt;br /&gt;
REM SQL*Plus&lt;br /&gt;
REM&lt;br /&gt;
REM ACCESS PRIVILEGES&lt;br /&gt;
REM =================&lt;br /&gt;
REM Select on V$SESSTAT, V$SESSION, V$BGPROCESS, V$PROCESS and V$INSTANCE.&lt;br /&gt;
REM&lt;br /&gt;
REM USAGE&lt;br /&gt;
REM =====&lt;br /&gt;
REM $ sqlplus "/ as sysdba" @MEMORY&lt;br /&gt;
REM&lt;br /&gt;
REM INSTRUCTIONS&lt;br /&gt;
REM ============&lt;br /&gt;
REM Call MEMORY.sql from SQL*Plus, connected as any DBA user.&lt;br /&gt;
REM Press &lt;enter&gt; whenever you want to refresh information.&lt;br /&gt;
REM You can change the ordered column and the statistics shown by choosing from the menu.&lt;br /&gt;
REM Spool files named MEMORY_YYYYMMDD_HH24MISS.lst will be generated in the current directory.&lt;br /&gt;
REM Every time you refresh screen, a new spool file is created, with a snapshot of the statistics shown.&lt;br /&gt;
REM These snapshot files may be uploaded to Oracle Support Services for future reference, if needed.&lt;br /&gt;
REM&lt;br /&gt;
REM REFERENCES&lt;br /&gt;
REM ==========&lt;br /&gt;
REM "Oracle Reference" - Online Documentation&lt;br /&gt;
REM&lt;br /&gt;
REM SAMPLE OUTPUT&lt;br /&gt;
REM =============&lt;br /&gt;
REM :::::::::::::::::::::::::::::::::: PROGRAM GLOBAL AREA statistics :::::::::::::::::::::::::::::::::&lt;br /&gt;
REM&lt;br /&gt;
REM SESSION                                            PID/THREAD       CURRENT SIZE       MAXIMUM SIZE&lt;br /&gt;
REM -------------------------------------------------- ---------- ------------------ ------------------&lt;br /&gt;
REM     9 - SYS: myworkstation                               2258           10.59 MB           10.59 MB&lt;br /&gt;
REM     3 - LGWR: testserver                                 2246            5.71 MB            5.71 MB&lt;br /&gt;
REM     2 - DBW0: testserver                                 2244            2.67 MB            2.67 MB&lt;br /&gt;
REM ...&lt;br /&gt;
REM&lt;br /&gt;
REM :::::::::::::::::::::::::::::::::::: USER GLOBAL AREA statistics ::::::::::::::::::::::::::::::::::&lt;br /&gt;
REM&lt;br /&gt;
REM SESSION                                            PID/THREAD       CURRENT SIZE       MAXIMUM SIZE&lt;br /&gt;
REM -------------------------------------------------- ---------- ------------------ ------------------&lt;br /&gt;
REM     9 - SYS: myworkstation                               2258            0.29 MB            0.30 MB&lt;br /&gt;
REM     5 - SMON: testserver                                 2250            0.06 MB            0.06 MB&lt;br /&gt;
REM     4 - CKPT: testserver                                 2248            0.05 MB            0.05 MB&lt;br /&gt;
REM ...&lt;br /&gt;
REM&lt;br /&gt;
REM SCRIPT BODY&lt;br /&gt;
REM ===========&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
spool MEMORY_YYYYMMDD_HH24MISS.log&lt;br /&gt;
&lt;br /&gt;
REM Starting script execution&lt;br /&gt;
CLE SCR&lt;br /&gt;
PROMPT .&lt;br /&gt;
PROMPT .              ======== SCRIPT TO MONITOR MEMORY USAGE BY DATABASE SESSIONS ========&lt;br /&gt;
PROMPT .&lt;br /&gt;
&lt;br /&gt;
REM Setting environment variables&lt;br /&gt;
SET LINESIZE       200&lt;br /&gt;
SET PAGESIZE       500&lt;br /&gt;
SET FEEDBACK       OFF&lt;br /&gt;
SET VERIFY         OFF&lt;br /&gt;
SET SERVEROUTPUT   ON&lt;br /&gt;
SET TRIMSPOOL      ON&lt;br /&gt;
COL "SESSION"      FORMAT A50&lt;br /&gt;
COL "PID/THREAD"   FORMAT A10&lt;br /&gt;
COL "      CURRENT SIZE" FORMAT A18&lt;br /&gt;
COL "      MAXIMUM SIZE" FORMAT A18&lt;br /&gt;
&lt;br /&gt;
REM Setting user variables values&lt;br /&gt;
SET    TERMOUT OFF&lt;br /&gt;
DEFINE sort_order = 3&lt;br /&gt;
DEFINE show_pga   = 'ON'&lt;br /&gt;
DEFINE show_uga   = 'ON'&lt;br /&gt;
COL    sort_column NEW_VALUE sort_order&lt;br /&gt;
COL    pga_column  NEW_VALUE show_pga&lt;br /&gt;
COL    uga_column  NEW_VALUE show_uga&lt;br /&gt;
COL    snap_column NEW_VALUE snap_time&lt;br /&gt;
SELECT nvl(:sort_choice, 3) "SORT_COLUMN"&lt;br /&gt;
FROM   dual&lt;br /&gt;
/&lt;br /&gt;
SELECT nvl(:pga_choice, 'ON') "PGA_COLUMN"&lt;br /&gt;
FROM   dual&lt;br /&gt;
/&lt;br /&gt;
SELECT nvl(:uga_choice, 'ON') "UGA_COLUMN"&lt;br /&gt;
FROM   dual&lt;br /&gt;
/&lt;br /&gt;
SELECT to_char(sysdate, 'YYYYMMDD_HH24MISS') "SNAP_COLUMN"&lt;br /&gt;
FROM   dual&lt;br /&gt;
/&lt;br /&gt;
&lt;br /&gt;
REM Creating new snapshot spool file&lt;br /&gt;
SPOOL MEMORY_&amp;amp;snap_time&lt;br /&gt;
&lt;br /&gt;
REM Showing PGA statistics for each session and background process&lt;br /&gt;
SET      TERMOUT &amp;amp;show_pga&lt;br /&gt;
PROMPT&lt;br /&gt;
PROMPT   :::::::::::::::::::::::::::::::::: PROGRAM GLOBAL AREA statistics :::::::::::::::::::::::::::::::::&lt;br /&gt;
SELECT   to_char(ssn.sid, '9999') || ' - ' || nvl(ssn.username, nvl(bgp.name, 'background')) ||&lt;br /&gt;
nvl(lower(ssn.machine), ins.host_name) "SESSION",&lt;br /&gt;
to_char(prc.spid, '999999999') "PID/THREAD",&lt;br /&gt;
to_char((se1.value/1024)/1024, '999G999G990D00') || ' MB' "      CURRENT SIZE",&lt;br /&gt;
to_char((se2.value/1024)/1024, '999G999G990D00') || ' MB' "      MAXIMUM SIZE"&lt;br /&gt;
FROM     v$sesstat se1, v$sesstat se2, v$session ssn, v$bgprocess bgp, v$process prc,&lt;br /&gt;
v$instance ins,  v$statname stat1, v$statname stat2&lt;br /&gt;
WHERE    se1.statistic# = stat1.statistic# and stat1.name = 'session pga memory'&lt;br /&gt;
AND      se2.statistic#  = stat2.statistic# and stat2.name = 'session pga memory max'&lt;br /&gt;
AND      se1.sid        = ssn.sid&lt;br /&gt;
AND      se2.sid        = ssn.sid&lt;br /&gt;
AND      ssn.paddr      = bgp.paddr (+)&lt;br /&gt;
AND      ssn.paddr      = prc.addr  (+)&lt;br /&gt;
ORDER BY &amp;amp;sort_order DESC&lt;br /&gt;
/&lt;br /&gt;
&lt;br /&gt;
REM Showing UGA statistics for each session and background process&lt;br /&gt;
SET      TERMOUT &amp;amp;show_uga&lt;br /&gt;
PROMPT&lt;br /&gt;
PROMPT   :::::::::::::::::::::::::::::::::::: USER GLOBAL AREA statistics ::::::::::::::::::::::::::::::::::&lt;br /&gt;
SELECT   to_char(ssn.sid, '9999') || ' - ' || nvl(ssn.username, nvl(bgp.name, 'background')) ||&lt;br /&gt;
nvl(lower(ssn.machine), ins.host_name) "SESSION",&lt;br /&gt;
to_char(prc.spid, '999999999') "PID/THREAD",&lt;br /&gt;
to_char((se1.value/1024)/1024, '999G999G990D00') || ' MB' "      CURRENT SIZE",&lt;br /&gt;
to_char((se2.value/1024)/1024, '999G999G990D00') || ' MB' "      MAXIMUM SIZE"&lt;br /&gt;
FROM     v$sesstat se1, v$sesstat se2, v$session ssn, v$bgprocess bgp, v$process prc,&lt;br /&gt;
v$instance ins,  v$statname stat1, v$statname stat2&lt;br /&gt;
WHERE    se1.statistic# = stat1.statistic# and stat1.name = 'session uga memory'&lt;br /&gt;
AND      se2.statistic#  = stat2.statistic# and stat2.name = 'session uga memory max'&lt;br /&gt;
AND      se1.sid        = ssn.sid&lt;br /&gt;
AND      se2.sid        = ssn.sid&lt;br /&gt;
AND      ssn.paddr      = bgp.paddr (+)&lt;br /&gt;
AND      ssn.paddr      = prc.addr  (+)&lt;br /&gt;
ORDER BY &amp;amp;sort_order DESC&lt;br /&gt;
/&lt;br /&gt;
&lt;br /&gt;
REM Showing sort information&lt;br /&gt;
SET TERMOUT ON&lt;br /&gt;
PROMPT&lt;br /&gt;
BEGIN&lt;br /&gt;
IF (&amp;amp;sort_order = 1) THEN&lt;br /&gt;
dbms_output.put_line('Ordered by SESSION');&lt;br /&gt;
ELSIF (&amp;amp;sort_order = 2) THEN&lt;br /&gt;
dbms_output.put_line('Ordered by PID/THREAD');&lt;br /&gt;
ELSIF (&amp;amp;sort_order = 3) THEN&lt;br /&gt;
dbms_output.put_line('Ordered by CURRENT SIZE');&lt;br /&gt;
ELSIF (&amp;amp;sort_order = 4) THEN&lt;br /&gt;
dbms_output.put_line('Ordered by MAXIMUM SIZE');&lt;br /&gt;
END IF;&lt;br /&gt;
END;&lt;br /&gt;
/&lt;br /&gt;
&lt;br /&gt;
REM Closing current snapshot spool file&lt;br /&gt;
SPOOL OFF&lt;br /&gt;
&lt;br /&gt;
REM Showing the menu and getting sort order and information viewing choice&lt;br /&gt;
PROMPT&lt;br /&gt;
PROMPT Choose the column you want to sort:        == OR ==        You can choose which information to see: &lt;br /&gt;
PROMPT ... 1. Order by SESSION                                    ... 5. PGA and UGA statistics (default)&lt;br /&gt;
PROMPT ... 2. Order by PID/THREAD                                 ... 6. PGA statistics only&lt;br /&gt;
PROMPT ... 3. Order by CURRENT SIZE (default)                     ... 7. UGA statistics only&lt;br /&gt;
PROMPT ... 4. Order by MAXIMUM SIZE&lt;br /&gt;
PROMPT&lt;br /&gt;
ACCEPT choice NUMBER PROMPT 'Enter the number of your choice or press &lt;enter&gt; to refresh information: '&lt;br /&gt;
VAR    sort_choice NUMBER&lt;br /&gt;
VAR    pga_choice  CHAR(3)&lt;br /&gt;
VAR    uga_choice  CHAR(3)&lt;br /&gt;
BEGIN&lt;br /&gt;
IF (&amp;amp;choice = 1 OR &amp;amp;choice = 2 OR &amp;amp;choice = 3 OR &amp;amp;choice = 4) THEN&lt;br /&gt;
:sort_choice := &amp;choice;&lt;br /&gt;
:pga_choice  := '&amp;amp;show_pga';&lt;br /&gt;
:uga_choice  := '&amp;amp;show_uga';&lt;br /&gt;
ELSIF (&amp;amp;choice = 5) THEN&lt;br /&gt;
:sort_choice := &amp;amp;sort_order;&lt;br /&gt;
:pga_choice  := 'ON';&lt;br /&gt;
:uga_choice  := 'ON';&lt;br /&gt;
ELSIF (&amp;amp;choice = 6) THEN&lt;br /&gt;
:sort_choice := &amp;amp;sort_order;&lt;br /&gt;
:pga_choice  := 'ON';&lt;br /&gt;
:uga_choice  := 'OFF';&lt;br /&gt;
ELSIF (&amp;amp;choice = 7) THEN&lt;br /&gt;
:sort_choice := &amp;amp;sort_order;&lt;br /&gt;
:pga_choice  := 'OFF';&lt;br /&gt;
:uga_choice  := 'ON';&lt;br /&gt;
ELSE&lt;br /&gt;
:sort_choice := &amp;amp;sort_order;&lt;br /&gt;
:pga_choice  := '&amp;amp;show_pga';&lt;br /&gt;
:uga_choice  := '&amp;amp;show_uga';&lt;br /&gt;
END IF;&lt;br /&gt;
END;&lt;br /&gt;
/&lt;br /&gt;
&lt;br /&gt;
REM Finishing script execution&lt;br /&gt;
PROMPT Type "@MEMORY" and press &lt;enter&gt;&lt;br /&gt;
SET FEEDBACK     ON&lt;br /&gt;
SET VERIFY       ON&lt;br /&gt;
SET SERVEROUTPUT OFF&lt;br /&gt;
SET TRIMSPOOL    OFF&lt;br /&gt;
&lt;br /&gt;
spool off&lt;br /&gt;
&lt;br /&gt;
REM =============&lt;br /&gt;
REM END OF SCRIPT&lt;br /&gt;
REM =============&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-8047124231988395512?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cqoC2-j7RdLMV-W863w03MHUczw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cqoC2-j7RdLMV-W863w03MHUczw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cqoC2-j7RdLMV-W863w03MHUczw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cqoC2-j7RdLMV-W863w03MHUczw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/bEDTZ_y5p4I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/8047124231988395512/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2010/09/script-to-monitor-memory-usage-by.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/8047124231988395512?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/8047124231988395512?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/bEDTZ_y5p4I/script-to-monitor-memory-usage-by.html" title="SCRIPT TO MONITOR MEMORY USAGE BY DATABASE SESSIONS" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2010/09/script-to-monitor-memory-usage-by.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IMSHcyfCp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-541644054527437403</id><published>2010-09-26T00:56:00.004+05:30</published><updated>2011-03-05T21:09:49.994+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:09:49.994+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Oracle DBA" /><title>Database Health Monitoring Scripts in Oracle.</title><content type="html">#################################################################################&lt;br /&gt;
----------------------  Database health Monitor ---------------------------------&lt;br /&gt;
#################################################################################&lt;br /&gt;
&lt;br /&gt;
break on today &lt;br /&gt;
column today noprint new_value tdate &lt;br /&gt;
select substr(to_char(sysdate,'fmMonth DD, YYYY HH:MI:SS P.M.'),1,35) today from dual; &lt;br /&gt;
column name noprint new_value DB &lt;br /&gt;
select name from v$database; &lt;br /&gt;
&lt;br /&gt;
set heading on &lt;br /&gt;
set feedback off &lt;br /&gt;
&lt;br /&gt;
spool health.lst &lt;br /&gt;
--spool Windows Path or Unix Path\health.lst&lt;br /&gt;
&lt;br /&gt;
prompt ********************************************************** &lt;br /&gt;
prompt *****            Database Information                ***** &lt;br /&gt;
prompt ********************************************************** &lt;br /&gt;
ttitle left "DATABASE:  "DB"    (AS OF:  "tdate")" &lt;br /&gt;
select name, created, log_mode from v$database; &lt;br /&gt;
prompt &lt;br /&gt;
prompt ********************************************************** &lt;br /&gt;
ttitle off &lt;br /&gt;
&lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
rem             DB Block Buffer - Hit Ratio &lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
&lt;br /&gt;
clear breaks &lt;br /&gt;
clear computes &lt;br /&gt;
&lt;br /&gt;
set heading off &lt;br /&gt;
set feedback off &lt;br /&gt;
set termout off &lt;br /&gt;
&lt;br /&gt;
create table dbbb ( &lt;br /&gt;
PR      number, &lt;br /&gt;
CG      number, &lt;br /&gt;
dbbg    number); &lt;br /&gt;
&lt;br /&gt;
insert into DBBB values (0,0,0); &lt;br /&gt;
UPDATE dbbb &lt;br /&gt;
set dbbg = &lt;br /&gt;
(SELECT  VALUE FROM V$SYSSTAT WHERE NAME = 'db block gets'); &lt;br /&gt;
UPDATE dbbb &lt;br /&gt;
set cg = &lt;br /&gt;
(SELECT  VALUE FROM V$SYSSTAT WHERE NAME = 'consistent gets'); &lt;br /&gt;
UPDATE dbbb &lt;br /&gt;
set pr = &lt;br /&gt;
(SELECT  VALUE FROM V$SYSSTAT WHERE NAME = 'physical reads'); &lt;br /&gt;
&lt;br /&gt;
set heading on &lt;br /&gt;
set termout on &lt;br /&gt;
&lt;br /&gt;
column "Physical Reads" format 99,999,999,999 &lt;br /&gt;
column "Consistent Gets" format 99,999,999,999 &lt;br /&gt;
column "DB Block Gets" format 99,999,999,999 &lt;br /&gt;
column "Percent (Above 70% ?)" format 999.99 &lt;br /&gt;
&lt;br /&gt;
TTitle left "*****  Database:  "db", DB Block Buffers ( As of:  "tdate" )   *****" skip 1 - left "Percent = (100*(1-(Physical Reads/(Consistent Gets + DB Block  Gets))))" skip 2 &lt;br /&gt;
SELECT  pr "Physical Reads", &lt;br /&gt;
cg "Consistent Gets", &lt;br /&gt;
dbbg "DB Block Gets", &lt;br /&gt;
(100*(1-(PR/(CG+dbbg)))) "Percent (Above 70% ?)" &lt;br /&gt;
from dbbb; &lt;br /&gt;
&lt;br /&gt;
set heading off &lt;br /&gt;
set termout off &lt;br /&gt;
drop table dbbb; &lt;br /&gt;
ttitle off &lt;br /&gt;
clear breaks &lt;br /&gt;
clear computes &lt;br /&gt;
set heading on &lt;br /&gt;
set termout on &lt;br /&gt;
&lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
rem             Shared Pool Size - Gets and Misses &lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
&lt;br /&gt;
set line 150 &lt;br /&gt;
&lt;br /&gt;
column "Executions" format 999,999,990 &lt;br /&gt;
column "Cache Misses Executing" format 999,999,990 &lt;br /&gt;
column "Data Dictionary Gets" format 999,999,999 &lt;br /&gt;
column "Get Misses" format 999,999,999 &lt;br /&gt;
&lt;br /&gt;
ttitle left skip 1 - left "**********     Shared Pool Size (Execution Misses)     **********" skip 1 &lt;br /&gt;
&lt;br /&gt;
select sum(pins) "Executions", &lt;br /&gt;
sum(reloads) "Cache Misses Executing", &lt;br /&gt;
(sum(reloads)/sum(pins)*100) "% Ratio (STAY UNDER 1%)" &lt;br /&gt;
from v$librarycache; &lt;br /&gt;
&lt;br /&gt;
ttitle left "**********     Shared Pool Size (Dictionary Gets)     **********"  skip 1 &lt;br /&gt;
&lt;br /&gt;
select sum(gets) "Data Dictionary Gets", &lt;br /&gt;
sum(getmisses) "Get Misses", &lt;br /&gt;
100*(sum(getmisses)/sum(gets)) "% Ratio (STAY UNDER 12%)" &lt;br /&gt;
from v$rowcache; &lt;br /&gt;
&lt;br /&gt;
ttitle off &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
rem             Log Buffer &lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
&lt;br /&gt;
ttitle left "**********     Log Buffers     **********" skip 1 &lt;br /&gt;
&lt;br /&gt;
select  substr(name,1,25) Name, &lt;br /&gt;
substr(value,1,15) "VALUE (Near 0?)" &lt;br /&gt;
from v$sysstat &lt;br /&gt;
where name = 'redo log space requests'; &lt;br /&gt;
&lt;br /&gt;
ttitle off &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
rem             Latch Contention &lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
&lt;br /&gt;
ttitle left "**********     Latch Information     **********" skip 1 &lt;br /&gt;
&lt;br /&gt;
select  substr(l.name,1,25) Name, &lt;br /&gt;
l.gets, l.misses, &lt;br /&gt;
l.immediate_gets, l.immediate_misses &lt;br /&gt;
from v$latch l, v$latchname ln &lt;br /&gt;
where ln.name in ('redo allocation', 'redo copy') &lt;br /&gt;
and ln.latch# = l.latch#; &lt;br /&gt;
&lt;br /&gt;
ttitle off &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
rem             Reinstates the xdbname parameter &lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
&lt;br /&gt;
column name noprint new_value xdbname &lt;br /&gt;
select name from v$database; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
rem             Tablespace Usage &lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
&lt;br /&gt;
set pagesize 66 &lt;br /&gt;
set line 132 &lt;br /&gt;
&lt;br /&gt;
clear breaks &lt;br /&gt;
clear computes &lt;br /&gt;
&lt;br /&gt;
column "Total Bytes" format 9,999,999,999 &lt;br /&gt;
column "SQL Blocks" format 999,999,999 &lt;br /&gt;
column "VMS Blocks" format 999,999,999 &lt;br /&gt;
column "Bytes Free" format 9,999,999,999 &lt;br /&gt;
column "Bytes Used" format 9,999,999,999 &lt;br /&gt;
column "% Free" format 9999.999 &lt;br /&gt;
column "% Used" format 9999.999 &lt;br /&gt;
break on report &lt;br /&gt;
compute sum of "Total Bytes" on report &lt;br /&gt;
compute sum of "SQL Blocks" on report &lt;br /&gt;
compute sum of "VMS Blocks" on report &lt;br /&gt;
compute sum of "Bytes Free" on report &lt;br /&gt;
compute sum of "Bytes Used" on report &lt;br /&gt;
compute avg of "% Free" on report &lt;br /&gt;
compute avg of "% Used" on report &lt;br /&gt;
&lt;br /&gt;
TTitle left "*******   Database:  "db", Current Tablespace Usage ( As of:   "tdate" )   *******" skip 1 &lt;br /&gt;
&lt;br /&gt;
select  substr(fs.FILE_ID,1,3) "ID#", &lt;br /&gt;
fs.tablespace_name, &lt;br /&gt;
df.bytes "Total Bytes", &lt;br /&gt;
df.blocks "SQL Blocks", &lt;br /&gt;
df.bytes/512 "VMS Blocks", &lt;br /&gt;
sum(fs.bytes) "Bytes Free", &lt;br /&gt;
(100*((sum(fs.bytes))/df.bytes)) "% Free", &lt;br /&gt;
df.bytes-sum(fs.bytes) "Bytes Used", &lt;br /&gt;
(100*((df.bytes-sum(fs.bytes))/df.bytes)) "% Used" &lt;br /&gt;
from sys.dba_data_files df, sys.dba_free_space fs &lt;br /&gt;
where df.file_id(+) = fs.file_id &lt;br /&gt;
group by fs.FILE_ID, fs.tablespace_name, df.bytes, df.blocks &lt;br /&gt;
order by fs.tablespace_name; &lt;br /&gt;
&lt;br /&gt;
ttitle off &lt;br /&gt;
&lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
rem             Disk Activity &lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
&lt;br /&gt;
column "File Total" format 99,999,990 &lt;br /&gt;
&lt;br /&gt;
set line 132 &lt;br /&gt;
set pagesize 33 &lt;br /&gt;
&lt;br /&gt;
ttitle  "        *****   Database:  "db", DataFile's Disk Activity (As  of:" tdate " )   *****" &lt;br /&gt;
&lt;br /&gt;
select substr(df.file#,1,2) "ID", &lt;br /&gt;
rpad(substr(name,1,52),52,'.') "File Name", &lt;br /&gt;
rpad(substr(phyrds,1,10),10,'.') "Phy Reads", &lt;br /&gt;
rpad(substr(phywrts,1,10),10,'.') "Phy Writes", &lt;br /&gt;
rpad(substr(phyblkrd,1,10),10,'.') "Blk Reads", &lt;br /&gt;
rpad(substr(phyblkwrt,1,10),10,'.') "Blk Writes", &lt;br /&gt;
rpad(substr(readtim,1,9),9,'.') "Read Time", &lt;br /&gt;
rpad(substr(writetim,1,10),10,'.') "Write Time", &lt;br /&gt;
(sum(phyrds+phywrts+phyblkrd+phyblkwrt+readtim)) "File Total" &lt;br /&gt;
from v$filestat fs, v$datafile df &lt;br /&gt;
where fs.file# = df.file# &lt;br /&gt;
group by df.file#, df.name, phyrds, phywrts, phyblkrd, &lt;br /&gt;
phyblkwrt, readtim, writetim &lt;br /&gt;
order by sum(phyrds+phywrts+phyblkrd+phyblkwrt+readtim) desc, df.name; &lt;br /&gt;
&lt;br /&gt;
ttitle off &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
rem             Fragmentation Need &lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
&lt;br /&gt;
set heading on &lt;br /&gt;
set termout on &lt;br /&gt;
set pagesize 66 &lt;br /&gt;
set line 132 &lt;br /&gt;
&lt;br /&gt;
ttitle left "     *****    Database:  "db", DEFRAGMENTATION NEED, AS OF:    " tdate "      *****" &lt;br /&gt;
&lt;br /&gt;
select  substr(de.owner,1,8) "Owner", &lt;br /&gt;
substr(de.segment_type,1,8) "Seg Type", &lt;br /&gt;
substr(de.segment_name,1,35) "Table Name (Segment)", &lt;br /&gt;
substr(de.tablespace_name,1,20) "Tablespace Name", &lt;br /&gt;
count(*) "Frag NEED", &lt;br /&gt;
substr(df.name,1,40) "DataFile Name" &lt;br /&gt;
from sys.dba_extents de, v$datafile df &lt;br /&gt;
where de.owner &lt;&gt; 'SYS' &lt;br /&gt;
and de.file_id = df.file# &lt;br /&gt;
and de.segment_type = 'TABLE' &lt;br /&gt;
group by de.owner, de.segment_name, de.segment_type, de.tablespace_name,  &lt;br /&gt;
df.name &lt;br /&gt;
having count(*) &gt; 1 &lt;br /&gt;
order by count(*) desc; &lt;br /&gt;
&lt;br /&gt;
ttitle off &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
rem             Rollback Information &lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
&lt;br /&gt;
set pagesize 66 &lt;br /&gt;
set line 132 &lt;br /&gt;
&lt;br /&gt;
TTitle left "*** Database:  "db", Rollback Information ( As of:  " tdate "  ) ***" skip 2 &lt;br /&gt;
&lt;br /&gt;
select  substr(sys.dba_rollback_segs.SEGMENT_ID,1,5) "ID#", &lt;br /&gt;
substr(sys.dba_segments.OWNER,1,8) "Owner", &lt;br /&gt;
substr(sys.dba_segments.TABLESPACE_NAME,1,17) "Tablespace Name", &lt;br /&gt;
substr(sys.dba_segments.SEGMENT_NAME,1,17) "Rollback Name", &lt;br /&gt;
substr(sys.dba_rollback_segs.INITIAL_EXTENT,1,10) "INI_Extent",&lt;br /&gt;
substr(sys.dba_rollback_segs.NEXT_EXTENT,1,10) "Next Exts",&lt;br /&gt;
substr(sys.dba_segments.MIN_EXTENTS,1,5) "MinEx",&lt;br /&gt;
substr(sys.dba_segments.MAX_EXTENTS,1,5) "MaxEx",&lt;br /&gt;
substr(sys.dba_segments.PCT_INCREASE,1,5) "%Incr", &lt;br /&gt;
substr(sys.dba_segments.BYTES,1,15) "Size (Bytes)", &lt;br /&gt;
substr(sys.dba_segments.EXTENTS,1,6) "Extent#", &lt;br /&gt;
substr(sys.dba_rollback_segs.STATUS,1,10) "Status" &lt;br /&gt;
from sys.dba_segments, sys.dba_rollback_segs &lt;br /&gt;
where sys.dba_segments.segment_name = sys.dba_rollback_segs.segment_name and &lt;br /&gt;
sys.dba_segments.segment_type = 'ROLLBACK' &lt;br /&gt;
order by sys.dba_rollback_segs.segment_id; &lt;br /&gt;
&lt;br /&gt;
ttitle off &lt;br /&gt;
&lt;br /&gt;
TTitle left " " skip 2 - left "*** Database:  "db", Rollback Status ( As of:  " tdate " )  ***" skip 2 &lt;br /&gt;
&lt;br /&gt;
select substr(V$rollname.NAME,1,20) "Rollback_Name",&lt;br /&gt;
substr(V$rollstat.EXTENTS,1,6) "EXTENT",&lt;br /&gt;
v$rollstat.RSSIZE, v$rollstat.WRITES,&lt;br /&gt;
substr(v$rollstat.XACTS,1,6) "XACTS",&lt;br /&gt;
v$rollstat.GETS,&lt;br /&gt;
substr(v$rollstat.WAITS,1,6) "WAITS",&lt;br /&gt;
v$rollstat.HWMSIZE, v$rollstat.SHRINKS,&lt;br /&gt;
substr(v$rollstat.WRAPS,1,6) "WRAPS",&lt;br /&gt;
substr(v$rollstat.EXTENDS,1,6) "EXTEND",&lt;br /&gt;
v$rollstat.AVESHRINK,&lt;br /&gt;
v$rollstat.AVEACTIVE&lt;br /&gt;
from v$rollname, v$rollstat&lt;br /&gt;
where v$rollname.USN = v$rollstat.USN&lt;br /&gt;
order by v$rollname.USN;&lt;br /&gt;
&lt;br /&gt;
ttitle off &lt;br /&gt;
&lt;br /&gt;
TTitle left " " skip 2 - left "*** Database:  "db", Rollback Segment Mapping ( As of:  "  tdate " ) ***" skip 2 &lt;br /&gt;
&lt;br /&gt;
select  r.name Rollback_Name, &lt;br /&gt;
p.pid Oracle_PID, &lt;br /&gt;
p.spid VMS_PID, &lt;br /&gt;
nvl(p.username,'NO TRANSACTION') Transaction, &lt;br /&gt;
p.terminal Terminal &lt;br /&gt;
from v$lock l, v$process p, v$rollname r &lt;br /&gt;
where   l.addr = p.addr(+) &lt;br /&gt;
and trunc(l.id1(+)/65536)=r.usn &lt;br /&gt;
and l.type(+) = 'TX' &lt;br /&gt;
and l.lmode(+) = 6 &lt;br /&gt;
order by r.name; &lt;br /&gt;
&lt;br /&gt;
ttitle off &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
rem             Current Users &lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
&lt;br /&gt;
set line 132 &lt;br /&gt;
set pagesize 66 &lt;br /&gt;
&lt;br /&gt;
TTitle left "***   Database:  "db", Current User Info (As of:  "tdate")    ***" skip 1 &lt;br /&gt;
&lt;br /&gt;
select  substr(s.username,1,15) "DB UserName", &lt;br /&gt;
s.osuser "OS UserName", &lt;br /&gt;
substr(a.object,1,25) Object, &lt;br /&gt;
a.type , s.command, &lt;br /&gt;
substr(s.machine,1,15) Machine, &lt;br /&gt;
substr(s.terminal,1,15) Terminal, s.process, s.status &lt;br /&gt;
from v$access a, v$session s &lt;br /&gt;
where a.sid = s.sid &lt;br /&gt;
order by username; &lt;br /&gt;
&lt;br /&gt;
TTitle left "***   Database:  "db", Current Sessions (As of:  "tdate")    ***" skip 1 &lt;br /&gt;
&lt;br /&gt;
select  substr(username,1,15) "DB UserName", &lt;br /&gt;
substr(osuser,1,15) "OS UserName", &lt;br /&gt;
substr(command,1,3) CMD, &lt;br /&gt;
substr(machine,1,10) Machine, &lt;br /&gt;
terminal, process, status, &lt;br /&gt;
substr(program,1,50) "OS Program Name" &lt;br /&gt;
from v$session &lt;br /&gt;
where type = 'USER' &lt;br /&gt;
order by username; &lt;br /&gt;
&lt;br /&gt;
TTitle left "***   Database:  "db", Current Access (As of:  "tdate") ***" skip 1 &lt;br /&gt;
&lt;br /&gt;
select  sid, &lt;br /&gt;
substr(owner,1,15) Owner, &lt;br /&gt;
substr(object,1,25) Object, &lt;br /&gt;
type &lt;br /&gt;
from v$access &lt;br /&gt;
order by owner; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
rem ------------------------------------------------------------- &lt;br /&gt;
&lt;br /&gt;
spool off &lt;br /&gt;
set feedback on&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-541644054527437403?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1pnx2J_d8DRu3QFlLO-_jrRpxEc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1pnx2J_d8DRu3QFlLO-_jrRpxEc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1pnx2J_d8DRu3QFlLO-_jrRpxEc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1pnx2J_d8DRu3QFlLO-_jrRpxEc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/XsEbMp1rSng" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/541644054527437403/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2010/09/database-health-monitoring-scripts-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/541644054527437403?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/541644054527437403?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/XsEbMp1rSng/database-health-monitoring-scripts-in.html" title="Database Health Monitoring Scripts in Oracle." /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2010/09/database-health-monitoring-scripts-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcGQnk4eCp7ImA9Wx5WFEk.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-8405792624961786908</id><published>2010-09-26T00:40:00.001+05:30</published><updated>2010-09-26T00:43:43.730+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-26T00:43:43.730+05:30</app:edited><title>PL/SQL Procedure to write records to excel</title><content type="html">-- This PL/SQL procedure will write records to an Excel File. &lt;br /&gt;-- We will use UTL_FILE ( You need an init.ora parameter set for this to work correctly). &lt;br /&gt;-- UTL_FILE allows us to write a file on the server. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;create or replace&lt;br /&gt;package spread_sheet as&lt;br /&gt;--&lt;br /&gt;  type owaSylkArray is table of varchar2(2000);&lt;br /&gt;--&lt;br /&gt;  procedure show(&lt;br /&gt;      sheet_file     in utl_file.file_type,&lt;br /&gt;      sheet_query    in varchar2,&lt;br /&gt;      sheet_parm_names    in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_parm_values   in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_sum_column    in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_max_rows      in number     default 10000,&lt;br /&gt;      sheet_show_null_as  in varchar2   default null,&lt;br /&gt;      sheet_show_grid     in varchar2   default 'YES',&lt;br /&gt;      sheet_show_col_headers in varchar2 default 'YES',&lt;br /&gt;      sheet_font_name     in varchar2   default 'Courier New',&lt;br /&gt;      sheet_widths        in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_titles        in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_strisheet_html    in varchar2   default 'YES' );&lt;br /&gt;--&lt;br /&gt;  procedure show(&lt;br /&gt;      sheet_filein utl_file.file_type,&lt;br /&gt;      sheet_cursor        in integer,&lt;br /&gt;      sheet_sum_column    in owaSylkArray  default owaSylkArray(),&lt;br /&gt;      sheet_max_rows      in number     default 10000,&lt;br /&gt;      sheet_show_null_as  in varchar2   default null,&lt;br /&gt;      sheet_show_grid     in varchar2   default 'YES',&lt;br /&gt;      sheet_show_col_headers in varchar2 default 'YES',&lt;br /&gt;      sheet_font_name     in varchar2   default 'Courier New',&lt;br /&gt;      sheet_widths        in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_titles        in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_strisheet_html    in varchar2   default 'YES' );&lt;br /&gt;--&lt;br /&gt;end spread_sheet;&lt;br /&gt;/&lt;br /&gt;show error&lt;br /&gt;&lt;br /&gt;create or replace&lt;br /&gt;package body spread_sheet as&lt;br /&gt;--&lt;br /&gt;  g_cvalue  varchar2(32767);&lt;br /&gt;  g_desc_t dbms_sql.desc_tab;&lt;br /&gt;&lt;br /&gt;  type vc_arr is table of varchar2(2000) index by binary_integer;&lt;br /&gt;  g_lengths vc_arr;&lt;br /&gt;  g_sums vc_arr;&lt;br /&gt;--&lt;br /&gt;--&lt;br /&gt;&lt;br /&gt;  g_file  utl_file.file_type;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  procedure p( sheet_str in varchar2 )&lt;br /&gt;  is&lt;br /&gt;  begin&lt;br /&gt;    utl_file.put_line( g_file, sheet_str );&lt;br /&gt;  exception&lt;br /&gt;    when others then null;&lt;br /&gt;  end;&lt;br /&gt;&lt;br /&gt;  function build_cursor(&lt;br /&gt;      q in varchar2,&lt;br /&gt;      n in owaSylkArray,&lt;br /&gt;      v in owaSylkArray ) return integer is&lt;br /&gt;    c integer := dbms_sql.open_cursor;&lt;br /&gt;    i number := 1;&lt;br /&gt;  begin&lt;br /&gt;    dbms_sql.parse (c, q, dbms_sql.native);&lt;br /&gt;    loop&lt;br /&gt;      dbms_sql.bind_variable( c, n(i), v(i) );&lt;br /&gt;      i := i + 1;&lt;br /&gt;    end loop;&lt;br /&gt;    return c;&lt;br /&gt;  exception&lt;br /&gt;    when others then&lt;br /&gt;      return c;&lt;br /&gt;  end build_cursor;&lt;br /&gt;--&lt;br /&gt;--&lt;br /&gt;  function str_html ( line in varchar2 ) return varchar2 is&lt;br /&gt;    x       varchar2(32767) := null;&lt;br /&gt;    in_html boolean         := FALSE;&lt;br /&gt;    s       varchar2(1);&lt;br /&gt;  begin&lt;br /&gt;    if line is null then&lt;br /&gt;      return line;&lt;br /&gt;    end if;&lt;br /&gt;    for i in 1 .. length( line ) loop&lt;br /&gt;      s := substr( line, i, 1 );&lt;br /&gt;      if in_html then&lt;br /&gt;        if s = '&gt;' then&lt;br /&gt;          in_html := FALSE;&lt;br /&gt;        end if;&lt;br /&gt;      else&lt;br /&gt;        if s = '&lt;' then&lt;br /&gt;          in_html := TRUE;&lt;br /&gt;        end if;&lt;br /&gt;      end if;&lt;br /&gt;      if not in_html and s != '&gt;' then&lt;br /&gt;        x := x || s;&lt;br /&gt;      end if;&lt;br /&gt;    end loop;&lt;br /&gt;    return x;&lt;br /&gt;  end str_html;&lt;br /&gt;--&lt;br /&gt;  function ite( b boolean,&lt;br /&gt;                t varchar2,&lt;br /&gt;                f varchar2 ) return varchar2 is&lt;br /&gt;  begin&lt;br /&gt;    if b then&lt;br /&gt;      return t;&lt;br /&gt;    else&lt;br /&gt;      return f;&lt;br /&gt;    end if;&lt;br /&gt;  end ite;&lt;br /&gt;--&lt;br /&gt;  procedure print_comment( sheet_comment varchar2 ) is&lt;br /&gt;  begin&lt;br /&gt;    return;&lt;br /&gt;    p( ';' || chr(10) || '; ' || sheet_comment || chr(10) || ';' );&lt;br /&gt;  end print_comment;&lt;br /&gt;--&lt;br /&gt;  procedure print_heading( font in varchar2, &lt;br /&gt;                           grid in varchar2, &lt;br /&gt;                           col_heading in varchar2, &lt;br /&gt;                           titles in owaSylkArray ) &lt;br /&gt;  is&lt;br /&gt;    l_title varchar2(2000);&lt;br /&gt;  begin&lt;br /&gt;    p( 'ID;ORACLE' );&lt;br /&gt;    print_comment( 'Fonts' );&lt;br /&gt;    p( 'P;F' || font || ';M200' );&lt;br /&gt;    p( 'P;F' || font || ';M200;SB' );&lt;br /&gt;    p( 'P;F' || font || ';M200;SUB' );&lt;br /&gt;    --&lt;br /&gt;    print_comment( 'Global Formatting' );&lt;br /&gt;    p( 'F;C1;FG0R;SM1' || &lt;br /&gt;           ite( upper(grid)='YES', '', ';G' ) || &lt;br /&gt;           ite( upper(col_heading)='YES', '', ';H' )  );&lt;br /&gt;    for i in 1 .. g_desc_t.count loop&lt;br /&gt;      p( 'F;C' || to_char(i+1) || ';FG0R;SM0' );&lt;br /&gt;    end loop;&lt;br /&gt;    --&lt;br /&gt;    print_comment( 'Title Row' );&lt;br /&gt;    p( 'F;R1;FG0C;SM2' );&lt;br /&gt;    for i in 1 .. g_desc_t.count loop&lt;br /&gt;      g_lengths(i) := g_desc_t(i).col_name_len;&lt;br /&gt;      g_sums(i) := 0;&lt;br /&gt;      begin&lt;br /&gt;        l_title := titles(i);&lt;br /&gt;      exception&lt;br /&gt;        when others then&lt;br /&gt;          l_title := g_desc_t(i).col_name;&lt;br /&gt;      end;&lt;br /&gt;      if i = 1 then&lt;br /&gt;        p( 'C;Y1;X2;K"' || l_title || '"' );&lt;br /&gt;      else&lt;br /&gt;        p( 'C;X' || to_char(i+1) || ';K"' || l_title || '"' );&lt;br /&gt;      end if;&lt;br /&gt;    end loop;&lt;br /&gt;  end print_heading;&lt;br /&gt;--&lt;br /&gt;  function print_rows(&lt;br /&gt;      c            in integer,&lt;br /&gt;      max_rows     in number,&lt;br /&gt;      sum_columns  in owaSylkArray,&lt;br /&gt;      show_null_as in varchar2,&lt;br /&gt;      strisheet_html   in varchar2 ) return number is&lt;br /&gt;    row_cnt number          := 0;&lt;br /&gt;    line    varchar2(32767) := null;&lt;br /&gt;    n       number;&lt;br /&gt;  begin&lt;br /&gt;    loop&lt;br /&gt;      exit when ( row_cnt &gt;= max_rows or&lt;br /&gt;                  dbms_sql.fetch_rows( c ) &lt;= 0 );&lt;br /&gt;      row_cnt := row_cnt + 1;&lt;br /&gt;      print_comment( 'Row ' || row_cnt );&lt;br /&gt;      --&lt;br /&gt;      p( 'C;Y' || to_char(row_cnt+2) );&lt;br /&gt;&lt;br /&gt;      for i in 1 .. g_desc_t.count loop&lt;br /&gt;        dbms_sql.column_value( c, i, g_cvalue );&lt;br /&gt;        g_cvalue := translate( g_cvalue, &lt;br /&gt;                            chr(10)||chr(9)||';', '   ' );&lt;br /&gt;        g_cvalue := ite( upper( strisheet_html ) = 'YES',&lt;br /&gt;                             str_html( g_cvalue ),&lt;br /&gt;                             g_cvalue );&lt;br /&gt;        g_lengths(i) := greatest( nvl(length(g_cvalue), &lt;br /&gt;                                  nvl(length(show_null_as),0)),&lt;br /&gt;                                  g_lengths(i) );&lt;br /&gt;        line := 'C;X' || to_char(i+1);&lt;br /&gt;        line := line || ';K';&lt;br /&gt;        begin&lt;br /&gt;          n := to_number( g_cvalue );&lt;br /&gt;          if upper( sum_columns(i)) = 'Y' then&lt;br /&gt;            g_sums(i) := g_sums(i) + nvl(n,0);&lt;br /&gt;          end if;&lt;br /&gt;        exception&lt;br /&gt;          when others then&lt;br /&gt;            n := null;&lt;br /&gt;        end;&lt;br /&gt;        line := line || &lt;br /&gt;                 ite( n is null, &lt;br /&gt;                      ite( g_cvalue is null, &lt;br /&gt;                               '"'||show_null_as||&lt;br /&gt;                                  '"', '"'||g_cvalue||'"' ), &lt;br /&gt;                             n );&lt;br /&gt;        p( line );&lt;br /&gt;      end loop;&lt;br /&gt;      --&lt;br /&gt;    end loop;&lt;br /&gt;    return row_cnt;&lt;br /&gt;  end print_rows;&lt;br /&gt;--&lt;br /&gt;  procedure print_sums(&lt;br /&gt;      sum_columns  in owaSylkArray,&lt;br /&gt;      row_cnt      in number ) is&lt;br /&gt;  begin&lt;br /&gt;    if sum_columns.count = 0 then&lt;br /&gt;      return;&lt;br /&gt;    end if;&lt;br /&gt;    --&lt;br /&gt;    print_comment( 'Totals Row' );&lt;br /&gt;    p( 'C;Y' || to_char(row_cnt + 4) );&lt;br /&gt;    p( 'C;X1;K"Totals:"' );&lt;br /&gt;    --&lt;br /&gt;    for i in 1 .. g_desc_t.count loop&lt;br /&gt;      begin&lt;br /&gt;        if upper(sum_columns(i)) = 'Y' then&lt;br /&gt;          p( 'C;X' || to_char(i+1) || ';ESUM(R3C:R' || &lt;br /&gt;                  to_char(row_cnt+2) || 'C)' );&lt;br /&gt;        end if;&lt;br /&gt;      exception&lt;br /&gt;        when others then&lt;br /&gt;          null;&lt;br /&gt;      end;&lt;br /&gt;    end loop;&lt;br /&gt;  end print_sums;&lt;br /&gt;--&lt;br /&gt;  procedure print_widths( widths owaSylkArray ) is&lt;br /&gt;  begin&lt;br /&gt;    print_comment( 'Format Column Widths' );&lt;br /&gt;    p( 'F;W1 1 7' );&lt;br /&gt;    for i in 1 .. g_desc_t.count loop&lt;br /&gt;      begin&lt;br /&gt;        p( 'F;W' || to_char(i+1) || ' ' || &lt;br /&gt;            to_char(i+1) || ' ' || &lt;br /&gt;            to_char(to_number(widths(i))) );&lt;br /&gt;      exception&lt;br /&gt;        when others then&lt;br /&gt;          p( 'F;W' || to_char(i+1) || ' ' || &lt;br /&gt;               to_char(i+1) || ' ' || &lt;br /&gt;               greatest( g_lengths(i), length( g_sums(i) )));&lt;br /&gt;      end;&lt;br /&gt;    end loop;&lt;br /&gt;    p( 'E' );&lt;br /&gt;  end print_widths;&lt;br /&gt;procedure show(&lt;br /&gt;      sheet_filein utl_file.file_type,&lt;br /&gt;      sheet_cursor        in integer,&lt;br /&gt;      sheet_sum_column    in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_max_rows      in number     default 10000,&lt;br /&gt;      sheet_show_null_as  in varchar2   default null,&lt;br /&gt;      sheet_show_grid     in varchar2   default 'YES',&lt;br /&gt;      sheet_show_col_headers in varchar2 default 'YES',&lt;br /&gt;      sheet_font_name     in varchar2   default 'Courier New',&lt;br /&gt;      sheet_widths        in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_titles        in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_strisheet_html    in varchar2   default 'YES' ) is&lt;br /&gt;  --&lt;br /&gt;    l_row_cnt number;&lt;br /&gt;    l_col_cnt number;&lt;br /&gt;    l_status  number;&lt;br /&gt;  begin&lt;br /&gt;    g_file := sheet_file;&lt;br /&gt;    dbms_sql.describe_columns( sheet_cursor, l_col_cnt, g_desc_t );&lt;br /&gt;    --&lt;br /&gt;    for i in 1 .. g_desc_t.count loop&lt;br /&gt;      dbms_sql.define_column( sheet_cursor, i, g_cvalue, 32765);&lt;br /&gt;    end loop;&lt;br /&gt;    --&lt;br /&gt;    print_heading( sheet_font_name, &lt;br /&gt;                   sheet_show_grid, &lt;br /&gt;                   sheet_show_col_headers, &lt;br /&gt;                   sheet_titles );&lt;br /&gt;    l_status := dbms_sql.execute( sheet_cursor );&lt;br /&gt;    l_row_cnt := print_rows(&lt;br /&gt;                   sheet_cursor, &lt;br /&gt;                   sheet_max_rows,&lt;br /&gt;                   sheet_sum_column,&lt;br /&gt;                   sheet_show_null_as,&lt;br /&gt;                   sheet_strisheet_html );&lt;br /&gt;    print_sums( sheet_sum_column, l_row_cnt );&lt;br /&gt;    print_widths( sheet_widths );&lt;br /&gt;  end show;&lt;br /&gt;--&lt;br /&gt;  procedure show(&lt;br /&gt;      sheet_filein utl_file.file_type,&lt;br /&gt;      sheet_query         in varchar2,&lt;br /&gt;      sheet_parm_names    in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_parm_values   in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_sum_column    in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_max_rows      in number     default 10000,&lt;br /&gt;      sheet_show_null_as  in varchar2   default null,&lt;br /&gt;      sheet_show_grid     in varchar2   default 'YES',&lt;br /&gt;      sheet_show_col_headers in varchar2 default 'YES',&lt;br /&gt;      sheet_font_name     in varchar2   default 'Courier New',&lt;br /&gt;      sheet_widths        in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_titles        in owaSylkArray default owaSylkArray(),&lt;br /&gt;      sheet_strisheet_html    in varchar2   default 'YES' ) is&lt;br /&gt;  begin&lt;br /&gt;    show( sheet_file =&gt; sheet_file,&lt;br /&gt;          sheet_cursor =&gt; build_cursor( sheet_query, &lt;br /&gt;                                    sheet_parm_names, &lt;br /&gt;                                    sheet_parm_values ),&lt;br /&gt;          sheet_sum_column =&gt; sheet_sum_column,&lt;br /&gt;          sheet_max_rows =&gt; sheet_max_rows,&lt;br /&gt;          sheet_show_null_as =&gt; sheet_show_null_as,&lt;br /&gt;          sheet_show_grid =&gt; sheet_show_grid,&lt;br /&gt;          sheet_show_col_headers =&gt; sheet_show_col_headers,&lt;br /&gt;          sheet_font_name =&gt; sheet_font_name,&lt;br /&gt;          sheet_widths =&gt; sheet_widths,&lt;br /&gt;          sheet_titles =&gt; sheet_titles,&lt;br /&gt;          sheet_strisheet_html =&gt; sheet_strisheet_html );&lt;br /&gt;  end show;&lt;br /&gt;--&lt;br /&gt;end spread_sheet;&lt;br /&gt;/&lt;br /&gt;show error&lt;br /&gt;declare&lt;br /&gt;    l_cursor number := dbms_sql.open_cursor;&lt;br /&gt;    output utl_file.file_type;&lt;br /&gt;begin&lt;br /&gt;    output := utl_file.fopen( 'c:\temp\', 'emp2.slk', 'w',32000 );&lt;br /&gt;&lt;br /&gt;    dbms_sql.parse( l_cursor,&lt;br /&gt;        'select empno id, ename employee,&lt;br /&gt;                sal Salary, comm commission ' ||&lt;br /&gt;          'from scott.emp ' ||&lt;br /&gt;          'where job = ''MANAGER'' ' ||&lt;br /&gt;          'and sal &gt; 2000',&lt;br /&gt;        dbms_sql.native );&lt;br /&gt;&lt;br /&gt;    spread_sheet.show(&lt;br /&gt;        sheet_file =&gt; output ,&lt;br /&gt;        sheet_cursor =&gt; l_cursor,&lt;br /&gt;        sheet_sum_column =&gt;&lt;br /&gt;            spread_sheet.owaSylkArray( 'N', 'N', 'Y', 'Y' ),&lt;br /&gt;        sheet_show_grid =&gt; 'NO' );&lt;br /&gt;    dbms_sql.close_cursor( l_cursor );&lt;br /&gt;    utl_file.fclose( output );&lt;br /&gt;end;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-8405792624961786908?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VqwGiD23NHni5BenkG5zZFo6IYo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VqwGiD23NHni5BenkG5zZFo6IYo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VqwGiD23NHni5BenkG5zZFo6IYo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VqwGiD23NHni5BenkG5zZFo6IYo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/i5znO-Zblt4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/8405792624961786908/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2010/09/plsql-procedure-to-write-records-to.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/8405792624961786908?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/8405792624961786908?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/i5znO-Zblt4/plsql-procedure-to-write-records-to.html" title="PL/SQL Procedure to write records to excel" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2010/09/plsql-procedure-to-write-records-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IGRHg6eyp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-5475282143444362156</id><published>2010-09-26T00:38:00.001+05:30</published><updated>2011-03-05T21:08:45.613+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:08:45.613+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Oracle DBA" /><title>Password Encrypt Query in Oracle</title><content type="html">CREATE OR REPLACE PACKAGE ENCRY_PASS AS&lt;br /&gt;
FUNCTION encrypt( Str VARCHAR2 ) RETURN RAW;&lt;br /&gt;
FUNCTION decrypt( xCrypt VARCHAR2 ) RETURN VARCHAR2;&lt;br /&gt;
END ENCRY_PASS;&lt;br /&gt;
/&lt;br /&gt;
&lt;br /&gt;
CREATE OR REPLACE PACKAGE BODY ENCRY_PASS AS&lt;br /&gt;
crypt_raw RAW(2000);&lt;br /&gt;
crypt_str VARCHAR(2000);&lt;br /&gt;
&lt;br /&gt;
-- Encrypt the string --&lt;br /&gt;
FUNCTION encrypt( Str VARCHAR2 ) RETURN RAW AS&lt;br /&gt;
&lt;br /&gt;
l INTEGER := LENGTH(str);&lt;br /&gt;
i INTEGER;&lt;br /&gt;
padblock RAW(2000);&lt;br /&gt;
Cle RAW(8) := UTL_RAW.CAST_TO_RAW('frankzap');&lt;br /&gt;
&lt;br /&gt;
BEGIN&lt;br /&gt;
i := 8-MOD(l,8);&lt;br /&gt;
padblock := utl_raw.cast_to_raw(str||RPAD(CHR(i),i,CHR(i)));&lt;br /&gt;
&lt;br /&gt;
dbms_obfuscation_toolkit.DESEncrypt(&lt;br /&gt;
input     =&gt; padblock,&lt;br /&gt;
KEY       =&gt; Cle,&lt;br /&gt;
encrypted_data =&gt; crypt_raw );&lt;br /&gt;
RETURN crypt_raw ;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
-- Decrypt the string --&lt;br /&gt;
FUNCTION decrypt( xCrypt VARCHAR2 ) RETURN VARCHAR2 AS&lt;br /&gt;
l NUMBER;&lt;br /&gt;
Cle RAW(8) := UTL_RAW.CAST_TO_RAW('frankzap');&lt;br /&gt;
crypt_raw RAW(2000) := utl_raw.cast_to_raw(utl_raw.cast_to_varchar2(xCrypt)) ;&lt;br /&gt;
BEGIN&lt;br /&gt;
dbms_obfuscation_toolkit.DESDecrypt(&lt;br /&gt;
input     =&gt; xCrypt,&lt;br /&gt;
KEY       =&gt; Cle,&lt;br /&gt;
decrypted_data =&gt; crypt_raw );&lt;br /&gt;
crypt_str := utl_raw.cast_to_varchar2(crypt_raw);&lt;br /&gt;
l := LENGTH(crypt_str);&lt;br /&gt;
crypt_str := RPAD(crypt_str,l-ASCII(SUBSTR(crypt_str,l)));&lt;br /&gt;
RETURN crypt_str;&lt;br /&gt;
END;&lt;br /&gt;
END ENCRY_PASS;&lt;br /&gt;
/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-5475282143444362156?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_xCzVx8E7LzIPT-PzxjSISDAZhY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_xCzVx8E7LzIPT-PzxjSISDAZhY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_xCzVx8E7LzIPT-PzxjSISDAZhY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_xCzVx8E7LzIPT-PzxjSISDAZhY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/79V3CRUu6dI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/5475282143444362156/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2010/09/password-encrypt-query-in-oracle.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/5475282143444362156?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/5475282143444362156?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/79V3CRUu6dI/password-encrypt-query-in-oracle.html" title="Password Encrypt Query in Oracle" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2010/09/password-encrypt-query-in-oracle.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IBQncyeyp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-7832432775517788801</id><published>2010-09-26T00:35:00.002+05:30</published><updated>2011-03-05T21:09:13.993+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:09:13.993+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Oracle DBA" /><title>Locked Query Script in Oracle 10g</title><content type="html">SELECT OBJECT_NAME, SQL_TEXT,SID, OSUSER, SCHEMANAME, RECURSIVE, LAST_CALL_ET/(60) MINUTES, &lt;br /&gt;
(case type when 'TM' then 'DML/TABLE LOCK' &lt;br /&gt;
when 'TX' then 'TRANSACTION LOCK' &lt;br /&gt;
when 'MR' then 'MEDIA RECOVERY'&lt;br /&gt;
when 'ST' then 'DISK SPACE TRANSACTION'&lt;br /&gt;
when 'UL' then 'USER SUPPLIED'&lt;br /&gt;
else 'LOCKED'&lt;br /&gt;
end) LOCK_TYPE, &lt;br /&gt;
decode(lmode,0,'NONE',1,'NULL',2,'ROW S',3,'ROW X',4,'TABLE S',5,'SHARED ROW X',6,'TABLE X',NULL) LOCK_MODE,&lt;br /&gt;
decode(REQUEST,0,'NONE',1,'NULL',2,'ROW S',3,'ROW X',4,'TABLE S',5,'SHARED ROW X',6,'TABLE X',NULL) REQUEST, CTIME/(60) LOCKED_SINCE_MIN&lt;br /&gt;
FROM V$TRANSACTION JOIN V$SESSION ON SADDR = SES_ADDR JOIN V$LOCK USING (SID)&lt;br /&gt;
JOIN V$SQLAREA ON ADDRESS = PREV_SQL_ADDR AND HASH_VALUE = PREV_HASH_VALUE&lt;br /&gt;
JOIN V$LOCKED_OBJECT ON SID=SESSION_ID&lt;br /&gt;
JOIN DBA_OBJECTS USING (OBJECT_ID)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-7832432775517788801?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NTysab2PfjPXgljHzGDE3Agz09A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NTysab2PfjPXgljHzGDE3Agz09A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NTysab2PfjPXgljHzGDE3Agz09A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NTysab2PfjPXgljHzGDE3Agz09A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/wX0W_8QCgg4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/7832432775517788801/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2010/09/locked-query-script-in-oracle-10g.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/7832432775517788801?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/7832432775517788801?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/wX0W_8QCgg4/locked-query-script-in-oracle-10g.html" title="Locked Query Script in Oracle 10g" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2010/09/locked-query-script-in-oracle-10g.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0ICSX04eCp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-6009296480236028892</id><published>2010-09-26T00:34:00.002+05:30</published><updated>2011-03-05T21:09:28.330+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:09:28.330+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Oracle DBA" /><title>Locked Query Script in Oracle 9i</title><content type="html">SELECT OBJECT_NAME, SID, OSUSER, SCHEMANAME, RECURSIVE, LAST_CALL_ET/(60) MINUTES, &lt;br /&gt;
(case type when 'TM' then 'DML/TABLE LOCK' &lt;br /&gt;
when 'TX' then 'TRANSACTION LOCK' &lt;br /&gt;
when 'MR' then 'MEDIA RECOVERY'&lt;br /&gt;
when 'ST' then 'DISK SPACE TRANSACTION'&lt;br /&gt;
when 'UL' then 'USER SUPPLIED'&lt;br /&gt;
else 'LOCKED'&lt;br /&gt;
end) LOCK_TYPE, &lt;br /&gt;
decode(lmode,0,'NONE',1,'NULL',2,'ROW S',3,'ROW X',4,'TABLE S',5,'SHARED ROW X',6,'TABLE X',NULL) LOCK_MODE,&lt;br /&gt;
decode(REQUEST,0,'NONE',1,'NULL',2,'ROW S',3,'ROW X',4,'TABLE S',5,'SHARED ROW X',6,'TABLE X',NULL) REQUEST,&lt;br /&gt;
CTIME/(60) LOCKED_SINCE_MIN,SQL_TEXT&lt;br /&gt;
FROM V$TRANSACTION JOIN V$SESSION ON SADDR = SES_ADDR JOIN V$LOCK USING (SID)&lt;br /&gt;
JOIN V$SQLAREA ON HASH_VALUE = SQL_HASH_VALUE AND SQL_ADDRESS = ADDRESS&lt;br /&gt;
JOIN V$LOCKED_OBJECT ON SID=SESSION_ID&lt;br /&gt;
JOIN DBA_OBJECTS USING (OBJECT_ID)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-6009296480236028892?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/i4mcy6FGboJTZpNWBlewddRgJHg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i4mcy6FGboJTZpNWBlewddRgJHg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/i4mcy6FGboJTZpNWBlewddRgJHg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i4mcy6FGboJTZpNWBlewddRgJHg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/7ytgBdG6baQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/6009296480236028892/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2010/09/locked-query-script-in-oracle-9i.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/6009296480236028892?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/6009296480236028892?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/7ytgBdG6baQ/locked-query-script-in-oracle-9i.html" title="Locked Query Script in Oracle 9i" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2010/09/locked-query-script-in-oracle-9i.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EERHk7fyp7ImA9Wx9aE04.&quot;"><id>tag:blogger.com,1999:blog-5358832114629268695.post-6778140116667447528</id><published>2010-09-26T00:32:00.002+05:30</published><updated>2011-03-05T21:10:05.707+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-05T21:10:05.707+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Oracle DBA" /><title>Detailed Lock Scripts in Oracle</title><content type="html">prompt "Identify the blocking session"&lt;br /&gt;
prompt "================================================="&lt;br /&gt;
&lt;br /&gt;
select * from v$lock ;&lt;br /&gt;
&lt;br /&gt;
prompt ""&lt;br /&gt;
prompt ""&lt;br /&gt;
prompt ""&lt;br /&gt;
prompt "Note the BLOCK column. If a session holds a lock that's blocking another session, BLOCK=1."&lt;br /&gt;
prompt "Further, you can tell which session is being blocked by comparing the values in ID1 and ID2."&lt;br /&gt;
prompt "The blocked session will have the same values in ID1 and ID2 as the blocking session,"&lt;br /&gt;
prompt "and, since it is requesting a lock it's unable to get, it will have REQUEST &gt; 0."&lt;br /&gt;
prompt ""&lt;br /&gt;
prompt ""&lt;br /&gt;
&lt;br /&gt;
prompt "================================================="&lt;br /&gt;
prompt "Detailed View"&lt;br /&gt;
prompt "================================================="&lt;br /&gt;
&lt;br /&gt;
select l1.sid, ' IS BLOCKING ', l2.sid&lt;br /&gt;
from v$lock l1, v$lock l2&lt;br /&gt;
where l1.block =1 and l2.request &gt; 0&lt;br /&gt;
and l1.id1=l2.id1&lt;br /&gt;
and l1.id2=l2.id2;&lt;br /&gt;
&lt;br /&gt;
prompt ""&lt;br /&gt;
prompt ""&lt;br /&gt;
prompt "================================================="&lt;br /&gt;
prompt "Readable View"&lt;br /&gt;
prompt "================================================="&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
select s1.username || '@' || s1.machine|| ' ( SID=' || s1.sid || ' )  is blocking '|| s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status&lt;br /&gt;
from v$lock l1, v$session s1, v$lock l2, v$session s2&lt;br /&gt;
where s1.sid=l1.sid and s2.sid=l2.sid&lt;br /&gt;
and l1.BLOCK=1 and l2.request &gt; 0&lt;br /&gt;
and l1.id1 = l2.id1&lt;br /&gt;
and l2.id2 = l2.id2 ;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5358832114629268695-6778140116667447528?l=venkat-freetutorials.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ed9C-pEsaAmHZx-ZkU6LoE3bPmE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ed9C-pEsaAmHZx-ZkU6LoE3bPmE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ed9C-pEsaAmHZx-ZkU6LoE3bPmE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ed9C-pEsaAmHZx-ZkU6LoE3bPmE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/bCpN/~4/67pxtHnBK1o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://venkat-freetutorials.blogspot.com/feeds/6778140116667447528/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://venkat-freetutorials.blogspot.com/2010/09/detailed-lock-scripts-in-oracle.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/6778140116667447528?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5358832114629268695/posts/default/6778140116667447528?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/bCpN/~3/67pxtHnBK1o/detailed-lock-scripts-in-oracle.html" title="Detailed Lock Scripts in Oracle" /><author><name>venkat</name><uri>http://www.blogger.com/profile/01962962780072861209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://venkat-freetutorials.blogspot.com/2010/09/detailed-lock-scripts-in-oracle.html</feedburner:origLink></entry></feed>

