<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5510749163670835379</id><updated>2012-02-14T11:45:48.364+02:00</updated><category term='SQL'/><category term='Oracle Database'/><category term='Oracle Enterprise Manager Grid Control'/><category term='Course Notes'/><category term='Article'/><category term='SQL Server'/><category term='Solaris'/><category term='PLSQL'/><category term='11g New Features'/><category term='Oracle RAC'/><category term='RMAN'/><category term='Oracle Security'/><category term='Tutorial'/><category term='Streams'/><category term='Google Apps'/><category term='ASM'/><title type='text'>Ergem PEKER 's Oracle Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>50</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-8055525950241399738</id><published>2011-10-19T16:36:00.000+03:00</published><updated>2011-10-19T16:36:39.752+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='11g New Features'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle RAC'/><title type='text'>Oracle Restart hands on</title><content type='html'>Starting from Oracle Database 11g, a new product (or functionality) called Oracle Restart comes with the part of the Grid Infrastructure installation. It seems Oracle decided to use crsctl, crs_stat, and srvctl like RAC commands for also managing the processes of the single instance databases. This standardization seems handy to me as i have already get used to manage RAC databases day by day. &lt;br /&gt;&lt;br /&gt;After upgraded one of the development databases in our data center from 10.2.0.4 to 11.2.0.2 as well as the ASM instance, i decided to spend some of my time to play with this new functionality. &lt;br /&gt;&lt;br /&gt;As on the RAC installations status of the services can be investigated with the &lt;font face='courier'&gt;crs_stat -t&lt;/font&gt; command. I think it is understandable that there is not vip, ons, gsd services here as this is not a RAC database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;[oracle@rhel6]:/oracle &gt; crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host        &lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora...._ASM.dg ora....up.type ONLINE    OFFLINE               &lt;br /&gt;ora....ER.lsnr ora....er.type OFFLINE   OFFLINE               &lt;br /&gt;ora.asm        ora.asm.type   OFFLINE   OFFLINE               &lt;br /&gt;ora.cssd       ora.cssd.type  ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.diskmon    ora....on.type ONLINE    ONLINE    rhel6 &lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt; crs_stat&lt;br /&gt;NAME=ora.DG_DB_ASM.dg&lt;br /&gt;TYPE=ora.diskgroup.type&lt;br /&gt;TARGET=ONLINE&lt;br /&gt;STATE=OFFLINE&lt;br /&gt;&lt;br /&gt;NAME=ora.LISTENER.lsnr&lt;br /&gt;TYPE=ora.listener.type&lt;br /&gt;TARGET=OFFLINE&lt;br /&gt;STATE=OFFLINE&lt;br /&gt;&lt;br /&gt;NAME=ora.asm&lt;br /&gt;TYPE=ora.asm.type&lt;br /&gt;TARGET=OFFLINE&lt;br /&gt;STATE=OFFLINE&lt;br /&gt;&lt;br /&gt;NAME=ora.cssd&lt;br /&gt;TYPE=ora.cssd.type&lt;br /&gt;TARGET=ONLINE&lt;br /&gt;STATE=ONLINE on rhel6&lt;br /&gt;&lt;br /&gt;NAME=ora.diskmon&lt;br /&gt;TYPE=ora.diskmon.type&lt;br /&gt;TARGET=ONLINE&lt;br /&gt;STATE=ONLINE on rhel6 &lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The processes of the CRS (it is "HAS" for single instance) is again controlled by &lt;font face='courier'&gt;crsctl&lt;/font&gt; as it is in the RAC installations. You can use &lt;u&gt;check, start, stop&lt;/u&gt; options to manage the processes as usual. A small note; CRS processes in the RAC installation is not installed for the single instance installations. For the single instance installations, there is the HAS processes stands for "High Availability Services" and covers the cssd and diskmon processes. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;[oracle@rhel6]:/oracle &gt; crsctl check has&lt;br /&gt;CRS-4638: Oracle High Availability Services is online&lt;br /&gt;[oracle@rhel6]:/oracle &gt; crsctl check css&lt;br /&gt;CRS-4529: Cluster Synchronization Services is online&lt;br /&gt;[oracle@rhel6]:/oracle &gt; crsctl check resource ora.cssd&lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt; crsctl stop has&lt;br /&gt;CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rhel6'&lt;br /&gt;CRS-2673: Attempting to stop 'ora.cssd' on 'rhel6'&lt;br /&gt;CRS-2677: Stop of 'ora.cssd' on 'rhel6' succeeded&lt;br /&gt;CRS-2673: Attempting to stop 'ora.diskmon' on 'rhel6'&lt;br /&gt;CRS-2677: Stop of 'ora.diskmon' on 'rhel6' succeeded&lt;br /&gt;CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rhel6' has completed&lt;br /&gt;CRS-4133: Oracle High Availability Services has been stopped.&lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt; crs_stat -t&lt;br /&gt;CRS-0184: Cannot communicate with the CRS daemon.&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After my upgrade process Oracle Restart could not be able to manage the upgraded database. By using srvctl i added the database resource to the repository so that i can manage the database services by using srvctl command line tool. One of the nicest option is, by using the "-a" option and supplying dependent diskgroups of the database makes Oracle Restart to start the ASM and mount the related diskgroups before starting up the database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;[oracle@rhel6]:/oracle &gt; crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host        &lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora...._ASM.dg ora....up.type ONLINE    ONLINE    rhel6   &lt;br /&gt;ora....ER.lsnr ora....er.type ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.asm        ora.asm.type   ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.cssd       ora.cssd.type  ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.diskmon    ora....on.type ONLINE    ONLINE    rhel6   &lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt; srvctl add database -h          &lt;br /&gt;&lt;br /&gt;Adds a database configuration to be managed by Oracle Restart.&lt;br /&gt;&lt;br /&gt;Usage: srvctl add database -d &lt;db_unique_name&gt; -o &lt;oracle_home&gt; &lt;br /&gt;  [-m &lt;domain_name&gt;] &lt;br /&gt;  [-p &lt;spfile&gt;] &lt;br /&gt;  [-r {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY}] &lt;br /&gt;  [-s &lt;start_options&gt;] &lt;br /&gt;  [-t &lt;stop_options&gt;] &lt;br /&gt;  [-n &lt;db_name&gt;] &lt;br /&gt;  [-y {AUTOMATIC | MANUAL}] &lt;br /&gt;  [-a "&lt;diskgroup_list&gt;"]&lt;br /&gt;-d &lt;db_unique_name&gt;      Unique name for the database&lt;br /&gt;-o &lt;oracle_home&gt;         ORACLE_HOME path&lt;br /&gt;-m &lt;domain&gt;              Domain for database. Must be set if database has DB_DOMAIN set.&lt;br /&gt;-p &lt;spfile&gt;              Server parameter file path&lt;br /&gt;-r &lt;role&gt;                Role of the database (primary, physical_standby, logical_standby, snapshot_standby)&lt;br /&gt;-s &lt;start_options&gt;       Startup options for the database. Examples of startup options are open, mount, or nomount.&lt;br /&gt;-t &lt;stop_options&gt;        Stop options for the database. Examples of shutdown options are normal, transactional, immediate, or abort.&lt;br /&gt;-n &lt;db_name&gt;        Database name (DB_NAME), if different from the unique name given by the -d option&lt;br /&gt;-y &lt;dbpolicy&gt;            Management policy for the database (AUTOMATIC or MANUAL)&lt;br /&gt;-a "&lt;diskgroup_list&gt;"      Comma separated list of disk groups&lt;br /&gt;-h                       Print usage&lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt; srvctl add database -d ORCLT -o /oracle/orahome1&lt;br /&gt;[oracle@rhel6]:/oracle &gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt;&lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt; crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host        &lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora...._ASM.dg ora....up.type ONLINE    ONLINE    rhel6   &lt;br /&gt;ora....ER.lsnr ora....er.type ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.asm        ora.asm.type   ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.ORCLT.db   ora....se.type OFFLINE   OFFLINE               &lt;br /&gt;ora.cssd       ora.cssd.type  ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.diskmon    ora....on.type ONLINE    ONLINE    rhel6   &lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt; srvctl start database -d ORCLT&lt;br /&gt;[oracle@rhel6]:/oracle &gt; ps -ef | grep smon&lt;br /&gt;oracle  9109530        1   0 15:46:08      -  0:00 ora_smon_ORCLT&lt;br /&gt;oracle 11075806        1   0 15:43:50      -  0:00 asm_smon_+ASM&lt;br /&gt;[oracle@rhel6]:/oracle &gt;&lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt;                                                                                                     &lt;br /&gt;[oracle@rhel6]:/oracle &gt;&lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt; srvctl status database -d ORCLT&lt;br /&gt;Database is running.&lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt;            &lt;br /&gt;                    &lt;br /&gt;[oracle@rhel6]:/oracle &gt; crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host        &lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora...._ASM.dg ora....up.type ONLINE    ONLINE    rhel6   &lt;br /&gt;ora....ER.lsnr ora....er.type ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.asm        ora.asm.type   ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.ORCLT.db   ora....se.type ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.cssd       ora.cssd.type  ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.diskmon    ora....on.type ONLINE    ONLINE    rhel6   &lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt;&lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt; srvctl stop database -d ORCLT&lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt; crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host        &lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora...._ASM.dg ora....up.type ONLINE    ONLINE    rhel6   &lt;br /&gt;ora....ER.lsnr ora....er.type ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.asm        ora.asm.type   OFFLINE   ONLINE    rhel6   &lt;br /&gt;ora.ORCLT.db   ora....se.type OFFLINE   OFFLINE               &lt;br /&gt;ora.cssd       ora.cssd.type  ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.diskmon    ora....on.type ONLINE    ONLINE    rhel6&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The second handy feature is "enable" and "disable" of the &lt;font face='courier'&gt;srvctl&lt;/font&gt; which configures the related objects restart options on host restart or restart of the process on failure.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;[oracle@rhel6]:/oracle &gt; srvctl enable -h &lt;br /&gt;&lt;br /&gt;The SRVCTL enable command enables the named object so that it can run under &lt;br /&gt;  Oracle Restart for automatic startup, failover, or restart.&lt;br /&gt;&lt;br /&gt;Usage: srvctl enable database -d &lt;db_unique_name&gt;&lt;br /&gt;Usage: srvctl enable service -d &lt;db_unique_name&gt; -s "&lt;service_name_list&gt;"&lt;br /&gt;Usage: srvctl enable asm&lt;br /&gt;Usage: srvctl enable listener [-l &lt;lsnr_name&gt;]&lt;br /&gt;Usage: srvctl enable diskgroup -g &lt;dg_name&gt;&lt;br /&gt;Usage: srvctl enable ons [-v]&lt;br /&gt;Usage: srvctl enable eons [-v]&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Shutting down everything nicely with Oracle Restart.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;[oracle@rhel6]:/oracle &gt; srvctl stop database -d ORCLT&lt;br /&gt;[oracle@rhel6]:/oracle &gt; srvctl stop diskgroup -g DG_DB_ASM&lt;br /&gt;[oracle@rhel6]:/oracle &gt; srvctl stop asm&lt;br /&gt;[oracle@rhel6]:/oracle &gt; srvctl stop listener&lt;br /&gt;&lt;br /&gt;[oracle@rhel6]:/oracle &gt; crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host        &lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora...._ASM.dg ora....up.type OFFLINE   OFFLINE               &lt;br /&gt;ora....ER.lsnr ora....er.type OFFLINE   OFFLINE               &lt;br /&gt;ora.asm        ora.asm.type   OFFLINE   OFFLINE               &lt;br /&gt;ora.ORCLT.db   ora....se.type OFFLINE   OFFLINE               &lt;br /&gt;ora.cssd       ora.cssd.type  ONLINE    ONLINE    rhel6   &lt;br /&gt;ora.diskmon    ora....on.type ONLINE    ONLINE    rhel6  &lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;resources:&lt;/u&gt;&lt;br /&gt;http://download.oracle.com/docs/cd/E14072_01/server.112/e10595/restart001.htm&lt;br /&gt;$ srvctl -h&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-8055525950241399738?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/8055525950241399738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2011/10/oracle-restart-hands-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/8055525950241399738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/8055525950241399738'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2011/10/oracle-restart-hands-on.html' title='Oracle Restart hands on'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-5303334352454327777</id><published>2011-09-12T23:47:00.000+03:00</published><updated>2011-09-12T23:47:33.716+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Article'/><title type='text'>Random Data Generation and DBMS_RANDOM</title><content type='html'>Generating random data itself is already a subject of its own. But here i can only write about the needs of random data in a database environment and how a database developer or administrator can generate the random data to fulfill his/her requirements. I personally used random data generation in three main purposes up to now.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;DATAMASKING&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Almost in every company i have worked for, datamasking is a must-have procedure for test data generation, especially after restoring production data to a prelive or day-1 database. In common sense just truncating the sensitive data or updating the columns to NULL maybe enough for security purposes. But in some individual cases application logic needs to continue which depends on the data availability. In such cases there are two main roadmaps, hashing the real data and un-identify it or some random data may be generated for representing the real sensitive data. The generated data may also ensure the formatting of the known structures such as credit card information, postal code or telephone number of the customers.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;PASSWORD GENERATION&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;After applying the new password policy to our database, forgotten passwords by the end users are not recovered that easily because of the password complexity functions (by applying password verify function) and the password_reuse_max parameter of the profile. This means that, the portal used by the level-1 support is not enough as the procedure lies behind the button is simply changes the password to a default value which is not changed from the beginning of the procedure at all, which causes ORA-28007: the password cannot be reused exception. &lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;TEST DATA GENERATION&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;In order to test any functionality or any new features by myself, generating data for newly created tables is a necessity. Formatted varchar2 and number columns are very handy to test some functionalities and how some functionalities behave in large amount of structured table data.&lt;br /&gt;&lt;br /&gt;Dictionary views can be used for this purpose but If it is not enough for the individual test conditions then generation a random data within the desired format is crucial.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;DBMS_RANDOM PACKAGE&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;For all the mentioned purposes, oracle database has a built-in package which is DBMS_RANDOM to generate random data. There are several functions in this package which can be used to obtain same results with some manipulation of the output values. Main functions to produce random number would be;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;DBMS_RANDOM.VALUE()&lt;/u&gt; whichs output value is NUMBER datatype, this means you can produce up to 32 digit numbers.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;select dbms_random.value() as result from dual;&lt;br /&gt;&lt;br /&gt;RESULT&lt;br /&gt;------&lt;br /&gt;0.33363563290178533954768590716355821427&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;DBMS_RANDOM.VALUE(arg1 number, arg2 number)&lt;/u&gt; returns a random value between the supplied limits. The following sql should return a random number between 1 and 20.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;select dbms_random.value(1,20) as result from dual;&lt;br /&gt;&lt;br /&gt;RESULT&lt;br /&gt;------&lt;br /&gt;14.25291834803147861791906299688905822678&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;DBMS_RANDOM.STRING()&lt;/u&gt; function can also be used in order to generate a random character or a string. Function has two parameters one for the type of characters to be used and the second parameter for the length of the string. The following function definition is copied here from and Oracle 11gR2 databases DBMS_RANDOM package spec. It explains itself very well and nothing needs to be added.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;FUNCTION string (opt char, len NUMBER)&lt;br /&gt;&lt;br /&gt;/* &lt;br /&gt;"opt" specifies that the returned string may contain:&lt;br /&gt;&lt;br /&gt;'u','U': upper case alpha characters only&lt;br /&gt;'l','L': lower case alpha characters only&lt;br /&gt;'a','A': alpha characters only (mixed case)&lt;br /&gt;'x','X': any alpha-numeric characters 'p','P': any printable characters&lt;br /&gt;*/&lt;br /&gt;RETURN VARCHAR2;  &lt;br /&gt;--string of &lt;len&gt; characters&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So, if you need to produce some random string with 8 characters long and all characters are alpha numeric and lower case then it is easy by using the DBMS_RANDOM.STRING() function:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;select dbms_random.string('l',8) as result from dual;&lt;br /&gt;&lt;br /&gt;RESULT&lt;br /&gt;------&lt;br /&gt;yhxctomv&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;DBMS_RANDOM BY EXAMPLES&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;All the explanations of the examples can be found in the document that i shared from &lt;a href='https://docs.google.com/viewer?a=v&amp;pid=explorer&amp;chrome=true&amp;srcid=0B4iHu58AFesMODZiYmYzMDgtMzhlZC00MjkwLWJhYzQtYTRjMGFkOWU0MmVh&amp;hl=en_US'&gt;here&lt;/a&gt;. You can also find the link at the bottom of this post to the same document.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;--------------------------&lt;br /&gt;--masking the card numbers&lt;br /&gt;--Ex.1&lt;br /&gt;--------------------------&lt;br /&gt;select &lt;br /&gt;lpad(round(dbms_random.value*power(10,4)),4,0) || '-' ||&lt;br /&gt;lpad(round(dbms_random.value*power(10,4)),4,0) || '-' ||&lt;br /&gt;lpad(round(dbms_random.value*power(10,4)),4,0) || '-' ||&lt;br /&gt;lpad(round(dbms_random.value*power(10,4)),4,0)  as card_number&lt;br /&gt;from dual &lt;br /&gt;connect by level &lt;=5; &lt;br /&gt;/*&lt;br /&gt;CARD_NUMBER&lt;br /&gt;-----------&lt;br /&gt;2877-6639-0728-5456&lt;br /&gt;6026-6002-2218-9038&lt;br /&gt;7679-8441-0899-2826&lt;br /&gt;8294-6783-6110-7988&lt;br /&gt;1836-0407-9206-3333&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;--------------------------&lt;br /&gt;--masking the card numbers&lt;br /&gt;--Ex.2&lt;br /&gt;--------------------------&lt;br /&gt;select &lt;br /&gt;ltrim(to_char(dbms_random.value(1,9999),'0000')) || '-' ||&lt;br /&gt;ltrim(to_char(dbms_random.value(1,9999),'0000')) || '-' ||&lt;br /&gt;ltrim(to_char(dbms_random.value(1,9999),'0000')) || '-' ||&lt;br /&gt;ltrim(to_char(dbms_random.value(1,9999),'0000'))  as card_number&lt;br /&gt;from dual &lt;br /&gt;connect by level &lt;=5; &lt;br /&gt;/*&lt;br /&gt;CARD_NUMBER&lt;br /&gt;-----------&lt;br /&gt;1558-9846-7194-5325&lt;br /&gt;5109-3233-0641-9209&lt;br /&gt;3081-5946-9840-6615&lt;br /&gt;4400-9638-6333-9113&lt;br /&gt;2928-9883-1771-0465&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;--------------------------&lt;br /&gt;--masking the card numbers&lt;br /&gt;--Ex.3&lt;br /&gt;--------------------------&lt;br /&gt;select &lt;br /&gt;ltrim(replace(to_char(round(dbms_random.value*power(10,16)),'0000,0000,0000,0000'),',','-')) as card_number&lt;br /&gt;from dual&lt;br /&gt;connect by level &lt;=5;&lt;br /&gt;/*&lt;br /&gt;CARD_NUMBER&lt;br /&gt;-----------&lt;br /&gt;0157-8125-6418-6025&lt;br /&gt;3829-9039-1357-9048&lt;br /&gt;2876-1086-5371-8152&lt;br /&gt;2775-1748-2591-2523&lt;br /&gt;2058-2404-1101-5320&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;--------------------------&lt;br /&gt;--masking the card numbers&lt;br /&gt;--Ex.4&lt;br /&gt;--------------------------&lt;br /&gt;select &lt;br /&gt;substr(abs(dbms_random.random),1,4) || '-' ||&lt;br /&gt;substr(abs(dbms_random.random),1,4) || '-' ||&lt;br /&gt;substr(abs(dbms_random.random),1,4) || '-' ||&lt;br /&gt;substr(abs(dbms_random.random),1,4)  as card_number&lt;br /&gt;from dual &lt;br /&gt;connect by level &lt;=5; &lt;br /&gt;/*&lt;br /&gt;CARD_NUMBER&lt;br /&gt;-----------&lt;br /&gt;8639-7576-1359-3965&lt;br /&gt;1317-1525-2526-1796&lt;br /&gt;1043-5881-1000-7113&lt;br /&gt;2106-3239-8662-3769&lt;br /&gt;1461-7473-5870-6829&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;--------------------------&lt;br /&gt;--masking the phone number&lt;br /&gt;--Ex.5&lt;br /&gt;--------------------------&lt;br /&gt;select &lt;br /&gt;  '+' || &lt;br /&gt;  round(DBMS_RANDOM.VALUE(1,99)) || '-' ||&lt;br /&gt;  round(DBMS_RANDOM.VALUE(10,99)) || '-' ||&lt;br /&gt;  round(DBMS_RANDOM.VALUE(1000000,9999999)) as phone_number&lt;br /&gt;from dual&lt;br /&gt;connect by level &lt;= 5;&lt;br /&gt;/*&lt;br /&gt;PHONE_NUMBER&lt;br /&gt;------------&lt;br /&gt;+8-44-9146987&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;----------------------&lt;br /&gt;--masking the postcode&lt;br /&gt;--Ex.6&lt;br /&gt;----------------------&lt;br /&gt;select &lt;br /&gt;  round(dbms_random.value(1000,9999)) || '-' || &lt;br /&gt;  dbms_random.string('U',2) as postcode &lt;br /&gt;from dual;&lt;br /&gt;/*&lt;br /&gt;POSTCODE&lt;br /&gt;--------&lt;br /&gt;4997-QP&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;What if, you have a password verify function which commits the passwords will be at least 8 characters long and must contain alphanumeric characters and this password complexity merged with a profile which has a password_lifetime of two month and password_reuse_max is four. If there is a predefined automatic case which explained detailly in the paper mentioned before which needs random password generation then there is the example which can be used;&lt;br/&gt;&lt;br/&gt;&lt;span style="font-size: 80%;"&gt;&lt;pre class="brush:sql"&gt;-----------------&lt;br /&gt;--random password&lt;br /&gt;--Ex.7&lt;br /&gt;-----------------&lt;br /&gt;select  &lt;br /&gt;  DBMS_RANDOM.STRING('A',1) || &lt;br /&gt;  round(DBMS_RANDOM.VALUE()*10) || &lt;br /&gt;  DBMS_RANDOM.STRING('X',6) as password &lt;br /&gt;from dual;&lt;br /&gt;/*&lt;br /&gt;PASSWORD&lt;br /&gt;--------&lt;br /&gt;w7N3C1YG&lt;br /&gt;*/&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;u&gt;&lt;b&gt;TEST DATA GENERATION&lt;/b&gt;&lt;/u&gt;&lt;br/&gt;&lt;br/&gt;I generally use two different methods while generating test data to fill the test tables. One of them is by using the DBMS_RANDOM package and the other is filling the bulk data in the columns with the same output as you can find in the following examples.&lt;br/&gt;&lt;br/&gt;In this first part of the following example, the code tries to simulate a username bu using lower case string and with random lengths between five and fifteen. The firstname starts with uppercase by using INICAP() function and the lastname is fully in uppercase by using the UPPER() inline function. The second part is not that clever and it just creates the same data over and over which can substitude a customer name or a username.&lt;br/&gt;&lt;br/&gt;&lt;span style="font-size: 80%;"&gt;&lt;pre class="brush:sql"&gt;----------------------&lt;br /&gt;--test data generation&lt;br /&gt;--Ex.8&lt;br /&gt;----------------------&lt;br /&gt;select &lt;br /&gt;  initcap(dbms_random.string('L',round(dbms_random.value(5,15)))) || ' ' || &lt;br /&gt;  upper(dbms_random.string('L',round(dbms_random.value(5,15)))) as name&lt;br /&gt;from dual&lt;br /&gt;connect by level &lt;= 5;&lt;br /&gt;/*&lt;br /&gt;NAME&lt;br /&gt;----&lt;br /&gt;Abzvsidgbcfa AGUGIR&lt;br /&gt;Wvuogptkxwhdwa IPOOXTVBLLCNPV&lt;br /&gt;Yiwcgh SGPFKJYCDISO&lt;br /&gt;Radshiyidcrst ZNKNSEYUZXVWY&lt;br /&gt;Daxeqzugq LKJILZJEYULVI&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;select&lt;br /&gt;initcap(lpad('x',round(dbms_random.value(5,15)),'x')) || ' ' || &lt;br /&gt;upper(lpad('y',round(dbms_random.value(5,15)),'y')) as name&lt;br /&gt;from dual&lt;br /&gt;connect by level &lt;= 5;&lt;br /&gt;/*&lt;br /&gt;NAME&lt;br /&gt;----&lt;br /&gt;Xxxxxxxxxxxx YYYYYYYYYYY&lt;br /&gt;Xxxxxxxxxxxxxxx YYYYYYYYYYYYY&lt;br /&gt;Xxxxxxxxxxxxxx YYYYYYYYY&lt;br /&gt;Xxxxxxxx YYYYYYYYYYY&lt;br /&gt;Xxxxxx YYYYYYYY&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select &lt;br /&gt;  initcap(lpad('x',9,'x')) || ' ' ||&lt;br /&gt;  upper(lpad('y',9,'y')) as name&lt;br /&gt;from dual&lt;br /&gt;connect by level &lt;= 5;&lt;br /&gt;/*&lt;br /&gt;NAME&lt;br /&gt;----&lt;br /&gt;Xxxxxxxxx YYYYYYYYY&lt;br /&gt;Xxxxxxxxx YYYYYYYYY&lt;br /&gt;Xxxxxxxxx YYYYYYYYY&lt;br /&gt;Xxxxxxxxx YYYYYYYYY&lt;br /&gt;Xxxxxxxxx YYYYYYYYY&lt;br /&gt;*/&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;u&gt;&lt;b&gt;GENERATING MEANINGFUL DATA&lt;/b&gt;&lt;/u&gt;&lt;br/&gt;&lt;br/&gt;Upto now, the generated data was completely dummy. For example while masking the credit card number, it wasn’t important if this was a valid card number or not, or if the names are real names or not. All the data generated were dummy random data which does not make any sense, they are just string or numbers formed by number characters or digits. &lt;br/&gt;&lt;br/&gt;But by using the following example random data can be generated which makes sense (or a little sensible than the previous methods). &lt;br/&gt;&lt;br/&gt;In this small example, there is a lookup table (which can be extended as far as the individual case needs) and the phone number generator picks up a random country code from the lookup table to generate the phone number. Every random phone number generated will have a valid country code by using the following example. Of course this example can be extended for the area codes as well.&lt;br/&gt;&lt;br/&gt;&lt;span style="font-size: 80%;"&gt;&lt;pre class="brush:sql"&gt;--------------------------&lt;br /&gt;--generating sensible data&lt;br /&gt;--Ex.9&lt;br /&gt;--------------------------&lt;br /&gt;create table t_country_codes &lt;br /&gt;  (key number(2), &lt;br /&gt;   code number(2), &lt;br /&gt;   country varchar2(20));&lt;br /&gt;   &lt;br /&gt;insert into t_country_codes values (1,1,'United States');&lt;br /&gt;insert into t_country_codes values (2,31,'Netherlands');&lt;br /&gt;insert into t_country_codes values (3,44,'United Kingdom');&lt;br /&gt;insert into t_country_codes values (4,49,'Germany');&lt;br /&gt;insert into t_country_codes values (5,90,'Turkey');&lt;br /&gt;commit;&lt;br /&gt;&lt;br /&gt;select &lt;br /&gt;  '+' || code || '-' || &lt;br /&gt;  round(dbms_random.value(10,99)) || '-' || &lt;br /&gt;  round(DBMS_RANDOM.VALUE(100000,999999)) as phone_number&lt;br /&gt;from &lt;br /&gt;  t_country_codes &lt;br /&gt;where &lt;br /&gt;  key=(select round(DBMS_RANDOM.VALUE(1,5)) from dual);&lt;br /&gt;/*  &lt;br /&gt;PHONE_NUMBER&lt;br /&gt;------------&lt;br /&gt;+31-54-732777&lt;br /&gt;*/  &lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;This post is taken from the paper i wrote for an internal use and enchanced for my blog post. You can download the paper from the following link if you have google docs access. &lt;a href='https://docs.google.com/viewer?a=v&amp;pid=explorer&amp;chrome=true&amp;srcid=0B4iHu58AFesMODZiYmYzMDgtMzhlZC00MjkwLWJhYzQtYTRjMGFkOWU0MmVh&amp;hl=en_US'&gt;Generating Random Data in Oracle 11g Database&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-5303334352454327777?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/5303334352454327777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2011/09/random-data-generation-and-dbmsrandom.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5303334352454327777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5303334352454327777'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2011/09/random-data-generation-and-dbmsrandom.html' title='Random Data Generation and DBMS_RANDOM'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-2366880058766603137</id><published>2011-08-08T11:16:00.000+03:00</published><updated>2011-08-08T11:16:23.698+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Streams'/><title type='text'>Howto Recover Archive Gap in Streams Configuration</title><content type='html'>When i realized that my archive logs are not shipping to the destination database (both the databases are version 10.2.0.4) which is using downstream capture process for streams replication it was too late that i already missed around 20 archived logs. I fixed the problem which was originated from the different service definition in the log_archive_dest_2 system parameter and the TNS alias. But what about the missing archived logs?&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class='brush:sql'&gt;--SOURCE DB&lt;br /&gt;SQL&gt; select name, value from v$parameter where name = 'log_archive_dest_2';&lt;br /&gt;&lt;br /&gt;NAME               VALUE&lt;br /&gt;----               -----&lt;br /&gt;log_archive_dest_2 SERVICE=ODSD ASYNC NOREGISTER&lt;br /&gt;                   VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)   &lt;br /&gt;                   DB_UNIQUE_NAME=ODSD&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After correcting the entry in the tnsnames.ora file log shipping started from where it paused. I tested it by simply archiving the current redolog. &lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class='brush:plain'&gt;--SOURCE DB&lt;br /&gt;SQL&gt; alter system archive log current;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SH&gt; ls&lt;br /&gt;-rw-r-----    1 oracle   dba      43451392 Aug 05 09:00 1_21759_657122256.dbf&lt;br /&gt;-rw-r-----    1 oracle   dba       8708608 Aug 05 09:57 1_21760_657122256.dbf&lt;br /&gt;&lt;br /&gt;--DESTINATION DB&lt;br /&gt;SH&gt; ls&lt;br /&gt;-rw-r-----    1 oracle   dba      15930368 Aug  4 16:38 1_21727_657122256.dbf&lt;br /&gt;-rw-r-----    1 oracle   dba       8708608 Aug  5 09:58 1_21760_657122256.dbf&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now the question how can i recover the gap between the last archivelog and the one created approximately 12 hours ago. First i should define the exact archived logs should be carried from the source to the target. I will check the capture process and see which SCN is it waiting for. As i am using a downstream capture process i should check the capture process in the target database.&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class='brush:sql'&gt;--DESTINATION DB&lt;br /&gt;SQL&gt; select capture_name, state from v$streams_capture;&lt;br /&gt;&lt;br /&gt;CAPTURE_NAME       STATE&lt;br /&gt;------------       -----&lt;br /&gt;CAPTURE_TABLE_GRP1 WAITING FOR DICTIONARY REDO: SCN 7523421102323&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I find the SCN number which is waited in the target. I should find which archived log is this scn in the source database?&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class='brush:sql'&gt;--SOURCE DB&lt;br /&gt;SQL&gt; SELECT &lt;br /&gt;  name, dest_id, sequence#, first_change#, next_change#, completion_time &lt;br /&gt;FROM V$ARCHIVED_LOG where 7523421102323 between first_change# and next_change#&lt;br /&gt;&lt;br /&gt;NAME                               DEST_ID SEQUENCE# FIRST_CHANGE# COMPLETION_TIME&lt;br /&gt;----                               ------- -------- ------------- ---------------&lt;br /&gt;/oracle/.../1_21728_657122256.dbf  1       21728    7523421102321 04/08/11 16:38:52&lt;br /&gt;ODSD,                              2       21728    7523421102321 04/08/11 16:38:54&lt;br /&gt;/oracle/.../1_21729_657122256.dbf  1       21729    7523421102323 04/08/11 16:39:10&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It seems that after sequence# 21728 archived logs are not shipped to the destination database. What i will do is to copy these archived logs manually to the destination host from the target by using OS commands. &lt;br /&gt;&lt;br /&gt;After copying the archived logs i have to register the archived logs for the streams configuration. The beginning of the register command is similar to the one we already know. And a small oppss!...&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class='brush:sql'&gt;--DESTINATION DB&lt;br /&gt;SQL&gt; alter database register logical logfile '/oracle/admin/ODSD/archive/1_21759_657122256.dbf';&lt;br /&gt;&lt;br /&gt;ORA-16225: Missing LogMiner session name for Streams&lt;br /&gt;&lt;br /&gt;SQL&gt; select name, source_database from DBA_LOGMNR_SESSION;&lt;br /&gt;&lt;br /&gt;ID NAME               SOURCE_DATABASE&lt;br /&gt;-- ----               ---------------  &lt;br /&gt;2  CAPTURE_TABLE_GRP1 CORED.CEB.LOCAL&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database register logical logfile '/oracle/admin/ODSD/archive/1_21759_657122256.dbf' for 'CAPTURE_TABLE_GRP1';&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select logmnr_session_id, name from DBA_LOGMNR_LOG; --or dba_registered_archived_log&lt;br /&gt;&lt;br /&gt;LOGMNR_SESSION_ID NAME&lt;br /&gt;----------------- ----&lt;br /&gt;2                 /oracle/admin/ODSD/archive/1_21759_657122256.dbf&lt;br /&gt;2                 /oracle/admin/ODSD/archive/1_21760_657122256.dbf&lt;br /&gt;2                 /oracle/admin/ODSD/archive/1_21761_657122256.dbf&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Lets check the capture process again. And the second oppss!..&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class='brush:sql'&gt;--DESTINATION DB&lt;br /&gt;SQL&gt; select capture_name, state from v$streams_capture;&lt;br /&gt;&lt;br /&gt;no rows selected.&lt;br /&gt;&lt;br /&gt;SQL&gt; select capture_name, status, captured_scn, applied_scn from dba_capture;&lt;br /&gt;&lt;br /&gt;CAPTURE_NAME  STATUS CAPTURED_SCN APPLIED_SCN&lt;br /&gt;------------  ------ ------------ -----------&lt;br /&gt;CAPTURE_TABLE_GRP1 ABORTED 7523421102323 7523421102323&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It seems the capture process is aborted while we are registering the archived logs. Maybe we need to restart it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class='brush:sql'&gt;SQL&gt; exec DBMS_CAPTURE_ADM.START_CAPTURE('CAPTURE_TABLE_GRP1');&lt;br /&gt;&lt;br /&gt;SQL&gt; select capture_name, state from v$streams_capture;&lt;br /&gt;&lt;br /&gt;CAPTURE_NAME       STATE&lt;br /&gt;------------       -----&lt;br /&gt;CAPTURE_TABLE_GRP1 WAITING FOR DICTIONARY REDO: SCN 7523573032011&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It seems the problem is solved and the capture process moves on with the next scn and the archived logs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-2366880058766603137?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/2366880058766603137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2011/08/howto-recover-archive-gap-in-streams.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/2366880058766603137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/2366880058766603137'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2011/08/howto-recover-archive-gap-in-streams.html' title='Howto Recover Archive Gap in Streams Configuration'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-1168186124126945152</id><published>2011-07-19T12:43:00.006+03:00</published><updated>2011-07-20T17:15:54.001+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Security'/><title type='text'>Hasty DBA's Most Probable Errors while testing TDE</title><content type='html'>Here I tested Oracle Transparent Data Encryption in 10gR2 (10.2.0.4) database which is installed on AIX 6.1 to see how it works and if there are some undocumented difficulty while using the technology. As i was too hasty and careless, i have seen most of the cheap errors. &lt;br /&gt;&lt;br /&gt;In Summary;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;ORA-28368: cannot auto-create wallet&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Solution: Create the wallet directory (in this case default wallet directory which is $ORACLE_BASE/admin/$ORACLE_SID/wallet)&lt;br /&gt;&lt;br /&gt;&lt;u&gt;ORA-28336: cannot encrypt SYS owned objects&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Solution: Do not test under SYS schema :)&lt;br /&gt;&lt;br /&gt;&lt;u&gt;ORA-39173: Encrypted data has been stored unencrypted in dump file set.&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Solution: Use encryption_password parameter to store encrypted data safe in the export dump. Else it will be plain text.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;ORA-31693:&lt;/u&gt; Table data object "ERGEMP"."T_ENCRYPTED" failed to load/unload and is being skipped due to error:&lt;br /&gt;&lt;u&gt;ORA-28336:&lt;/u&gt; cannot encrypt SYS owned objects&lt;br /&gt;&lt;br /&gt;Solution: Use your own user for exporting instead of SYS as you cannot encrypt SYS obejcts even in the export dumpfile.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Error: ORA-39087: directory name DATA_PUMP_DIR is invalid&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Solution: Dont forget to give write permission to your user which you are exporting data with :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The rest is as follows. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;[oracle@defbora01]:/oracle/admin/CORET &amp;gt; sql&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jul 14 12:18:08 2011&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; alter system set encryption key identified by "pass1234";&lt;br /&gt;alter system set encryption key identified by "pass1234"&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-28368: cannot auto-create wallet&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;[oracle@defbora01]:/oracle/admin/CORET &amp;gt; mkdir wallet&lt;br /&gt;[oracle@defbora01]:/oracle/admin/CORET &amp;gt; sql&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jul 14 12:20:03 2011&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; alter system set encryption key identified by "pass1234";&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*** ***/&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; create table t_encrypted(col1 varchar2(50) encrypt);&lt;br /&gt;create table t_encrypted(col1 varchar2(50) encrypt)&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-28336: cannot encrypt SYS owned objects&lt;br /&gt;SQL&amp;gt; create user ergemp identified by "pass1234" default tablespace users;&lt;br /&gt;&lt;br /&gt;User created.&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; &lt;br /&gt;SQL&amp;gt; &lt;br /&gt;SQL&amp;gt; grant connect, resource to ergemp;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; create table ergemp.t_encrypted(col1 varchar2(50) encrypt);&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; insert into ergemp.t_encrypted values ('this text should be encrypted');&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; commit;&lt;br /&gt;&lt;br /&gt;Commit complete.&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; select * from dba_encrypted_columns;&lt;br /&gt;&lt;br /&gt;OWNER           TABLE_NAME                     COLUMN_NAME               ENCRYPTION_ALG                SAL&lt;br /&gt;--------------- ------------------------------ ------------------------- ----------------------------- ---&lt;br /&gt;ERGEMP          T_ENCRYPTED                    COL1                      AES 192 bits key              YES&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; select * from ERGEMP.T_ENCRYPTED;&lt;br /&gt;&lt;br /&gt;COL1&lt;br /&gt;--------------------------------------------------&lt;br /&gt;this text should be encrypted&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; &lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I will test the datapump export. First i will not use the "encryption_password" parameter and search for the string of the column value if it is somewhere in the dumpfile. &lt;br /&gt;&lt;br /&gt;And then i will run the same datapump export by using the "encryption_password" parameter to be sure the column value is not readable in the dumpfile with "string" utility.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;[oracle@defbora01]:/oracle/orahome1/rdbms&amp;gt; expdp '/******** AS SYSDBA' directory=DATA_PUMP_DIR dumpfile=expdp.dmp logfile=expdp.log tables='ERGEMP.T_ENCRYPTED'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Export: Release 10.2.0.4.0 - 64bit Production on Friday, 15 July, 2011 11:53:18&lt;br /&gt;&lt;br /&gt;Copyright (c) 2003, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;Starting "SYS"."SYS_EXPORT_TABLE_01":  '/******** AS SYSDBA' directory=DATA_PUMP_DIR dumpfile=expdp.dmp logfile=expdp.log tables=ERGEMP.T_ENCRYPTED &lt;br /&gt;Estimate in progress using BLOCKS method...&lt;br /&gt;Processing object type TABLE_EXPORT/TABLE/TABLE_DATA&lt;br /&gt;Total estimation using BLOCKS method: 64 KB&lt;br /&gt;Processing object type TABLE_EXPORT/TABLE/TABLE&lt;br /&gt;Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS&lt;br /&gt;. . exported "ERGEMP"."T_ENCRYPTED"                      4.953 KB       1 rows&lt;br /&gt;ORA-39173: Encrypted data has been stored unencrypted in dump file set.&lt;br /&gt;Master table "SYS"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded&lt;br /&gt;******************************************************************************&lt;br /&gt;Dump file set for SYS.SYS_EXPORT_TABLE_01 is:&lt;br /&gt;/oracle/orahome1/rdbms/log/expdp.dmp&lt;br /&gt;Job "SYS"."SYS_EXPORT_TABLE_01" completed with 1 error(s) at 11:56:53&lt;br /&gt;&lt;br /&gt;[oracle@defbora01]:/oracle/orahome1/rdbms/log &amp;gt; strings expdp.dmp | grep "this text should be encrypted"&lt;br /&gt;this text should be encrypted&lt;br /&gt;&lt;br /&gt;[oracle@defbora01]:/oracle/orahome1/rdbms/log &amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Without using the "encryption_password", data in the export files are not safe because the they are held as in plain text as it can be seen from the previous example. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;[oracle@defbora01]:/oracle/orahome1/rdbms&amp;gt; expdp '/******** AS SYSDBA' directory=DATA_PUMP_DIR dumpfile=expdp.dmp logfile=expdp.log tables='ERGEMP.T_ENCRYPTED' encryption_password="pass1234"&lt;br /&gt;&lt;br /&gt;Export: Release 10.2.0.4.0 - 64bit Production on Friday, 15 July, 2011 13:53:56&lt;br /&gt;&lt;br /&gt;Copyright (c) 2003, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;Starting "SYS"."SYS_EXPORT_TABLE_01":  '/******** AS SYSDBA' directory=DATA_PUMP_DIR dumpfile=expdp.dmp logfile=expdp.log tables=ERGEMP.T_ENCRYPTED encryption_password=******** &lt;br /&gt;Estimate in progress using BLOCKS method...&lt;br /&gt;Processing object type TABLE_EXPORT/TABLE/TABLE_DATA&lt;br /&gt;Total estimation using BLOCKS method: 64 KB&lt;br /&gt;Processing object type TABLE_EXPORT/TABLE/TABLE&lt;br /&gt;Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS&lt;br /&gt;ORA-31693: Table data object "ERGEMP"."T_ENCRYPTED" failed to load/unload and is being skipped due to error:&lt;br /&gt;ORA-28336: cannot encrypt SYS owned objects&lt;br /&gt;Master table "SYS"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded&lt;br /&gt;******************************************************************************&lt;br /&gt;Dump file set for SYS.SYS_EXPORT_TABLE_01 is:&lt;br /&gt;/oracle/orahome1/rdbms/log/expdp.dmp&lt;br /&gt;Job "SYS"."SYS_EXPORT_TABLE_01" completed with 1 error(s) at 13:55:55&lt;br /&gt;&lt;br /&gt;[oracle@defbora01]:/oracle/orahome1/rdbms&amp;gt; expdp 'ergemp/********' directory=DATA_PUMP_DIR dumpfile=expdp.dmp logfile=expdp.log tables='ERGEMP.T_ENCRYPTED' encryption_password="pass1234"&lt;br /&gt;&lt;br /&gt;Export: Release 10.2.0.4.0 - 64bit Production on Friday, 15 July, 2011 13:59:17&lt;br /&gt;&lt;br /&gt;Copyright (c) 2003, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;ORA-39002: invalid operation&lt;br /&gt;ORA-39070: Unable to open the log file.&lt;br /&gt;ORA-39087: directory name DATA_PUMP_DIR is invalid&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; grant read,write on directory DATA_PUMP_DIR to ERGEMP;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;[oracle@defbora01]:/oracle/orahome1/rdbms&amp;gt; expdp 'ergemp/********' directory=DATA_PUMP_DIR dumpfile=expdp.dmp logfile=expdp.log tables='ERGEMP.T_ENCRYPTED' encryption_password="pass1234"&lt;br /&gt;&lt;br /&gt;Export: Release 10.2.0.4.0 - 64bit Production on Friday, 15 July, 2011 14:08:59&lt;br /&gt;&lt;br /&gt;Copyright (c) 2003, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;Starting "ERGEMP"."SYS_EXPORT_TABLE_01":  'ergemp/********' directory=DATA_PUMP_DIR dumpfile=expdp.dmp logfile=expdp.log tables=ERGEMP.T_ENCRYPTED encryption_password=******** &lt;br /&gt;Estimate in progress using BLOCKS method...&lt;br /&gt;Processing object type TABLE_EXPORT/TABLE/TABLE_DATA&lt;br /&gt;Total estimation using BLOCKS method: 64 KB&lt;br /&gt;Processing object type TABLE_EXPORT/TABLE/TABLE&lt;br /&gt;Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS&lt;br /&gt;. . exported "ERGEMP"."T_ENCRYPTED"                          5 KB       1 rows&lt;br /&gt;Master table "ERGEMP"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded&lt;br /&gt;******************************************************************************&lt;br /&gt;Dump file set for ERGEMP.SYS_EXPORT_TABLE_01 is:&lt;br /&gt;/oracle/orahome1/rdbms/log/expdp.dmp&lt;br /&gt;Job "ERGEMP"."SYS_EXPORT_TABLE_01" successfully completed at 14:10:19&lt;br /&gt;&lt;br /&gt;[oracle@defbora01]:/oracle/orahome1/rdbms/log &amp;gt; strings expdp.dmp | grep "this text should be encrypted"&lt;br /&gt;&lt;br /&gt;[oracle@defbora01]:/oracle/orahome1/rdbms/log &amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;By using the "encryption_password" while exporting the table the data in the column cannot be distinguished by digging the plain strings in the export file. &lt;br /&gt;&lt;br /&gt;&lt;u&gt;resources:&lt;/u&gt;&lt;br /&gt;&lt;a href="http://download.oracle.com/docs/cd/E11882_01/network.112/e10746/asotrans.htm#g1011122"&gt;Oracle Advanced Security Admin Guide&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-1168186124126945152?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/1168186124126945152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2011/07/hasty-dbas-most-probable-errors-while.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/1168186124126945152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/1168186124126945152'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2011/07/hasty-dbas-most-probable-errors-while.html' title='Hasty DBA&apos;s Most Probable Errors while testing TDE'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-6089370076647878430</id><published>2011-07-13T16:57:00.001+03:00</published><updated>2011-07-13T18:05:48.888+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Howto setup a manual logshipping in SQL server</title><content type='html'>Whenever i receive an error during the setup of the SQL server logshipping i was always hopeless. But from now on i have a procedure to setup a manual logshipping schedule from primary sql server to secondary. It is important to mention that i used the following structure in SQL Server 2000 and it worked like a piece of cake. &lt;br /&gt;&lt;br /&gt;In summary, the main steps are as follows;&lt;br /&gt;&lt;br /&gt;1- on primary database: create a job to backup transaction logs regularly&lt;br /&gt;2- on primary database: share the transaction log backup directory.&lt;br /&gt;3- backup and restore the database to be log shipped from prımary to secondary database&lt;br /&gt;4- on secondary database: create the following structure (tables and procedures)&lt;br /&gt;5- on secondary database: create the copy and load jobs via the created structure&lt;br /&gt;6- on secondary database: monitor the process&lt;br /&gt;&lt;br /&gt;There are 3 stored procedures and 3 tables to create;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:80%"&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;USE msdb&lt;br /&gt;CREATE TABLE backup_movement_plans&lt;br /&gt;(&lt;br /&gt;  plan_id         UNIQUEIDENTIFIER NOT NULL PRIMARY KEY CLUSTERED,&lt;br /&gt;  plan_name       sysname          NULL,&lt;br /&gt;  source_dir      NVARCHAR(256)    NOT NULL,&lt;br /&gt;  destination_dir NVARCHAR(256)    NOT NULL,&lt;br /&gt;  database_subdir BIT              NOT NULL DEFAULT (1)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;USE msdb&lt;br /&gt;CREATE TABLE backup_movement_plan_databases&lt;br /&gt;(&lt;br /&gt;plan_id  UNIQUEIDENTIFIER NOT NULL FOREIGN KEY REFERENCES       backup_movement_plans(plan_id),&lt;br /&gt;  source_database      sysname          NOT NULL,&lt;br /&gt;  destination_database sysname          NOT NULL,&lt;br /&gt;  source_server        sysname          NOT NULL DEFAULT (@@servername),&lt;br /&gt;  load_delay           INT              NOT NULL DEFAULT(0),  -- In minutes&lt;br /&gt;  load_all             BIT              NOT NULL DEFAULT(1),&lt;br /&gt;  retention_period     INT              NOT NULL DEFAULT(48), -- In hours&lt;br /&gt;  last_file_copied     NVARCHAR(256)    NULL,&lt;br /&gt;  date_last_copied     DATETIME         NULL,&lt;br /&gt;  last_file_loaded     NVARCHAR(256)    NULL,&lt;br /&gt;  date_last_loaded     DATETIME         NULL&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;USE msdb&lt;br /&gt;CREATE TABLE backup_movement_plan_history&lt;br /&gt;(&lt;br /&gt;  sequence_id          INT              NOT NULL IDENTITY UNIQUE CLUSTERED,&lt;br /&gt;  plan_id              UNIQUEIDENTIFIER NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),&lt;br /&gt;  plan_name            sysname          NOT NULL DEFAULT ('All ad-hoc plans'),&lt;br /&gt;  destination_server   sysname          NOT NULL DEFAULT (@@servername),&lt;br /&gt;  source_server        sysname          NOT NULL DEFAULT (@@servername),&lt;br /&gt;  source_database      sysname          NOT NULL,&lt;br /&gt;  destination_database sysname          NOT NULL,&lt;br /&gt;  activity             BIT              NOT NULL DEFAULT (0),&lt;br /&gt;  succeeded            BIT              NOT NULL DEFAULT (1),&lt;br /&gt;  num_files            INT              NOT NULL DEFAULT (0),&lt;br /&gt;  last_file            NVARCHAR(256)    NULL,&lt;br /&gt;  end_time             DATETIME         NOT NULL DEFAULT (GETDATE()),&lt;br /&gt;  duration             INT              NULL     DEFAULT (0),&lt;br /&gt;  error_number         INT              NOT NULL DEFAULT (0),&lt;br /&gt;  message              NVARCHAR(512)    NULL&lt;br /&gt;)  &lt;br /&gt;&lt;br /&gt;USE msdb&lt;br /&gt;CREATE PROCEDURE sp_create_backup_movement_plan&lt;br /&gt;    @name          sysname,&lt;br /&gt;    @source_dir    VARCHAR(256),&lt;br /&gt;    @dest_dir      VARCHAR(256),&lt;br /&gt;    @sub_dir       BIT = 1, -- Each database has it's own sub-directory&lt;br /&gt;    @load_job_freq INT = 5, -- In Minutes&lt;br /&gt;    @copy_job_freq INT = 5  -- In Minutes&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;BEGIN TRANSACTION&lt;br /&gt;  SET       NOCOUNT             ON&lt;br /&gt;  SET       QUOTED_IDENTIFIER   OFF&lt;br /&gt;  SET       ANSI_NULLS          ON &lt;br /&gt;&lt;br /&gt;  DECLARE   @PlanID        uniqueidentifier&lt;br /&gt;  DECLARE   @CopyJobName   sysname&lt;br /&gt;  DECLARE   @LoadJobName   sysname&lt;br /&gt;  DECLARE   @CopyCommand   VARCHAR(500)&lt;br /&gt;  DECLARE   @LoadCommand   VARCHAR(500)&lt;br /&gt;  DECLARE   @ReturnCode    INT&lt;br /&gt;&lt;br /&gt;  -- Create a GUID for the plan&lt;br /&gt;  SELECT @PlanID = NEWID()&lt;br /&gt;    &lt;br /&gt;  -- Check if a plan with the same name exists&lt;br /&gt;  IF (EXISTS (SELECT * &lt;br /&gt;              FROM   msdb.dbo.backup_movement_plans&lt;br /&gt;              WHERE  plan_name = @name ))&lt;br /&gt;  BEGIN&lt;br /&gt;    RAISERROR('A backup movement plan with the same name already exists. Specify a different name.'', 16, 1)&lt;br /&gt;    GOTO QuitWithRollback&lt;br /&gt;  END&lt;br /&gt;&lt;br /&gt;  -- Insert plan in the table&lt;br /&gt;  INSERT msdb.dbo.backup_movement_plans &lt;br /&gt;         (plan_id, plan_name, source_dir, destination_dir, database_subdir)&lt;br /&gt;  VALUES&lt;br /&gt;         (@PlanID, @name, @source_dir, @dest_dir, @sub_dir)&lt;br /&gt;&lt;br /&gt;  SELECT @CopyJobName = N'Copy Job For ' + @name&lt;br /&gt;  SELECT @LoadJobName = N'Load Job For ' + @name&lt;br /&gt;  SELECT @CopyCommand = N'EXECUTE master.dbo.xp_sqlmaint ''-CopyPlanName "' + @name + '" '' '&lt;br /&gt;  SELECT @LoadCommand = N'EXECUTE master.dbo.xp_sqlmaint ''-LoadPlanName "' + @name + '" '' '&lt;br /&gt;  &lt;br /&gt;  -- Create the load job&lt;br /&gt;  EXECUTE @ReturnCode = msdb.dbo.sp_add_job @job_name = @LoadJobName&lt;br /&gt;&lt;br /&gt;  IF (@@ERROR &lt;&gt; 0 OR @ReturnCode &lt;&gt; 0) GOTO QuitWithRollback&lt;br /&gt;&lt;br /&gt;  EXECUTE @ReturnCode = msdb.dbo.sp_add_jobstep @job_name = @LoadJobName, &lt;br /&gt;     @step_id=1,&lt;br /&gt;     @step_name = N'step1', &lt;br /&gt;     @command = @LoadCommand, &lt;br /&gt;     @subsystem = N'TSQL', &lt;br /&gt;     @on_success_step_id = 0, &lt;br /&gt;     @on_success_action = 1, &lt;br /&gt;     @on_fail_step_id = 0, &lt;br /&gt;     @on_fail_action = 2, @flags = 4&lt;br /&gt;&lt;br /&gt;  IF (@@ERROR &lt;&gt; 0 OR @ReturnCode &lt;&gt; 0) GOTO QuitWithRollback &lt;br /&gt;&lt;br /&gt;  EXECUTE @ReturnCode = msdb.dbo.sp_add_jobschedule @job_name = @LoadJobName, &lt;br /&gt;     @freq_subday_interval = @load_job_freq, &lt;br /&gt;     @name = N'sch1', &lt;br /&gt;     @enabled = 1, &lt;br /&gt;     @freq_type = 4, &lt;br /&gt;     @active_start_date = 19980402, &lt;br /&gt;     @active_start_time = 0, &lt;br /&gt;     @freq_interval = 1, &lt;br /&gt;     @freq_subday_type = 4, &lt;br /&gt;     @freq_relative_interval = 0, &lt;br /&gt;     @freq_recurrence_factor = 0, &lt;br /&gt;     @active_end_date = 99991231, &lt;br /&gt;     @active_end_time = 235959&lt;br /&gt;&lt;br /&gt;  IF (@@ERROR &lt;&gt; 0 OR @ReturnCode &lt;&gt; 0) GOTO QuitWithRollback &lt;br /&gt;&lt;br /&gt;  EXECUTE @ReturnCode = msdb.dbo.sp_add_jobserver @job_name = @LoadJobName, @server_name = N'(local)' &lt;br /&gt;&lt;br /&gt;  IF (@@ERROR &lt;&gt; 0 OR @ReturnCode &lt;&gt; 0) GOTO QuitWithRollback &lt;br /&gt;&lt;br /&gt;  -- Create the Copy Job&lt;br /&gt;  EXECUTE @ReturnCode = msdb.dbo.sp_add_job @job_name = @CopyJobName&lt;br /&gt;&lt;br /&gt;  IF (@@ERROR &lt;&gt; 0 OR @ReturnCode &lt;&gt; 0) GOTO QuitWithRollback &lt;br /&gt;&lt;br /&gt;  EXECUTE @ReturnCode = msdb.dbo.sp_add_jobstep @job_name = @CopyJobName, &lt;br /&gt;     @step_id = 1, &lt;br /&gt;     @step_name = N'step1', &lt;br /&gt;     @command = @CopyCommand, &lt;br /&gt;     @subsystem = N'TSQL', &lt;br /&gt;     @on_success_step_id = 0, &lt;br /&gt;     @on_success_action = 1, &lt;br /&gt;     @on_fail_step_id = 0, &lt;br /&gt;     @on_fail_action = 2, &lt;br /&gt;     @flags = 4&lt;br /&gt;&lt;br /&gt;  IF (@@ERROR &lt;&gt; 0 OR @ReturnCode &lt;&gt; 0) GOTO QuitWithRollback &lt;br /&gt;&lt;br /&gt;  EXECUTE @ReturnCode = msdb.dbo.sp_add_jobschedule @job_name = @CopyJobName, &lt;br /&gt;     @freq_subday_interval = @copy_job_freq, &lt;br /&gt;     @name = N'sch1', &lt;br /&gt;     @enabled = 1, &lt;br /&gt;     @freq_type = 4, &lt;br /&gt;     @active_start_date = 19980402, &lt;br /&gt;     @active_start_time = 0, &lt;br /&gt;     @freq_interval = 1, &lt;br /&gt;     @freq_subday_type = 4, &lt;br /&gt;     @freq_relative_interval = 0, &lt;br /&gt;     @freq_recurrence_factor = 0, &lt;br /&gt;     @active_end_date = 99991231, &lt;br /&gt;     @active_end_time = 235959&lt;br /&gt;&lt;br /&gt;  IF (@@ERROR &lt;&gt; 0 OR @ReturnCode &lt;&gt; 0) GOTO QuitWithRollback &lt;br /&gt;&lt;br /&gt;  EXECUTE @ReturnCode = msdb.dbo.sp_add_jobserver @job_name = @CopyJobName, @server_name = N'(local)' &lt;br /&gt;&lt;br /&gt;  IF (@@ERROR &lt;&gt; 0 OR @ReturnCode &lt;&gt; 0) GOTO QuitWithRollback &lt;br /&gt;&lt;br /&gt;COMMIT TRANSACTION          &lt;br /&gt;GOTO   EndSave              &lt;br /&gt;QuitWithRollback:&lt;br /&gt; IF (@@TRANCOUNT &gt; 0) ROLLBACK TRANSACTION &lt;br /&gt;EndSave: &lt;br /&gt;END &lt;br /&gt;&lt;br /&gt;USE msdb&lt;br /&gt;CREATE PROCEDURE sp_add_db_to_backup_movement_plan&lt;br /&gt;    @plan_id       uniqueidentifier   = NULL,&lt;br /&gt;    @plan_name     sysname            = NULL,&lt;br /&gt;    @source_db     sysname,&lt;br /&gt;    @dest_db       sysname,&lt;br /&gt;    @load_delay    INT                = 0,            -- In Minutes&lt;br /&gt;    @load_all      BIT                = 1,&lt;br /&gt;    @source_server sysname            = @@servername,&lt;br /&gt;    @retention_period INT             = 48            -- In Hours. 0 implies do not delete files &lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;    SET       NOCOUNT             ON&lt;br /&gt;    SET       QUOTED_IDENTIFIER   OFF&lt;br /&gt;    SET       ANSI_NULLS          ON &lt;br /&gt;    DECLARE   @PlanID             uniqueidentifier&lt;br /&gt;&lt;br /&gt;    if((@plan_id IS NULL) AND (@plan_name IS NULL))&lt;br /&gt;    BEGIN&lt;br /&gt;      RAISERROR('You must supply the plan name or the plan id.', 16, 1)&lt;br /&gt;      RETURN(1)&lt;br /&gt;    END&lt;br /&gt;&lt;br /&gt;    IF (@plan_id IS NULL)&lt;br /&gt;    BEGIN        &lt;br /&gt;        IF (NOT EXISTS (SELECT * &lt;br /&gt;                        FROM   msdb.dbo.backup_movement_plans&lt;br /&gt;                        WHERE  plan_name = @plan_name ) )&lt;br /&gt;        BEGIN&lt;br /&gt;          RAISERROR('Backup movement plan with this name was not found.', 16, 1)&lt;br /&gt;          RETURN(1)&lt;br /&gt;        END&lt;br /&gt;&lt;br /&gt;        IF (SELECT COUNT(*) &lt;br /&gt;            FROM   msdb.dbo.backup_movement_plans&lt;br /&gt;            WHERE  plan_name = @plan_name) &gt; 1&lt;br /&gt;        BEGIN&lt;br /&gt;          RAISERROR('There are more than one backup movement plans with this name.', 16, 1)&lt;br /&gt;          RETURN(1)&lt;br /&gt;        END&lt;br /&gt;&lt;br /&gt;        SELECT @PlanID = plan_id &lt;br /&gt;        FROM   msdb.dbo.backup_movement_plans&lt;br /&gt;        WHERE  plan_name = @plan_name&lt;br /&gt;    END&lt;br /&gt;    ELSE&lt;br /&gt;    BEGIN&lt;br /&gt;        SELECT @PlanID = @plan_id &lt;br /&gt;        IF (NOT EXISTS (SELECT * &lt;br /&gt;                        FROM   msdb.dbo.backup_movement_plans&lt;br /&gt;                        WHERE  plan_id = @plan_id ) )&lt;br /&gt;        BEGIN&lt;br /&gt;          RAISERROR('Backup movement plan with this id.', 16, 1)&lt;br /&gt;          RETURN(1)&lt;br /&gt;        END&lt;br /&gt;&lt;br /&gt;        IF (SELECT COUNT(*) &lt;br /&gt;            FROM   msdb.dbo.backup_movement_plans&lt;br /&gt;            WHERE  plan_id = @plan_id) &gt; 1&lt;br /&gt;        BEGIN&lt;br /&gt;          RAISERROR('There are more than one backup movement plans with this id.', 16, 1)&lt;br /&gt;          RETURN(1)&lt;br /&gt;        END&lt;br /&gt;    END&lt;br /&gt;&lt;br /&gt;    IF (EXISTS ( SELECT *&lt;br /&gt;                 FROM msdb.dbo.backup_movement_plan_databases&lt;br /&gt;                 WHERE plan_id = @PlanID AND source_database = @source_db AND destination_database = @dest_db ))&lt;br /&gt;    BEGIN&lt;br /&gt;      RAISERROR('These databases are already included in this plan', 16, 1)&lt;br /&gt;      RETURN(1)&lt;br /&gt;    END&lt;br /&gt;        &lt;br /&gt;    INSERT msdb.dbo.backup_movement_plan_databases&lt;br /&gt;   (plan_id, source_database, destination_database, load_delay, load_all, source_server, retention_period)&lt;br /&gt;    VALUES&lt;br /&gt;          (@PlanID, @source_db, @dest_db, @load_delay, @load_all, @source_server, @retention_period)&lt;br /&gt;END&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After creating the infrastructure you can create the transaction log backup copy and load jobs by running the following script. After running the script logshipping started via the created jobs and the process can be monitored by creating and using the following stored procedure.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:80%"&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;exec msdb..sp_create_backup_movement_plan &lt;br /&gt;  @name = "DB01_logshipping",&lt;br /&gt;  @source_dir = "\\PRMDB01\trnlogs", &lt;br /&gt;  @dest_dir = "D:\logshipping\",&lt;br /&gt;  @sub_dir = "DB01",&lt;br /&gt;  @load_job_freq =30,&lt;br /&gt;  @copy_job_freq = 30&lt;br /&gt;&lt;br /&gt;exec msdb..sp_add_db_to_backup_movement_plan &lt;br /&gt;  @plan_name = "DB01_logshipping",&lt;br /&gt;  @source_db = "DB01", &lt;br /&gt;  @dest_db = "DB01",&lt;br /&gt;  @load_delay = 10, &lt;br /&gt;  @load_all = 1,&lt;br /&gt;  @source_server = 'PRMYDB01', &lt;br /&gt;  @retention_period = 30  --in days&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is the stored procedure to monitor the log shipping process.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:80%"&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;USE msdb&lt;br /&gt;CREATE PROCEDURE dbo.sp_log_ship_status&lt;br /&gt; @p_svr         varchar( 30 ) = NULL,&lt;br /&gt; @p_db          varchar( 30 )= NULL&lt;br /&gt;AS&lt;br /&gt;Begin&lt;br /&gt;&lt;br /&gt;set nocount on&lt;br /&gt;DECLARE @dest_db char(30),&lt;br /&gt; @history_id int,&lt;br /&gt; @time_delta int&lt;br /&gt;&lt;br /&gt;CREATE TABLE #table ( destination_db  CHAR(30),&lt;br /&gt;   time_delta INT)&lt;br /&gt;&lt;br /&gt;DECLARE log_ship_cursor CURSOR&lt;br /&gt; FOR SELECT destination_database &lt;br /&gt; from backup_movement_plan_databases&lt;br /&gt;&lt;br /&gt;OPEN log_ship_cursor&lt;br /&gt;&lt;br /&gt;FETCH NEXT FROM log_ship_cursor into @dest_db&lt;br /&gt;&lt;br /&gt;WHILE @@FETCH_STATUS = 0&lt;br /&gt;BEGIN&lt;br /&gt;  set nocount on&lt;br /&gt;&lt;br /&gt;  select  @history_id = (select max(restore_history_id) &lt;br /&gt;                           from restorehistory &lt;br /&gt;                           where destination_database_name = @dest_db)&lt;br /&gt;&lt;br /&gt;  select  @time_delta = (select datediff(mi, (select backup_start_date &lt;br /&gt;                           from backupset &lt;br /&gt;                           where backup_set_id = (select backup_set_id &lt;br /&gt;                                                   from restorehistory &lt;br /&gt;                                                   where restore_history_id = @history_id)), getdate()))&lt;br /&gt;&lt;br /&gt;  INSERT INTO #table VALUES( @dest_db, @time_delta)&lt;br /&gt;  FETCH NEXT from log_ship_cursor into @dest_db &lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;close log_ship_cursor&lt;br /&gt;DEALLOCATE log_ship_cursor&lt;br /&gt;&lt;br /&gt;SELECT "Primary Srv" = CONVERT(char(30),source_server),&lt;br /&gt; "Primary DB" = CONVERT(char(30),source_database),&lt;br /&gt; "Secondary DB" = CONVERT(char(30),destination_database),&lt;br /&gt; "Delta" = time_delta,&lt;br /&gt; "Load All" = CASE WHEN (load_all = 0) THEN "No" ELSE "Yes" end,&lt;br /&gt; "Load Delay" = load_delay,&lt;br /&gt; "Save Period" = retention_period,&lt;br /&gt; "Last File Copied" = CONVERT(char(75),last_file_copied),&lt;br /&gt; "Copy Logged Time" = date_last_copied,&lt;br /&gt; "Last File Loaded" = CONVERT(char(75),last_file_loaded),&lt;br /&gt; "Load Logged Time" = date_last_loaded&lt;br /&gt;FROM  msdb..backup_movement_plan_databases,&lt;br /&gt; #table&lt;br /&gt;WHERE (@p_svr is NULL or source_server like @p_svr)&lt;br /&gt;AND (@p_db is NULL or source_database like @p_db)&lt;br /&gt;AND destination_database = destination_db&lt;br /&gt;&lt;br /&gt;drop table #table&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;-------------------------&lt;br /&gt;-- it seems it is working&lt;br /&gt;-------------------------&lt;br /&gt;dbo.log_ship_status&lt;br /&gt;/*&lt;br /&gt;Primary Srv Primary DB      Secondary DB      Delta    Load All Load Delay  Save Period Last File Copied                                 Copy Logged Time        Last File Loaded                               Load Logged Time&lt;br /&gt;----------- --------------- ----------------- -------- -------- ----------- ----------- ------------------------------------------------ ----------------------- -------------------------------------------    -----------------------&lt;br /&gt;crmsbdb01   siebeldb        siebeldb          34       Yes      1           60          \\crmsbdb01\t-logs\siebeldb\siebeldb_tlog_201... 2011-07-13 15:10:01.610 E:\t-logs\siebeldb\siebeldb_tlog_2011071314... 2011-07-13 15:00:12.563&lt;br /&gt;crmsbdb01   IVR_INTEGRATE   IVR_INTEGRATE     34       Yes      1           60          \\crmsbdb01\t-logs\IVR_INTEGRATE\IVR_INTEGRAT... 2011-07-13 15:10:03.313 E:\t-logs\IVR_INTEGRATE\IVR_INTEGRATE_tlog_... 2011-07-13 14:50:07.627&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-6089370076647878430?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/6089370076647878430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2011/07/howto-setup-manual-logshipping-in-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6089370076647878430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6089370076647878430'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2011/07/howto-setup-manual-logshipping-in-sql.html' title='Howto setup a manual logshipping in SQL server'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-7873111643055387442</id><published>2011-06-28T15:08:00.000+03:00</published><updated>2011-06-28T15:08:52.325+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>Export problem and the invalid XDB library</title><content type='html'>This was about to be a regular export to the filesystem which is running on AIX 5.1 Operating system and the Oracle Database version is 9.2.0.7 and the Oracle client version is 10.2.0.3. But the weird error just popped out and interesting search results came up. Here is the story of the export.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:80%"&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;Export: Release 10.2.0.3.0 - Production on Wed Oct 3 11:52:37 2007&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP and Data Mining options&lt;br /&gt;Export done in WE8ISO8859P9 character set and AL16UTF16 NCHAR character set&lt;br /&gt;&lt;br /&gt;About to export specified users ...&lt;br /&gt;. exporting pre-schema procedural objects and actions&lt;br /&gt;. exporting foreign function library names for user PARITEM &lt;br /&gt;. exporting PUBLIC type synonyms&lt;br /&gt;. exporting private type synonyms&lt;br /&gt;. exporting object type definitions for user PARITEM &lt;br /&gt;About to export PARITEM's objects ...&lt;br /&gt;. exporting database links&lt;br /&gt;. exporting sequence numbers&lt;br /&gt;. exporting cluster definitions&lt;br /&gt;EXP-00056: ORACLE error 600 encountered&lt;br /&gt;ORA-00600: internal error code, arguments: [unable to load XDB library], [], [], [], [], [], [], []&lt;br /&gt;EXP-00000: Export terminated unsuccessfully&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It seems there is a problem with the XDB library. When i select from dba_registry to see the components and the statuses, i realized there is a problem with the XML Database component. After investigation and searching the metalink, i came up to the a document which explains how to recreate the XML database (please see the end of the post for the related resources) &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:80%"&gt;&lt;br /&gt;&lt;pre class="brush: plain"&gt;--INVALID XML Database component&lt;br /&gt;&lt;br /&gt;SQL&gt; col comp_name format a30&lt;br /&gt;SQL&gt; set pagesize 100&lt;br /&gt;SQL&gt; select comp_name, status, version from dba_registry;&lt;br /&gt;&lt;br /&gt;COMP_NAME                      STATUS      VERSION&lt;br /&gt;------------------------------ ----------- ------------------------------&lt;br /&gt;Oracle9i Catalog Views         VALID       9.2.0.7.0&lt;br /&gt;Oracle9i Packages and Types    VALID       9.2.0.7.0&lt;br /&gt;Oracle Workspace Manager       VALID       9.2.0.1.0&lt;br /&gt;JServer JAVA Virtual Machine   VALID       9.2.0.7.0&lt;br /&gt;Oracle XDK for Java            VALID       9.2.0.9.0&lt;br /&gt;Oracle9i Java Packages         VALID       9.2.0.7.0&lt;br /&gt;Oracle Text                    VALID       9.2.0.7.0&lt;br /&gt;Oracle XML Database            INVALID     9.2.0.7.0&lt;br /&gt;Spatial                        VALID       9.2.0.7.0&lt;br /&gt;Oracle Ultra Search            VALID       9.2.0.7.0&lt;br /&gt;Oracle Data Mining             VALID       9.2.0.7.0&lt;br /&gt;OLAP Analytic Workspace        UPGRADED    9.2.0.7.0&lt;br /&gt;Oracle OLAP API                UPGRADED    9.2.0.7.0&lt;br /&gt;OLAP Catalog                   VALID       9.2.0.7.0&lt;br /&gt;&lt;br /&gt;14 rows selected.&lt;br /&gt;&lt;br /&gt;-- Dropping xml database&lt;br /&gt;SQL&gt; @?/rdbms/admin/catnoqm.sql;&lt;br /&gt;SQL&gt; drop trigger sys.xdb_installation_trigger;&lt;br /&gt;SQL&gt; drop trigger sys.dropped_xdb_instll_trigger;&lt;br /&gt;SQL&gt; drop table dropped_xdb_instll_tab;&lt;br /&gt;&lt;br /&gt;-- Recreating the xml database&lt;br /&gt;SQL&gt; startup migrate;&lt;br /&gt;SQL&gt; @?/rdbms/admin/catproc.sql;&lt;br /&gt;SQL&gt; @?/rdbms/admin/catqm.sql;&lt;br /&gt;SQL&gt; @?/rdbms/admin/dbmsxsch.sql;&lt;br /&gt;SQL&gt; @?/rdbms/admin/catxdbj.sql; -- only in 9i&lt;br /&gt;SQL&gt; @?/rdbms/admin/xdbpatch;&lt;br /&gt;&lt;br /&gt;SQL&gt; select comp_name, status, version from dba_registry;&lt;br /&gt;&lt;br /&gt;COMP_NAME                      STATUS      VERSION&lt;br /&gt;------------------------------ ----------- ------------------------------&lt;br /&gt;Oracle9i Catalog Views         VALID       9.2.0.7.0&lt;br /&gt;Oracle9i Packages and Types    VALID       9.2.0.7.0&lt;br /&gt;Oracle Workspace Manager       VALID       9.2.0.1.0&lt;br /&gt;JServer JAVA Virtual Machine   VALID       9.2.0.7.0&lt;br /&gt;Oracle XDK for Java            VALID       9.2.0.9.0&lt;br /&gt;Oracle9i Java Packages         VALID       9.2.0.7.0&lt;br /&gt;Oracle Text                    VALID       9.2.0.7.0&lt;br /&gt;Oracle XML Database            VALID       9.2.0.7.0&lt;br /&gt;Spatial                        VALID       9.2.0.7.0&lt;br /&gt;Oracle Ultra Search            VALID       9.2.0.7.0&lt;br /&gt;Oracle Data Mining             VALID       9.2.0.7.0&lt;br /&gt;OLAP Analytic Workspace        UPGRADED    9.2.0.7.0&lt;br /&gt;Oracle OLAP API                UPGRADED    9.2.0.7.0&lt;br /&gt;OLAP Catalog                   VALID       9.2.0.7.0&lt;br /&gt;&lt;br /&gt;14 rows selected.&lt;br /&gt;&lt;br /&gt;Re run the export now !...&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;u&gt;resources:&lt;/u&gt;&lt;br /&gt;http://www.oratransplant.nl/2005/11/22/unable-to-export-char-semantic-102-database/&lt;br /&gt;Note:339938.1 - Full Export From 10.2.0.1 Aborts With EXP-56 ORA-932 (Inconsistent Datatypes) EXP-0&lt;br /&gt;Note:243554.1 - How to Deinstall and Reinstall XML Database (XDB)&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-7873111643055387442?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/7873111643055387442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2011/06/export-problem-and-invalid-xdb-library.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7873111643055387442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7873111643055387442'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2011/06/export-problem-and-invalid-xdb-library.html' title='Export problem and the invalid XDB library'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-1308750104685225592</id><published>2011-06-16T14:11:00.001+03:00</published><updated>2011-06-20T15:09:46.271+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>The way of opatch 10.2.0.4 Database on AIX</title><content type='html'>&lt;span style="font-size:90%"&gt;&lt;br /&gt;&lt;pre class="brush: bash"&gt;[oracle@]:/oracle/asmhome1/OPatch &gt; opatch version&lt;br /&gt;Invoking OPatch 10.2.0.5.1&lt;br /&gt;&lt;br /&gt;OPatch Version: 10.2.0.5.1&lt;br /&gt;&lt;br /&gt;OPatch succeeded.&lt;br /&gt;&lt;br /&gt;[oracle@]:/oracle/asmhome1/OPatch &gt; cd&lt;br /&gt;[oracle@]:/oracle &gt; . .profile&lt;br /&gt;&lt;br /&gt;[oracle@]:/oracle &gt; sql&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.4.0 - Production on Wed Jun 1 09:48:52 2011&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system checkpoint;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown abort;&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;br /&gt;[oracle@]:/oracle &gt; &lt;br /&gt;[oracle@]:/oracle &gt; . .profile_asm&lt;br /&gt;[YOU HAVE NEW MAIL]&lt;br /&gt;[oracle@]:/oracle &gt; sql&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.4.0 - Production on Wed Jun 1 09:54:58 2011&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown;&lt;br /&gt;ASM diskgroups dismounted&lt;br /&gt;ASM instance shutdown&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;[oracle@]:/oracle &gt; lsnrctl stop&lt;br /&gt;&lt;br /&gt;LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production on 01-JUN-2011 09:49:09&lt;br /&gt;&lt;br /&gt;Copyright (c) 1991, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=defbora01)(PORT=1521)))&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;br /&gt;[oracle@]:/oracle/orahome1/OPatch &gt; su - &lt;br /&gt;root's Password: &lt;br /&gt;[root@]:/home/root&gt; /usr/sbin/slibclean&lt;br /&gt;[root@]:/home/root&gt;&lt;br /&gt;&lt;br /&gt;[oracle@]:/oracle &gt; cd $ORACLE_HOME/OPatch&lt;br /&gt;[oracle@]:/oracle/asmhome1/OPatch &gt; ls&lt;br /&gt;11725015                              jlib                                  opatch.pl&lt;br /&gt;README.txt                            ocm                                   opatchprereqs&lt;br /&gt;crs                                   opatch                                p11725015_10204_AIX5L-cpuapr2011.zip&lt;br /&gt;docs                                  opatch.bat                            p6880880_102000_AIX64-5L-opatch.zip&lt;br /&gt;emdpatch.pl                           opatch.ini&lt;br /&gt;[oracle@]:/oracle/asmhome1/OPatch &gt; cd 11725015 &lt;br /&gt;[oracle@]:/oracle/asmhome1/OPatch/11725015 &gt; opatch napply --skip_subset --skip_duplicate&lt;br /&gt;&lt;br /&gt;... &lt;br /&gt;(output truncated)&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;**********************************************************************&lt;br /&gt;**                       ATTENTION                                  **&lt;br /&gt;**                                                                  **&lt;br /&gt;** Please note that this Patch Installation is                      **&lt;br /&gt;** not complete until all the Post Installation instructions        **&lt;br /&gt;** noted in the Readme accompanying this patch, have been           **&lt;br /&gt;** successfully completed.                                          **&lt;br /&gt;**                                                                  **&lt;br /&gt;**********************************************************************&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The local system has been patched and can be restarted.&lt;br /&gt;&lt;br /&gt;UtilSession: N-Apply done.&lt;br /&gt;&lt;br /&gt;OPatch succeeded.&lt;br /&gt;&lt;br /&gt;[oracle@]:/oracle/asmhome1/OPatch/11725015 &gt; &lt;br /&gt;[oracle@]:/oracle/asmhome1/OPatch/11725015 &gt; opatch lsinv&lt;br /&gt;&lt;br /&gt;... &lt;br /&gt;(output truncated)&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;[oracle@]:/oracle &gt; . .profile&lt;br /&gt;[oracle@]:/oracle/orahome1/OPatch &gt; cd 11725015 &lt;br /&gt;[oracle@]:/oracle/orahome1/OPatch/11725015 &gt; opatch napply --skip_subset --skip_duplicate&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;(output truncated)&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;[oracle@]:/oracle/orahome1/OPatch/11725015 &gt; sql&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.4.0 - Production on Wed Jun 1 10:20:14 2011&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;Connected to an idle instance.&lt;br /&gt;&lt;br /&gt;SQL&gt; startup upgrade;&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 3221225472 bytes&lt;br /&gt;Fixed Size                  2087480 bytes&lt;br /&gt;Variable Size             637535688 bytes&lt;br /&gt;Database Buffers         2566914048 bytes&lt;br /&gt;Redo Buffers               14688256 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;Database opened.&lt;br /&gt;SQL&gt; @?/rdbms/admin/catbundle.sql cpu apply&lt;br /&gt;SQL&gt; @?/rdbms/admin/utlrp.sql&lt;br /&gt;&lt;br /&gt;[oracle@]:/oracle/orahome1/cpu/view_recompile &gt; ls -l&lt;br /&gt;total 24&lt;br /&gt;-rwxr-xr-x    1 oracle   dba            2095 Jul 10 2008  recompile_precheck_jan2008cpu.sql&lt;br /&gt;-rwxr-xr-x    1 oracle   dba            5143 Jul 10 2008  view_recompile_jan2008cpu.sql&lt;br /&gt;[oracle@]:/oracle/orahome1/cpu/view_recompile &gt; sql&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.4.0 - Production on Wed Jun 1 10:34:16 2011&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;br /&gt;SQL&gt; @recompile_precheck_jan2008cpu.sql;&lt;br /&gt;&lt;br /&gt;Running precheck.sql...&lt;br /&gt;&lt;br /&gt;Number of views to be recompiled :2226&lt;br /&gt;-----------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Number of objects to be recompiled :4347&lt;br /&gt;Please follow the README.txt instructions for running viewrecomp.sql&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; @view_recompile_jan2008cpu.sql;&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Commit complete.&lt;br /&gt;&lt;br /&gt;No. of Invalid Objects is :1848&lt;br /&gt;Please refer to README.html to for instructions on validating these objects&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;Logfile for the current viewrecomp.sql session is : vcomp_CORET_01Jun2011_11_47_53.log&lt;br /&gt;SQL&gt; shutdown immediate;&lt;br /&gt;Database closed.&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;SQL&gt; startup;&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 3221225472 bytes&lt;br /&gt;Fixed Size                  2087480 bytes&lt;br /&gt;Variable Size             637535688 bytes&lt;br /&gt;Database Buffers         2566914048 bytes&lt;br /&gt;Redo Buffers               14688256 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;Database opened.&lt;br /&gt;SQL&gt; &lt;br /&gt;&lt;br /&gt;SQL&gt; select bundle_series, action, version from dba_registry_history;&lt;br /&gt;&lt;br /&gt;BUNDLE_SERIES          ACTION  VERSION&lt;br /&gt;---------------------- ---------------- --------&lt;br /&gt;CPU                    APPLY CPU 10.2.0.4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT * FROM registry$history where ID = '6452863';&lt;br /&gt;&lt;br /&gt;SQL&gt; select bundle_series, action, version from registry$history where ID = '6452863';&lt;br /&gt;&lt;br /&gt;BUNDLE_SERIES                  ACTION     VERSION&lt;br /&gt;------------------------------ ---------- ------------------------------&lt;br /&gt;CPU&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-1308750104685225592?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/1308750104685225592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2011/06/way-of-opatch-10204-database-on-aix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/1308750104685225592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/1308750104685225592'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2011/06/way-of-opatch-10204-database-on-aix.html' title='The way of opatch 10.2.0.4 Database on AIX'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-5449287470259949335</id><published>2010-12-30T09:36:00.005+02:00</published><updated>2012-02-09T15:11:31.540+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle RAC'/><title type='text'>Error in checking condition of instance on node</title><content type='html'>After rebooting both rac nodes srvctl started to complain about the condition of the second node of my cluster. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:90%;color:blue"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[oracle@EPRHEL6 admin]$ srvctl status database -d orcl&lt;br /&gt;Instance ORCL1 is running on node eprhel5&lt;br /&gt;PRKO-2015 : Error in checking condition of instance on node: eprhel6&lt;br /&gt;&lt;br /&gt;[oracle@EPRHEL6 admin]$ sqlplus system/password@ORCL2&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 27 00:03:11 2010&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;ERROR:&lt;br /&gt;ORA-12514: TNS:listener does not currently know of service requested in connect&lt;br /&gt;descriptor&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Enter user-name: &lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl also complains when i was trying to start the instance on the second node. So i decided to start the instance manually by using sqlplus.&lt;br /&gt;&lt;span style="font-size:90%;color:blue"&gt;&lt;br /&gt;&lt;pre&gt;[oracle@EPRHEL6 admin]$ sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 27 00:03:24 2010&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production&lt;br /&gt;With the Partitioning, Real Application Clusters, OLAP and Data Mining options&lt;br /&gt;&lt;br /&gt;SQL&gt; startup;&lt;br /&gt;Oracle instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 599785472 bytes&lt;br /&gt;Fixed Size     2022600 bytes&lt;br /&gt;Variable Size   188744504 bytes&lt;br /&gt;Database Buffers  402653184 bytes&lt;br /&gt;Redo Buffers     6365184 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;Database opened.&lt;br /&gt;SQL&gt; alter system register;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production&lt;br /&gt;With the Partitioning, Real Application Clusters, OLAP and Data Mining options&lt;br /&gt;&lt;br /&gt;[oracle@EPRHEL6 admin]$ sqlplus system/password@ORCL2&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 27 00:04:18 2010&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production&lt;br /&gt;With the Partitioning, Real Application Clusters, OLAP and Data Mining options&lt;br /&gt;&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production&lt;br /&gt;With the Partitioning, Real Application Clusters, OLAP and Data Mining options&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;It seems there is not any problem with the instance itself. Sqlplus barely connects to the instance ORCL2. There should be a problem about the way of communication between srvctl and the instance. &lt;br /&gt;&lt;span style="font-size:90%;color:blue"&gt;&lt;br /&gt;&lt;pre&gt;[oracle@EPRHEL6 admin]$ crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host        &lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora....L1.inst application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....L2.inst application    ONLINE    UNKNOWN   eprhel6     &lt;br /&gt;ora.ORCL.db    application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....SM1.asm application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....L5.lsnr application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.gsd application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.ons application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.vip application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....SM2.asm application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....L5.lsnr application    OFFLINE   OFFLINE               &lt;br /&gt;ora....L6.lsnr application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.gsd application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.ons application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.vip application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;&lt;br /&gt;[oracle@EPRHEL6 admin]$ srvctl start listener -n EPRHEL6&lt;br /&gt;&lt;br /&gt;[oracle@EPRHEL6 admin]$ crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host        &lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora....L1.inst application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....L2.inst application    ONLINE    UNKNOWN   eprhel6     &lt;br /&gt;ora.ORCL.db    application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....SM1.asm application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....L5.lsnr application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.gsd application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.ons application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.vip application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....SM2.asm application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....L5.lsnr application    OFFLINE   OFFLINE               &lt;br /&gt;ora....L6.lsnr application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.gsd application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.ons application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.vip application    ONLINE    ONLINE    eprhel6  &lt;br /&gt;&lt;br /&gt;[oracle@EPRHEL6 admin]$ sqlplus system/password@ORCL1&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 27 00:04:35 2010&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production&lt;br /&gt;With the Partitioning, Real Application Clusters, OLAP and Data Mining options&lt;br /&gt;&lt;br /&gt;SQL&gt; show parameter listener;&lt;br /&gt;&lt;br /&gt;NAME                                 TYPE        VALUE&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;local_listener                       string&lt;br /&gt;remote_listener                      string      LISTENERS_ORCL&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production&lt;br /&gt;With the Partitioning, Real Application Clusters, OLAP and Data Mining options&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;I think there is a problem with listener configuration or the listener resource itself. But everything seems fine except that OFFLINE resource. After searching google a little bit, i found a solution indicates listener configuration. I decided to recreate the listeners with netca. I will first delete listener named LISTENER from both ASM and DB homes using netca and then recreate them only using DB home. Maybe this resolves the problem. &lt;br /&gt;&lt;br /&gt;My action plan is first stop all asm and db instances. Manually remove that OFFLINE listener which is very confusing. Remove all the listener configuration from the cluster with netca and recreate using db home. Here we go. &lt;br /&gt;&lt;span style="font-size:90%;color:blue"&gt;&lt;br /&gt;&lt;pre&gt;[oracle@EPRHEL6 db]$ lsnrctl status&lt;br /&gt;&lt;br /&gt;LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 27-DEC-2010 00:22:16&lt;br /&gt;&lt;br /&gt;Copyright (c) 1991, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))&lt;br /&gt;STATUS of the LISTENER&lt;br /&gt;------------------------&lt;br /&gt;Alias                     LISTENER_EPRHEL6&lt;br /&gt;Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production&lt;br /&gt;Start Date                27-DEC-2010 00:02:31&lt;br /&gt;Uptime                    0 days 0 hr. 19 min. 44 sec&lt;br /&gt;Trace Level               off&lt;br /&gt;Security                  ON: Local OS Authentication&lt;br /&gt;SNMP                      OFF&lt;br /&gt;Listener Parameter File   /oracle/product/asm/network/admin/listener.ora&lt;br /&gt;Listener Log File         /oracle/product/asm/network/log/listener_eprhel6.log&lt;br /&gt;Listening Endpoints Summary...&lt;br /&gt;(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.28.4.226)(PORT=1521)))&lt;br /&gt;(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.28.4.246)(PORT=1521)))&lt;br /&gt;(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;Services Summary...&lt;br /&gt;Service "+ASM" has 1 instance(s).&lt;br /&gt;Instance "+ASM2", status BLOCKED, has 1 handler(s) for this service...&lt;br /&gt;Service "+ASM_XPT" has 1 instance(s).&lt;br /&gt;Instance "+ASM2", status BLOCKED, has 1 handler(s) for this service...&lt;br /&gt;Service "ORCL" has 2 instance(s).&lt;br /&gt;Instance "ORCL1", status READY, has 1 handler(s) for this service...&lt;br /&gt;Instance "ORCL2", status READY, has 2 handler(s) for this service...&lt;br /&gt;Service "ORCLXDB" has 2 instance(s).&lt;br /&gt;Instance "ORCL1", status READY, has 1 handler(s) for this service...&lt;br /&gt;Instance "ORCL2", status READY, has 1 handler(s) for this service...&lt;br /&gt;Service "ORCL_XPT" has 2 instance(s).&lt;br /&gt;Instance "ORCL1", status READY, has 1 handler(s) for this service...&lt;br /&gt;Instance "ORCL2", status READY, has 2 handler(s) for this service...&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;br /&gt;[oracle@EPRHEL6 db]$ srvctl stop database -d orcl&lt;br /&gt;[oracle@EPRHEL6 db]$ srvctl stop asm -n EPRHEL5&lt;br /&gt;[oracle@EPRHEL6 db]$ srvctl stop asm -n EPRHEL6&lt;br /&gt;[oracle@EPRHEL6 db]$ crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host        &lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora....L1.inst application    OFFLINE   OFFLINE               &lt;br /&gt;ora....L2.inst application    OFFLINE   OFFLINE               &lt;br /&gt;ora.ORCL.db    application    OFFLINE   OFFLINE               &lt;br /&gt;ora....SM1.asm application    OFFLINE   OFFLINE               &lt;br /&gt;ora....el5.gsd application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.ons application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.vip application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....SM2.asm application    OFFLINE   OFFLINE               &lt;br /&gt;ora....L5.lsnr application    OFFLINE   OFFLINE               &lt;br /&gt;ora....el6.gsd application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.ons application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.vip application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;&lt;br /&gt;[oracle@EPRHEL6 db]$ crs_getperm ora.eprhel6.LISTENER_EPRHEL5.lsnr&lt;br /&gt;Name: ora.eprhel6.LISTENER_EPRHEL5.lsnr&lt;br /&gt;owner:oracle:rwx,pgrp:dba:rwx,other::r--,&lt;br /&gt;[oracle@EPRHEL6 db]$ crs_unregister ora.eprhel6.LISTENER_EPRHEL5.lsnr&lt;br /&gt;[oracle@EPRHEL6 db]$ crs_profile -delete ora.eprhel6.LISTENER_EPRHEL5.lsnr&lt;br /&gt;CRS-0170: The resource 'ora.eprhel6.LISTENER_EPRHEL5.lsnr' doesn't exist.&lt;br /&gt;&lt;br /&gt;[oracle@EPRHEL6 db]$ crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host        &lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora....L1.inst application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....L2.inst application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora.ORCL.db    application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....SM1.asm application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....L5.lsnr application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.gsd application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.ons application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.vip application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....SM2.asm application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....L6.lsnr application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.gsd application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.ons application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.vip application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;[oracle@EPRHEL6 db]$ srvctl status database -d orcl&lt;br /&gt;Instance ORCL1 is running on node eprhel5&lt;br /&gt;Instance ORCL2 is running on node eprhel6&lt;br /&gt;[oracle@EPRHEL6 db]$ &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;It seems problem is solved. &lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-5449287470259949335?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/5449287470259949335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2010/12/error-in-checking-condition-of-instance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5449287470259949335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5449287470259949335'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2010/12/error-in-checking-condition-of-instance.html' title='Error in checking condition of instance on node'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-6721904219674650984</id><published>2010-12-28T13:50:00.005+02:00</published><updated>2012-01-07T23:32:52.817+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle RAC'/><title type='text'>Relocating CRS Resource</title><content type='html'>I have installed a one node RAC 10gR2 on RHEL5.5 for test purposes (&lt;a href="https://docs.google.com/document/d/1owbbjHegp2fDG6zPFupnWUdyG-vk-cEzHKN06g4TWYc/edit"&gt;my 10gR2 rac on RHEL5.5 vmware installation notes&lt;/a&gt;). After adding the second node to the cluster successfully, i realized that the new nodes vip resource is running on the first node. I have seen this problem before on a solaris system but i hadnt got any time to write about that. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:80%"&gt;&lt;br /&gt;&lt;pre class="brush:bash"&gt;[root@EPRHEL6]# crsctl check crs&lt;br /&gt;CSS appears healthy&lt;br /&gt;CRS appears healthy&lt;br /&gt;EVM appears healthy&lt;br /&gt;&lt;br /&gt;[root@EPRHEL6]# crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host        &lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora....L1.inst application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora.ORCL.db    application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....SM1.asm application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....L5.lsnr application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.gsd application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.ons application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.vip application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el6.gsd application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.ons application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.vip application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;&lt;br /&gt;[root@EPRHEL6]# ping eprhel6-vip&lt;br /&gt;PING eprhel6-vip (172.28.4.226) 56(84) bytes of data.&lt;br /&gt;64 bytes from eprhel6-vip (172.28.4.226): icmp_seq=1 ttl=64 time=2.28 ms&lt;br /&gt;64 bytes from eprhel6-vip (172.28.4.226): icmp_seq=2 ttl=64 time=1.03 ms&lt;br /&gt;64 bytes from eprhel6-vip (172.28.4.226): icmp_seq=3 ttl=64 time=0.131 ms&lt;br /&gt;&lt;br /&gt;[root@EPRHEL6]# ifconfig -a&lt;br /&gt;eth0      Link encap:Ethernet  HWaddr 00:0C:29:DE:D8:FD  &lt;br /&gt;inet addr:172.28.4.246  Bcast:172.28.4.255  Mask:255.255.255.0&lt;br /&gt;inet6 addr: fe80::20c:29ff:fede:d8fd/64 Scope:Link&lt;br /&gt;UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;RX packets:36798 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;TX packets:13478 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;collisions:0 txqueuelen:1000 &lt;br /&gt;RX bytes:21057458 (20.0 MiB)  TX bytes:10660215 (10.1 MiB)&lt;br /&gt;&lt;br /&gt;eth1      Link encap:Ethernet  HWaddr 00:0C:29:DE:D8:07  &lt;br /&gt;BROADCAST MULTICAST  MTU:1500  Metric:1&lt;br /&gt;RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;TX packets:0 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;collisions:0 txqueuelen:1000 &lt;br /&gt;RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)&lt;br /&gt;&lt;br /&gt;[root@EPRHEL5]# ifconfig eth0&lt;br /&gt;eth0      Link encap:Ethernet  HWaddr 00:0C:29:B7:92:45  &lt;br /&gt;inet addr:172.28.4.245  Bcast:172.28.4.255  Mask:255.255.255.0&lt;br /&gt;inet6 addr: fe80::20c:29ff:feb7:9245/64 Scope:Link&lt;br /&gt;UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;RX packets:9074707 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;TX packets:1212938 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;collisions:0 txqueuelen:1000 &lt;br /&gt;RX bytes:1173926429 (1.0 GiB)  TX bytes:1041963477 (993.6 MiB)&lt;br /&gt;&lt;br /&gt;[root@EPRHEL5]# ifconfig eth0:1&lt;br /&gt;eth0:1    Link encap:Ethernet  HWaddr 00:0C:29:B7:92:45  &lt;br /&gt;inet addr:172.28.4.225  Bcast:172.28.4.255  Mask:255.255.255.0&lt;br /&gt;UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;&lt;br /&gt;[root@EPRHEL5]# ifconfig eth0:2&lt;br /&gt;eth0:2    Link encap:Ethernet  HWaddr 00:0C:29:B7:92:45  &lt;br /&gt;inet addr:172.28.4.226  Bcast:172.28.4.255  Mask:255.255.255.0&lt;br /&gt;UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I suppose this is because of the network settings of the newly added node and somehow crs could not assign the vip ip address to the nic card. crs_relocate may work on this.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:80%"&gt;&lt;br /&gt;&lt;pre class="brush:bash"&gt;[root@EPRHEL5]# crs_relocate ora.eprhel6.vip&lt;br /&gt;Attempting to stop `ora.eprhel6.vip` on member `eprhel5`&lt;br /&gt;Stop of `ora.eprhel6.vip` on member `eprhel5` succeeded.&lt;br /&gt;Attempting to start `ora.eprhel6.vip` on member `eprhel6`&lt;br /&gt;Start of `ora.eprhel6.vip` on member `eprhel6` succeeded.&lt;br /&gt;[root@EPRHEL5]# crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host        &lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora....L1.inst application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora.ORCL.db    application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....SM1.asm application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....L5.lsnr application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.gsd application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.ons application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el5.vip application    ONLINE    ONLINE    eprhel5     &lt;br /&gt;ora....el6.gsd application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.ons application    ONLINE    ONLINE    eprhel6     &lt;br /&gt;ora....el6.vip application    ONLINE    ONLINE    eprhel6  &lt;br /&gt;&lt;br /&gt;Now ifconfig on my new node should show the vip ip address information.&lt;br /&gt;&lt;br /&gt;[root@EPRHEL6 network-scripts]# ifconfig -a&lt;br /&gt;eth0      Link encap:Ethernet  HWaddr 00:0C:29:DE:D8:FD  &lt;br /&gt;inet addr:172.28.4.246  Bcast:172.28.4.255  Mask:255.255.255.0&lt;br /&gt;inet6 addr: fe80::20c:29ff:fede:d8fd/64 Scope:Link&lt;br /&gt;UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;RX packets:36798 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;TX packets:13478 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;collisions:0 txqueuelen:1000 &lt;br /&gt;RX bytes:21057458 (20.0 MiB)  TX bytes:10660215 (10.1 MiB)&lt;br /&gt;&lt;br /&gt;eth0:1    Link encap:Ethernet  HWaddr 00:0C:29:DE:D8:FD  &lt;br /&gt;inet addr:172.28.4.226  Bcast:172.28.4.255  Mask:255.255.255.0&lt;br /&gt;UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-6721904219674650984?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/6721904219674650984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2010/12/relocating-crs-resource.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6721904219674650984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6721904219674650984'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2010/12/relocating-crs-resource.html' title='Relocating CRS Resource'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-653167115507067812</id><published>2010-11-13T17:24:00.020+02:00</published><updated>2011-06-30T17:37:32.908+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PLSQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>Basic Team Coding Extension for Oracle</title><content type='html'>Our development group is complaining about override each other 's codes by recompiling the same PLSQL program unit that is actively in development with any other developer. TOAD has builtin Team Coding functionality but there are developers not using TOAD in the development department.&lt;br /&gt;&lt;br /&gt;I developed a tiny Team Coding functionality works in the database with using a DDL trigger. By this BEFORE CREATE Trigger developers are not able to alter any program unit by without first checking it out. You can find a small example below. &lt;br /&gt;&lt;br /&gt;Without first declaring in which schema you want Team Coding should work everything works as they should be. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:90%"&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;connect SYSTEM/***@ORCL11G&lt;br /&gt;&lt;br /&gt;create or replace function SYSTEM.FNC_TEST return date as &lt;br /&gt;begin&lt;br /&gt;return sysdate;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;--FUNCTION FNC_TEST compiled&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After declaring the schema you want to enable Team Coding.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:90%"&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;exec PCK_TCODE_CONTROL.set_param('SCHEMA_NAME','SYSTEM','INSERT');&lt;br /&gt;--anonymous block completed&lt;br /&gt;&lt;br /&gt;create or replace function SYSTEM.FNC_TEST return date as &lt;br /&gt;begin&lt;br /&gt;return sysdate;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;--ORA-20501: You are not allowed to compile the code! &lt;br /&gt;--           First PCK_TCODE_CONTROL.CHECKOUT the unit.&lt;br /&gt;&lt;br /&gt;exec PCK_TCODE_CONTROL.checkout('FNC_TEST','SYSTEM');&lt;br /&gt;--anonymous block completed&lt;br /&gt;&lt;br /&gt;create or replace function SYSTEM.FNC_TEST return date as &lt;br /&gt;begin&lt;br /&gt;return sysdate;&lt;br /&gt;end;&lt;br /&gt;--FUNCTION FNC_TEST compiled&lt;br /&gt;&lt;br /&gt;connect u_epeker/***@ORCL11G&lt;br /&gt;&lt;br /&gt;create or replace function SYSTEM.FNC_TEST return date as &lt;br /&gt;begin&lt;br /&gt;return sysdate;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;--ORA-20500: Unit Locked by another user! &lt;br /&gt;--           Check PCK_TCODE_CONTROL.CHECK_AVAILIBILITY function&lt;br /&gt;&lt;br /&gt;select PCK_TCODE_CONTROL.check_avail('FNC_TEST','SYSTEM') from dual;&lt;br /&gt;/*&lt;br /&gt;"PCK_TCODE_CONTROL.CHECK_AVAIL('FNC_TEST','SYSTEM')"&lt;br /&gt;"TCODE: SYSTEM.FNC_TEST is checked out by SYSTEM on 13.11.2010 19:26:30"&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;connect SYSTEM/***@ORCL11G&lt;br /&gt;&lt;br /&gt;exec PCK_TCODE_CONTROL.checkin('FNC_TEST','SYSTEM');&lt;br /&gt;--anonymous block completed&lt;br /&gt;&lt;br /&gt;connect U_EPEKER/***@ORCL11G&lt;br /&gt;&lt;br /&gt;select PCK_TCODE_CONTROL.check_avail('FNC_TEST','SYSTEM') from dual;&lt;br /&gt;--null&lt;br /&gt;&lt;br /&gt;exec PCK_TCODE_CONTROL.checkin('FNC_TEST','SYSTEM');&lt;br /&gt;--anonymous block completed&lt;br /&gt;&lt;br /&gt;select PCK_TCODE_CONTROL.check_avail('FNC_TEST','SYSTEM') from dual;&lt;br /&gt;/*&lt;br /&gt;"PCK_TCODE_CONTROL.CHECK_AVAIL('FNC_TEST','SYSTEM')"&lt;br /&gt;"TCODE: SYSTEM.FNC_TEST is checked out by U_EPEKER on 13.11.2010 19:33:53"&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;create or replace function SYSTEM.FNC_TEST return date as &lt;br /&gt;begin&lt;br /&gt;return sysdate;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;--FUNCTION FNC_TEST compiled&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As you can see people are not able to override their codes hence this functionality exists. You can add this functionality to you database by running the following script. This small script does not remember the versions of the program units. Anyone can develop version history functionality on top of this small script and repository or maybe I can handle this version history in another version. &lt;br /&gt;&lt;br /&gt;&lt;a href="https://docs.google.com/document/d/1frElJ-gxn_Cz__VJos4GT1urfYT9lTVB57A2hQNkiBQ/edit?hl=" en=""&gt;&lt;u&gt;You can find the script here&lt;/u&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-653167115507067812?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/653167115507067812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2010/11/basic-team-coding-extension-for-oracle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/653167115507067812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/653167115507067812'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2010/11/basic-team-coding-extension-for-oracle.html' title='Basic Team Coding Extension for Oracle'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-9084309032318346397</id><published>2010-10-28T09:18:00.005+03:00</published><updated>2012-01-07T23:38:31.839+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Course Notes'/><title type='text'>Oracle SQL Fundamentals Course Notes</title><content type='html'>I was in Oracle SQL Course for last 4 days. The course went like a hands on lab so I'd like to share my course notes on Oracle SQL fundamentals.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Links:&lt;/u&gt;&lt;br /&gt;&lt;a href="https://docs.google.com/document/d/13exvZkXgySfl1AIIHpVqlM2XhbVlByJ8fEqOKhG-3SE/edit"&gt;Course Notes&lt;/a&gt;&lt;br /&gt;&lt;a href="http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=402&amp;p_nl=OSQD"&gt;Course Details&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-9084309032318346397?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/9084309032318346397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2010/10/oracle-sql-fundamentals-course-notes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/9084309032318346397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/9084309032318346397'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2010/10/oracle-sql-fundamentals-course-notes.html' title='Oracle SQL Fundamentals Course Notes'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-7117192047965953022</id><published>2010-05-31T14:26:00.017+03:00</published><updated>2010-05-31T15:23:05.048+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RMAN'/><title type='text'>Duplicate Database with RMAN is as easy as it should be</title><content type='html'>Duplicating a database with RMAN saves you from an ordinary routine consists of a hot backup, restore, recover and open the aux database procedure.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span family="courier"  style="font-size:85%;"&gt;&lt;br /&gt;C:\Users\dtepeker&gt; &lt;span style="background-color: rgb(255, 255, 0);"&gt;set ORACLE_SID=ORCL2&lt;/span&gt;&lt;br /&gt;C:\Users\dtepeker&gt; &lt;span style="background-color: rgb(255, 255, 0);"&gt;sqlplus "/ as sysdba&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; &lt;span style="background-color: rgb(0, 255, 0);"&gt;shutdown abort;&lt;/span&gt;&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;SQL&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;SQL&gt; &lt;span style="background-color: rgb(0, 255, 0);"&gt;create pfile='C:\oracle\product\initORCL2.ora' from spfile;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;File created.&lt;br /&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;br /&gt;C:\Users\dtepeker&gt; &lt;span style="background-color: rgb(255, 255, 0);"&gt;more C:\oracle\product\initORCL2.ora&lt;/span&gt;&lt;br /&gt;orcl2.__db_cache_size=369098752&lt;br /&gt;orcl2.__java_pool_size=4194304&lt;br /&gt;orcl2.__large_pool_size=4194304&lt;br /&gt;orcl2.__shared_pool_size=142606336&lt;br /&gt;orcl2.__streams_pool_size=8388608&lt;br /&gt;*.audit_file_dest='C:\oracle\product\admin\ORCL2\adump'&lt;br /&gt;*.background_dump_dest='C:\oracle\product\admin\ORCL2\bdump'&lt;br /&gt;*.compatible='10.2.0.3.0'&lt;br /&gt;*.control_files='C:\oracle\product\oradata\ORCL2\control01.ctl'&lt;br /&gt;*.core_dump_dest='C:\oracle\product\admin\ORCL2\cdump'&lt;br /&gt;*.db_block_size=8192&lt;br /&gt;*.db_domain=''&lt;br /&gt;*.db_file_multiblock_read_count=16&lt;br /&gt;*.db_name='ORCL2'&lt;br /&gt;*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCL2XDB)'&lt;br /&gt;*.job_queue_processes=10&lt;br /&gt;*.open_cursors=300&lt;br /&gt;*.pga_aggregate_target=268435456&lt;br /&gt;*.processes=150&lt;br /&gt;*.remote_login_passwordfile='EXCLUSIVE'&lt;br /&gt;*.sga_target=536870912&lt;br /&gt;*.undo_management='AUTO'&lt;br /&gt;*.undo_tablespace='UNDOTBS1'&lt;br /&gt;*.user_dump_dest='C:\oracle\product\admin\ORCL2\udump'&lt;br /&gt;&lt;span style="background-color: rgb(255, 0, 0);"&gt;&lt;br /&gt;*.db_file_name_convert=(C:\oracle\product\oradata\ORCL,C:\oracle\product\oradata\ORCL2)&lt;br /&gt;*.log_file_name_convert=(C:\oracle\product\oradata\ORCL,C:\oracle\product\oradata\ORCL2)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;SQL&gt; &lt;span style="background-color: rgb(0, 255, 0);"&gt;create spfile from pfile='C:\oracle\product\initORCL2.ora';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;File created.&lt;br /&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;br /&gt;C:\Users\dtepeker&gt; &lt;span style="background-color: rgb(255, 255, 0);"&gt;more C:\oracle\product\db10g\network\admin\tnsnames.ora&lt;/span&gt;&lt;br /&gt;# tnsnames.ora Network Configuration File: C:\oracle\product\db10g\network\admin\tnsnames.ora&lt;br /&gt;# Generated by Oracle configuration tools.&lt;br /&gt;&lt;br /&gt;### duplicate/destination db&lt;br /&gt;ORCL2 =&lt;br /&gt;(DESCRIPTION =&lt;br /&gt;  (ADDRESS_LIST =&lt;br /&gt;    (ADDRESS = (PROTOCOL = TCP)(HOST = dtl1optim1)(PORT = 1521))&lt;br /&gt;  )&lt;br /&gt;  (CONNECT_DATA =&lt;br /&gt;    (SERVICE_NAME = ORCL2)&lt;br /&gt;  )&lt;br /&gt;)&lt;br /&gt;### target/source db&lt;br /&gt;ORCL =&lt;br /&gt;(DESCRIPTION =&lt;br /&gt;  (ADDRESS = (PROTOCOL = TCP)(HOST = dtl1optim1)(PORT = 1521))&lt;br /&gt;  (CONNECT_DATA =&lt;br /&gt;    (SID = ORCL)&lt;br /&gt;  )&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;EXTPROC_CONNECTION_DATA =&lt;br /&gt;(DESCRIPTION =&lt;br /&gt;  (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))&lt;br /&gt;  (CONNECT_DATA =&lt;br /&gt;    (PRESENTATION = RO)&lt;br /&gt;    (SID = PLSExtProc)&lt;br /&gt;  )&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;C:\oracle\product\oradata\ORCL2&gt;&lt;span style="background-color: rgb(255, 255, 0);"&gt;del *.dbf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;C:\oracle\product\oradata\ORCL2&gt;&lt;span style="background-color: rgb(255, 255, 0);"&gt;dir&lt;/span&gt;&lt;br /&gt;Volume in drive C has no label.&lt;br /&gt;Volume Serial Number is 3A6A-99E9&lt;br /&gt;&lt;br /&gt;Directory of C:\oracle\product\oradata\ORCL2&lt;br /&gt;&lt;br /&gt;05/31/2010  12:06 PM    &lt;dir&gt;          .&lt;br /&gt;05/31/2010  12:06 PM    &lt;dir&gt;          ..&lt;br /&gt;05/31/2010  11:58 AM         7,389,184 CONTROL01.CTL&lt;br /&gt;05/27/2010  04:58 PM             1,317 CONTROLFILE.CTL&lt;br /&gt;05/27/2010  04:52 PM               854 initORCL2.ora&lt;br /&gt;04/20/2010  03:27 PM    &lt;dir&gt;          ORCL2&lt;br /&gt;05/31/2010  11:54 AM        52,429,312 REDO01.LOG&lt;br /&gt;05/31/2010  11:54 AM        52,429,312 REDO02.LOG&lt;br /&gt;05/31/2010  11:54 AM        52,429,312 REDO03.LOG&lt;br /&gt;             6 File(s)    164,679,291 bytes&lt;br /&gt;             3 Dir(s)  92,947,480,576 bytes free&lt;br /&gt;&lt;br /&gt;C:\oracle\product\oradata\ORCL2&gt;&lt;span style="background-color: rgb(255, 255, 0);"&gt;del *.log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;C:\oracle\product\oradata\ORCL2&gt;&lt;span style="background-color: rgb(255, 255, 0);"&gt;del *.ctl&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;C:\oracle\product\oradata\ORCL2&gt;&lt;span style="background-color: rgb(255, 255, 0);"&gt;dir&lt;/span&gt;&lt;br /&gt;Volume in drive C has no label.&lt;br /&gt;Volume Serial Number is 3A6A-99E9&lt;br /&gt;&lt;br /&gt;Directory of C:\oracle\product\oradata\ORCL2&lt;br /&gt;&lt;br /&gt;05/31/2010  12:06 PM    &lt;dir&gt;          .&lt;br /&gt;05/31/2010  12:06 PM    &lt;dir&gt;          ..&lt;br /&gt;05/27/2010  04:52 PM               854 initORCL2.ora&lt;br /&gt;04/20/2010  03:27 PM    &lt;dir&gt;          ORCL2&lt;br /&gt;             1 File(s)            854 bytes&lt;br /&gt;             3 Dir(s)  93,112,172,544 bytes free&lt;br /&gt;&lt;br /&gt;C:\oracle\product\oradata\ORCL2&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;font family="courier" size="1"&gt;&lt;br /&gt;C:\oracle\product\oradata\ORCL2&gt;&lt;span style="background-color: rgb(255, 255, 0);"&gt;rman target sys/password@ORCL auxiliary /&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.2.0.4.0 - Production on Mon May 31 12:07:32 2010&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to target database: ORCL (DBID=1235781100)&lt;br /&gt;connected to auxiliary database: ORCL2 (not mounted)&lt;br /&gt;&lt;br /&gt;RMAN&gt; &lt;span style="background-color: rgb(0, 255, 0);"&gt;duplicate target database to ORCL2;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Starting Duplicate Db at 31-MAY-10&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;allocated channel: ORA_AUX_DISK_1&lt;br /&gt;channel ORA_AUX_DISK_1: sid=155 devtype=DISK&lt;br /&gt;&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt; set until scn  23097370;&lt;br /&gt; set newname for datafile  1 to&lt;br /&gt;"C:\ORACLE\PRODUCT\ORADATA\ORCL2\SYSTEM01.DBF";&lt;br /&gt; set newname for datafile  2 to&lt;br /&gt;"C:\ORACLE\PRODUCT\ORADATA\ORCL2\UNDOTBS01.DBF";&lt;br /&gt; set newname for datafile  3 to&lt;br /&gt;"C:\ORACLE\PRODUCT\ORADATA\ORCL2\SYSAUX01.DBF";&lt;br /&gt; set newname for datafile  4 to&lt;br /&gt;"C:\ORACLE\PRODUCT\ORADATA\ORCL2\USERS01.DBF";&lt;br /&gt; set newname for datafile  5 to&lt;br /&gt;"C:\ORACLE\PRODUCT\ORADATA\ORCL2\TS_STREAMS_01.DBF";&lt;br /&gt; restore&lt;br /&gt; check readonly&lt;br /&gt; clone database&lt;br /&gt; ;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;executing command: SET until clause&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;Starting restore at 31-MAY-10&lt;br /&gt;using channel ORA_AUX_DISK_1&lt;br /&gt;&lt;br /&gt;channel ORA_AUX_DISK_1: restoring datafile 00001&lt;br /&gt;input datafile copy recid=20 stamp=720116353 filename=C:\ORACLE\PRODUCT\FRA\ORCL\ORCL\DATAFILE\O1_MF_SYSTEM_5ZWW6PW1_.DBF&lt;br /&gt;destination for restore of datafile 00001: C:\ORACLE\PRODUCT\ORADATA\ORCL2\SYSTEM01.DBF&lt;br /&gt;channel ORA_AUX_DISK_1: copied datafile copy of datafile 00001&lt;br /&gt;output filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\SYSTEM01.DBF&lt;br /&gt;channel ORA_AUX_DISK_1: restoring datafile 00002&lt;br /&gt;input datafile copy recid=21 stamp=720116353 filename=C:\ORACLE\PRODUCT\FRA\ORCL\ORCL\DATAFILE\O1_MF_UNDOTBS1_5ZWW4TN9_.DBF&lt;br /&gt;destination for restore of datafile 00002: C:\ORACLE\PRODUCT\ORADATA\ORCL2\UNDOTBS01.DBF&lt;br /&gt;channel ORA_AUX_DISK_1: copied datafile copy of datafile 00002&lt;br /&gt;output filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\UNDOTBS01.DBF&lt;br /&gt;channel ORA_AUX_DISK_1: restoring datafile 00003&lt;br /&gt;input datafile copy recid=22 stamp=720116353 filename=C:\ORACLE\PRODUCT\FRA\ORCL\ORCL\DATAFILE\O1_MF_SYSAUX_5ZWW5XQX_.DBF&lt;br /&gt;destination for restore of datafile 00003: C:\ORACLE\PRODUCT\ORADATA\ORCL2\SYSAUX01.DBF&lt;br /&gt;channel ORA_AUX_DISK_1: copied datafile copy of datafile 00003&lt;br /&gt;output filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\SYSAUX01.DBF&lt;br /&gt;channel ORA_AUX_DISK_1: restoring datafile 00004&lt;br /&gt;input datafile copy recid=19 stamp=720116353 filename=C:\ORACLE\PRODUCT\FRA\ORCL\ORCL\DATAFILE\O1_MF_USERS_5ZWW7937_.DBF&lt;br /&gt;&lt;br /&gt;destination for restore of datafile 00004: C:\ORACLE\PRODUCT\ORADATA\ORCL2\USERS01.DBF&lt;br /&gt;channel ORA_AUX_DISK_1: copied datafile copy of datafile 00004&lt;br /&gt;output filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\USERS01.DBF&lt;br /&gt;channel ORA_AUX_DISK_1: restoring datafile 00005&lt;br /&gt;input datafile copy recid=18 stamp=720116353 filename=C:\ORACLE\PRODUCT\FRA\ORCL\ORCL\DATAFILE\O1_MF_TS_STREA_5ZWW763V_.DBF&lt;br /&gt;destination for restore of datafile 00005: C:\ORACLE\PRODUCT\ORADATA\ORCL2\TS_STREAMS_01.DBF&lt;br /&gt;channel ORA_AUX_DISK_1: copied datafile copy of datafile 00005&lt;br /&gt;output filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\TS_STREAMS_01.DBF&lt;br /&gt;Finished restore at 31-MAY-10&lt;br /&gt;sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORCL2" RESETLOGS ARCHIVELOG&lt;br /&gt;MAXLOGFILES     16&lt;br /&gt;MAXLOGMEMBERS      3&lt;br /&gt;MAXDATAFILES      100&lt;br /&gt;MAXINSTANCES     8&lt;br /&gt;MAXLOGHISTORY      292&lt;br /&gt;LOGFILE&lt;br /&gt;GROUP  1 ( 'C:\ORACLE\PRODUCT\ORADATA\ORCL2\REDO01.LOG' ) SIZE 50 M  REUSE,&lt;br /&gt;GROUP  2 ( 'C:\ORACLE\PRODUCT\ORADATA\ORCL2\REDO02.LOG' ) SIZE 50 M  REUSE,&lt;br /&gt;GROUP  3 ( 'C:\ORACLE\PRODUCT\ORADATA\ORCL2\REDO03.LOG' ) SIZE 50 M  REUSE&lt;br /&gt;DATAFILE&lt;br /&gt;'C:\ORACLE\PRODUCT\ORADATA\ORCL2\SYSTEM01.DBF'&lt;br /&gt;CHARACTER SET WE8ISO8859P9&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt; switch clone datafile all;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;released channel: ORA_AUX_DISK_1&lt;br /&gt;datafile 2 switched to datafile copy&lt;br /&gt;input datafile copy recid=1 stamp=720446949 filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\UNDOTBS01.DBF&lt;br /&gt;datafile 3 switched to datafile copy&lt;br /&gt;input datafile copy recid=2 stamp=720446950 filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\SYSAUX01.DBF&lt;br /&gt;datafile 4 switched to datafile copy&lt;br /&gt;input datafile copy recid=3 stamp=720446950 filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\USERS01.DBF&lt;br /&gt;datafile 5 switched to datafile copy&lt;br /&gt;input datafile copy recid=4 stamp=720446950 filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\TS_STREAMS_01.DBF&lt;br /&gt;&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt; set until scn  23097370;&lt;br /&gt; recover&lt;br /&gt; clone database&lt;br /&gt;  delete archivelog&lt;br /&gt; ;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;executing command: SET until clause&lt;br /&gt;&lt;br /&gt;Starting recover at 31-MAY-10&lt;br /&gt;allocated channel: ORA_AUX_DISK_1&lt;br /&gt;channel ORA_AUX_DISK_1: sid=155 devtype=DISK&lt;br /&gt;&lt;br /&gt;starting media recovery&lt;br /&gt;&lt;br /&gt;archive log thread 1 sequence 416 is already on disk as file C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00416_0708000366.001&lt;br /&gt;archive log thread 1 sequence 417 is already on disk as file C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00417_0708000366.001&lt;br /&gt;archive log thread 1 sequence 418 is already on disk as file C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00418_0708000366.001&lt;br /&gt;archive log thread 1 sequence 419 is already on disk as file C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00419_0708000366.001&lt;br /&gt;archive log thread 1 sequence 420 is already on disk as file C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00420_0708000366.001&lt;br /&gt;archive log thread 1 sequence 421 is already on disk as file C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00421_0708000366.001&lt;br /&gt;archive log thread 1 sequence 422 is already on disk as file C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00422_0708000366.001&lt;br /&gt;archive log thread 1 sequence 423 is already on disk as file C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00423_0708000366.001&lt;br /&gt;archive log thread 1 sequence 424 is already on disk as file C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00424_0708000366.001&lt;br /&gt;archive log filename=C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00416_0708000366.001 thread=1 sequence=416&lt;br /&gt;archive log filename=C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00417_0708000366.001 thread=1 sequence=417&lt;br /&gt;archive log filename=C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00418_0708000366.001 thread=1 sequence=418&lt;br /&gt;archive log filename=C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00419_0708000366.001 thread=1 sequence=419&lt;br /&gt;archive log filename=C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00420_0708000366.001 thread=1 sequence=420&lt;br /&gt;archive log filename=C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00421_0708000366.001 thread=1 sequence=421&lt;br /&gt;archive log filename=C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00422_0708000366.001 thread=1 sequence=422&lt;br /&gt;archive log filename=C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00423_0708000366.001 thread=1 sequence=423&lt;br /&gt;archive log filename=C:\ORACLE\PRODUCT\ORADATA\ORCL\ARCHIVE\ARC00424_0708000366.001 thread=1 sequence=424&lt;br /&gt;media recovery complete, elapsed time: 00:00:29&lt;br /&gt;Finished recover at 31-MAY-10&lt;br /&gt;&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt; shutdown clone;&lt;br /&gt; startup clone nomount ;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;database dismounted&lt;br /&gt;Oracle instance shut down&lt;br /&gt;&lt;br /&gt;connected to auxiliary database (not started)&lt;br /&gt;Oracle instance started&lt;br /&gt;&lt;br /&gt;Total System Global Area     536870912 bytes&lt;br /&gt;&lt;br /&gt;Fixed Size                     1297724 bytes&lt;br /&gt;Variable Size                159384260 bytes&lt;br /&gt;Database Buffers             369098752 bytes&lt;br /&gt;Redo Buffers                   7090176 bytes&lt;br /&gt;sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORCL2" RESETLOGS ARCHIVELOG&lt;br /&gt;MAXLOGFILES     16&lt;br /&gt;MAXLOGMEMBERS      3&lt;br /&gt;MAXDATAFILES      100&lt;br /&gt;MAXINSTANCES     8&lt;br /&gt;MAXLOGHISTORY      292&lt;br /&gt;LOGFILE&lt;br /&gt;GROUP  1 ( 'C:\ORACLE\PRODUCT\ORADATA\ORCL2\REDO01.LOG' ) SIZE 50 M  REUSE,&lt;br /&gt;GROUP  2 ( 'C:\ORACLE\PRODUCT\ORADATA\ORCL2\REDO02.LOG' ) SIZE 50 M  REUSE,&lt;br /&gt;GROUP  3 ( 'C:\ORACLE\PRODUCT\ORADATA\ORCL2\REDO03.LOG' ) SIZE 50 M  REUSE&lt;br /&gt;DATAFILE&lt;br /&gt;'C:\ORACLE\PRODUCT\ORADATA\ORCL2\SYSTEM01.DBF'&lt;br /&gt;CHARACTER SET WE8ISO8859P9&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt; set newname for tempfile  1 to&lt;br /&gt;"C:\ORACLE\PRODUCT\ORADATA\ORCL2\TEMP01.DBF";&lt;br /&gt; switch clone tempfile all;&lt;br /&gt; catalog clone datafilecopy  "C:\ORACLE\PRODUCT\ORADATA\ORCL2\UNDOTBS01.DBF";&lt;br /&gt; catalog clone datafilecopy  "C:\ORACLE\PRODUCT\ORADATA\ORCL2\SYSAUX01.DBF";&lt;br /&gt; catalog clone datafilecopy  "C:\ORACLE\PRODUCT\ORADATA\ORCL2\USERS01.DBF";&lt;br /&gt; catalog clone datafilecopy  "C:\ORACLE\PRODUCT\ORADATA\ORCL2\TS_STREAMS_01.DBF";&lt;br /&gt; switch clone datafile all;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;renamed temporary file 1 to C:\ORACLE\PRODUCT\ORADATA\ORCL2\TEMP01.DBF in control file&lt;br /&gt;&lt;br /&gt;cataloged datafile copy&lt;br /&gt;datafile copy filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\UNDOTBS01.DBF recid=1 stamp=720446995&lt;br /&gt;&lt;br /&gt;cataloged datafile copy&lt;br /&gt;datafile copy filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\SYSAUX01.DBF recid=2 stamp=720446995&lt;br /&gt;&lt;br /&gt;cataloged datafile copy&lt;br /&gt;datafile copy filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\USERS01.DBF recid=3 stamp=720446995&lt;br /&gt;&lt;br /&gt;cataloged datafile copy&lt;br /&gt;datafile copy filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\TS_STREAMS_01.DBF recid=4 stamp=720446996&lt;br /&gt;&lt;br /&gt;datafile 2 switched to datafile copy&lt;br /&gt;input datafile copy recid=1 stamp=720446995 filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\UNDOTBS01.DBF&lt;br /&gt;datafile 3 switched to datafile copy&lt;br /&gt;input datafile copy recid=2 stamp=720446995 filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\SYSAUX01.DBF&lt;br /&gt;datafile 4 switched to datafile copy&lt;br /&gt;input datafile copy recid=3 stamp=720446995 filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\USERS01.DBF&lt;br /&gt;datafile 5 switched to datafile copy&lt;br /&gt;input datafile copy recid=4 stamp=720446996 filename=C:\ORACLE\PRODUCT\ORADATA\ORCL2\TS_STREAMS_01.DBF&lt;br /&gt;&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt; Alter clone database open resetlogs;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;database opened&lt;br /&gt;Finished Duplicate Db at 31-MAY-10&lt;br /&gt;&lt;br /&gt;RMAN&gt;&lt;/dir&gt;&lt;/dir&gt;&lt;/dir&gt;&lt;/dir&gt;&lt;/dir&gt;&lt;/dir&gt;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Related:&lt;br /&gt;&lt;a href="http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmdupdb.htm#i1008564%22"&gt;Oracle Database Backup and Recovery Advanced Users Guide&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.oracle-base.com/articles/9i/DuplicateDatabaseUsingRMAN9i.php"&gt;Oracle-Base.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-7117192047965953022?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/7117192047965953022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2010/05/duplicate-database-with-rman-is-as-easy.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7117192047965953022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7117192047965953022'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2010/05/duplicate-database-with-rman-is-as-easy.html' title='Duplicate Database with RMAN is as easy as it should be'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-5463247143783264359</id><published>2010-05-02T00:20:00.000+03:00</published><updated>2010-05-02T12:18:13.983+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Enterprise Manager Grid Control'/><title type='text'>Oracle Enterprise Manager gets bigger with Sun Opscenter</title><content type='html'>I was on the Sun Oracle event here in Istanbul, Turkey on 28.04.2010. The main course was about engaging Oracle with Sun. &lt;br /&gt;&lt;br /&gt;The most interesting part for me was the future of Oracle Enterprise Manager. There were a lot of clue for it is going to get bigger, not only for database and application server management but also in virtual machine (both on Solaris and Enterprise linux) and operating system management (Solaris, Redhat Linux and Suse Linux). &lt;br /&gt;&lt;br /&gt;Oracle has already began to integrate Sun Opscenter to the Oracle Enterprise Manager. Main idea is single handed management of a datacenter with Oracle Enterprise Manager. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There are some links about this topic.&lt;br /&gt;&lt;br /&gt;http://www.oracle.com/oms/enterprisemanager11g/webcast-067871.html&lt;br /&gt;http://www.oracle.com/us/products/enterprise-manager/index.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-5463247143783264359?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/5463247143783264359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2010/04/oracle-enterprise-manager-gets-bigger.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5463247143783264359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5463247143783264359'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2010/04/oracle-enterprise-manager-gets-bigger.html' title='Oracle Enterprise Manager gets bigger with Sun Opscenter'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-6473355745386790408</id><published>2010-04-27T10:18:00.018+03:00</published><updated>2010-04-27T11:18:22.490+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google Apps'/><title type='text'>Google Analytics works better than i expected</title><content type='html'>I installed Google Analytics site script to my blog two weeks ago and i received more than i imagine. Here are some report supplied by the dashboard today.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_fSrIpdF1Zdk/S9aQ5C4pvRI/AAAAAAAABMg/2smHMCqh6C0/s1600/analytic1.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 125px;" src="http://2.bp.blogspot.com/_fSrIpdF1Zdk/S9aQ5C4pvRI/AAAAAAAABMg/2smHMCqh6C0/s400/analytic1.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464714507562106130" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;At first sight this is an expected result like visits, pagevisits and pages/visit ratio and so on. On the visitors tab of the dashboard you can obtain lots of information about the users locations and technical specs.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_fSrIpdF1Zdk/S9adPLhFrRI/AAAAAAAABNQ/ehQzQJz0SU4/s1600/analytic2.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 151px;" src="http://2.bp.blogspot.com/_fSrIpdF1Zdk/S9adPLhFrRI/AAAAAAAABNQ/ehQzQJz0SU4/s400/analytic2.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5464728081975848210" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_fSrIpdF1Zdk/S9aTaRO6OjI/AAAAAAAABMw/lmmu0kblNg0/s1600/analytic3.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 281px;" src="http://4.bp.blogspot.com/_fSrIpdF1Zdk/S9aTaRO6OjI/AAAAAAAABMw/lmmu0kblNg0/s400/analytic3.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464717277372496434" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can also investigate which search engine hits the site? and also the keywords. Another nice feature is you can also see which contents (in this case which posts) hit by the readers mostly? and with which keywords :)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_fSrIpdF1Zdk/S9aVvowX4_I/AAAAAAAABM4/E4htmRL86Ls/s1600/analytic5.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 158px;" src="http://2.bp.blogspot.com/_fSrIpdF1Zdk/S9aVvowX4_I/AAAAAAAABM4/E4htmRL86Ls/s400/analytic5.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464719843487376370" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_fSrIpdF1Zdk/S9aV-gFlPGI/AAAAAAAABNA/QyOXVOmA5kA/s1600/analytic4.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 149px;" src="http://4.bp.blogspot.com/_fSrIpdF1Zdk/S9aV-gFlPGI/AAAAAAAABNA/QyOXVOmA5kA/s400/analytic4.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464720098858450018" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_fSrIpdF1Zdk/S9aWD-LR9AI/AAAAAAAABNI/cj3tjl9wn8g/s1600/analytic6.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 226px;" src="http://1.bp.blogspot.com/_fSrIpdF1Zdk/S9aWD-LR9AI/AAAAAAAABNI/cj3tjl9wn8g/s400/analytic6.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464720192834761730" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As can be seen from the results &lt;a href="http://ergemp.blogspot.com/2008/06/oracle-em-grid-control-custom-reports.html"&gt;Oracle Grid Custom Reports&lt;/a&gt; is the most visited post and &lt;a href="http://ergemp.blogspot.com/"&gt;Homepage&lt;/a&gt; follows it very closely. It seems &lt;a href="http://ergemp.blogspot.com/search/label/Oracle%20Enterprise%20Manager%20Grid%20Control"&gt;Oracle Enterprise Manager Grid Control&lt;/a&gt; posts are mostly interested subject. &lt;a href="http://ergemp.blogspot.com/search/label/Streams"&gt;Streams&lt;/a&gt; comes with the &lt;a href="http://ergemp.blogspot.com/2009/05/sql-server-detected-logical-consistency.html"&gt;SQL Server Logical Consistency Based IO Error&lt;/a&gt; post which is a real pain for the admins.&lt;br /&gt;&lt;br /&gt;Unfortunately there is no way (or I couldnt find) to share the reports anonymously like GoogleNotes or GoogleDocs. I hope this would be a new feature in a new version. &lt;br /&gt;&lt;br /&gt;&lt;u&gt;Some links:&lt;/u&gt;&lt;br /&gt;&lt;a href="http://www.google.com/analytics"&gt;http://www.google.com/analytics&lt;/a&gt;&lt;br /&gt;&lt;a href="http://analytics.blogspot.com/2010/04/5-years-ago-today-google-acquired.html"&gt;Interesting post from google to google analytics blog&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-6473355745386790408?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/6473355745386790408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2010/04/google-analytics-works-better-than-i.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6473355745386790408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6473355745386790408'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2010/04/google-analytics-works-better-than-i.html' title='Google Analytics works better than i expected'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_fSrIpdF1Zdk/S9aQ5C4pvRI/AAAAAAAABMg/2smHMCqh6C0/s72-c/analytic1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-7115995495926968217</id><published>2010-04-02T15:37:00.027+03:00</published><updated>2010-04-14T22:54:22.711+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Streams'/><title type='text'>Schema replication with Oracle Streams</title><content type='html'>I tested table replication with Oracle Streams before. And now i used Schema Replication with an OLTP Tester schema. The source database is 10.2.0.4 on a windows OS and the destination is 11.1.0.7 database on same host with a windows 2008 Server.  I faced a couple of problems listed at the end of this post. The purpose of the post is setting up a Schema replication using streams. And start the OLTP test and monitor the streams processes. Piece of cake!.&lt;br /&gt;&lt;br /&gt;Lets start with the schema replication with the MAINTAIN_SCHEMAS which is the easiest way. Streams does the rest of it (creating queues, captre, propagation and apply processes.. etc. ). But before running streams packages there are some preconfiguration of the database that has to be done.&lt;br /&gt;&lt;br /&gt;- &lt;a href="http://www.google.com/notebook/public/03315935748025284432/BDVSJ3goQzt6CzPok"&gt;Enabling Archivelog&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.google.com/notebook/public/03315935748025284432/BDcMU3goQr_Hl-fok"&gt;Preconfiguring Oracle Streams&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And after all we should be ready for streams replication.&lt;br /&gt;BEGIN&lt;br /&gt;&lt;pre&gt;&lt;font style=""&gt;&lt;font size="1"&gt;DBMS_STREAMS_ADM.MAINTAIN_SCHEMAS(&lt;br /&gt;schema_names                 =&gt; 'U_EPEKER',&lt;br /&gt;source_directory_object      =&gt; 'DATA_PUMP_DIR',&lt;br /&gt;destination_directory_object =&gt; 'DATA_PUMP_DIR',&lt;br /&gt;source_database              =&gt; 'ORCL',&lt;br /&gt;destination_database         =&gt; 'ORCL11G',&lt;br /&gt;perform_actions              =&gt; TRUE,&lt;br /&gt;capture_name                 =&gt; 'CAPTURE_SCHEMA_U_EPEKER',&lt;br /&gt;--capture_queue_table        =&gt; NULL,&lt;br /&gt;capture_queue_name           =&gt; 'QUEUE_CAPT_SCH_U_EPEKER',&lt;br /&gt;capture_queue_user           =&gt; 'U_STREAMS_ADM',&lt;br /&gt;propagation_name             =&gt; 'PROP_SCH_U_EPEKER',&lt;br /&gt;apply_name                   =&gt; 'APPLY_SCH_U_EPEKER',&lt;br /&gt;--apply_queue_table          =&gt; NULL,&lt;br /&gt;apply_queue_name             =&gt; 'QUEUE_APP_SCH_U_EPEKER',&lt;br /&gt;apply_queue_user             =&gt; 'U_STREAMS_ADM',       &lt;br /&gt;bi_directional               =&gt; FALSE,&lt;br /&gt;include_ddl                  =&gt; TRUE,&lt;br /&gt;instantiation                =&gt; DBMS_STREAMS_ADM.INSTANTIATION_SCHEMA_NETWORK);&lt;br /&gt;END;&lt;/font&gt;&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;In case of any error following dba views can be queried and see which script has an error or in case of any hopeless situation you can recover the operation and remove the streams configuration and re-run the maintain_schemas after overcome any misconfiguration.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;select * from DBA_RECOVERABLE_SCRIPT_BLOCKS;&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;select * from DBA_RECOVERABLE_SCRIPT_ERRORS;&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;execute DBMS_STREAMS_ADM.RECOVER_OPERATION('3A53A54E70764958BA0AFA68DAC0C7F0','PURGE');&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;exec DBMS_STREAMS_ADM.REMOVE_STREAMS_CONFIGURATION;&lt;br /&gt;&lt;/font&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;-- and on the remote server&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;exec DBMS_STREAMS_ADM.REMOVE_STREAMS_CONFIGURATION@ORCL11G;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Checking the streams processes if they are set all right after the maintain_schemas procedure.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;select capture_name,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;       queue_name,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;       rule_set_name,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;       source_database,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;       status &lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;  from dba_capture;&lt;br /&gt;&lt;/font&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;/*&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;CAPTURE_NAME                QUEUE_NAME              RULE_SET_NAME   SOURCE_DATABASE STATUS&lt;/font&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;&lt;br /&gt;------------                ----------              -------------   --------------- ------&lt;br /&gt;&lt;/font&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;CAPTURE_SCHEMA_U_EPEKER     QUEUE_CAPT_SCH_U_EPEKER RULESET$_12     ORCL            ENABLED&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;*/&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;select propagation_name,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      source_queue_name,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      destination_queue_name,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      destination_dblink,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      rule_set_name,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      status&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt; from dba_propagation;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" size="1"&gt;&lt;font face="courier new"&gt;/*&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;PROPAGATION_NAME    SOURCE_QUEUE_NAME           DESTINATION_QUEUE_NAME  DESTINATION_DBLINK  RULE_SET_NAME&lt;/font&gt;&lt;font face="courier new"&gt;&lt;br /&gt;---------------     ----------------            ---------------------   -----------------   -------------&lt;br /&gt;&lt;/font&gt;&lt;font face="courier new"&gt;PROP_SCH_U_EPEKER   QUEUE_CAPT_SCH_U_EPEKER     QUEUE_APP_SCH_U_EPEKER  ORCL11G             RULESET$_9&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;*/&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;select sid,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      serial#,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      capture_name,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      state&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt; from v$streams_capture;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" size="1"&gt;&lt;font face="courier new"&gt;/*&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;SID     SERIAL#     CAPTURE_NAME                STATE&lt;/font&gt;&lt;font face="courier new"&gt;&lt;br /&gt;---     ------      ------------                -----&lt;br /&gt;&lt;/font&gt;&lt;font face="courier new"&gt;128     8           CAPTURE_SCHEMA_U_EPEKER    CAPTURING CHANGES&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;*/&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Everything seems operational in the capture side. I need to check if apply process also created and runs smoothly.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;select apply_name,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      queue_name,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      apply_captured,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      rule_set_name,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      status&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt; from dba_apply@ORCL11G;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" size="1"&gt;&lt;font face="courier new"&gt;/*&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;APPLY_NAME          QUEUE_NAME              APPLY_CAPTURED      RULE_SET_NAME   STATUS&lt;br /&gt;&lt;/font&gt;&lt;font face="courier new"&gt;---------          ----------              --------------      -------------   ------&lt;br /&gt;&lt;/font&gt;&lt;font face="courier new"&gt;APPLY_SCH_U_EPEKER  QUEUE_APP_SCH_U_EPEKER  YES                 RULESET$_6      ENABLED&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;*/&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;select sid,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      serial#,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      state,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      apply#,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      apply_name,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      total_applied,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;      total_errors&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt; from v$streams_apply_coordinator@ORCL11G;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" size="1"&gt;&lt;font face="courier new"&gt;/*&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;SID SERIAL# STATE   APPLY#  APPLY_NAME&lt;br /&gt;&lt;/font&gt;&lt;font face="courier new"&gt;--- ------  -----   -----   ----------&lt;br /&gt;&lt;/font&gt;&lt;font face="courier new"&gt;116 19550   IDLE    1       APPLY_SCH_U_EPEKER&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;*/&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I have created the schema before which includes an OLTP Simulator procedures. I am planning to share this schema in this blog further. Anyway, here is the script to create the schema:&lt;a href="http://docs.google.com/Doc?docid=0AYiHu58AFesMZGNmd3Bra2hfNDFjamg2c25ncw&amp;hl=en"&gt; OLTP Simulator Script&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now I will use the P_CREATE_REPOS procedure to populate the schema. I hope streams is going to replicate the transactions. This create procedure will create 5 groups and 10 user each group. After that it will going to create 10 pages for each user.&lt;br /&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;exec U_EPEKER.P_CREATE_REPOS(5,10,1);&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;After executing this procedure there should be 5 groups and 10 users in each group and total 50 pages for 1 page each user.&lt;br /&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;select 'source ' || count(*) as user_count from u_epeker.t_user&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;union all&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;select 'destination ' || count(*) as user_count from u_epeker.t_user@ORCL11G;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" size="1"&gt;&lt;font face="courier new"&gt;/*&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;USER_COUNT&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;source 50&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;destination 50&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;*/&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;select 'source ' || count(*) as group_count from u_epeker.t_group&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;union all&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;select 'destination ' || count(*) as group_count from u_epeker.t_group@ORCL11G;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" size="1"&gt;&lt;font face="courier new"&gt;/*&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;GROUP_COUNT&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;source 5&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;destination 5&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;*/&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;select 'source ' || count(*) as page_count from u_epeker.t_pages&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;union all&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;select 'destination ' || count(*) as page_count from u_epeker.t_pages@ORCL11G;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" size="1"&gt;&lt;font face="courier new"&gt;/*&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;PAGE_COUNT&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;source 50&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;destination 50&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;*/&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Seems everything goes fine. Now i will simulate an OLTP function in the source database and monitor the streams processes. For this I will use the P_CREATE_JOBS procedure of the OLTP Simulator schema and it will implicitly call the P_SIMULATE_REQUEST procedure sequentially.&lt;br /&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;-- with U_EPEKER user&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;exec U_EPEKER.P_CREATE_JOBS(20,1,'SIMULATE_JOBS',1);&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;With these parameter this procedure should create 20 jobs all intervals are 1 second means we are filling up T_VISIT_STATS_DETAILED and yes it works. Our replication should also work.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;select count(*) from U_EPEKER.T_VISIT_STATS_DETAILED&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;union all&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;select count(*) from U_EPEKER.T_VISIT_STATS_DETAILED@ORCL11G;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" size="1"&gt;&lt;font face="courier new"&gt;/*&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;COUNT(*)&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;-------&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;385&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;376&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font face="courier new"&gt;on the second run&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font face="courier new"&gt;COUNT(*)&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;-------&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;385&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;385&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;*/&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;so it comes a few seconds behind (the time for shipping the logs i think). What about the capture and the apply processes and i can see TOTAL_MESSAGED_CAPTURED and the TOTAL_APPLIED values are getting higher.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;select state, capture_name, total_messages_captured  from v$streams_capture;&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;/*&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;STATE,CAPTURE_NAME,TOTAL_MESSAGES_CAPTURED&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;CAPTURING CHANGES,CAPTURE_SCHEMA_U_EPEKER,112817&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;*/&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;select state, apply_name, total_applied from v$streams_apply_coordinator@ORCL11G;&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;/*&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;STATE,APPLY_NAME,TOTAL_APPLIED&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;IDLE,APPLY_SCH_U_EPEKER,753&lt;/font&gt;&lt;br /&gt;&lt;font style="color: rgb(0, 153, 0);" face="courier new"&gt;*/&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Bonus: Excluding a table from the schema replication, it works!.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;BEGIN&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;DBMS_STREAMS_ADM.ADD_TABLE_RULES&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;(&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;table_name      =&gt; 'u_epeker.t_visit_stats_detailed',&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;streams_type    =&gt; 'capture',&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;streams_name    =&gt; 'capture_schema_u_epeker',&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;queue_name      =&gt; 'queue_capt_sch_u_epeker',&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;include_dml     =&gt; true,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;include_ddl     =&gt; true,&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;source_database =&gt; 'orcl',&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;inclusion_rule  =&gt; false  --specifies the negative rule set&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;);&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;END;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font face="courier new"&gt;exec DBMS_RULE_ADM.DROP_RULE('T_VISIT_STATS_DETAILED50',true);&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;exec DBMS_RULE_ADM.DROP_RULE('T_VISIT_STATS_DETAILED51',true);&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I can drop the simulation jobs and streams configuration for now.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;font face="courier new"&gt;-- with u_epeker&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;exec U_EPEKER.P_DROP_JOBS;&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;exec DBMS_STREAMS_ADM.REMOVE_STREAMS_CONFIGURATION;&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;-- and on the remote server&lt;/font&gt;&lt;br /&gt;&lt;font face="courier new"&gt;exec DBMS_STREAMS_ADM.REMOVE_STREAMS_CONFIGURATION@ORCL11G;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I faced some problem while creating this schema replication configuration with streams.&lt;br /&gt;&lt;br /&gt;The weird problem was, cannot shipping the logs to the destination from the source. When I examine the alert.log file of the source database i saw lots of ORA-01031 Insufficient Privileges.&lt;br /&gt;After a little seach on the otn i solved the problem with createing the passwordfile from scratch with orapwd. Strange problem and i still dont know the underlying reason, anyway it is solved.&lt;br /&gt;&lt;br /&gt;While instantiation i got an error. As this is a schema replication dont forget to create the same tablespace on the destination or else user/schema creation fails.&lt;br /&gt;&lt;br /&gt;And last, an ORA-00600 problem which is &lt;font size="1"&gt;&lt;span style="font-family: courier new;"&gt;ORA-00600: internal error code, arguments: [kwqbmcrcpts101], [], [], [], [], [], [], []&lt;/span&gt;&lt;/font&gt; . I figured this problem after i dropped all streams configuration from the both databases and after 2 days i released that host is run out of the disk space. I found that there are lots of dump files under bdump. After a search on otn, i think i hit a 10.2.0.3 bug which occurs on streams environment. As this is a test environment i bounced the db. The problem is solved as i have already deleted streams configuration. &lt;a href="http://forums.oracle.com/forums/thread.jspa?threadID=960277&amp;amp;tstart=90"&gt;the subject on oracle forums&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-7115995495926968217?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/7115995495926968217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2010/04/schema-replication-with-oracle-streams.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7115995495926968217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7115995495926968217'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2010/04/schema-replication-with-oracle-streams.html' title='Schema replication with Oracle Streams'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-6313253802910185663</id><published>2010-04-01T11:05:00.010+03:00</published><updated>2010-04-21T10:59:32.961+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Streams'/><title type='text'>"PAUSED" state for streams capture process</title><content type='html'>My test replication somehow got broken and does not apply changes to the target database (Seem a new challange for me!) First thing i checked was streams capture process and i saw the weird message following.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);font-size:78%;" &gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;" &gt;select sid, &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;" &gt;       serial#, &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;" &gt;       capture_name, &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;" &gt;       state &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:courier new;" &gt;  from v$streams_capture;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;/*  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;SID SERIAL# CAPTURE_NAME                        STATE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;--  -------  ------------                        -----&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;121 1524    CAPTURE_SCHEMA_U_EPEKER  PAUSED FOR FLOW CONTROL&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;*/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now if capture process is stopped, may be i need to check what is going on the apply process. But it seems nothing is received by the capture process. I think the problem should be on the capture side.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:courier new;"&gt;select sid,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       serial#,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       state,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       apply#,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       apply_name,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       total_applied,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       total_errors &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  from v$streams_apply_coordinator@ORCL11G;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;SID SERIAL# STATE   APPLY#  APPLY_NAME                  TOTAL_APPLIED   TOTAL_ERRORS&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;--- ------   ----    ------  -----------                 ------------- ------------&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;110 4208       IDLE     1      APPLY_SCH_U_EPEKER  0                           0&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;*/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I still didnt understand anything from this message "PAUSED FOR FLOW CONTROL". I did a little search on Google and the i come to &lt;a href="http://www.filibeto.org/sun/lib/nonsun/oracle/11.1.0.6.0/B28359_01/server.111/b28322/troub_rep.htm"&gt;Oracle Documentation&lt;/a&gt; as always. It seems i need to check the streams_pool_size parameter.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:courier new;"&gt;select queue_name, sender_name, num_msgs, unbrowsed_msgs, memory_usage, publisher_state from V$BUFFERED_PUBLISHERS;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;&lt;br /&gt;/*&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;QUEUE_NAME                                        SENDER_NAME                                         NUM_MSGS    UNBROWSED_MSGS  MEMORY_USAGE    PUBLISHER_STATE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;---------               -----------                                         --------    --------------  -----------       ---------------&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;QUEUE_CAPT_SCH_U_EPEKER CAPTURE_SCHEMA_U_EPEKER     15057             15057                             87                                  IN FLOW CONTROL: TOO MANY UNBROWSED MESSAGES&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;*/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If the memory usage stands for MB which seems 87, then there could be a problem. As with the following invesitgation it seems ASSM gives 56Mb to streams_pool_size and it seems there could be a lack of memory. I decided to increase the streams_pool_size to 200Mb.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:courier new;"&gt;select name, value from v$parameter where name = 'streams_pool_size';&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;/*&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;NAME                                          VALUE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;----                                          -----&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;streams_pool_size   0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;select name, value/1024/1024 as mb from v$parameter where name = 'sga_target';&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;/*&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;NAME                    MB&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;----       --&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sga_target  512&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;*/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:courier new;"&gt;select pool, round(sum(bytes)/1024/1024) as MB from v$sgastat group by pool;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;POOL                        MB&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;----              --&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;                  140&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;java pool               12&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;streams pool         56&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;shared pool           300&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;large pool             4&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;*/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:courier new;"&gt;alter system set sga_target=1G scope=spfile;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;alter system set streams_pool_size=200M scope=spfile;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;shutdown immediate;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;startup;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As soon as the database opened capture process is up again. And the publishers state is now "PUBLISHING MESSAGES"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:courier new;"&gt;select sid,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     serial#,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     capture_name,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     state&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;from v$streams_capture;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;SID SERIAL# CAPTURE_NAME                           STATE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;--- ------   ------------            -----&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;151 1             CAPTURE_SCHEMA_U_EPEKER     CAPTURING CHANGES&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;*/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:courier new;"&gt;select queue_name, sender_name, num_msgs, unbrowsed_msgs, memory_usage, publisher_state from V$BUFFERED_PUBLISHERS;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;QUEUE_NAME                               SENDER_NAME                         NUM_MSGS    UNBROWSED_MSGS  MEMORY_USAGE    PUBLISHER_STATE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;----------              -----------                         --------    --------------  ------------    ---------------&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;QUEUE_CAPT_SCH_U_EPEKER     CAPTURE_SCHEMA_U_EPEKER 44                0                            5                          PUBLISHING MESSAGES&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;*/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-6313253802910185663?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/6313253802910185663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2010/04/paused-state-for-streams-capture.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6313253802910185663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6313253802910185663'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2010/04/paused-state-for-streams-capture.html' title='&quot;PAUSED&quot; state for streams capture process'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-9095378548483019273</id><published>2010-03-26T19:36:00.010+02:00</published><updated>2010-04-20T10:03:31.855+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google Apps'/><title type='text'>Google Docs instead of Google Notes</title><content type='html'>I used to take notes on &lt;a href="http://www.google.com/notebook"&gt;Google Notebook&lt;/a&gt; which is not supported any more and has some constraints (especially on note size). &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/notebook/user/03315935748025284432"&gt;Google Notebook - Shared Notes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;From now on I decided to use &lt;a href="http://www.google.com/docs"&gt;Google Docs&lt;/a&gt;. Here are my shared documents. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://docs.google.com/leaf?id=0B4iHu58AFesMOTQyNThhMzQtNzg4Yy00NTJhLTg4ZTQtMDA0Y2MxYzM5OTZk&amp;hl=en"&gt;Oracle Documents&lt;/a&gt;&lt;br /&gt;&lt;a href="http://docs.google.com/leaf?id=0B4iHu58AFesMZjBmNTllODQtOTFlZS00ZjA1LTgzNWYtYjcwYmJlNmU5MTA4&amp;hl=en"&gt;UNIX Documents&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There are scripts and documents more than i shared, but i have to reformat them before sharing. I hope i will do this handling on my spare times. &lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-9095378548483019273?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/9095378548483019273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2010/03/google-docs-instead-of-google-notes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/9095378548483019273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/9095378548483019273'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2010/03/google-docs-instead-of-google-notes.html' title='Google Docs instead of Google Notes'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-6906947557874713635</id><published>2010-03-22T08:22:00.008+02:00</published><updated>2012-01-08T00:27:09.102+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Solaris'/><category scheme='http://www.blogger.com/atom/ns#' term='Course Notes'/><title type='text'>SA200-S10 - Solaris Admin I Course Notes</title><content type='html'>Last week i accomplished Sun Solaris 10 Admin I (SA200-S10) training for 5 days.&lt;br /&gt;&lt;br /&gt;I used to admin RHEL4 and RHEL5 operating systems for years but Solaris is far beyond. Especially ZFS and filesystem snapshot utilities are pretty effective as well as service management features.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://docs.google.com/document/d/16MWXR7ljN4Dep6tvqRsX3lMJSPh_V_0VUgUh3UWD0H8/edit"&gt;Here are my course notes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getCourseDesc?dc=D61846GC10"&gt;And the course details&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.opensolaris.com/"&gt;It is good to be open and downloadable for free&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-6906947557874713635?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/6906947557874713635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2010/03/sa200-s10-solaris-admin-i-course-notes.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6906947557874713635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6906947557874713635'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2010/03/sa200-s10-solaris-admin-i-course-notes.html' title='SA200-S10 - Solaris Admin I Course Notes'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-6054434709840191045</id><published>2010-02-23T11:33:00.007+02:00</published><updated>2012-01-08T00:30:02.957+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>testing SQL Server 2005 partitioning option</title><content type='html'>This post is a version of the pervious "SQL Server Partitioning Option" explanatory presentation of mine which i wrote for a friend of mine. The presentation starts with what is partitioning, why to use table partitions, how to use the partitons and advantages. All the chapters basis on one test case which consists of partitioning a table and examine the IO performance before and after the partition operation. &lt;br /&gt;&lt;br /&gt;&lt;u&gt;What is partitioning&lt;/u&gt;&lt;br /&gt;Partitioning is basically aggregation of the data by its meaning or value on different physical structures and this also brings retrieve times to acceptible values. &lt;br /&gt;&lt;br /&gt;As this option can be used for archiving needs it is usually used for faster reporting and query performances. &lt;br /&gt;&lt;br /&gt;&lt;u&gt;Why to use partitioning&lt;/u&gt;&lt;br /&gt;The mostly used area of the partitioning is increasing full table scan performances. One of the most obvious reason of the unavoidable full table scans which are; accessing more than certain amount of table data (There are different methods to avoid or increasing performance on full table scans but they are not in the scope of this article while we are concerning partitioning option of Microsoft SQL Server).&lt;br /&gt;&lt;br /&gt;As well as performance considerations, partitioning also helps archiving in large tables especially log tables that are stored on daily/monthly or even yearly basis. There are lots of structures that holds the older data of the table (say older than 6 months) on SATA disks which are cheaper and on compressed partitions. &lt;br /&gt;&lt;br /&gt;&lt;u&gt;How to use partitioning&lt;/u&gt;&lt;br /&gt;I have used a Windows Server 2003 Standart Edition Operating system with SQL Server 2005 Enterprise edition (By the way SQL Server Standart Edition does not support partitioning). Recommended hardware requirements were 1Gb of ram 1 CPU and minimum 10Gb of disk space which i installed my virtual machine with these configurations. &lt;br /&gt;&lt;br /&gt;First we need a comparison sql query which I used a standart built-in sql server Adventureworks database. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;select &lt;br /&gt;cat.name as category_name, &lt;br /&gt;subcat.name as subcategory_name, &lt;br /&gt;prd.* &lt;br /&gt;from &lt;br /&gt;AdventureWorks.Production.Product prd LEFT JOIN &lt;br /&gt;AdventureWorks.Production.ProductSubCategory subcat ON&lt;br /&gt;(prd.ProductSubcategoryID=subcat.ProductSubcategoryID) LEFT JOIN &lt;br /&gt;AdventureWorks.Production.ProductCategory cat ON&lt;br /&gt;cat.ProductCategoryID=subcat.ProductCategoryID&lt;br /&gt;where&lt;br /&gt;cat.name is not null and&lt;br /&gt;subcat.name is not null&lt;br /&gt;order by &lt;br /&gt;cat.Name,subcat.name&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now i decided to build a structure that has four different filegroups which correspond to each category so that one query can stick on four of these datafiles simultaneously. To achieve this first i will create four filegroups and add one file to each filegroups as follows (corresponds creating tablespaces on a Oracle database and adding one datafile to each tablespace). &lt;br /&gt;&lt;br /&gt;In the real world i would want to spread the datafiles over four individual drives to increase the disk throughput but in this test case i dont have that kind of test environment. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;ALTER DATABASE AdventureWorks ADD FILEGROUP [FG1]&lt;br /&gt;ALTER DATABASE AdventureWorks ADD FILEGROUP [FG2]&lt;br /&gt;ALTER DATABASE AdventureWorks ADD FILEGROUP [FG3]&lt;br /&gt;ALTER DATABASE AdventureWorks ADD FILEGROUP [FG4]&lt;br /&gt;&lt;br /&gt;ALTER DATABASE AdventureWorks&lt;br /&gt;ADD FILE &lt;br /&gt;(NAME = N'FG1_F1',&lt;br /&gt;FILENAME = N'C:\FG1_F1.ndf',&lt;br /&gt;SIZE = 5MB,&lt;br /&gt;MAXSIZE = 100MB,&lt;br /&gt;FILEGROWTH = 5MB)&lt;br /&gt;TO FILEGROUP [FG1]&lt;br /&gt;&lt;br /&gt;ALTER DATABASE AdventureWorks&lt;br /&gt;ADD FILE &lt;br /&gt;(NAME = N'FG2_F1',&lt;br /&gt;FILENAME = N'C:\FG2_F1.ndf',&lt;br /&gt;SIZE = 5MB,&lt;br /&gt;MAXSIZE = 100MB,&lt;br /&gt;FILEGROWTH = 5MB)&lt;br /&gt;TO FILEGROUP [FG2]&lt;br /&gt;&lt;br /&gt;ALTER DATABASE AdventureWorks&lt;br /&gt;ADD FILE &lt;br /&gt;(NAME = N'FG3_F1',&lt;br /&gt;FILENAME = N'C:\FG3_F1.ndf',&lt;br /&gt;SIZE = 5MB,&lt;br /&gt;MAXSIZE = 100MB,&lt;br /&gt;FILEGROWTH = 5MB)&lt;br /&gt;TO FILEGROUP [FG3]&lt;br /&gt;&lt;br /&gt;ALTER DATABASE AdventureWorks&lt;br /&gt;ADD FILE &lt;br /&gt;(NAME = N'FG4_F1',&lt;br /&gt;FILENAME = N'C:\FG4_F1.ndf',&lt;br /&gt;SIZE = 5MB,&lt;br /&gt;MAXSIZE = 100MB,&lt;br /&gt;FILEGROWTH = 5MB)&lt;br /&gt;TO FILEGROUP [FG4]&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I decided to define a partition strategy over the "category" column which has evenly distributed datasets (you can check by aggregating the data with "group by and count").&lt;br /&gt;&lt;br /&gt;The first thing we need is a partitioning function which will create a basis for partition scheme. And then create the partitioning schema based on the parititon function and on the desired filegroups. After all i will create the table on the partition scheme which means using the partition function and all of the filegroups. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;-- create the partition function&lt;br /&gt;CREATE PARTITION FUNCTION [f_part_category] (char(20))&lt;br /&gt;AS RANGE LEFT FOR VALUES ('Bikes', 'Components', 'Clothing', 'Accessories');&lt;br /&gt;&lt;br /&gt;-- check the partition function&lt;br /&gt;select * from sys.partition_functions&lt;br /&gt;&lt;br /&gt;name                function_id   type_desc       &lt;br /&gt;------------------  ------------- --------------- &lt;br /&gt;f_part_category     65539         RANGE           &lt;br /&gt;&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;-- create the partition scheme&lt;br /&gt;CREATE PARTITION SCHEME s_part_category&lt;br /&gt;AS PARTITION f_part_category&lt;br /&gt;TO ([FG1], [FG2], [FG3], [FG4], [FG4]);&lt;br /&gt;&lt;br /&gt;-- check the partition scheme&lt;br /&gt;select * from sys.partition_schemes&lt;br /&gt;&lt;br /&gt;name                 data_space_id      type  type_desc                  &lt;br /&gt;-------------------- -----------------  ----  -----------------&lt;br /&gt;s_part_category      65601              PS    PARTITION_SCHEME           &lt;br /&gt;&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[t_product_part](&lt;br /&gt;[category_name] [char](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,&lt;br /&gt;[subcategory_name] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,&lt;br /&gt;[ProductID] [int] NOT NULL,&lt;br /&gt;[Name] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,&lt;br /&gt;[ProductNumber] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,&lt;br /&gt;[MakeFlag] [bit] NOT NULL,&lt;br /&gt;[FinishedGoodsFlag] [bit] NOT NULL,&lt;br /&gt;[Color] [nvarchar](15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,&lt;br /&gt;[SafetyStockLevel] [smallint] NOT NULL,&lt;br /&gt;[ReorderPoint] [smallint] NOT NULL,&lt;br /&gt;[StandardCost] [money] NOT NULL,&lt;br /&gt;[ListPrice] [money] NOT NULL,&lt;br /&gt;[Size] [nvarchar](5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,&lt;br /&gt;[SizeUnitMeasureCode] [nchar](3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,&lt;br /&gt;[WeightUnitMeasureCode] [nchar](3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,&lt;br /&gt;[Weight] [decimal](8, 2) NULL,&lt;br /&gt;[DaysToManufacture] [int] NOT NULL,&lt;br /&gt;[ProductLine] [nchar](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,&lt;br /&gt;[Class] [nchar](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,&lt;br /&gt;[Style] [nchar](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,&lt;br /&gt;[ProductSubcategoryID] [int] NULL,&lt;br /&gt;[ProductModelID] [int] NULL,&lt;br /&gt;[SellStartDate] [datetime] NOT NULL,&lt;br /&gt;[SellEndDate] [datetime] NULL,&lt;br /&gt;[DiscontinuedDate] [datetime] NULL,&lt;br /&gt;[rowguid] [uniqueidentifier] NOT NULL,&lt;br /&gt;[ModifiedDate] [datetime] NOT NULL&lt;br /&gt;) ON s_part_category (category_name)&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now; time to test the performance issue. As the data is not heavily loaded we can check the execution plans of the before and after queries. &lt;br /&gt;&lt;br /&gt;&lt;font face='courier new' size='1'&gt;&lt;br /&gt;insert into t_product_part select * from master.dbo.v_products2&lt;br /&gt;&lt;br /&gt;select * from t_product_part&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;BEFORE PARTITIONING&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_fSrIpdF1Zdk/S4Oig-97OCI/AAAAAAAAA_A/zx4IlbErkso/s1600-h/sql_server_part_before.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 244px;" src="http://4.bp.blogspot.com/_fSrIpdF1Zdk/S4Oig-97OCI/AAAAAAAAA_A/zx4IlbErkso/s400/sql_server_part_before.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5441371462335936546" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;AFTER PARTITIONING&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_fSrIpdF1Zdk/S4OihO_nSWI/AAAAAAAAA_I/I28loaEQh6M/s1600-h/sql_server_part_after.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 247px;" src="http://1.bp.blogspot.com/_fSrIpdF1Zdk/S4OihO_nSWI/AAAAAAAAA_I/I28loaEQh6M/s400/sql_server_part_after.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5441371466637986146" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Conclusion&lt;/u&gt;&lt;br /&gt;Effective IO usage with using more than one datafile simultaneously.&lt;br /&gt;Remarkable increase in the IO performance.&lt;br /&gt;2.3 times faster IO performance with the sample data (with only one drive) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-6054434709840191045?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/6054434709840191045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2010/02/testing-sql-server-2005-partitioning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6054434709840191045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6054434709840191045'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2010/02/testing-sql-server-2005-partitioning.html' title='testing SQL Server 2005 partitioning option'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_fSrIpdF1Zdk/S4Oig-97OCI/AAAAAAAAA_A/zx4IlbErkso/s72-c/sql_server_part_before.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-3097311338375594979</id><published>2009-11-11T22:36:00.011+02:00</published><updated>2009-11-11T22:52:50.789+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Enterprise Manager Grid Control'/><title type='text'>creating user defined metric for monitoring job durations</title><content type='html'>In this production system there are some number of database jobs (not Scheduler Jobs) running on different time intervals. Some of these jobs are running on every five minutes while the other running on every hour. There are also some batch jobs scheduled to be run on every night. &lt;br /&gt;&lt;br /&gt;There was a custom developed Oracle9i script to monitor every job duration and warn the DBA if there is a broken job or a job with more than three hours of duration. As this database is upgraded to 10g now we are able to use "Notification Rules" and "User Defined Metrics" to monitor the database jobs. This approach will supply us the historical data collection and also the standart notification method with all other EM Console messages. We also will not need to compile this old package on all of the production databases instead the User Defined Metric can be applied to all of the databases with including the metric in the monitoring templates.&lt;br /&gt;&lt;br /&gt;"User Defined Metrics" page can be reached from a link at the bottom of the main page of the Enterprise Manager DB Console just under the Related Links section shown below. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_fSrIpdF1Zdk/SvsiqdiOWfI/AAAAAAAAA9o/qs1ZsQu17rY/s1600-h/1User-Defined+Metrics_Link.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 54px;" src="http://1.bp.blogspot.com/_fSrIpdF1Zdk/SvsiqdiOWfI/AAAAAAAAA9o/qs1ZsQu17rY/s320/1User-Defined+Metrics_Link.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5402950290839067122" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;When you click to the "User-Defined Metrics" link on the main page of the EM DB Console, User Defined Metrics are listed. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_fSrIpdF1Zdk/Svsi5bIOoLI/AAAAAAAAA9w/zrS74a8M9JM/s1600-h/2User-Defined+Metrics_MainPage.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 68px;" src="http://1.bp.blogspot.com/_fSrIpdF1Zdk/Svsi5bIOoLI/AAAAAAAAA9w/zrS74a8M9JM/s320/2User-Defined+Metrics_MainPage.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5402950547891200178" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can manage the your own custom metrics by using the right top buttons. You can simply select on of the User Defined Metric and click on the "View Data" Button.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_fSrIpdF1Zdk/SvsjEHTn4hI/AAAAAAAAA94/9aQm6gOGwr0/s1600-h/3User-Defined+Metrics_Buttons.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 102px;" src="http://1.bp.blogspot.com/_fSrIpdF1Zdk/SvsjEHTn4hI/AAAAAAAAA94/9aQm6gOGwr0/s320/3User-Defined+Metrics_Buttons.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5402950731548844562" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;When you click on the "View Data" button the Metric Value History of the specified Metric can be seen. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_fSrIpdF1Zdk/SvsjtDYCDKI/AAAAAAAAA-A/4wmU4li3MeU/s1600-h/4User-Defined+Metrics_ViewData.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 255px;" src="http://4.bp.blogspot.com/_fSrIpdF1Zdk/SvsjtDYCDKI/AAAAAAAAA-A/4wmU4li3MeU/s320/4User-Defined+Metrics_ViewData.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5402951434868231330" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Again from the main page of the "User-Defined Metrics" you can click on the "Create" Button to create a brand new User Defined Metric. There is a sample new metric creation page values which i used for the metric UDM_LONG_RUNNING_JOBS. This metric calculates the job durations and notified the DBA if there are jobs which have more than 180 Minutes of duration time. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_fSrIpdF1Zdk/Svsj2b1JiuI/AAAAAAAAA-I/HjqSnEXNz98/s1600-h/5User-Defined+Metrics_Create.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 170px;" src="http://4.bp.blogspot.com/_fSrIpdF1Zdk/Svsj2b1JiuI/AAAAAAAAA-I/HjqSnEXNz98/s320/5User-Defined+Metrics_Create.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5402951596051630818" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This metric has a string value and collection SQL of the metric is as follows. If the return value contains "DURATION" string then EM Console pretends as it exceeds a Critical Treshold and throws a Critical Alert. Metric collection runs every 5 minutes. At least 1 occurance is sufficient to send a Critical Alert. &lt;br /&gt;&lt;br /&gt;&lt;font face="courier new" size="1"&gt;&lt;br /&gt;select RETURN from &lt;br /&gt;(&lt;br /&gt;select 'DURATION: ' || round((sysdate-this_date)*24*60,2) || 'minutes    JOB: ' || job || ' -&gt; ' ||  substr(WHAT,1,50) as RETURN from &lt;br /&gt;(&lt;br /&gt;select &lt;br /&gt;  CASE when round((sysdate-this_date)*24*60,2) &gt;= 5 then 'TRUE' else 'FALSE' end as return, &lt;br /&gt;  round((sysdate-this_date)*24*60,2) as minutes, &lt;br /&gt;  this_date, &lt;br /&gt;  sysdate, &lt;br /&gt;  job, &lt;br /&gt;  schema_user, &lt;br /&gt;  last_date, &lt;br /&gt;  next_date, &lt;br /&gt;  total_time, &lt;br /&gt;  interval,&lt;br /&gt;  what&lt;br /&gt;from &lt;br /&gt;  dba_jobs &lt;br /&gt;where &lt;br /&gt;  broken='N' and &lt;br /&gt;  LAST_DATE is not NULL &lt;br /&gt;order by &lt;br /&gt;  next_date asc&lt;br /&gt;)&lt;br /&gt;where return='TRUE'&lt;br /&gt;group by round((sysdate-this_date)*24*60,2),job,substr(WHAT,1,50)&lt;br /&gt;UNION&lt;br /&gt;select 'OK' as RETURN from dual&lt;br /&gt;)&lt;br /&gt;where rownum=1&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;The last thing is, if you want an email notification when a Critical Alert triggered by this User Defined Metric you should add this metric to the notification rules which is in the preferences page of the EM Grid Control.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_fSrIpdF1Zdk/Svsj_2SENzI/AAAAAAAAA-Q/P6SCy0jXqPY/s1600-h/6User-Defined+Metrics_Preferences.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 241px;" src="http://1.bp.blogspot.com/_fSrIpdF1Zdk/Svsj_2SENzI/AAAAAAAAA-Q/P6SCy0jXqPY/s320/6User-Defined+Metrics_Preferences.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5402951757771061042" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-3097311338375594979?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/3097311338375594979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2009/11/creating-user-defined-metric-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/3097311338375594979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/3097311338375594979'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2009/11/creating-user-defined-metric-for.html' title='creating user defined metric for monitoring job durations'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SvsiqdiOWfI/AAAAAAAAA9o/qs1ZsQu17rY/s72-c/1User-Defined+Metrics_Link.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-83874681139792679</id><published>2009-11-04T19:13:00.003+02:00</published><updated>2012-01-08T00:34:32.878+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>what is datapump doing in my system tablespace</title><content type='html'>One of our datapump export jobs was continously ending unsuccessfully with the following error. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;Job "SYSTEM"."SYS_EXPORT_FULL_06" stopped due to fatal error at 01:42:36&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I decided to investigate the log file and seems there is a lack of available space in the system tablespace and the datapump job goes in to the resumable wait and after 2 hours (which is a default resumable timeout value) fails. The error lines as follows.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;ORA-39171: Job is experiencing a resumable wait.&lt;br /&gt;ORA-01653: unable to extend table SYSTEM.SYS_EXPORT_FULL_06 by 128 in tablespace SYSTEM&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I think I should investigate the root cause of the problem. I want to know what objects are using the SYSTEM tablespace first. Listing the largest segments would be handy. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;select &lt;br /&gt;segment_name, bytes/1024/1024 as MB from dba_segments &lt;br /&gt;where &lt;br /&gt;tablespace_name='SYSTEM' &lt;br /&gt;order by bytes desc; &lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;SEGMENT_NAME                MB&lt;br /&gt;------------                --&lt;br /&gt;SYS_LOB0001316900C00039$$   3072&lt;br /&gt;SYS_LOB0001344581C00039$$   3054&lt;br /&gt;SYS_LOB0001343732C00039$$   3029&lt;br /&gt;SYS_LOB0001320071C00039$$   2375&lt;br /&gt;SYS_LOB0001344712C00039$$   1216&lt;br /&gt;C_OBJ#                      816&lt;br /&gt;I_COL1                      745&lt;br /&gt;I_COL2                      484&lt;br /&gt;*/&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What are these SYSTEM generated segments?? They are allocating lots of space here. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;select &lt;br /&gt;owner, segment_name, segment_type, tablespace_name, bytes/1024/1024 as MB &lt;br /&gt;from &lt;br /&gt;dba_segments &lt;br /&gt;where &lt;br /&gt;segment_name = 'SYS_LOB0001344712C00039$$'&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;OWNER   SEGMENT_NAME                SEGMENT_TYPE    TABLESPACE_NAME MB&lt;br /&gt;-----   ------------                ------------    --------------- --&lt;br /&gt;SYSTEM  SYS_LOB0001344712C00039$$   LOBSEGMENT      SYSTEM          1216&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;select &lt;br /&gt;owner, table_name, column_name, segment_name &lt;br /&gt;from &lt;br /&gt;dba_lobs &lt;br /&gt;where segment_name = 'SYS_LOB0001344712C00039$$';&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;OWNER   TABLE_NAME          COLUMN_NAME     SEGMENT_NAME&lt;br /&gt;-----   ----------          -----------     ------------&lt;br /&gt;SYSTEM  SYS_EXPORT_FULL_05  XML_CLOB        SYS_LOB0001344712C00039$$&lt;br /&gt;*/ &lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now it is clear. Datapump jobs locked themselves because of the tables created by the jobs itself (master tables of the datapump jobs). I think when the jobs couldnt ended up with success (or failed unexpectedly), datapump cannot tidy up its behind. Let me see the datapump jobs existing in the database. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;select * from dba_datapump_jobs;&lt;br /&gt;select * from dba_datapump_sessions;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;OWNER_NAME  JOB_NAME            OPERATION       JOB_MODE        STATE&lt;br /&gt;----------  --------            --------        --------        -----       &lt;br /&gt;SYSTEM      SYS_EXPORT_FULL_04  EXPORT          FULL            NOT RUNNING &lt;br /&gt;SYSTEM      SYS_EXPORT_FULL_05  EXPORT          FULL            NOT RUNNING&lt;br /&gt;*/&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I think that is what i guess. The jobs are not running and there no sessions attached to them. I decided to drop the tables to obtain some free space to the SYSTEM tablespace.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 80%;"&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;drop table SYSTEM.SYS_EXPORT_FULL_04;&lt;br /&gt;&lt;br /&gt;select &lt;br /&gt;segment_name, bytes/1024/1024 as MB from dba_segments &lt;br /&gt;where &lt;br /&gt;tablespace_name='SYSTEM' &lt;br /&gt;order by bytes desc; &lt;br /&gt;&lt;br /&gt;select to_char(trunc(sum(bytes)/1024/1024),'99,999,999') as FREE_MB from dba_free_space where tablespace_name='SYSTEM';&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;FREE_MB&lt;br /&gt;------&lt;br /&gt;14,644&lt;br /&gt;*/&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now it is OK. 20Gb of SYSTEM tablespace is now has more than 14Gb of free space. Let me investigate the problem further for not to fall into the same problem again. When i check the available space of filesystem which datapump job works at, there seems a little space left on the disks. Then it is possible to be an unexpected job failure.&lt;br /&gt;&lt;br /&gt;Meanwhile, As far as i know if you are using datapump in parallel mode you should obtain more than one dumpfile. You can attach %U parameter at the end of the file then datapump will automatically create the number of the files for every parallel thread. But in this case there is only one file is specified and 6 parallel thread is trying to be used. I dont know if this is the real cause of the problem but i will definitely remove the parallel clause from the parameter file. &lt;br /&gt;&lt;br /&gt;There is another option here that i didnt tried before which is compression. I am not sure of this but may be the compression operation of the METADATA is done in the system tablespace? Or somehow needs some space in the database. It look silly because if the compression is done in an algorithm like this it is not really efficient, but i still dont want to use this parameter so also removed the compression parameter from the parameter file. &lt;br /&gt;&lt;br /&gt;&lt;font face='courier new' size='1'&gt;&lt;br /&gt;full=y&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#FFFF00"&gt;compression=METADATA_ONLY&lt;/font&gt;&lt;br /&gt;directory=DATA_PUMP_DIR&lt;br /&gt;dumpfile=fusion_export_full.exp&lt;br /&gt;logfile=fusion_export_full.log&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#FFFF00"&gt;parallel=6&lt;/font&gt;&lt;br /&gt;userid=system/&lt;pass&gt;@&lt;tns_alias&gt; &lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-83874681139792679?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/83874681139792679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2009/11/what-is-datapump-doing-in-my-system.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/83874681139792679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/83874681139792679'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2009/11/what-is-datapump-doing-in-my-system.html' title='what is datapump doing in my system tablespace'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-3102263838079594651</id><published>2009-10-28T17:13:00.004+02:00</published><updated>2010-06-16T09:39:48.040+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>DRCP vs Oracle Shared Server</title><content type='html'>While i was hanging out in the Oracle Database 11g New Features documents on OTN I found something interesting which is not documented on Oracle 11g New Features, Database Resident Connection Pooling (DRCP). I was surprised because this feature is very handy and usable in a lot of environment especially if you serve your data to more than one application running on more than one application server and with enormous number of connections.&lt;br /&gt;&lt;br /&gt;Before Oracle Database 11g we were all using Oracle Shared Server architecture to lower the server side user processes and their overheads to the server resources. But with 11g the similar architecture is available now called Database Resident Connection Pooling (DRCP). &lt;br /&gt;&lt;br /&gt;Quoted from the related document linked at the end of the this post:&lt;br /&gt;&lt;br /&gt;&lt;font face='courier new' size='1' style="BACKGROUND-COLOR:#FFFF00"&gt;&lt;br /&gt;"In one of our test scenarios on a 2GB system, DRCP was able to support 10 times the number of connections compared to shared servers, and 20 times the number of connections compared to dedicated servers."&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;The question; is DRCP a replacement of Oracle Shared Server?&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Related:&lt;/u&gt;&lt;br /&gt;&lt;a href='http://www.oracle.com/technology/tech/oci/pdf/oracledrcp11g.pdf'&gt;Database Resident Connection Pooling (DRCP) Oracle Database 11g Technical White Paper&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-3102263838079594651?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/3102263838079594651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2009/10/drcp-vs-oracle-shared-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/3102263838079594651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/3102263838079594651'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2009/10/drcp-vs-oracle-shared-server.html' title='DRCP vs Oracle Shared Server'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-7253017634047768021</id><published>2009-10-14T19:32:00.006+03:00</published><updated>2009-10-28T17:49:10.368+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Streams'/><title type='text'>Some Notes on Oracle Streams Table Replication</title><content type='html'>In this test, replication is made from Oracle Database version 11.1.0.7 to 11.1.0.6 database on a virtual machine. This is not a performance test but only a functional test of the streams basic abilities. This test is made on table replication basis maybe I can publish the schema replication based test in another article. &lt;br /&gt;&lt;br /&gt;Some preparation needed first and i assume both the databases are in archivelog mode. Actually documentation says only the source database is enough for archiving redologs. That is reasonable for capturing the changes and not to miss one. But my databases are both in archivelog mode so I cover this necessity.&lt;br /&gt;&lt;br /&gt;&lt;font size='1' face='courier new'&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--check if there are unsupported column types.&lt;/font&gt;&lt;br /&gt;select * from DBA_STREAMS_UNSUPPORTED;&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--create a tablespace on the source database for test purposes&lt;/font&gt;&lt;br /&gt;create tablespace TS_STREAMS_SRC DATAFILE 'D:\oracledb11g\oradata\orcl\TS_STREAMS_SRC_01.dbf' &lt;br /&gt;  SIZE 10M AUTOEXTEND ON NEXT 10M MAXSIZE 100M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--create a tablespace on the destination database for test purposes&lt;/font&gt;&lt;br /&gt;create tablespace TS_STREAMS_DEST DATAFILE 'D:\oracledb11g\oradata\orcl\TS_STREAMS_DEST_01.dbf' &lt;br /&gt;  SIZE 10M AUTOEXTEND ON NEXT 10M MAXSIZE 100M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO; &lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--creating the streams admin user on both of the databases.&lt;/font&gt;&lt;br /&gt;create user U_STREAMS_ADM identified by password&lt;br /&gt;  DEFAULT TABLESPACE TS_STREAMS_SRC&lt;br /&gt;  QUOTA UNLIMITED ON TS_STREAMS_SRC;  &lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--streams user should have dba privilege&lt;/font&gt;&lt;br /&gt;grant connect,resource,dba to U_STREAMS_ADM;  &lt;br /&gt;exec DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE('U_STREAMS_ADM',TRUE);&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--create database links on the databases to access both from SOURCE to DESTINATION and from DESTINATION to SOURCE&lt;br /&gt;&lt;br /&gt;--here ORCL_SOURCE is the tns alias for the SOURCE database and ORCL_DESTINATION is the tns alias for the DESTINATION database&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;create database link ORCL.SOURCE.LOCAL connect to U_STREAMS_ADM_SRC identified by password using 'ORCL_SOURCE';&lt;br /&gt;&lt;br /&gt;create database link ORCL.DESINATION.LOCAL connect to U_STREAMS_ADM_SRC identified by password using 'ORCL_DESTINATION';&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--a second destination should be defined on the source database to send the redo logs to the destination database&lt;/font&gt;&lt;br /&gt;alter system set LOG_ARCHIVE_DEST_2='SERVICE=ORCL ASYNC NOREGISTER VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=ORCL';&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;-- creating a table replication with MAINTAIN_TABLES&lt;br /&gt;-- with this configuration CAPTURE and PROPAGATION processes are on the source database&lt;br /&gt;-- APPLY process is on the DESTINATION database&lt;/font&gt;&lt;br /&gt;DECLARE&lt;br /&gt;  tables DBMS_UTILITY.UNCL_ARRAY;&lt;br /&gt;  BEGIN&lt;br /&gt;    tables(1) := 'scott.dept';&lt;br /&gt;    DBMS_STREAMS_ADM.MAINTAIN_TABLES(&lt;br /&gt;      table_names                  =&gt; tables,&lt;br /&gt;      source_directory_object      =&gt; NULL,&lt;br /&gt;      destination_directory_object =&gt; NULL,&lt;br /&gt;      source_database              =&gt; 'ORCL.SOURCE.LOCAL',&lt;br /&gt;      destination_database         =&gt; 'ORCL.DESTINATION.LOCAL',&lt;br /&gt;      capture_name                 =&gt; 'CAPTURE_TABLE_GRP1',&lt;br /&gt;      capture_queue_name           =&gt; 'QUEUE_CAPT_TABLE_GRP1',&lt;br /&gt;      capture_queue_user           =&gt; 'U_STREAMS_ADM',&lt;br /&gt;      propagation_name             =&gt; 'PROPAGATE_TABLE_GRP1',&lt;br /&gt;      apply_name                   =&gt; 'APPLY_TABLE_GRP1',&lt;br /&gt;      apply_queue_name             =&gt; 'QUEUE_APPLY_TABLE_GRP1',&lt;br /&gt;      apply_queue_user             =&gt; 'U_STREAMS_ADM',&lt;br /&gt;      perform_actions              =&gt; TRUE,&lt;br /&gt;      script_directory_object      =&gt; NULL,&lt;br /&gt;      script_name                  =&gt; NULL,&lt;br /&gt;      bi_directional               =&gt; FALSE,&lt;br /&gt;      include_ddl                  =&gt; TRUE,&lt;br /&gt;      instantiation                =&gt; DBMS_STREAMS_ADM.INSTANTIATION_TABLE_NETWORK);&lt;br /&gt;END;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;The procedure worked smoothly while I was waiting for it to be end with an exception. But if there is a problem with the instantiation of the replication then the following set of commands helps you to clear the inadequate configuration and then you can run the MAINTAIN_TABLES again.&lt;br /&gt;&lt;br /&gt;&lt;font face='courier new' size='1'&gt;&lt;br /&gt;SELECT * FROM DBA_RECOVERABLE_SCRIPT_ERRORS;&lt;br /&gt;execute DBMS_STREAMS_ADM.RECOVER_OPERATION('A6B753822B9C4C30A5CD87B9571ACF03','PURGE');&lt;br /&gt;exec DBMS_STREAMS_ADM.REMOVE_STREAMS_CONFIGURATION();&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--The insert tests just worked fine as follows.&lt;/font&gt;&lt;br /&gt;insert into SCOTT.DEPT values (60,'IT-DEVELOPMENT','IST');&lt;br /&gt;insert into SCOTT.DEPT values (70,'IT-STORAGE','IST');&lt;br /&gt;insert into SCOTT.DEPT values (80,'IT-BACKUP','IST');&lt;br /&gt;insert into SCOTT.DEPT values (90,'IT-WINDOWS','IST');&lt;br /&gt;insert into SCOTT.DEPT values (95,'IT-UNIX','IST');&lt;br /&gt;insert into SCOTT.DEPT values (96,'IT-SECURITY','IST');&lt;br /&gt;commit;&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--Findout the configuration and status of the processes&lt;/font&gt;&lt;br /&gt;select * from dba_capture;&lt;br /&gt;select * from dba_propagation;&lt;br /&gt;select * from dba_apply;&lt;br /&gt;select * from v$streams_capture;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Lets see if the configuration is flexible enough to add a new table rule to the existing set easily. I followed the documentation with the following commands in order.&lt;br /&gt;&lt;br /&gt;&lt;font face='courier new' size='1'&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--on source database&lt;/font&gt;&lt;br /&gt;exec DBMS_CAPTURE_ADM.STOP_CAPTURE('CAPTURE_TABLE_GRP1');&lt;br /&gt;exec DBMS_PROPAGATION_ADM.STOP_PROPAGATION('PROPAGATE_TABLE_GRP1');&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--on the destination database&lt;/font&gt;&lt;br /&gt;exec DBMS_APPLY_ADM.STOP_APPLY('APPLY_TABLE_GRP1');&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--add new rule to the CAPTURE process&lt;/font&gt;&lt;br /&gt;exec DBMS_STREAMS_ADM.ADD_TABLE_RULES( &lt;br /&gt;    TABLE_NAME =&gt;'SCOTT.EMP',&lt;br /&gt;    STREAMS_TYPE =&gt; 'CAPTURE',  &lt;br /&gt;    STREAMS_NAME =&gt; 'CAPTURE_TABLE_GRP1',  &lt;br /&gt;    SOURCE_DATABASE =&gt; 'ORCL.SOURCE.LOCAL',&lt;br /&gt;    QUEUE_NAME =&gt; 'QUEUE_CAPT_TABLE_GRP1',&lt;br /&gt;    INCLUDE_DML =&gt; TRUE,&lt;br /&gt;    INCLUDE_DDL =&gt; TRUE,&lt;br /&gt;    --DDL_RULE_NAME =&gt; NULL,&lt;br /&gt;    --DML_RULE_NAME =&gt; NULL,&lt;br /&gt;    INCLUSION_RULE =&gt; TRUE, &lt;br /&gt;    AND_CONDITION =&gt; NULL);&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--add new rule to the PROPAGATION process&lt;/font&gt;&lt;br /&gt;exec DBMS_STREAMS_ADM.ADD_TABLE_PROPAGATION_RULES(&lt;br /&gt;    TABLE_NAME =&gt; 'SCOTT.EMP',&lt;br /&gt;    STREAMS_NAME =&gt; '', --if propagation exists on source_queue_name then uses the existing propagation &lt;br /&gt;    SOURCE_QUEUE_NAME =&gt; 'U_STREAMS_ADM.QUEUE_CAPT_TABLE_GRP1',&lt;br /&gt;    DESTINATION_QUEUE_NAME =&gt; 'U_STREAMS_ADM.QUEUE_APPLY_TABLE_GRP1@ORCL.DESTINATION.LOCAL',&lt;br /&gt;    INCLUDE_DML =&gt; TRUE,&lt;br /&gt;    INCLUDE_DDL =&gt; TRUE,&lt;br /&gt;    SOURCE_DATABASE =&gt; 'ORCL.SOURCE.LOCAL',&lt;br /&gt;    INCLUSION_RULE =&gt; TRUE,&lt;br /&gt;    AND_CONDITION =&gt; NULL,&lt;br /&gt;    QUEUE_TO_QUEUE =&gt; TRUE --TRUE=queue_to_queue FALSE=queue_to_dblink&lt;br /&gt;    );&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--now the last thing is to add a new rule to the APPLY process&lt;/font&gt;&lt;br /&gt;exec DBMS_STREAMS_ADM.ADD_TABLE_RULES( &lt;br /&gt;    TABLE_NAME =&gt;'SCOTT.EMP',&lt;br /&gt;    STREAMS_TYPE =&gt; 'APPLY',  &lt;br /&gt;    STREAMS_NAME =&gt; 'APPLY_TABLE_GRP1', &lt;br /&gt;    SOURCE_DATABASE =&gt; 'ORCL.SOURCE.LOCAL',&lt;br /&gt;    QUEUE_NAME =&gt; 'QUEUE_APPLY_TABLE_GRP1',&lt;br /&gt;    INCLUDE_DML =&gt; TRUE,&lt;br /&gt;    INCLUDE_DDL =&gt; TRUE,&lt;br /&gt;    --DDL_RULE_NAME =&gt; NULL,&lt;br /&gt;    --DML_RULE_NAME =&gt; NULL,&lt;br /&gt;    INCLUSION_RULE =&gt; TRUE,&lt;br /&gt;    AND_CONDITION =&gt; NULL);&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;We can now check if the new rules are added and the conditions of the rules with the following views. We cannot see and new process configuration as i added the rules to the existing APPLY, PROPAGATION and CAPTURE processes.&lt;br /&gt;&lt;br /&gt;DBA_RULES&lt;br /&gt;DBA_RULE_SETS&lt;br /&gt;DBA_STREAMS_RULES&lt;br /&gt;DBA_RULE_SET_RULES&lt;br /&gt;&lt;br /&gt;If you did something wrong wile adding the rules you can easily delete the rules by running the following procedures which are under the DBMS_RULE_ADM. Be sure what are you deleting by selecting DBA_STREAMS_RULES. You dont want to delete a rule associated with a working process. &lt;br /&gt;&lt;br /&gt;&lt;font face='courier new' size=1&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--If you want to delete a rule you should first remove it&lt;/font&gt;&lt;br /&gt;DBMS_RULE_ADM.REMOVE_RULE&lt;br /&gt;DBMS_RULE_ADM.DELETE_RULE&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;I added the rules and now I should instantiate the table/tables manually. MAINTAIN_TABLES procedure makes this instantiation automatically for you but if you want to add the rules explicitly then you need to instantiate them.&lt;br /&gt;&lt;br /&gt;&lt;font face='courier new' size='1'&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--set the instantiation SCN of the SOURCE table/tables&lt;/font&gt;&lt;br /&gt;DECLARE&lt;br /&gt;  iscn  NUMBER;         --Variable to hold instantiation SCN value&lt;br /&gt;BEGIN&lt;br /&gt;  iscn := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER();&lt;br /&gt;  DBMS_APPLY_ADM.SET_TABLE_INSTANTIATION_SCN(&lt;br /&gt;    source_object_name    =&gt; 'scott.emp',&lt;br /&gt;    source_database_name  =&gt; 'ORCL.SOURCE.LOCAL',&lt;br /&gt;    instantiation_scn     =&gt; iscn);&lt;br /&gt;END;&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--Create the table on the DESTINATION database.&lt;/font&gt;&lt;br /&gt;create table scott.emp as select * from scott.emp@ORCL.SOURCE.LOCAL;&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--The last thing is not to forget the SUPPLEMENTAL LOGGING for the replicated table to capture and apply the changes. &lt;/font&gt;&lt;br /&gt;ALTER TABLE scott.emp ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--After checking all the configuration again now I can start the processes i have stopped. &lt;br /&gt;-- on source database.&lt;/font&gt;&lt;br /&gt;exec DBMS_CAPTURE_ADM.START_CAPTURE('CAPTURE_TABLE_GRP1');&lt;br /&gt;exec DBMS_PROPAGATION_ADM.START_PROPAGATION('PROPAGATE_TABLE_GRP1');&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--On the destination database.&lt;/font&gt;&lt;br /&gt;exec DBMS_APPLY_ADM.START_APPLY('APPLY_TABLE_GRP1');&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;It seems everything worked fine as the Oracle documentation stated. Adding rules to working processes of the streams are easy accept you have to manually instantiate the tables via create table .. as .. or export/import or expdp/impdp if you are adding the rules manually. Now i want to go furher and alter a replication rule of an existing configuration of the apply process to capture only a subset of the changes. &lt;br /&gt;&lt;br /&gt;Rules can be seen by selecting DBA_RULES, DBA_RULESETS, DBA_RULE_SET_RULES or DBA_STREAMS_RULES which i prefer to use. One should be careful which rule he/she is going to alter. There are DML and DDL rules for every process. And the rule that will be altered should be related with the correct CAPTURE PROCESS (since there can be more than one capture process).&lt;br /&gt;&lt;br /&gt;In my case the rule that i will going to alter is BONUS85 as follows. Stopping the processes before any change in the configuration is a good idea. Without stopping and starting the processes the new configuration cannot be applied to the existing streams processes. &lt;br /&gt;&lt;br /&gt;&lt;font face='courier new' size='1'&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--On source database &lt;/font&gt;&lt;br /&gt;exec DBMS_CAPTURE_ADM.STOP_CAPTURE('CAPTURE_TABLE_GRP1');&lt;br /&gt;exec DBMS_PROPAGATION_ADM.STOP_PROPAGATION('PROPAGATE_TABLE_GRP1');&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--On the destination database&lt;/font&gt;&lt;br /&gt;exec DBMS_APPLY_ADM.STOP_APPLY('APPLY_TABLE_GRP1');&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--Altering a rule capturing a subset of the data in the table.&lt;/font&gt;&lt;br /&gt;execute dbms_rule_adm.alter_rule('BONUS85',':dml.get_object_owner()=''SCOTT'' AND :dml.get_object_name()=''BONUS'' &lt;br /&gt;AND :dml.is_null_tag()=''Y'' AND :dml.get_source_database_name() = ''ORCL.DIGITURK.LOCAL''&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#FFFF00"&gt;AND (:dml.get_value(''NEW'',''ENAME'').AccessVarchar2()=''ERGEM'')');&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--On source database&lt;/font&gt;&lt;br /&gt;exec DBMS_CAPTURE_ADM.START_CAPTURE('CAPTURE_TABLE_GRP1');&lt;br /&gt;exec DBMS_PROPAGATION_ADM.START_PROPAGATION('PROPAGATE_TABLE_GRP1');&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--On the destination database&lt;/font&gt;&lt;br /&gt;exec DBMS_APPLY_ADM.START_APPLY('APPLY_TABLE_GRP1');&lt;br /&gt;&lt;br /&gt;&lt;font color="#008800"&gt;--Related views for streams monitoring &lt;/font&gt;&lt;br /&gt;select * from v$streams_apply_coordinator&lt;br /&gt;select * from v$streams_apply_reader&lt;br /&gt;select * from v$streams_apply_server&lt;br /&gt;select * from v$streams_capture&lt;br /&gt;select * from v$streams_pool_advice&lt;br /&gt;select * from v$streams_transaction&lt;br /&gt;select * from v$streams_monitor&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;As a conclusion Oracle Streams is easy to configure and use. It seems flexible to change the configuration easily and altering the existing rules to gather the subset of the changes. I did not test the performance but functional tests seems OK.&lt;br /&gt;&lt;br /&gt;Of course there is a lot of options you can use; Downstream Capture Processes, Sync Captures, Parallel Capture/Apply Processes and so on. Oracle Documentation has sufficient information about the Streams.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Related:&lt;/u&gt;&lt;br /&gt;&lt;a href='http://download.oracle.com/docs/cd/B28359_01/server.111/b28322/toc.htm'&gt;Oracle Streams Replication Administrators Guide&lt;/a&gt;&lt;br /&gt;&lt;a href='http://download.oracle.com/docs/cd/B28359_01/server.111/b28321/toc.htm'&gt;Oracle Streams Concepts and Administration&lt;/a&gt;&lt;br /&gt;&lt;a href='http://www.psoug.org/reference/cdc_demo2.html'&gt;PSOUG Streams Demo&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-7253017634047768021?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/7253017634047768021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2009/10/some-notes-on-oracle-streams-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7253017634047768021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7253017634047768021'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2009/10/some-notes-on-oracle-streams-table.html' title='Some Notes on Oracle Streams Table Replication'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-4138565787071662098</id><published>2009-05-15T16:05:00.022+03:00</published><updated>2011-01-03T20:10:00.531+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server detected a logical consistency-based I/O error</title><content type='html'>After migrating the SQL Server 2005 SP2 32-bit database to SP3 64-bit environment some queries started to complain about the following error in the SQL Server Error Logs.&lt;br /&gt;&lt;br /&gt;&lt;font size='1' face='courier new'&gt;&lt;br /&gt;Message:&lt;br /&gt;SQL Server detected a logical consistency-based I/O error: torn page (expected signature: 0x0; actual signature: 0x5be5d620). It occurred during a read of page (1:718204) in database ID 7 at offset 0x0000015eaf8000 in file 'E:\MSSQL\DATA\SMPPGatewayBEP.mdf'.  Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;It is obvious that there happened an IO inconsistency. Maybe while the backup or the restore operation. I decided to execute &lt;font size='1' face='courier' style="BACKGROUND-COLOR:#FFFF00" &gt;DBCC CHECKDB('SMPPGatewayBEP')&lt;/font&gt; But the following output generated by the server.&lt;br /&gt;&lt;br /&gt;&lt;font size='1' face='courier new'&gt;&lt;br /&gt;Msg 8967, Level 16, State 216, Line 1&lt;br /&gt;An internal error occurred in DBCC that prevented further processing. Contact Customer Support Services.&lt;br /&gt;DBCC results for 'SMPPGatewayBEP'.&lt;br /&gt;Msg 8921, Level 16, State 1, Line 1&lt;br /&gt;Check terminated. A failure was detected while collecting facts. Possibly tempdb out of space or a system table is inconsistent. Check previous errors.&lt;br /&gt;CHECKDB found 0 allocation errors and 0 consistency errors in database 'SMPPGatewayBEP'.&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;After a little search on msdn i decided to try to set the database into the single user mode by running:&lt;br /&gt;&lt;br /&gt;&lt;font size='1' style="BACKGROUND-COLOR:#FFFF00" face='courier new'&gt;&lt;br /&gt;alter database SMPPGatewayBEP SET SINGLE_USER WITH ROLLBACK IMMEDIATE&lt;br /&gt;DBCC CHECKDB('SMPPGatewayBEP', REPAIR_ALLOW_DATA_LOSS)&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Now it started to repair the data pages by reading the log pages. There is thousands of lines of this output so i put the head and tail part of the output. &lt;br /&gt;&lt;br /&gt;&lt;font size='1' face='courier new'&gt;&lt;br /&gt;DBCC results for 'SMPPGatewayBEP'.&lt;br /&gt;Service Broker Msg 9675, State 1: Message Types analyzed: 14.&lt;br /&gt;Service Broker Msg 9676, State 1: Service Contracts analyzed: 6.&lt;br /&gt;Service Broker Msg 9667, State 1: Services analyzed: 3.&lt;br /&gt;Service Broker Msg 9668, State 1: Service Queues analyzed: 3.&lt;br /&gt;Service Broker Msg 9669, State 1: Conversation Endpoints analyzed: 0.&lt;br /&gt;Service Broker Msg 9674, State 1: Conversation Groups analyzed: 0.&lt;br /&gt;Service Broker Msg 9670, State 1: Remote Service Bindings analyzed: 0.&lt;br /&gt;Msg 8909, Level 16, State 1, Line 1&lt;br /&gt;Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 0 (type Unknown), page ID (1:352523) contains an incorrect page ID in its page header. The PageId in the page header = (0:0).&lt;br /&gt;        The error has been repaired.&lt;br /&gt;Msg 8909, Level 16, State 1, Line 1&lt;br /&gt;Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 0 (type Unknown), page ID (1:352524) contains an incorrect page ID in its page header. The PageId in the page header = (0:0).&lt;br /&gt;        The error has been repaired.&lt;br /&gt;Msg 8909, Level 16, State 1, Line 1&lt;br /&gt;Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 0 (type Unknown), page ID (1:352525) contains an incorrect page ID in its page header. The PageId in the page header = (0:0).&lt;br /&gt;        The error has been repaired.&lt;br /&gt;Msg 8909, Level 16, State 1, Line 1&lt;br /&gt;Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 0 (type Unknown), page ID (1:352526) contains an incorrect page ID in its page header. The PageId in the page header = (0:0).&lt;br /&gt;        The error has been repaired.&lt;br /&gt;Msg 8909, Level 16, State 1, Line 1&lt;br /&gt;Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 0 (type Unknown), page ID (1:352527) contains an incorrect page ID in its page header. The PageId in the page header = (0:0).&lt;br /&gt;        The error has been repaired.&lt;br /&gt;Msg 8909, Level 16, State 1, Line 1&lt;br /&gt;Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 0 (type Unknown), page ID (1:719092) contains an incorrect page ID in its page header. The PageId in the page header = (0:0).&lt;br /&gt;        The error has been repaired.&lt;br /&gt;Msg 8909, Level 16, State 1, Line 1&lt;br /&gt;Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 0 (type Unknown), page ID (1:719093) contains an incorrect page ID in its page header. The PageId in the page header = (0:0).&lt;br /&gt;        The error has been repaired.&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;..&lt;br /&gt;.&lt;br /&gt;&lt;br /&gt;        Could not repair this error. &lt;br /&gt;        Could not repair this error. &lt;br /&gt;        Could not repair this error. &lt;br /&gt;        Could not repair this error. &lt;br /&gt;        The error has been repaired.&lt;br /&gt;        The error has been repaired.&lt;br /&gt;        The error has been repaired.&lt;br /&gt;        Could not repair this error. &lt;br /&gt;        Could not repair this error. &lt;br /&gt;        Could not repair this error. &lt;br /&gt;        Could not repair this error. &lt;br /&gt;        Could not repair this error. &lt;br /&gt;        Could not repair this error. &lt;br /&gt;        The error has been repaired.&lt;br /&gt;CHECKDB found 0 allocation errors and 1857 consistency errors not associated with any single object.&lt;br /&gt;CHECKDB fixed 0 allocation errors and 973 consistency errors not associated with any single object.&lt;br /&gt;DBCC results for 'sys.sysrowsetcolumns'.&lt;br /&gt;There are 716 rows in 8 pages for object "sys.sysrowsetcolumns".&lt;br /&gt;DBCC results for 'sys.sysrowsets'.&lt;br /&gt;There are 101 rows in 1 pages for object "sys.sysrowsets".&lt;br /&gt;DBCC results for 'sysallocunits'.&lt;br /&gt;There are 115 rows in 2 pages for object "sysallocunits".&lt;br /&gt;DBCC results for 'sys.sysfiles1'.&lt;br /&gt;There are 2 rows in 1 pages for object "sys.sysfiles1".&lt;br /&gt;DBCC results for 'sys.syshobtcolumns'.&lt;br /&gt;There are 716 rows in 9 pages for object "sys.syshobtcolumns".&lt;br /&gt;DBCC results for 'sys.syshobts'.&lt;br /&gt;There are 101 rows in 1 pages for object "sys.syshobts".&lt;br /&gt;DBCC results for 'sys.sysftinds'.&lt;br /&gt;There are 0 rows in 0 pages for object "sys.sysftinds".&lt;br /&gt;DBCC results for 'sys.sysserefs'.&lt;br /&gt;There are 115 rows in 1 pages for object "sys.sysserefs".&lt;br /&gt;DBCC results for 'sys.sysowners'.&lt;br /&gt;There are 15 rows in 1 pages for object "sys.sysowners".&lt;br /&gt;DBCC results for 'sys.sysprivs'.&lt;br /&gt;There are 135 rows in 1 pages for object "sys.sysprivs".&lt;br /&gt;DBCC results for 'sys.sysschobjs'.&lt;br /&gt;There are 134 rows in 4 pages for object "sys.sysschobjs".&lt;br /&gt;DBCC results for 'sys.syscolpars'.&lt;br /&gt;There are 629 rows in 13 pages for object "sys.syscolpars".&lt;br /&gt;DBCC results for 'sys.sysnsobjs'.&lt;br /&gt;There are 1 rows in 1 pages for object "sys.sysnsobjs".&lt;br /&gt;DBCC results for 'sys.syscerts'.&lt;br /&gt;There are 0 rows in 0 pages for object "sys.syscerts".&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;..&lt;br /&gt;.&lt;br /&gt;&lt;br /&gt;Repair: The page (1:718716) has been deallocated from object ID 174623665, index ID 7, partition ID 72057594160414720, alloc unit ID 72057594168016896 (type In-row data).&lt;br /&gt;Repair: The page (1:718717) has been deallocated from object ID 174623665, index ID 7, partition ID 72057594160414720, alloc unit ID 72057594168016896 (type In-row data).&lt;br /&gt;Repair: The page (1:718718) has been deallocated from object ID 174623665, index ID 7, partition ID 72057594160414720, alloc unit ID 72057594168016896 (type In-row data).&lt;br /&gt;Repair: The page (1:718719) has been deallocated from object ID 174623665, index ID 7, partition ID 72057594160414720, alloc unit ID 72057594168016896 (type In-row data).&lt;br /&gt;Repair: The page (1:719048) has been deallocated from object ID 174623665, index ID 7, partition ID 72057594160414720, alloc unit ID 72057594168016896 (type In-row data).&lt;br /&gt;Repair: The page (1:719049) has been deallocated from object ID 174623665, index ID 7, partition ID 72057594160414720, alloc unit ID 72057594168016896 (type In-row data).&lt;br /&gt;Repair: The page (1:719050) has been deallocated from object ID 174623665, index ID 7, partition ID 72057594160414720, alloc unit ID 72057594168016896 (type In-row data).&lt;br /&gt;Repair: The page (1:719051) has been deallocated from object ID 174623665, index ID 7, partition ID 72057594160414720, alloc unit ID 72057594168016896 (type In-row data).&lt;br /&gt;Repair: The page (1:719052) has been deallocated from object ID 174623665, index ID 7, partition ID 72057594160414720, alloc unit ID 72057594168016896 (type In-row data).&lt;br /&gt;Repair: The page (1:719053) has been deallocated from object ID 174623665, index ID 7, partition ID 72057594160414720, alloc unit ID 72057594168016896 (type In-row data).&lt;br /&gt;Repair: The page (1:719054) has been deallocated from object ID 174623665, index ID 7, partition ID 72057594160414720, alloc unit ID 72057594168016896 (type In-row data).&lt;br /&gt;Repair: The page (1:719055) has been deallocated from object ID 174623665, index ID 7, partition ID 72057594160414720, alloc unit ID 72057594168016896 (type In-row data).&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;..&lt;br /&gt;.&lt;br /&gt;&lt;br /&gt;        The error has been repaired.&lt;br /&gt;        The error has been repaired.&lt;br /&gt;        The error has been repaired.&lt;br /&gt;There are 7270488 rows in 35601 pages for object "WSLog".&lt;br /&gt;CHECKDB found 0 allocation errors and 8 consistency errors in table 'WSLog' (object ID 398624463).&lt;br /&gt;CHECKDB fixed 0 allocation errors and 8 consistency errors in table 'WSLog' (object ID 398624463).&lt;br /&gt;DBCC results for 'SettingsInbound'.&lt;br /&gt;There are 1 rows in 1 pages for object "SettingsInbound".&lt;br /&gt;DBCC results for 'SettingsDelivered'.&lt;br /&gt;There are 1 rows in 1 pages for object "SettingsDelivered".&lt;br /&gt;DBCC results for 'sysdiagrams'.&lt;br /&gt;There are 0 rows in 0 pages for object "sysdiagrams".&lt;br /&gt;DBCC results for 'ThreadMonitoring'.&lt;br /&gt;There are 0 rows in 0 pages for object "ThreadMonitoring".&lt;br /&gt;DBCC results for 'Settings'.&lt;br /&gt;There are 1 rows in 1 pages for object "Settings".&lt;br /&gt;DBCC results for 'SMPPIncoming'.&lt;br /&gt;There are 95 rows in 4 pages for object "SMPPIncoming".&lt;br /&gt;DBCC results for 'BlankMessages'.&lt;br /&gt;There are 0 rows in 0 pages for object "BlankMessages".&lt;br /&gt;DBCC results for 'TestTrace'.&lt;br /&gt;There are 2134061 rows in 46701 pages for object "TestTrace".&lt;br /&gt;DBCC results for 'ServiceParams'.&lt;br /&gt;There are 18 rows in 1 pages for object "ServiceParams".&lt;br /&gt;DBCC results for 'sys.queue_messages_1977058079'.&lt;br /&gt;There are 0 rows in 0 pages for object "sys.queue_messages_1977058079".&lt;br /&gt;DBCC results for 'sys.queue_messages_2009058193'.&lt;br /&gt;There are 0 rows in 0 pages for object "sys.queue_messages_2009058193".&lt;br /&gt;DBCC results for 'sys.queue_messages_2041058307'.&lt;br /&gt;There are 0 rows in 0 pages for object "sys.queue_messages_2041058307".&lt;br /&gt;CHECKDB found 0 allocation errors and 6622 consistency errors in database 'SMPPGatewayBEP'.&lt;br /&gt;CHECKDB fixed 0 allocation errors and 5738 consistency errors in database 'SMPPGatewayBEP'.&lt;br /&gt;repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB (SMPPGatewayBEP, repair_allow_data_loss).&lt;br /&gt;DBCC execution completed. If DBCC printed error messages, contact your system administrator.&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;After one hour finally the summary shows that lots of the page errors are repaired. Maybe I should run the same DBCC CHECKDB second time, to be sure if the remaining errors would be gone but we didnt have to wait for that. After setting the database into multiuser mode again and backing it up users were able to run their reports again.&lt;br /&gt;&lt;br /&gt;&lt;font size='1' face='courier new' style="BACKGROUND-COLOR:#FFFF00"&gt;&lt;br /&gt;alter database SMPPGatewayBEP SET MULTI_USER;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-4138565787071662098?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/4138565787071662098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2009/05/sql-server-detected-logical-consistency.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/4138565787071662098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/4138565787071662098'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2009/05/sql-server-detected-logical-consistency.html' title='SQL Server detected a logical consistency-based I/O error'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-175319473803005474</id><published>2009-02-23T22:09:00.006+02:00</published><updated>2009-02-23T22:31:13.158+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle RAC'/><title type='text'>Problem with adding a new node to RAC after ocr and voting disk change</title><content type='html'>After changing the ocr and voting disks with different raw devices, that used with installation, later on i faced a problem while adding a new node to my existing 2node cluster installation.&lt;br /&gt;&lt;br /&gt;After the first step of adding a new node to a cluster (cloning my CRS_HOME (cluster home of oracle RAC) and ran all scripts), the last step in the &lt;a href='http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/adddelunix.htm#BEICADHD'&gt;documentation&lt;/a&gt; was running root.sh in the new node's CRS_HOME. But the unexpected error was;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;font size='1'&gt;&lt;br /&gt;root@radbank04 # ./root.sh&lt;br /&gt;"/dev/rdsk/c6t600601607D731F006596A6CD2CE9DD11d0s0" does not exist. Create it before proceeding.&lt;br /&gt;Make sure that this file is shared across cluster nodes.&lt;br /&gt;1&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;I am pretty sure with the raw device definitions are OK in the new node. I decided to examine the "root.sh" to see what it is running in the background. "root.sh" was consisting of two other scripts "rootinstall" and "rootconfig".&lt;br /&gt;&lt;pre&gt;&lt;font size='1'&gt;&lt;br /&gt;root@radbank04 # more root.sh&lt;br /&gt;#!/bin/sh&lt;br /&gt;/oracle/product/crs10g/install/rootinstall&lt;br /&gt;/oracle/product/crs10g/install/rootconfig&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;I found the following part of the script in the very beginning of the rootconfig script.&lt;br /&gt;&lt;pre&gt;&lt;font size='1px'&gt;&lt;br /&gt;SILENT=false&lt;br /&gt;ORA_CRS_HOME=/oracle/product/crs10g&lt;br /&gt;CRS_ORACLE_OWNER=oracle&lt;br /&gt;CRS_DBA_GROUP=oinstall&lt;br /&gt;CRS_VNDR_CLUSTER=false&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#FFFF00"&gt;CRS_OCR_LOCATIONS=/dev/rdsk/c6t600601607D731F00BAE716BB2CE9DD11d0s0,/dev/rdsk/c6t600601607D731F006496A6CD2CE9DD11d0s0&lt;/font&gt;&lt;br /&gt;CRS_CLUSTER_NAME=crs&lt;br /&gt;CRS_HOST_NAME_LIST=radbank02,1,radbank03,2&lt;br /&gt;CRS_NODE_NAME_LIST=radbank02,1,radbank03,2&lt;br /&gt;CRS_PRIVATE_NAME_LIST=radbank02-priv1,1,radbank03-priv1,2&lt;br /&gt;CRS_LANGUAGE_ID='AMERICAN_AMERICA.WE8ISO8859P1'&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#FFFF00"&gt;CRS_VOTING_DISKS=/dev/rdsk/c6t600601607D731F006596A6CD2CE9DD11d0s0&lt;/font&gt;&lt;br /&gt;CRS_NODELIST=radbank02,radbank03&lt;br /&gt;CRS_NODEVIPS='radbank02/radbank02-vip/255.255.255.0/bge0,radbank03/radbank03-vip/255.255.255.0/bge0'&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;Somehow &lt;a href="http://ergemp.blogspot.com/2008/08/srvctl-problem-after-10204-patch.html"&gt;(my second somehow in the 10gR2 RAC environment)&lt;/a&gt; crs records was showing the old ocr and voting disks. The new disks i have replaced in my existing RAC environment before was totally different. I decided to modify the rootconfig file and replace the old defined ocr and voting disks with the new ones as follows. An rerun the rootconfig file. I dont know if this action is recommended by oracle but i think this is the only change that i have in my hand.&lt;br /&gt;&lt;pre&gt;&lt;font size='1'&gt;&lt;br /&gt;SILENT=false&lt;br /&gt;ORA_CRS_HOME=/oracle/product/crs10g&lt;br /&gt;CRS_ORACLE_OWNER=oracle&lt;br /&gt;CRS_DBA_GROUP=oinstall&lt;br /&gt;CRS_VNDR_CLUSTER=false&lt;br /&gt;#CRS_OCR_LOCATIONS=/dev/rdsk/c6t600601607D731F00BAE716BB2CE9DD11d0s0,/dev/rdsk/c6t600601607D731F006496A6CD2CE9DD11d0s0&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#FFFF00"&gt;CRS_OCR_LOCATIONS=/dev/rdsk/c6t600601607D731F00AE6F711488FEDD11d0s0,/dev/rdsk/c6t600601607D731F00AF6F711488FEDD11d0s0&lt;/font&gt;&lt;br /&gt;CRS_CLUSTER_NAME=crs&lt;br /&gt;CRS_HOST_NAME_LIST=radbank02,1,radbank03,2&lt;br /&gt;CRS_NODE_NAME_LIST=radbank02,1,radbank03,2&lt;br /&gt;CRS_PRIVATE_NAME_LIST=radbank02-priv1,1,radbank03-priv1,2&lt;br /&gt;CRS_LANGUAGE_ID='AMERICAN_AMERICA.WE8ISO8859P1'&lt;br /&gt;#CRS_VOTING_DISKS=/dev/rdsk/c6t600601607D731F006596A6CD2CE9DD11d0s0&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#FFFF00"&gt;CRS_VOTING_DISKS=/dev/rdsk/c6t600601607D731F00A8833C0377FEDD11d0s0,/dev/rdsk/c6t600601607D731F00A6833C0377FEDD11d0s0,/dev/rdsk/c6t60&lt;/font&gt;&lt;br /&gt;0601607D731F00A7833C0377FEDD11d0s0&lt;br /&gt;CRS_NODELIST=radbank02,radbank03&lt;br /&gt;CRS_NODEVIPS='radbank02/radbank02-vip/255.255.255.0/bge0,radbank03/radbank03-vip/255.255.255.0/bge0'&lt;br /&gt;&lt;br /&gt;root@radbank04 # /oracle/product/crs10g/install/rootconfig&lt;br /&gt;&lt;br /&gt;Checking to see if Oracle CRS stack is already configured&lt;br /&gt;OCR LOCATIONS =  /dev/rdsk/c6t600601607D731F00AE6F711488FEDD11d0s0,/dev/rdsk/c6t600601607D731F00AF6F711488FEDD11d0s0&lt;br /&gt;OCR backup directory '/oracle/product/crs10g/cdata/crs' does not exist. Creating now&lt;br /&gt;Setting the permissions on OCR backup directory&lt;br /&gt;Setting up NS directories&lt;br /&gt;Oracle Cluster Registry configuration upgraded successfully&lt;br /&gt;WARNING: directory '/oracle/product' is not owned by root&lt;br /&gt;WARNING: directory '/oracle' is not owned by root&lt;br /&gt;clscfg: EXISTING configuration version 3 detected.&lt;br /&gt;clscfg: version 3 is 10G Release 2.&lt;br /&gt;Successfully accumulated necessary OCR keys.&lt;br /&gt;Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.&lt;br /&gt;node &lt;nodenumber&gt;: &lt;nodename&gt; &lt;private interconnect name&gt; &lt;hostname&gt;&lt;br /&gt;node 1: radbank02 radbank02-priv1 radbank02&lt;br /&gt;node 2: radbank03 radbank03-priv1 radbank03&lt;br /&gt;clscfg: Arguments check out successfully.&lt;br /&gt;&lt;br /&gt;NO KEYS WERE WRITTEN. Supply -force parameter to override.&lt;br /&gt;-force is destructive and will destroy any previous cluster&lt;br /&gt;configuration.&lt;br /&gt;Oracle Cluster Registry for cluster has already been initialized&lt;br /&gt;Startup will be queued to init within 30 seconds.&lt;br /&gt;Adding daemons to inittab&lt;br /&gt;Expecting the CRS daemons to be up within 600 seconds.&lt;br /&gt;CSS is active on these nodes.&lt;br /&gt;        radbank02&lt;br /&gt;        radbank03&lt;br /&gt;        radbank04&lt;br /&gt;CSS is active on all nodes.&lt;br /&gt;&lt;br /&gt;root@radbank04 # ./crs_stat -t&lt;br /&gt;&lt;br /&gt;Name           Type           Target    State     Host        &lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora.monsc.db   application    ONLINE    ONLINE    radbank03   &lt;br /&gt;ora....c1.inst application    ONLINE    ONLINE    radbank02   &lt;br /&gt;ora....c2.inst application    ONLINE    ONLINE    radbank03   &lt;br /&gt;ora.montc.db   application    ONLINE    ONLINE    radbank02   &lt;br /&gt;ora....ntc1.cs application    ONLINE    ONLINE    radbank02   &lt;br /&gt;ora....c1.inst application    ONLINE    ONLINE    radbank02   &lt;br /&gt;ora....tc1.srv application    ONLINE    ONLINE    radbank02   &lt;br /&gt;ora....ntc2.cs application    ONLINE    ONLINE    radbank03   &lt;br /&gt;ora....c2.inst application    ONLINE    ONLINE    radbank03   &lt;br /&gt;ora....tc2.srv application    ONLINE    ONLINE    radbank03   &lt;br /&gt;ora....ntc3.cs application    ONLINE    ONLINE    radbank03   &lt;br /&gt;ora....tc1.srv application    ONLINE    ONLINE    radbank02   &lt;br /&gt;ora....tc2.srv application    ONLINE    ONLINE    radbank03   &lt;br /&gt;ora....SM1.asm application    ONLINE    ONLINE    radbank02   &lt;br /&gt;ora....02.lsnr application    ONLINE    ONLINE    radbank02   &lt;br /&gt;ora....02.lsnr application    ONLINE    ONLINE    radbank02   &lt;br /&gt;ora....k02.gsd application    ONLINE    ONLINE    radbank02   &lt;br /&gt;ora....k02.ons application    ONLINE    ONLINE    radbank02   &lt;br /&gt;ora....k02.vip application    ONLINE    ONLINE    radbank02   &lt;br /&gt;ora....SM2.asm application    ONLINE    ONLINE    radbank03   &lt;br /&gt;ora....03.lsnr application    ONLINE    ONLINE    radbank03   &lt;br /&gt;ora....03.lsnr application    ONLINE    ONLINE    radbank03   &lt;br /&gt;ora....k03.gsd application    ONLINE    ONLINE    radbank03   &lt;br /&gt;ora....k03.ons application    ONLINE    ONLINE    radbank03   &lt;br /&gt;ora....k03.vip application    ONLINE    ONLINE    radbank03   &lt;br /&gt;ora....k04.gsd application    ONLINE    ONLINE    radbank04   &lt;br /&gt;ora....k04.ons application    ONLINE    ONLINE    radbank04   &lt;br /&gt;ora....k04.vip application    ONLINE    ONLINE    radbank04        &lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;My new node is part of my existing cluster now. Now time to add the ORACLE_HOME (database installation) and the instances with the services.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Resources:&lt;/u&gt;&lt;br /&gt;&lt;a href='http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/adddelunix.htm#BEICADHD'&gt;&lt;br /&gt;Oracle® Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide 10g Release 2 (10.2)&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-175319473803005474?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/175319473803005474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2009/02/problem-with-adding-new-node-ro-rac.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/175319473803005474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/175319473803005474'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2009/02/problem-with-adding-new-node-ro-rac.html' title='Problem with adding a new node to RAC after ocr and voting disk change'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-3232029527307693064</id><published>2009-02-23T21:25:00.009+02:00</published><updated>2011-06-16T14:25:40.596+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle RAC'/><category scheme='http://www.blogger.com/atom/ns#' term='ASM'/><title type='text'>Add/Remove ASM disks and asm_power_limit</title><content type='html'>Before going live on production our storage team decided to reconfigure their storage and raidsets for better performance. So i gave the raw devices back from asm and of course used the opportunity to test the asm_power_limit parameter. &lt;br /&gt;&lt;br /&gt;From the following listing you can find how to list asm disks, adding and removing disks from a disk group and watch the rebalance operation from v$asm_operation view. &lt;br /&gt;&lt;br /&gt;By changing the init parameter "asm_power_limit", asm rebalance operations are significantly getting faster. The difference can obviously be seen by setting the parameter to 10 (instead of default value 1) and then giving the same operations that need rebalance. Of course this was not an online system so we may want asm to exhaust all the IO for rebalancing. But in case of production systems there can be unwanted IO performance degradation of the application by this kind of aggressive setting. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;font size='1'&gt;&lt;br /&gt;SQL&gt; select group_number,state,name,total_mb from v$asm_disk;&lt;br /&gt;&lt;br /&gt;GROUP_NUMBER STATE    NAME                   TOTAL_MB&lt;br /&gt;------------ -------- -------------------- ----------&lt;br /&gt;0 NORMAL                               924&lt;br /&gt;0 NORMAL                               924&lt;br /&gt;0 NORMAL                               924&lt;br /&gt;0 NORMAL                               924&lt;br /&gt;1 NORMAL   DATA_0009                614300&lt;br /&gt;1 NORMAL   DATA_0008                614290&lt;br /&gt;1 NORMAL   DATA_0002                614290&lt;br /&gt;1 NORMAL   DATA_0001                614290&lt;br /&gt;1 NORMAL   DATA_0000                614290&lt;br /&gt;1 NORMAL   DATA_0007                614290&lt;br /&gt;1 NORMAL   DATA_0006                614290&lt;br /&gt;1 NORMAL   DATA_0005                614290&lt;br /&gt;1 NORMAL   DATA_0004                614290&lt;br /&gt;1 NORMAL   DATA_0003                614290&lt;br /&gt;&lt;br /&gt;14 rows selected.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter diskgroup DATA drop disk DATA_0000;&lt;br /&gt;&lt;br /&gt;Diskgroup altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter diskgroup DATA drop disk DATA_0001;&lt;br /&gt;&lt;br /&gt;Diskgroup altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select group_number,state,name,total_mb,label,path from v$asm_disk;&lt;br /&gt;&lt;br /&gt;GROUP_NUMBER STATE    NAME              TOTAL_MB LABEL PATH&lt;br /&gt;------------ -------- --------------- ---------- ----- --------------------------------------------------&lt;br /&gt;0 NORMAL                          924       /dev/rdsk/c6t600601607D731F00A8833C0377FEDD11d0s0&lt;br /&gt;0 NORMAL                          924       /dev/rdsk/c6t600601607D731F00A7833C0377FEDD11d0s0&lt;br /&gt;0 NORMAL                          924       /dev/rdsk/c6t600601607D731F00A6833C0377FEDD11d0s0&lt;br /&gt;0 NORMAL                          924       /dev/rdsk/c6t600601607D731F006596A6CD2CE9DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0009           614300       /dev/rdsk/c6t600601607D731F00D994060263E8DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0008           614290       /dev/rdsk/c6t600601607D731F00D894060263E8DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0002           614290       /dev/rdsk/c6t600601607D731F006A37A4E0A0E7DD11d0s0&lt;br /&gt;1 DROPPING DATA_0001           614290       /dev/rdsk/c6t600601607D731F006937A4E0A0E7DD11d0s0&lt;br /&gt;1 DROPPING DATA_0000           614290       /dev/rdsk/c6t600601607D731F006837A4E0A0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0007           614290       /dev/rdsk/c6t600601607D731F007608DB3DA0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0006           614290       /dev/rdsk/c6t600601607D731F007508DB3DA0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0005           614290       /dev/rdsk/c6t600601607D731F007408DB3DA0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0004           614290       /dev/rdsk/c6t600601607D731F007308DB3DA0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0003           614290       /dev/rdsk/c6t600601607D731F007208DB3DA0E7DD11d0s0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$asm_operation;&lt;br /&gt;&lt;br /&gt;OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES&lt;br /&gt;----- ---- ---------- ---------- ---------- ---------- ---------- -----------&lt;br /&gt;REBAL RUN          10         10       7198      12996        260          22&lt;br /&gt;REBAL RUN          10         10       7679      12979        242          21&lt;br /&gt;REBAL RUN          10         10       9286      12930        201          18&lt;br /&gt;REBAL RUN          10         10      11647      12899        237           5&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$asm_operation;&lt;br /&gt;&lt;br /&gt;no rows selected&lt;br /&gt;&lt;br /&gt;SQL&gt; select group_number,state,name,total_mb,label,path from v$asm_disk;&lt;br /&gt;&lt;br /&gt;GROUP_NUMBER STATE    NAME              TOTAL_MB LABEL PATH&lt;br /&gt;------------ -------- --------------- ---------- ----- --------------------------------------------------&lt;br /&gt;0 NORMAL                          924       /dev/rdsk/c6t600601607D731F00A8833C0377FEDD11d0s0&lt;br /&gt;0 NORMAL                          924       /dev/rdsk/c6t600601607D731F00A7833C0377FEDD11d0s0&lt;br /&gt;0 NORMAL                          924       /dev/rdsk/c6t600601607D731F00A6833C0377FEDD11d0s0&lt;br /&gt;0 NORMAL                       614290       /dev/rdsk/c6t600601607D731F006937A4E0A0E7DD11d0s0&lt;br /&gt;0 NORMAL                       614290       /dev/rdsk/c6t600601607D731F006837A4E0A0E7DD11d0s0&lt;br /&gt;0 NORMAL                          924       /dev/rdsk/c6t600601607D731F006596A6CD2CE9DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0009           614300       /dev/rdsk/c6t600601607D731F00D994060263E8DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0008           614290       /dev/rdsk/c6t600601607D731F00D894060263E8DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0002           614290       /dev/rdsk/c6t600601607D731F006A37A4E0A0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0007           614290       /dev/rdsk/c6t600601607D731F007608DB3DA0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0006           614290       /dev/rdsk/c6t600601607D731F007508DB3DA0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0005           614290       /dev/rdsk/c6t600601607D731F007408DB3DA0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0004           614290       /dev/rdsk/c6t600601607D731F007308DB3DA0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0003           614290       /dev/rdsk/c6t600601607D731F007208DB3DA0E7DD11d0s0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter diskgroup DATA add disk '/dev/rdsk/c6t600601607D731F006837A4E0A0E7DD11d0s0';&lt;br /&gt;&lt;br /&gt;Diskgroup altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select group_number,state,name,total_mb,label,path from v$asm_disk;&lt;br /&gt;&lt;br /&gt;GROUP_NUMBER STATE    NAME              TOTAL_MB LABEL PATH&lt;br /&gt;------------ -------- --------------- ---------- ----- --------------------------------------------------&lt;br /&gt;0 NORMAL                          924       /dev/rdsk/c6t600601607D731F00A8833C0377FEDD11d0s0&lt;br /&gt;0 NORMAL                          924       /dev/rdsk/c6t600601607D731F00A7833C0377FEDD11d0s0&lt;br /&gt;0 NORMAL                          924       /dev/rdsk/c6t600601607D731F00A6833C0377FEDD11d0s0&lt;br /&gt;0 NORMAL                       614290       /dev/rdsk/c6t600601607D731F006937A4E0A0E7DD11d0s0&lt;br /&gt;0 NORMAL                          924       /dev/rdsk/c6t600601607D731F006596A6CD2CE9DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0009           614300       /dev/rdsk/c6t600601607D731F00D994060263E8DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0008           614290       /dev/rdsk/c6t600601607D731F00D894060263E8DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0002           614290       /dev/rdsk/c6t600601607D731F006A37A4E0A0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0007           614290       /dev/rdsk/c6t600601607D731F007608DB3DA0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0006           614290       /dev/rdsk/c6t600601607D731F007508DB3DA0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0005           614290       /dev/rdsk/c6t600601607D731F007408DB3DA0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0004           614290       /dev/rdsk/c6t600601607D731F007308DB3DA0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0003           614290       /dev/rdsk/c6t600601607D731F007208DB3DA0E7DD11d0s0&lt;br /&gt;1 NORMAL   DATA_0000           614290       /dev/rdsk/c6t600601607D731F006837A4E0A0E7DD11d0s0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; show parameter asm_power_limit;&lt;br /&gt;&lt;br /&gt;NAME                            TYPE        VALUE&lt;br /&gt;------------------------------- ----------- -------------------------&lt;br /&gt;asm_power_limit                 integer     1&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set asm_power_limit=10;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; show parameter asm_power_limit;&lt;br /&gt;&lt;br /&gt;NAME                            TYPE        VALUE&lt;br /&gt;------------------------------- ----------- -------------------------&lt;br /&gt;asm_power_limit                 integer     10&lt;br /&gt;&lt;br /&gt;SQL&gt; &lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-3232029527307693064?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/3232029527307693064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2009/02/addremove-asm-disks-and-asmpowerlimit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/3232029527307693064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/3232029527307693064'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2009/02/addremove-asm-disks-and-asmpowerlimit.html' title='Add/Remove ASM disks and asm_power_limit'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-5159751814407688701</id><published>2008-12-14T21:13:00.005+02:00</published><updated>2008-12-15T08:25:07.401+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Security'/><title type='text'>why auditing</title><content type='html'>In general it seems that security is one of the least important routines of the dba. But in my opinion this issue should be one of the most important issues. Not only be able to supply audit records to firm-wide audit documentations but also knowing what is going on our databases to be sure everything goes straight. Auditing is not only blaming someone for a wrong action. This routine is for early clearing up for the wrong events. &lt;br /&gt;&lt;br /&gt;I start auditing with "db, extended" AUDIT_TRAIL parameter to track the sql statements with the actions by altering the system, restarting the instance is a must as this parameter cannot be changed online:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;font size="1"&gt;&lt;br /&gt;SQL&gt; alter system set audit_trail="db, extended" scope=spfile;&lt;br /&gt;SQL&gt; shutdown immediate,&lt;br /&gt;SQL&gt; startup;&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After enabling the auditing, i decided what actions should be audited. Here i am not very selective. All DML actions should be audited to me.&lt;br /&gt;&lt;br /&gt;&lt;font face="courier new" size="1"&gt;&lt;br /&gt;AUDIT INSERT ANY TABLE, DELETE ANY TABLE, UPDATE ANY TABLE BY -user1-, -user2- ... ;&lt;br /&gt;&lt;br /&gt;AUDIT INSERT TABLE, DELETE TABLE, UPDATE TABLE BY -user1-, -user2- ... ;&lt;br /&gt;&lt;br /&gt;AUDIT DROP ANY TABLE, DROP ANY INDEX, DROP ANY VIEW, DROP ANY SYNONYM, DROP ANY PROCEDURE, DROP ANY SEQUENCE, DROP ANY TRIGGER, DROP ANY TYPE BY -user1-, -user2- ... ;&lt;br /&gt;&lt;br /&gt;AUDIT ALTER ANY TABLE, ALTER ANY INDEX, ALTER ANY PROCEDURE, ALTER ANY SEQUENCE, ALTER ANY TRIGGER, ALTER ANY TYPE BY -user1-, -user2- ... ;&lt;br /&gt;&lt;br /&gt;AUDIT CREATE ANY TABLE, DROP ANY INDEX, DROP ANY VIEW, DROP ANY SYNONYM, DROP ANY PROCEDURE, DROP ANY SEQUENCE, DROP ANY TRIGGER, DROP ANY TYPE BY -user1-, -user2- ... ;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Move sys.aud$ table to data tablespace: We dont want to oversize the SYSTEM tablespace. As far as i read from oracle documentation moving AUD$ table to another tablespace is not supported. Instead writing some control and maintenance scripts are suggesgted to be used. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;select * from sys.AUD$&lt;br /&gt;alter table sys.AUD$ move tablespace PQ_DATA;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;List the auditing privileges and users: To check what is being audited by my database.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;select * from dba_priv_audit_opts;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After two weeks of auditing, i nearly captured more than three commonly wrong routines especially using wrong tablespaces and deleting routines.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-5159751814407688701?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/5159751814407688701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/12/why-auditing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5159751814407688701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5159751814407688701'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/12/why-auditing.html' title='why auditing'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-2525690335370268770</id><published>2008-11-15T13:53:00.003+02:00</published><updated>2008-11-15T13:59:57.729+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>creating awr reports manually</title><content type='html'>When working with the third parties on the same database there happens some confusion. The operational dba 's are responsible from the database performance and other standard operational duties like backup, security, architecture .. and so on. Vendor dba 's are also responsible to achieve SLA contract requirements and promised performance values. Both side should be causious not to overlap the other side 's duties. Here i tried to answer one of the requests of our vendor dba by supplying hourly AWR reports directly in their directories on the UNIX environment. I think they can follow database activitiy better from now on. &lt;br /&gt;&lt;br /&gt;&lt;font face='courier' size='1'&gt;&lt;br /&gt;### creating the awr report ###&lt;br /&gt;ORACLE_HOME=/oracle/product/10.2.0; export ORACLE_HOME&lt;br /&gt;ORACLE_SID=montc1; export ORACLE_SID&lt;br /&gt;PATH=$PATH:$ORACLE_HOME/bin; export PATH&lt;br /&gt;&lt;br /&gt;$ORACLE_HOME/bin/sqlplus "/ as sysdba" &lt;&lt; EOF&lt;br /&gt;declare&lt;br /&gt;  i_begin_snap_id number;&lt;br /&gt;  i_end_snap_id number;&lt;br /&gt;  i_db_id number;&lt;br /&gt;  i_inst_num number;     &lt;br /&gt;begin&lt;br /&gt;  &lt;br /&gt;  --select the db_id and the instance_number of the instance,&lt;br /&gt;  --these values are going to be used to create the awr_report&lt;br /&gt;  select DBID, INSTANCE_NUMBER into i_db_id, i_inst_num from dba_hist_database_instance where rownum=1;&lt;br /&gt;&lt;br /&gt;  --find the snap_id of the time being&lt;br /&gt;  select SNAP_ID into i_end_snap_id  from dba_hist_snapshot where trunc(end_interval_time,'HH24') = trunc(sysdate,'HH24') order by SNAP_ID desc;&lt;br /&gt;  &lt;br /&gt;  --set the begin snap_id of the previous hour as we are generation hourly awr reports&lt;br /&gt;  i_begin_snap_id := i_end_snap_id - 1;&lt;br /&gt;  &lt;br /&gt;  --generate and write the report to a table&lt;br /&gt;  insert into avea_sysmon.temp_awr_output select output from table (SYS.DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_HTML(i_db_id, i_inst_num, i_begin_snap_id, i_end_snap_id));&lt;br /&gt;  commit; &lt;br /&gt;   &lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;### creating report name ###&lt;br /&gt;report_name=/moneta_home/avea_data/awr/awr_report_`date | awk '{print $3"_"$2"_"$6"_"$4}'`.html&lt;br /&gt;export report_name&lt;br /&gt;&lt;br /&gt;### spooling previously created report to the file specified ###&lt;br /&gt;$ORACLE_HOME/bin/sqlplus -s "/ as sysdba" &lt;&lt; EOF&lt;br /&gt;set linesize 1500;&lt;br /&gt;set echo off;&lt;br /&gt;set heading off;&lt;br /&gt;set termout on;&lt;br /&gt;&lt;br /&gt;spool $report_name;&lt;br /&gt;select s_output from avea_sysmon.temp_awr_output;&lt;br /&gt;truncate table avea_sysmon.temp_awr_output;&lt;br /&gt;spool off;&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;### delete the older reports ###&lt;br /&gt;ctl=`ls -l /moneta_home/avea_data/awr | grep .html | wc -l`&lt;br /&gt;if [ $ctl -gt 110 ]&lt;br /&gt;then&lt;br /&gt;  ls -l /moneta_home/avea_data/awr | grep .html | head -10 | awk '{print "/moneta_home/avea_data/awr/"$9}' | xargs rm&lt;br /&gt;  #else&lt;br /&gt;  #echo "dont delete anything"&lt;br /&gt;fi&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;After i tested the script activity of the script, i used crontab to schedule this script as a job. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ crontab -l&lt;br /&gt;00,10,20,30,40,50 * * * * /oracle/epeker/check_arch.sh &gt; /oracle/epeker/check_arch.log 2&gt;&amp;1&lt;br /&gt;20 * * * * /oracle/awr_reports/get_awr.sh &gt; /oracle/awr_reports/get_awr.log 2&gt;&amp;1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The awr reports of the specified time are now available on application directories.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ ls -lrt /moneta_home/avea_data/awr&lt;br /&gt;total 1053328&lt;br /&gt;-rw-r--r--   1 oracle   dba      5229793 Nov  6 14:20 awr_report_6_Nov_2008_14:20:45.html&lt;br /&gt;-rw-r--r--   1 oracle   dba      4911565 Nov  6 15:20 awr_report_6_Nov_2008_15:20:08.html&lt;br /&gt;-rw-r--r--   1 oracle   dba      4865032 Nov  6 16:20 awr_report_6_Nov_2008_16:20:12.html&lt;br /&gt;-rw-r--r--   1 oracle   dba      6112427 Nov  6 17:20 awr_report_6_Nov_2008_17:20:06.html&lt;br /&gt;-rw-r--r--   1 oracle   dba      5057170 Nov  6 18:20 awr_report_6_Nov_2008_18:20:03.html&lt;br /&gt;-rw-r--r--   1 oracle   dba      5031651 Nov  6 19:20 awr_report_6_Nov_2008_19:20:02.html&lt;br /&gt;-rw-r--r--   1 oracle   dba      4798984 Nov  6 20:20 awr_report_6_Nov_2008_20:20:03.html&lt;br /&gt;-rw-r--r--   1 oracle   dba      5016641 Nov  6 21:20 awr_report_6_Nov_2008_21:20:02.html&lt;br /&gt;-rw-r--r--   1 oracle   dba      4895053 Nov  6 22:20 awr_report_6_Nov_2008_22:20:05.html&lt;br /&gt;-rw-r--r--   1 oracle   dba      5228292 Nov  6 23:20 awr_report_6_Nov_2008_23:20:09.html&lt;br /&gt;-rw-r--r--   1 oracle   dba      5018142 Nov  7 00:20 awr_report_7_Nov_2008_00:20:03.html&lt;br /&gt;-rw-r--r--   1 oracle   dba      5072180 Nov  7 01:20 awr_report_7_Nov_2008_01:20:10.html&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-2525690335370268770?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/2525690335370268770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/11/creating-awr-reports-manually.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/2525690335370268770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/2525690335370268770'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/11/creating-awr-reports-manually.html' title='creating awr reports manually'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-7285878254396516032</id><published>2008-11-03T14:41:00.004+02:00</published><updated>2008-11-15T13:57:39.376+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Security'/><title type='text'>Time to start securing the listeners</title><content type='html'>I decided to apply basic security issues to all of my databases listener processes. As always i prefer &lt;a href='http://docs.oracle.com'&gt;Oracle Documentation&lt;/a&gt; for a reliable reference, this time i found a detailed &lt;a href='http://www.integrigy.com/security-resources/whitepapers/Integrigy_Oracle_Listener_TNS_Security.pdf'&gt;white paper&lt;/a&gt; on &lt;a href='http://www.integrigy.com'&gt;integrigy web site&lt;/a&gt; which has a lot of hits from external links.&lt;br /&gt;&lt;br /&gt;Both two resources call attention for two most important issues. &lt;u&gt;Setting a password&lt;/u&gt; and &lt;u&gt;Logging&lt;/u&gt; for the listener. The other issues can be taken in account are securing lsnrctl and tnslsnr executables in $ORACLE_HOME/bin/ directory, setting ADMIN_RESTRICTIONS parameter of the listener itself, changing default port of the listener utility and so on mentioned in the referenced documents. But here i decided to secure most common tasks of setting a password for listener and logging the listener activity for my initial action. &lt;br /&gt;&lt;br /&gt;&lt;u&gt;Setting a listener password:&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;&lt;font size='1'&gt;&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;-bash-3.00$ lsnrctl&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;LSNRCTL for Linux: Version 10.2.0.3.0 - Production on 03-NOV-2008 14:06:01&lt;br /&gt;&lt;br /&gt;Copyright (c) 1991, 2006, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Welcome to LSNRCTL, type "help" for information.&lt;br /&gt;&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;LSNRCTL&gt; CHANGE_PASSWORD&lt;/font&gt;&lt;br /&gt;Old password: &lt;font style="BACKGROUND-COLOR:#FFFF00"&gt;&amp;lt;if not set then just hit enter&amp;gt;&lt;/font&gt;&lt;br /&gt;New password: &lt;br /&gt;Reenter new password: &lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=foa-op)(PORT=1521)))&lt;br /&gt;Password changed for LISTENER&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;LSNRCTL&gt; SAVE_CONFIG&lt;/font&gt;&lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=foa-op)(PORT=1521)))&lt;br /&gt;Saved LISTENER configuration parameters.&lt;br /&gt;Listener Parameter File   /oracle/product/10.2.0/OFADB/network/admin/listener.ora&lt;br /&gt;Old Parameter File   /oracle/product/10.2.0/OFADB/network/admin/listener.bak&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;LSNRCTL&gt; status&lt;/font&gt;&lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=foa-op)(PORT=1521)))&lt;br /&gt;STATUS of the LISTENER&lt;br /&gt;------------------------&lt;br /&gt;Alias                     LISTENER&lt;br /&gt;Version                   TNSLSNR for Linux: Version 10.2.0.3.0 - Production&lt;br /&gt;Start Date                03-NOV-2008 11:12:23&lt;br /&gt;Uptime                    0 days 2 hr. 54 min. 43 sec&lt;br /&gt;Trace Level               off&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#FFFF00"&gt;Security                  ON: Password or Local OS Authentication&lt;/font&gt;&lt;br /&gt;SNMP                      OFF&lt;br /&gt;Listener Parameter File   /oracle/product/10.2.0/OFADB/network/admin/listener.ora&lt;br /&gt;Listener Log File         /oracle/product/10.2.0/OFADB/network/log/listener.log&lt;br /&gt;Listening Endpoints Summary...&lt;br /&gt;  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=foa-op)(PORT=1521)))&lt;br /&gt;  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))&lt;br /&gt;Services Summary...&lt;br /&gt;Service "OFADB" has 1 instance(s).&lt;br /&gt;  Instance "OFADB", status READY, has 1 handler(s) for this service...&lt;br /&gt;Service "OFADBXDB" has 1 instance(s).&lt;br /&gt;  Instance "OFADB", status READY, has 1 handler(s) for this service...&lt;br /&gt;Service "OFADB_XPT" has 1 instance(s).&lt;br /&gt;  Instance "OFADB", status READY, has 1 handler(s) for this service...&lt;br /&gt;Service "PLSExtProc" has 1 instance(s).&lt;br /&gt;  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;LSNRCTL&gt; exit&lt;/font&gt;&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Logging the listener:&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;&lt;font size='1'&gt;&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;-bash-3.00$ lsnrctl&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;LSNRCTL for Linux: Version 10.2.0.3.0 - Production on 03-NOV-2008 11:18:43&lt;br /&gt;&lt;br /&gt;Copyright (c) 1991, 2006, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Welcome to LSNRCTL, type "help" for information.&lt;br /&gt;&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;LSNRCTL&gt; SET LOG_DIRECTORY /oracle/product/10.2.0/OFADB/network/admin/lsnr_log&lt;/font&gt;&lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=foa-op)(PORT=1521)))&lt;br /&gt;LISTENER parameter "log_directory" set to /oracle/product/10.2.0/OFADB/network/admin/lsnr_log&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;LSNRCTL&gt; set log_file lsnr.log&lt;/font&gt;&lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=foa-op)(PORT=1521)))&lt;br /&gt;LISTENER parameter "log_file" set to lsnr.log&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;LSNRCTL&gt; set log_status on&lt;/font&gt;&lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=foa-op)(PORT=1521)))&lt;br /&gt;LISTENER parameter "log_status" set to ON&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;LSNRCTL&gt; SAVE_CONFIG&lt;/font&gt;&lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=foa-op)(PORT=1521)))&lt;br /&gt;Saved LISTENER configuration parameters.&lt;br /&gt;Listener Parameter File   /oracle/product/10.2.0/OFADB/network/admin/listener.ora&lt;br /&gt;Old Parameter File   /oracle/product/10.2.0/OFADB/network/admin/listener.bak&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;LSNRCTL&gt; exit&lt;/font&gt;&lt;br /&gt;-bash-3.00$ lsnrctl status&lt;br /&gt;&lt;br /&gt;LSNRCTL for Linux: Version 10.2.0.3.0 - Production on 03-NOV-2008 11:20:08&lt;br /&gt;&lt;br /&gt;Copyright (c) 1991, 2006, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=foa-op)(PORT=1521)))&lt;br /&gt;STATUS of the LISTENER&lt;br /&gt;------------------------&lt;br /&gt;Alias                     LISTENER&lt;br /&gt;Version                   TNSLSNR for Linux: Version 10.2.0.3.0 - Production&lt;br /&gt;Start Date                03-NOV-2008 11:12:23&lt;br /&gt;Uptime                    0 days 0 hr. 7 min. 44 sec&lt;br /&gt;Trace Level               off&lt;br /&gt;Security                  ON: Password or Local OS Authentication&lt;br /&gt;SNMP                      OFF&lt;br /&gt;Listener Parameter File   /oracle/product/10.2.0/OFADB/network/admin/listener.ora&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#FFFF00"&gt;Listener Log File         /oracle/product/10.2.0/OFADB/network/admin/lsnr_log/lsnr.log&lt;/font&gt;&lt;br /&gt;Listening Endpoints Summary...&lt;br /&gt;  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=foa-op)(PORT=1521)))&lt;br /&gt;  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))&lt;br /&gt;Services Summary...&lt;br /&gt;Service "OFADB" has 1 instance(s).&lt;br /&gt;  Instance "OFADB", status READY, has 1 handler(s) for this service...&lt;br /&gt;Service "OFADBXDB" has 1 instance(s).&lt;br /&gt;  Instance "OFADB", status READY, has 1 handler(s) for this service...&lt;br /&gt;Service "OFADB_XPT" has 1 instance(s).&lt;br /&gt;  Instance "OFADB", status READY, has 1 handler(s) for this service...&lt;br /&gt;Service "PLSExtProc" has 1 instance(s).&lt;br /&gt;  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;But while i was monitoring the log file of the listener i found some warning messages right before every server process created by listener. The warning is something like;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;WARNING: Subscription for node down event still pending&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;There are some comments on forums for this warning message but the general sentence is setting the &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SUBSCRIBE_FOR_NODE_DOWN_EVENT_&amp;lt;listener_name&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;parameter to OFF in listener.ora file. By disabling this option we prevent listener to automatically registers itself to a notification service as it is unsuccessful to do because there is not one installed. Setting this parameter to OFF is worked for my environment and warning messages are cleared. Following you can find my final listener.ora file. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;font size='1'&gt;&lt;br /&gt;-bash-3.00$ cat listener.ora&lt;br /&gt;&lt;br /&gt;SID_LIST_LISTENER =&lt;br /&gt;  (SID_LIST =&lt;br /&gt;    (SID_DESC =&lt;br /&gt;      (SID_NAME = PLSExtProc)&lt;br /&gt;      (ORACLE_HOME = /oracle/product/10.2.0/OFADB)&lt;br /&gt;      (PROGRAM = extproc)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;LISTENER =&lt;br /&gt;  (DESCRIPTION_LIST =&lt;br /&gt;    (DESCRIPTION =&lt;br /&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = xxx-xx)(PORT = xxxx))&lt;br /&gt;      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;#----ADDED BY TNSLSNR 03-NOV-2008 11:08:38---&lt;br /&gt;PASSWORDS_LISTENER = xxxxxxxxxxxxxxxx&lt;br /&gt;LOGGING_LISTENER = ON&lt;br /&gt;#--------------------------------------------&lt;br /&gt;&lt;br /&gt;#----ADDED BY TNSLSNR 03-NOV-2008 11:19:57---&lt;br /&gt;LOG_FILE_LISTENER = lsnr.log&lt;br /&gt;LOG_DIRECTORY_LISTENER = /oracle/product/10.2.0/OFADB/network/admin/lsnr_log&lt;br /&gt;#--------------------------------------------&lt;br /&gt;&lt;br /&gt;SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Another handy operation of setting the password for the listener is remote administration option. The following demonstration is from my client computer to administer the server listener remotely. In a nutshell if you now the ip and port that the listeners runs on and also know the password, then you can remotely administer you listener. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;font size='1'&gt;&lt;br /&gt;Microsoft Windows XP [Version 5.1.2600]&lt;br /&gt;(C) Copyright 1985-2001 Microsoft Corp.&lt;br /&gt;&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;C:\&gt;lsnrctl status 10.4.38.32:1521&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 03-NOV-2008 14:36:02&lt;br /&gt;&lt;br /&gt;Copyright (c) 1991, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connecting to (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=10.4.38.32))(ADDRESS=(PRO&lt;br /&gt;TOCOL=TCP)(HOST=10.4.38.32)(PORT=1521)))&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#FFFF00"&gt;TNS-01169: The listener has not recognized the password&lt;/font&gt;&lt;br /&gt; TNS-01189: The listener could not authenticate the user&lt;br /&gt;&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;C:\&gt;lsnrctl&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 03-NOV-2008 14:36:05&lt;br /&gt;&lt;br /&gt;Copyright (c) 1991, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Welcome to LSNRCTL, type "help" for information.&lt;br /&gt;&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;LSNRCTL&gt; set password&lt;/font&gt;&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#FFFF00"&gt;Password:&lt;/font&gt;&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#00CC00"&gt;LSNRCTL&gt; status 10.4.38.32:1521&lt;/font&gt;&lt;br /&gt;Connecting to (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=10.4.38.32))(ADDRESS=(PRO&lt;br /&gt;TOCOL=TCP)(HOST=10.4.38.32)(PORT=1521)))&lt;br /&gt;STATUS of the LISTENER&lt;br /&gt;------------------------&lt;br /&gt;Alias                     LISTENER&lt;br /&gt;Version                   TNSLSNR for Linux: Version 10.2.0.3.0 - Production&lt;br /&gt;Start Date                03-NOV-2008 11:12:23&lt;br /&gt;Uptime                    0 days 3 hr. 24 min. 0 sec&lt;br /&gt;Trace Level               off&lt;br /&gt;Security                  ON: Password or Local OS Authentication&lt;br /&gt;SNMP                      OFF&lt;br /&gt;Listener Parameter File   /oracle/product/10.2.0/OFADB/network/admin/listener.ora&lt;br /&gt;Listener Log File         /oracle/product/10.2.0/OFADB/network/admin/lsnr_log/lsnr.log&lt;br /&gt;Listening Endpoints Summary...&lt;br /&gt;  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=foa-op)(PORT=1521)))&lt;br /&gt;  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))&lt;br /&gt;Services Summary...&lt;br /&gt;Service "OFADB" has 1 instance(s).&lt;br /&gt;  Instance "OFADB", status READY, has 1 handler(s) for this service...&lt;br /&gt;Service "OFADBXDB" has 1 instance(s).&lt;br /&gt;  Instance "OFADB", status READY, has 1 handler(s) for this service...&lt;br /&gt;Service "OFADB_XPT" has 1 instance(s).&lt;br /&gt;  Instance "OFADB", status READY, has 1 handler(s) for this service...&lt;br /&gt;Service "PLSExtProc" has 1 instance(s).&lt;br /&gt;  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;The command completed successfully&lt;br /&gt;LSNRCTL&gt;&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-7285878254396516032?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/7285878254396516032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/11/time-to-start-securing-listeners.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7285878254396516032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7285878254396516032'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/11/time-to-start-securing-listeners.html' title='Time to start securing the listeners'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-3256265856628356396</id><published>2008-10-07T11:22:00.017+03:00</published><updated>2008-10-07T11:48:53.613+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>Querying Oracle with C# and odp.net</title><content type='html'>Oracle recommends odp.net (Oracle Data Provider for .net) for opening and managing connections to an Oracle Database via .NET development environment. Odp.net has its own connection and command objects as well as dataadapter and datareader structures optimized for Oracle database. Here you can find the simple way of connecting and running a command on an Oracle Database v10.2.0.3. &lt;br /&gt;&lt;br /&gt;First of all, ODAC should be downloaded from &lt;a href='http://www.oracle.com/technology/software/tech/windows/odpnet/index.html'&gt;Oracle 's odp.net download page&lt;/a&gt;. After installing the software according to the installation instructions you can follow the following snapshots to include .dll file in Microsoft Visual C# IDE. After that we are able to use the classes in that dll. &lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOseEFLzj2I/AAAAAAAAAnY/0F3SaItlmxs/s1600-h/Snap1.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOseEFLzj2I/AAAAAAAAAnY/0F3SaItlmxs/s200/Snap1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5254326445717819234" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/SOsekyWyU1I/AAAAAAAAAng/k4dQwHTzlbk/s1600-h/Snap2.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_fSrIpdF1Zdk/SOsekyWyU1I/AAAAAAAAAng/k4dQwHTzlbk/s200/Snap2.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5254327007599285074" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/SOse0V-8tmI/AAAAAAAAAno/sk2pYtP1RrM/s1600-h/Snap3.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_fSrIpdF1Zdk/SOse0V-8tmI/AAAAAAAAAno/sk2pYtP1RrM/s200/Snap3.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5254327274861016674" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/SOsf3UL03MI/AAAAAAAAAnw/LONAe38l0SU/s1600-h/Snap4.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_fSrIpdF1Zdk/SOsf3UL03MI/AAAAAAAAAnw/LONAe38l0SU/s200/Snap4.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5254328425429392578" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;After importing the .dll file successfully you should easily use the classes.&lt;br /&gt;&lt;pre&gt;&lt;font size='2'&gt;&lt;br /&gt;&lt;font face='courier' size='1' color='#008800'&gt;&lt;br /&gt;/*&lt;br /&gt; * Defining variables&lt;br /&gt; */&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;// Connection Object &lt;br /&gt;private Oracle.DataAccess.Client.OracleConnection ocnn;&lt;br /&gt;&lt;br /&gt;// Command object&lt;br /&gt;private Oracle.DataAccess.Client.OracleCommand ocmd;&lt;br /&gt;&lt;br /&gt;// Structures to manipulate data&lt;br /&gt;private Oracle.DataAccess.Client.OracleDataAdapter oda;&lt;br /&gt;private Oracle.DataAccess.Client.OracleDataReader odr;&lt;br /&gt;private DataSet ods;&lt;br /&gt;&lt;br /&gt;&lt;font face='tahoma' size='1' color='#008800'&gt;&lt;br /&gt;// ------------------------------------------------------------&lt;br /&gt;// After all the definitions are made a sample try-catch block &lt;br /&gt;// that writes the sysdate to a label should be as follows&lt;br /&gt;// ------------------------------------------------------------&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;try&lt;br /&gt;    {&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// Creating the connection object&lt;/font&gt;&lt;br /&gt; ocnn = new Oracle.DataAccess.Client.OracleConnection();&lt;br /&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// Defining the connection string to connect to the specified database&lt;/font&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// User id and Password informations are obvious. Data Source value is the TNS alias of the database&lt;/font&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// There can be different values that can be used. Next example will cover another value.&lt;/font&gt;&lt;br /&gt; ocnn.ConnectionString = "User id=epeker;Password=********;Data Source=GRID_10.4.46.70";&lt;br /&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// Opening the connection and information is written as a label text&lt;/font&gt;&lt;br /&gt; ocnn.Open();&lt;br /&gt; lblerr.Text = "connected";&lt;br /&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// Now we need a command object that we want to execute on the database&lt;/font&gt;&lt;br /&gt; ocmd = new Oracle.DataAccess.Client.OracleCommand();&lt;br /&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// we defşne the previously created connection as the connection property of the command&lt;/font&gt;&lt;br /&gt; ocmd.Connection = ocnn;&lt;br /&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// commandText will be run on the database&lt;/font&gt;&lt;br /&gt; ocmd.CommandText = "select sysdate from dual";&lt;br /&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// with ExecuteReader() method of the command object we run the command and return the result to a reader object.&lt;/font&gt;&lt;br /&gt; odr = ocmd.ExecuteReader();&lt;br /&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// one or more rows could be fetched from the database&lt;/font&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// so we are readering from the reader of all rows&lt;/font&gt;&lt;br /&gt; while (odr.Read())&lt;br /&gt; {&lt;br /&gt;     lblerr.Text = lblerr.Text + '-' + odr[0].ToString();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;    catch (Exception ex)&lt;br /&gt;    {&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// if an exception raises we catch it here and write to our info label&lt;/font&gt;&lt;br /&gt; lblerr.Text = ex.Message;&lt;br /&gt;    }&lt;br /&gt;    finally &lt;br /&gt;    { &lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// finally, we cleaning and tidying the memory and the database connections&lt;/font&gt;&lt;br /&gt; if (ocnn != null)&lt;br /&gt; {&lt;br /&gt;   if (ocnn.State != ConnectionState.Closed)&lt;br /&gt;   {&lt;br /&gt;       ocnn.Close();&lt;br /&gt;       ocnn = null;&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;font face='tahoma' size='1' color='#008800'&gt;&lt;br /&gt;// ------------------------------------------------------------------------------------------------&lt;br /&gt;// This block uses standart Net8 connection string instead of a TNS alias and also demonstrates&lt;br /&gt;// the bind variable usage&lt;br /&gt;// ------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;try&lt;br /&gt;    {&lt;br /&gt; ocnn = new Oracle.DataAccess.Client.OracleConnection();&lt;br /&gt; ocnn.ConnectionString = "User id=epeker;Password=********;Data Source=(DESCRIPTION= " +&lt;br /&gt;    " (ADDRESS= " +&lt;br /&gt;    " (PROTOCOL=TCP)" +&lt;br /&gt;    " (HOST=10.4.46.70)" +&lt;br /&gt;    " (PORT=1521))" +    &lt;br /&gt;    " (CONNECT_DATA=(SERVICE_NAME=GRID)))";&lt;br /&gt; ocnn.Open();&lt;br /&gt; lblerr.Text = "connected";&lt;br /&gt; &lt;br /&gt; ods = new DataSet();&lt;br /&gt; oda = new Oracle.DataAccess.Client.OracleDataAdapter();&lt;br /&gt;&lt;br /&gt; ocmd = new Oracle.DataAccess.Client.OracleCommand();                &lt;br /&gt; string str_sql = "select * from v$datafile where file# = :f_number ";&lt;br /&gt;&lt;br /&gt; ocmd.CommandType = CommandType.Text;&lt;br /&gt; ocmd.CommandText = str_sql;&lt;br /&gt; ocmd.Connection = ocnn;&lt;br /&gt; &lt;br /&gt; oda.SelectCommand = ocmd;&lt;br /&gt; &lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// this parameter can also be set at the command level&lt;/font&gt;&lt;br /&gt; oda.SelectCommand.Parameters.Add("f_number",&lt;br /&gt;   Oracle.DataAccess.Client.OracleDbType.Int32,15).Value=2;                &lt;br /&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// another difference is dataset object&lt;/font&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// in the previous example we used datareader to read from the database which fetches the data row by row basis&lt;/font&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// Fill() method of the dataadapter object fetches all the recordset to the client side at one time&lt;/font&gt;&lt;br /&gt; oda.Fill(ods);&lt;br /&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// i will not cover the details of the dataadapter and dataset here&lt;/font&gt;&lt;br /&gt; lblerr.Text = ods.Tables[0].Rows[0]["name"].ToString(); &lt;br /&gt;    }&lt;br /&gt;    catch (Exception ex)&lt;br /&gt;    {&lt;br /&gt; lblerr.Text = ex.Message;&lt;br /&gt;    }&lt;br /&gt;    finally&lt;br /&gt;    {&lt;br /&gt; if (ocnn != null)&lt;br /&gt; {&lt;br /&gt;     if (ocnn.State != ConnectionState.Closed)&lt;br /&gt;     {&lt;br /&gt;  ocnn.Close();&lt;br /&gt;  ocnn = null;&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;    }&lt;br /&gt;&lt;font face='tahoma' size='1' color='#008800'&gt;&lt;br /&gt;// ----------------------------------------------------------------------------&lt;br /&gt;// last example demonstrates how to call a Oracle stored procedure with odp.net&lt;br /&gt;// ----------------------------------------------------------------------------&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;try&lt;br /&gt;    {&lt;br /&gt;     ocnn = new Oracle.DataAccess.Client.OracleConnection();&lt;br /&gt; ocnn.ConnectionString = "User id=epeker;Password=********;Data Source=GRID_10.4.46.70;";&lt;br /&gt; ocnn.Open();&lt;br /&gt; lblerr.Text = "connected";&lt;br /&gt;&lt;br /&gt; oda = new Oracle.DataAccess.Client.OracleDataAdapter();&lt;br /&gt; ods = new DataSet();&lt;br /&gt;&lt;br /&gt; ocmd = new Oracle.DataAccess.Client.OracleCommand();&lt;br /&gt; ocmd.Connection = ocnn;&lt;br /&gt; ocmd.CommandText = "epeker.p_return_cursor";&lt;br /&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// this time command type is a StoredProcedure&lt;/font&gt;&lt;br /&gt; ocmd.CommandType = CommandType.StoredProcedure;&lt;br /&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// this time parameters have directions&lt;/font&gt;&lt;br /&gt; ocmd.Parameters.Add("c_return", &lt;br /&gt;   Oracle.DataAccess.Client.OracleDbType.RefCursor).Direction = ParameterDirection.Output;&lt;br /&gt; ocmd.Parameters.Add("i_var", &lt;br /&gt;   Oracle.DataAccess.Client.OracleDbType.Int32).Direction = ParameterDirection.Input;&lt;br /&gt; ocmd.Parameters["i_var"].Value = 2;&lt;br /&gt;&lt;br /&gt; oda.SelectCommand = ocmd;&lt;br /&gt;&lt;br /&gt; oda.Fill(ods);&lt;br /&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// gw_result is a gridview object of .NET framework&lt;/font&gt;&lt;br /&gt; &lt;font face='tahoma' size='1' color='#008800'&gt;// helps to view the recordset as a table&lt;/font&gt;&lt;br /&gt; gw_result.DataSource = ods.Tables[0];&lt;br /&gt; gw_result.Refresh();&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;    catch (Exception ex)&lt;br /&gt;    {&lt;br /&gt; lblerr.Text = ex.Message;&lt;br /&gt;    }&lt;br /&gt;    finally&lt;br /&gt;    {&lt;br /&gt; if (ocnn != null)&lt;br /&gt; {&lt;br /&gt;     if (ocnn.State != ConnectionState.Closed)&lt;br /&gt;     {&lt;br /&gt;  ocnn.Close();&lt;br /&gt;  ocnn = null;&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;font size='2' color='#008800'&gt;&lt;br /&gt;/*&lt;br /&gt;---------------------------------------------&lt;br /&gt;--stored procedure used with the last example&lt;br /&gt;---------------------------------------------&lt;br /&gt;&lt;br /&gt;-- package needed for the ref_type declaration&lt;br /&gt;CREATE OR REPLACE package EPEKER.pck_ref_type as &lt;br /&gt;  type ref_type is ref cursor; &lt;br /&gt;end pck_ref_type;&lt;br /&gt;&lt;br /&gt;-- procedure itself&lt;br /&gt;CREATE OR REPLACE procedure EPEKER.p_return_cursor &lt;br /&gt;  (c_return out epeker.pck_ref_type.ref_type, i_var in number)&lt;br /&gt;is&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;  open c_return for&lt;br /&gt;    select * from v$datafile where file#=i_var;&lt;br /&gt;&lt;br /&gt;  exception&lt;br /&gt;    when others then&lt;br /&gt;      rollback;&lt;br /&gt;&lt;br /&gt;end p_return_cursor;&lt;br /&gt;*/&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href='http://www.oracle.com/technology/pub/articles/tech_dev.html#dotnet'&gt;Some other articles for .NET&lt;/a&gt;&lt;br /&gt;&lt;a href='http://www.oracle.com/technology/tech/windows/odpnet/index.html'&gt;odp.net homepage&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-3256265856628356396?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/3256265856628356396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/10/querying-oracle-with-c-and-odpnet.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/3256265856628356396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/3256265856628356396'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/10/querying-oracle-with-c-and-odpnet.html' title='Querying Oracle with C# and odp.net'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOseEFLzj2I/AAAAAAAAAnY/0F3SaItlmxs/s72-c/Snap1.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-5599377683143953603</id><published>2008-09-02T11:13:00.004+03:00</published><updated>2008-09-02T11:21:52.935+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>sql loader performance experiences</title><content type='html'>Lots of the reporting databases has data loading scripts, using oracle SQL Loader to load mass amount of data from a text file. Loaded data is used for reporting purposes in day time. Commonly reported problem is long running loader scripts and solving this kind of problems has genarally similar approaches. &lt;br /&gt;&lt;br /&gt;1- Dropping unnecessary indexes improves the performance of the batch loader operations hence every insert needs to update the indexes after updating the table. Fewer indexes means fewer operation for the DML statements. In my databases i examine &lt;font face="courier" size="2"&gt;v$sql, v$sqlarea, v$sqltext and dba_hist_sqltext&lt;/font&gt; views to examine the daily routine of the executed sql statements on the database to find out the index usage percentage of the statements. This gives a brief information about the index usage and to decide if i can drop any.&lt;br /&gt;&lt;br /&gt;2- Using nologging option for the tables generates less redo logs. If the database in archive mode then less redo means less work for the archiver. log writer related wait events can also be improved. Using this option causes database not to log the operation and database admin should be cautious about the backup and restore operations. Bacause a recover operation may not recover your nologging tables data. I prefer full and incremental backups with rman in this kind of databases.&lt;br /&gt;&lt;br /&gt;3- By setting &lt;font face="courier" size="2"&gt;Direct=true&lt;/font&gt; option of the sqlloader direct can be enabled, which loads data directly to datafiles by bypassing most of the database operations.&lt;br /&gt;&lt;br /&gt;4- Sometimes table data is deleted periodically. This delete operation fragments the segments of the table and indexes of the table. Moving the tables and the indexes defragments the segments. If the table is fragmented, i prefer dropping the indexes first and move the table and then recreate the indexes again. &lt;a href="http://ergemp.blogspot.com/2008/06/deleting-from-table-causes.html"&gt;One of my early postings&lt;/a&gt; covers this topic.&lt;br /&gt;&lt;br /&gt;There are some other parameters; rows (row size to be commited) and unrecoverable (if used with direct=true option, redo writes are bypassed) parameters for further enhancement for loader performance. But i frequently use the mentioned parameters and they worked more than enough for most cases.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-5599377683143953603?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/5599377683143953603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/09/sql-loader-performance-experiences.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5599377683143953603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5599377683143953603'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/09/sql-loader-performance-experiences.html' title='sql loader performance experiences'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-912531873407253012</id><published>2008-08-12T14:26:00.004+03:00</published><updated>2008-08-12T14:30:15.141+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle RAC'/><title type='text'>srvctl problem after 10.2.0.4 patch</title><content type='html'>New migration project of the database and system group in our company is from Oracle Database 9.2.0.5 RAC on LINUX AS3 32 bit to Oracle Database RAC 10.2.0.4 on LINUX ES4 Update6 64 bit. After installing clusterware and the database 10.2.0.1 successfully, i decided to upgrade the database and the clusterware to the last level of patchset 10.2.0.4. After installing the patchset i realised that srvctl cannot open the databases with the command &lt;font face="courier"&gt;srvctl start database -d PQ&lt;/font&gt;. But i can open the databases individually with the sqlplus. The wierd thing is srvctl works with "status" and "close" parameters. When i examine the crs logs i founded the following error logs.&lt;br /&gt;&lt;pre size='1'&gt;&lt;br /&gt;#cat /oracle/product/crs/log/pqvrtsrv1/crsd/crsd.log&lt;br /&gt;2008-07-16 17:52:37.840: [  CRSAPP][1535326560]0StartResource error for ora.PQ.db error code = 1&lt;br /&gt;2008-07-16 17:52:37.892: [  CRSRES][1535326560]0Start of `ora.PQ.db` on member `pqvrtsrv1` failed.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This one error message did not satisfy me to start taking action for the problem hence it has too few information to make a conclusion. I decided to look at the databases alert.log, if i can find any clue about the problem. But the last logs written to the alert.log was the databases closing messages. This may be a clue, because this means srvctl cannot reach the database to open it, now i can start from srvctl settings to examine.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#FFFF00"&gt;$ srvctl config database -d PQ -a&lt;/font&gt;&lt;br /&gt;pqvrtsrv1 PQ1 /oracle/product/db10g&lt;br /&gt;pqvrtsrv2 PQ2 /oracle/product/db10g&lt;br /&gt;DB_NAME: PQ&lt;br /&gt;ORACLE_HOME: /oracle/product/db10g&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#CC0000"&gt;SPFILE: /pqdata1/PQ/PQ/spfilePQ.ora&lt;/font&gt;&lt;br /&gt;DOMAIN: null&lt;br /&gt;DB_ROLE: null&lt;br /&gt;START_OPTIONS: null&lt;br /&gt;POLICY:  AUTOMATIC&lt;br /&gt;ENABLE FLAG: DB ENABLED&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now i can see things. SPFILE configuration is wrong for this database. I clearly remember that i have changed the spfile location to &lt;font face="courier"&gt;/pqdata1/PQ/spfilePQ.ora&lt;/font&gt;. But somehow after the patch is installed, setting are confused. I changed the SPFILE configuration with the correct settings and my problem is now solved.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#srvctl modify database -d PQ -p /pqdata1/PQ/spfilePQ.ora&lt;br /&gt;#srvctl start instance -d PQ -i PQ2&lt;br /&gt;#srvctl status database -d PQ&lt;br /&gt;Instance PQ1 is running on node pqvrtsrv1&lt;br /&gt;Instance PQ2 is running on node pqvrtsrv2&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Resources:&lt;/u&gt;&lt;br /&gt;&lt;a href="http://download.oracle.com/docs/cd/B28359_01/rac.111/b28254/srvctladmin.htm#CDCGICIF"&gt;&lt;br /&gt;Server Control Utility Reference&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-912531873407253012?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/912531873407253012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/08/srvctl-problem-after-10204-patch.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/912531873407253012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/912531873407253012'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/08/srvctl-problem-after-10204-patch.html' title='srvctl problem after 10.2.0.4 patch'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-7700757515154667959</id><published>2008-08-05T14:20:00.004+03:00</published><updated>2008-08-05T14:31:52.167+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Enterprise Manager Grid Control'/><title type='text'>Changing sysman password in OMS</title><content type='html'>I had to change the sysman password today. There are nice articles on the web but in summary, if you want to change the sysman password of the Oracle Enterprise Manager Grid Control Server;&lt;br /&gt;&lt;br /&gt;1- stop all opmn processes&lt;br /&gt;2- stop the oms&lt;br /&gt;3- stop the agent&lt;br /&gt;4- change the password of the sysman user&lt;br /&gt;5- update the $AGENT_HOME/sysman/emd/targets.xml file&lt;br /&gt;6- update the $OMS_HOME/sysman/config/emoms.properties file&lt;br /&gt;7- start the agent&lt;br /&gt;8- start the oms&lt;br /&gt;9- start all opmn processes (actually they are being started by oms)&lt;br /&gt;&lt;br /&gt;Here are the handy articles i used;&lt;br /&gt;&lt;font face="courier" size="1"&gt;&lt;br /&gt;&lt;a href="http://oraclespin.wordpress.com/2008/07/18/how-to-change-sysman-password-in-oem-oms/"&gt;http://oraclespin.wordpress.com/2008/07/18/how-to-change-sysman-password-in-oem-oms/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://thetendjee.wordpress.com/2006/07/19/changing-sysman-and-dbsnmp-passwords-it-aint-that-easy/"&gt;http://thetendjee.wordpress.com/2006/07/19/changing-sysman-and-dbsnmp-passwords-it-aint-that-easy/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dbataj.blogspot.com/2007/07/change-sysman-password.html"&gt;http://dbataj.blogspot.com/2007/07/change-sysman-password.html&lt;/a&gt;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br \&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-7700757515154667959?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/7700757515154667959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/08/changing-sysman-password-in-oms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7700757515154667959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7700757515154667959'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/08/changing-sysman-password-in-oms.html' title='Changing sysman password in OMS'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-7577129440456039349</id><published>2008-07-29T12:18:00.001+03:00</published><updated>2008-07-29T12:20:17.585+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle RAC'/><title type='text'>Problem with CRS startup after disk migration</title><content type='html'>Our unix and storage group has a project for migration from old storage subsystem to a brand new one. Action plan was simple; &lt;br /&gt;&lt;br /&gt;1- shutdown the database with &lt;pre&gt;srvctl stop database -d &lt;db_name&gt;&lt;/pre&gt;&lt;br /&gt;2- shutdown the crs with &lt;pre&gt;crsctl stop crs&lt;/pre&gt;&lt;br /&gt;3- move the data from old disks to new ones&lt;br /&gt;4- rename the new disks with the original names&lt;br /&gt;5- open the crs with &lt;pre&gt;crsctl start crs&lt;/pre&gt;&lt;br /&gt;6- startup the database with &lt;pre&gt;srvctl start database -d &lt;db_name&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;But right after step 4, crs was unable to open and I am called at night. When i tried to start crs with crsctl start crs, i had errors indicates crs was unable to reach the OCR disk. I tried to check the OCR with ocrcheck and trace the log file of the OCR in $CRS_HOME/log/&lt;hostname&gt;/client/&lt;br /&gt;&lt;pre&gt;&lt;font size='1'&gt;&lt;br /&gt;[root@raquality00 client]$ pwd&lt;br /&gt;/oracle/product/10.2.0/crs/log/raquality00/client&lt;br /&gt;[root@raquality00 client]# cat ocrcheck_13416.log&lt;br /&gt;Oracle Database 10g CRS Release 10.2.0.1.0 Production Copyright 1996, 2005 Oracle.  All rights reserved.&lt;br /&gt;2008-06-18 02:13:39.487: [OCRCHECK][2538462912]ocrcheck starts...&lt;br /&gt;2008-06-18 02:13:39.488: [  OCROSD][2538462912]utstoragetype: /oradata1/orcfile.ora is on FS type 1952539503. Not supported.&lt;br /&gt;2008-06-18 02:13:39.488: [  OCROSD][2538462912]utopen:6'': OCR location /oradata1/orcfile.ora configured is not valid storage type. Return code [37].&lt;br /&gt;2008-06-18 02:13:39.488: [  OCRRAW][2538462912]proprinit: Could not open raw device &lt;br /&gt;2008-06-18 02:13:39.488: [ default][2538462912]a_init:7!: Backend init unsuccessful : [37]&lt;br /&gt;2008-06-18 02:13:39.488: [OCRCHECK][2538462912]Failed to initialize OCR context: [PROC-37: Oracle Cluster Registry does not support the storage type configured]&lt;br /&gt;2008-06-18 02:13:39.488: [OCRCHECK][2538462912]Failed to initialize ocrchek2&lt;br /&gt;2008-06-18 02:13:39.488: [OCRCHECK][2538462912]Exiting [status=failed]...&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;Log file says there is a problem with the ocrfile.ora. But I am suspicious if the filename is true. I should be sure with the filename so I examine the install logs in $CRS_HOME/install/ directory. &lt;br /&gt;&lt;pre&gt;&lt;font size='1'&gt;&lt;br /&gt;[oracle@raquality00 install]$ pwd&lt;br /&gt;/oracle/product/10.2.0/crs/install&lt;br /&gt;[oracle@raquality00 install]$ cat paramfile.crs&lt;br /&gt;ORA_CRS_HOME=/oracle/product/10.2.0/crs&lt;br /&gt;CRS_ORACLE_OWNER=oracle&lt;br /&gt;CRS_DBA_GROUP=oinstall&lt;br /&gt;CRS_VNDR_CLUSTER=false&lt;br /&gt;&lt;font&gt;CRS_OCR_LOCATIONS=/oradata1/orcfile.ora&lt;/font&gt;&lt;br /&gt;CRS_CLUSTER_NAME=raqcrs&lt;br /&gt;CRS_HOST_NAME_LIST=raquality00,1,raquality01,2&lt;br /&gt;CRS_NODE_NAME_LIST=raquality00,1,raquality01,2&lt;br /&gt;CRS_PRIVATE_NAME_LIST=raquality00-priv,1,raquality01-priv,2&lt;br /&gt;CRS_LANGUAGE_ID='AMERICAN_AMERICA.WE8ISO8859P1'&lt;br /&gt;CRS_VOTING_DISKS=/oradata1/votingfile.ora&lt;br /&gt;CRS_NODELIST=raquality00,raquality01&lt;br /&gt;CRS_NODEVIPS='raquality00/raquality00-vip/255.255.255.0/eth0,raquality01/raquality01-vip/255.255.255.0/eth0'&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;Lets see if the location of the ocr file is changed by someone after installation by inspecting the /etc/oracle/ocr.loc. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[oracle@raquality00 oracle]$ pwd&lt;br /&gt;/etc/oracle&lt;br /&gt;[oracle@raquality00 oracle]$ cat ocr.loc&lt;br /&gt;&lt;font&gt;ocrconfig_loc=/oradata1/orcfile.ora&lt;/font&gt;&lt;br /&gt;local_only=FALSE&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;OCR location and the filename seems correct. Now we now it hasnt been changed after the installation. It seems there may be corruption with the OCR file. Checking the backups of the OCR is handy. Maybe I will need to restore from the backup. The command I runned is ocrconfig -showbackup. The output shows the case goes bad. &lt;br /&gt;&lt;pre&gt;&lt;font size='1'&gt;&lt;br /&gt;[root@raquality00 client]# cat ocrconfig_9347.log&lt;br /&gt;Oracle Database 10g CRS Release 10.2.0.1.0 Production Copyright 1996, 2005 Oracle.  All rights reserved.&lt;br /&gt;2008-06-18 02:04:20.350: [ OCRCONF][2538462912]ocrconfig starts...&lt;br /&gt;2008-06-18 02:04:20.353: [  OCROSD][2538462912]utstoragetype: /oradata1/orcfile.ora is on FS type 1952539503. Not supported.&lt;br /&gt;2008-06-18 02:04:20.353: [  OCROSD][2538462912]utopen:6'': OCR location /oradata1/orcfile.ora configured is not valid storage type. Return code [37].&lt;br /&gt;2008-06-18 02:04:20.353: [  OCRRAW][2538462912]proprcow: problem reading the bootblock&lt;br /&gt;2008-06-18 02:04:20.353: [ OCRCONF][2538462912]Failure in overwriting OCR configuration on disk&lt;br /&gt;2008-06-18 02:04:20.353: [ OCRCONF][2538462912]Exiting [status=failed]...&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;I am now getting doubt. Maybe there is a problem about the filesystems. I decided to check the filesystem types from fstab. But they seem OK.&lt;br /&gt;&lt;pre&gt;&lt;font size='1'&gt;&lt;br /&gt;[root@raquality00 raqcrs]# cat /etc/fstab&lt;br /&gt;# This file is edited by fstab-sync - see 'man fstab-sync' for details&lt;br /&gt;LABEL=/1                /                       ext3    defaults        1 1&lt;br /&gt;LABEL=/boot1            /boot                   ext3    defaults        1 2&lt;br /&gt;#LABEL=/oradata          /oradata1              ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;LABEL=/oradata1_new     /oradata1               ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;#LABEL=/oradata2         /oradata2              ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;LABEL=/oradata2_new     /oradata2               ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;#LABEL=/oradata3         /oradata3              ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;#LABEL=/oradata4         /oradata4              ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;#LABEL=/oradata5         /oradata5              ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;#LABEL=/oradata6         /oradata6              ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;#LABEL=/oradata7         /oradata7              ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;#LABEL=/oradata8         /oradata8              ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;#LABEL=/oradata9         /oradata9              ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;LABEL=/oradata9_new     /oradata9               ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;LABEL=/oradata10_new    /oradata10              ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;#LABEL=/oradata11        /oradata11             ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;LABEL=/oradata11_new    /oradata11              ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;#LABEL=/oradata12        /oradata12             ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;LABEL=/oradata12_new    /oradata12              ocfs2   _netdev,datavolume,nointr       0 0&lt;br /&gt;#/dev/mapper/vgra-lvra01        /ra01                   ext3    defaults        1 2&lt;br /&gt;/dev/vgra00/lvra01      /ra01_new               ext3    defaults        1 2&lt;br /&gt;none                    /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;none                    /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;none                    /proc                   proc    defaults        0 0&lt;br /&gt;none                    /sys                    sysfs   defaults        0 0&lt;br /&gt;LABEL=SWAP-sda2         swap                    swap    defaults        0 0&lt;br /&gt;/dev/sdb1               swap                    swap    defaults        0 0&lt;br /&gt;#/dev/vgora/lvora       /oracle                 ext3    defaults        1 2&lt;br /&gt;/dev/vgra00/lvoracle    /oracle                 ext3    defaults        1 2&lt;br /&gt;/dev/hda                /media/cdrom            auto    pamconsole,exec,noauto,managed 0 0&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;When i recheck the error logs of ocrcheck command i realised that there are some other error notifications after invalid storage type error line. OCR complains about reading bootblock and overwriting the file. There maybe a process holding the file. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[oracle@raquality00 install]$ ps -ef | grep crs&lt;br /&gt;root     10239  7791  0 Jun18 ?        00:37:59 /oracle/product/10.2.0/crs/bin/crsd.bin reboot&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now it is more clear, maybe our admins forgot to disable crs service by executing &lt;pre&gt;/etc/init.d/init.crs stop&lt;/pre&gt; after stopping crs with &lt;pre&gt;crsctl stop crs&lt;/pre&gt;. And data migration is made with the running crs service. I recommended a reboot but stopping the the service may also be OK. After the reboot crs is opened successfully and databases are now up and running.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[oracle@raquality00 install]$ crsctl check crs&lt;br /&gt;CSS appears healthy&lt;br /&gt;CRS appears healthy&lt;br /&gt;EVM appears healthy&lt;br /&gt;&lt;br /&gt;[oracle@raquality00 install]$ srvctl status database -d RADB&lt;br /&gt;Instance RADB1 is running on node raquality00&lt;br /&gt;Instance RADB2 is running on node raquality01&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-7577129440456039349?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/7577129440456039349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/07/problem-with-crs-startup-after-disk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7577129440456039349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7577129440456039349'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/07/problem-with-crs-startup-after-disk.html' title='Problem with CRS startup after disk migration'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-2516566837085001987</id><published>2008-07-05T21:09:00.004+03:00</published><updated>2008-07-05T21:22:31.409+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>Alter the table to change the structure</title><content type='html'>What will happen if one of the source files structure changes, and all data loading procedures and "sql loader" scripts are ready after long and busy working days. Oracle has options to change the table structure.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Altering a column&lt;/b&gt;&lt;br /&gt;&lt;pre size="2"&gt;&lt;br /&gt;create table EPEKER.ep_test (col1 varchar(10));&lt;br /&gt;&lt;br /&gt;insert into  EPEKER.ep_test values ('some text here');&lt;br /&gt;--ORA-12899: value too large for column "EPEKER"."EP_TEST"."COL1" (actual: 14, maximum: 10)&lt;br /&gt;&lt;br /&gt;alter table EPEKER.ep_test modify (col1 varchar2(20));&lt;br /&gt;insert into  EPEKER.ep_test values ('some text here');&lt;br /&gt;--1 row inserted&lt;br /&gt;commit;&lt;br /&gt;&lt;br /&gt;select * from EPEKER.ep_test;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Adding/Dropping a column&lt;/b&gt;&lt;br /&gt;&lt;pre size="2"&gt;&lt;br /&gt;alter table EPEKER.ep_test add (col2 date);&lt;br /&gt;alter table EPEKER.ep_test add (col2 date DEFAULT sysdate);&lt;br /&gt;&lt;br /&gt;alter table EPEKER.ep_test drop (col2);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Renaming Columns&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;alter table EPEKER.ep_test rename column col3 to col4;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Changing Datatypes&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;But changing datatype of a column is not that easy. As the following example shows to change a datatype of a column, the column to be modified must be empty.&lt;br /&gt;&lt;pre size="2"&gt;&lt;br /&gt;insert into EPEKER.ep_test (col3) values ('123')&lt;br /&gt;commit;&lt;br /&gt;alter table EPEKER.ep_test modify (col3 number)&lt;br /&gt;--ORA-01439: column to be modified must be empty to change datatype&lt;br /&gt;&lt;br /&gt;update EPEKER.ep_test set col3=NULL;&lt;br /&gt;commit;&lt;br /&gt;alter table EPEKER.ep_test modify (col3 number)&lt;br /&gt;&lt;br /&gt;desc EPEKER.ep_test&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Compressed Tables&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You can modify and add columns to compressed tables. But dropping a column is still not supported (v10.2). To drop a column one should first MOVE NOCOMPRESS, drop the column and again MOVE COMPRESS a table.&lt;br /&gt;&lt;pre size="2"&gt;&lt;br /&gt;alter table EPEKER.ep_test move compress;&lt;br /&gt;alter table EPEKER.ep_test add (col3 varchar2(10));&lt;br /&gt;alter table EPEKER.ep_test modify (col3 varchar2(20));&lt;br /&gt;&lt;br /&gt;alter table EPEKER.ep_test drop (col3);&lt;br /&gt;--ORA-39726: unsupported add/drop column operation on compressed tables&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-2516566837085001987?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/2516566837085001987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/07/alter-table-to-change-structure.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/2516566837085001987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/2516566837085001987'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/07/alter-table-to-change-structure.html' title='Alter the table to change the structure'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-7059932679558974371</id><published>2008-06-18T15:22:00.022+03:00</published><updated>2008-11-13T04:57:08.921+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Enterprise Manager Grid Control'/><title type='text'>Oracle EM Grid Control - Custom Reports</title><content type='html'>&lt;b&gt;Creating Custom Grid Report for database availability&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Oracle Enterprise Manager GRID Server contains built in reports to support Database Administrators to generate sightly reports. However, in my company, we need some reports that cannot be find in GRID and needs custom development. Here is how i did it.&lt;br /&gt;&lt;br /&gt;First Thing is to click to "Reports" tab on the top, right hand side of the GRID Management Console (&lt;a href="http://2.bp.blogspot.com/_fSrIpdF1Zdk/SFj-13wsr2I/AAAAAAAAAbI/wUhw0crQ_tA/s1600-h/grid_management_console.jpg"&gt;figure_grid_management_console&lt;/a&gt;). This page is where all the predefined and custom reports can be find. Now click on the "Create" Button on top of the page to create a new custom report. "Create Report Definition" page comes to the screen. There are four tabs for the definition of the report.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;General&lt;/b&gt;&lt;br /&gt;After specifiying title of the report then select category and subcategory from the comboboxes. Category and subcategory defines our newly custom report's group and standing place in the reports list of the GRID reports page. You can also create new categories by clicking the buttons between the comboboxes.&lt;br /&gt;&lt;br /&gt;Targets section enables you to limit the available list of target selection while generating the report or you can select a specified target to be used. I used "Specified Target" and left the textbox blank because this report will apply to all database and rac targets and is not allowed to be changed.&lt;br /&gt;&lt;br /&gt;You can enable to select time periods by end user or you can preset the time period from the "Time Period" section (&lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/SFj_9O8EfPI/AAAAAAAAAbQ/dOEU8W3YDhA/s1600-h/create_report_general_tab.jpg"&gt;figure_create_report_general_tab&lt;/a&gt;). This custom report always displays the last known and most updated state of the databases uptimes and downtimes.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Elements&lt;/b&gt;&lt;br /&gt;In the Elements tab, you can define the report elements and their positions in the report page (&lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/SFkAc7MUIFI/AAAAAAAAAbY/oyEsu3w42bw/s1600-h/add_element_01.jpg"&gt;figure_add_elements_1&lt;/a&gt;). Report elements are structures that displays selected data from the GRID Servers repository. Click "Add" Button to add elements. I used IPMSG_USER_CHART_FROM_SQL and IPMSG_USER_TABLE_FROM_SQL elements (&lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/SFkA9EKL4eI/AAAAAAAAAbg/tW45CgVJ2BY/s1600-h/add_element_02.jpg"&gt;figure_add_elements_2&lt;/a&gt;). Click on the "Set Parameters" icon on the right hand side of the listed items to obtain a statement for the elements (&lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/SFkA9EKL4eI/AAAAAAAAAbg/tW45CgVJ2BY/s1600-h/add_element_02.jpg"&gt;figure_add_elements_2&lt;/a&gt;). Here you can enter the sql statement that brings data into the element from Management Servers repository. Following you can find the sql statements for the elements.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;IPMSG_USER_TABLE_FROM_SQL&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;select&lt;br /&gt; target_name,&lt;br /&gt; target_type,&lt;br /&gt; sum(up_time) up_time,&lt;br /&gt; sum(down_time) down_time,&lt;br /&gt; sum(blackout_time) blackout_time,&lt;br /&gt; trunc(sum(up_time)/(sum(nvl(up_time,1))+sum(nvl(down_time,1)))*100) availability_pct&lt;br /&gt;from&lt;br /&gt;(&lt;br /&gt;select&lt;br /&gt; target_name,&lt;br /&gt; target_type,&lt;br /&gt; sum(trunc((nvl(end_timestamp,sysdate)-start_timestamp)*24)) total_hours,&lt;br /&gt; case availability_status&lt;br /&gt;   when 'Target Down' then&lt;br /&gt;     0&lt;br /&gt;   when 'Target Up' then&lt;br /&gt;     0&lt;br /&gt;   when 'Blackout' then&lt;br /&gt;     sum(trunc((nvl(end_timestamp,sysdate)-start_timestamp)*24))&lt;br /&gt; end blackout_time,&lt;br /&gt; case availability_status&lt;br /&gt;   when 'Target Down' then&lt;br /&gt;     0&lt;br /&gt;   when 'Target Up' then&lt;br /&gt;     sum(trunc((nvl(end_timestamp,sysdate)-start_timestamp)*24))&lt;br /&gt;   when 'Blackout' then&lt;br /&gt;     0&lt;br /&gt; end up_time, &lt;br /&gt; case availability_status&lt;br /&gt;   when 'Target Down' then&lt;br /&gt;     sum(trunc((nvl(end_timestamp,sysdate)-start_timestamp)*24))&lt;br /&gt;   when 'Target Up' then&lt;br /&gt;     0&lt;br /&gt;   when 'Blackout' then&lt;br /&gt;     0&lt;br /&gt; end down_time,&lt;br /&gt; availability_status&lt;br /&gt;from&lt;br /&gt; MGMT$AVAILABILITY_HISTORY&lt;br /&gt;where&lt;br /&gt; target_type in ('oracle_database','rac_database') and&lt;br /&gt; availability_status in ('Target Down','Target Up','Blackout')&lt;br /&gt;group by&lt;br /&gt; target_name, target_type, availability_status&lt;br /&gt;order by target_name, availability_status&lt;br /&gt;)&lt;br /&gt;group by target_name, target_type&lt;br /&gt;order by target_name&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;--sample output:&lt;br /&gt;&lt;br /&gt;TARGET_NAME    TARGET_TYPE     UP_TIME   DOWN_TIME    BLACKOUT_TIME  AVAILABILITY_PCT&lt;br /&gt;-----------    -----------     -------   ---------    -------------  ----------------&lt;br /&gt;ACTV           rac_database    4823      0            1                100&lt;br /&gt;ACTV_ACTV1     oracle_database 4823      0            1                100&lt;br /&gt;ACTV_ACTV2     oracle_database 3964      0            1                100&lt;br /&gt;ARCH.AVEA.COM  oracle_database 3334      0            0                100&lt;br /&gt;ARCHCM         oracle_database 2210      1126         0                66&lt;br /&gt;ARCHDB         rac_database    3858      0            653              100&lt;br /&gt;ARCHDB_ARCHDB1 oracle_database 3514      31           652              99&lt;br /&gt;ARCHDB_ARCHDB2 oracle_database 3725      0            652              100&lt;br /&gt;ASPDB          oracle_database 1750      2            0                99&lt;br /&gt;...&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;IPMSG_USER_CHART_FROM_SQL&lt;/u&gt;&lt;br /&gt;&lt;pre  style="font-size:78%;"&gt;&lt;br /&gt;select&lt;br /&gt; availability_status,&lt;br /&gt; sum(trunc((end_timestamp-start_timestamp)*24)) total_hours &lt;br /&gt;from&lt;br /&gt; MGMT$AVAILABILITY_HISTORY&lt;br /&gt;where&lt;br /&gt; target_type in ('oracle_database','rac_database') and&lt;br /&gt; availability_status in ('Target Down','Target Up','Blackout')&lt;br /&gt;group by&lt;br /&gt; availability_status&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;--sample output:&lt;br /&gt;&lt;br /&gt;AVAILABILITY_STATUS   TOTAL_HOURS&lt;br /&gt;-------------------   -----------&lt;br /&gt;Target Up             130008&lt;br /&gt;Target Down           2086&lt;br /&gt;Blackout              2405&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Schedule&lt;/b&gt;&lt;br /&gt;You can schedule a report to be emailed to an email by setting schedules (&lt;a href="http://1.bp.blogspot.com/_fSrIpdF1Zdk/SFkCjN95qhI/AAAAAAAAAb4/Hfu9ULocdNE/s1600-h/schedule_tab.jpg"&gt;figure_schedule_tab&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Access&lt;/b&gt;&lt;br /&gt;Report creator can define user groups or users who will be allowed to access this report. Here i used user groups (&lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/SFkCLqBVOUI/AAAAAAAAAbw/ZWjfhR5OU7g/s1600-h/access_tab.jpg"&gt;figure_access_tab&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_fSrIpdF1Zdk/SFkB55SNpSI/AAAAAAAAAbo/4G1UnO-H02k/s1600-h/report_page.jpg"&gt;Database availability report is now ready for managers&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-7059932679558974371?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/7059932679558974371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/06/oracle-em-grid-control-custom-reports.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7059932679558974371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7059932679558974371'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/06/oracle-em-grid-control-custom-reports.html' title='Oracle EM Grid Control - Custom Reports'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-1258028090002571610</id><published>2008-06-13T15:19:00.006+03:00</published><updated>2010-11-23T11:27:53.366+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>deleting from table causes fragmentation</title><content type='html'>One of our application groups periodically deletes data, which are older than 10 days, from some tables. This periodic action splits the table blocks to a wide range of datafile blocks. This causes performance problems on daily data loading and daytime reporting. &lt;br /&gt;&lt;br /&gt;As the first action plan gather statistics for trusted analysis.&lt;br /&gt;&lt;pre&gt;begin&lt;br /&gt;dbms_stats.gather_table_stats(&lt;br /&gt;    ownname=&gt;'PQ',&lt;br /&gt;    tabname=&gt;'GPRS_CELL_GPRS',&lt;br /&gt;    estimate_percent=&gt;33,&lt;br /&gt;    degree=&gt;2,&lt;br /&gt;    cascade=&gt;true);&lt;br /&gt;end;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can see the space fragmentation from the following. Currently the tables consumes nearly 3Gb 's of datafile usage. But if you calculate the average row length with the number of table rows, datafile usage should be 328Mb.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;select ceil((blocks*8)/1024) as table_mb from dba_tables &lt;br /&gt;    where table_name='GPRS_CELLGPRS' and owner='PQ'&lt;br /&gt;/*&lt;br /&gt;TABLE_MB&lt;br /&gt;2926&lt;br /&gt;*/&lt;br /&gt;select ceil((avg_row_len*num_rows)/1024/1024) as table_mb from dba_tables &lt;br /&gt;    where table_name='GPRS_CELLGPRS' and owner='PQ'&lt;br /&gt;/*&lt;br /&gt;TABLE_MB&lt;br /&gt;328&lt;br /&gt;*/ &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After this finding, following procedure is set to run periodically to delete 10 days older data from the table. After the delete operation table is moved for defragmentation. Table indexes should also be rebuilded. After the move and rebuild operation statistics should also be gathered. Keep in mind that table move and index rebuild operations blocks user access.&lt;br /&gt;&lt;pre&gt;&lt;font size='1'&gt;&lt;br /&gt;create or replace procedure avea_sysmon.P_TABLE_MAINTENANCE&lt;br /&gt;  (g_table_name varchar2, g_owner varchar2) AUTHID CURRENT_USER as &lt;br /&gt;  &lt;br /&gt;  cursor c1 is&lt;br /&gt;    select * from sys.dba_indexes where table_owner=g_owner and table_name=g_table_name;&lt;br /&gt;&lt;br /&gt;  r1 c1%rowtype;  &lt;br /&gt;begin&lt;br /&gt;    &lt;br /&gt;    execute immediate 'delete from PQ.GPRS_TRAFGPRS3 where ' || &lt;br /&gt;                      'to_number(substr(CDATE,1,6)) &lt; to_char(sysdate-15,''YYMMDD'')';&lt;br /&gt;    commit; &lt;br /&gt;    execute immediate 'alter table ' || g_owner || '.' || g_table_name || ' move';&lt;br /&gt;    &lt;br /&gt;    open c1;    &lt;br /&gt;    loop&lt;br /&gt;      fetch c1 into r1;&lt;br /&gt;      exit when c1%NOTFOUND;  &lt;br /&gt;      execute immediate 'alter index ' || r1.table_owner || '.' || &lt;br /&gt;                         r1.index_name || '  rebuild';      &lt;br /&gt;    end loop;&lt;br /&gt;    &lt;br /&gt;    dbms_stats.gather_table_stats(ownname=&gt;g_owner,tabname=&gt;g_table_name,&lt;br /&gt;                                  estimate_percent=&gt;33,cascade=&gt;true);&lt;br /&gt;    &lt;br /&gt;end P_TABLE_MAINTENANCE;&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;FOLLOW UP: (23.11.2010)&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;With Oracle10g there is a new way of reorganising your table segments. The best thing is there is not any unusable indexes anymore.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:90%"&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;&lt;br /&gt;select owner, table_name, &lt;br /&gt;  trunc((avg_row_len*num_rows)/1024/1024) as ROWS_MB, &lt;br /&gt;  trunc((blocks*8192)/1024/1024) as TOTAL_MB &lt;br /&gt;  from dba_tab_statistics where table_name = 'WIZ_CUSTOMER_MAILBOX';&lt;br /&gt;--OWNER, TABLE_ANME, ROWS_MB, TOTAL_MB&lt;br /&gt;--PROD_DBA,WIZ_CUSTOMER_MAILBOX,19982,29790&lt;br /&gt;&lt;br /&gt;alter table PROD_DBA.WIZ_CUSTOMER_MAILBOX enable row movement;&lt;br /&gt;alter table PROD_DBA.WIZ_CUSTOMER_MAILBOX shrink space compact;&lt;br /&gt;&lt;br /&gt;select owner, table_name, &lt;br /&gt;  trunc((avg_row_len*num_rows)/1024/1024) as ROWS_MB, &lt;br /&gt;  trunc((blocks*8192)/1024/1024) as TOTAL_MB &lt;br /&gt;  from dba_tab_statistics where table_name = 'WIZ_CUSTOMER_MAILBOX';&lt;br /&gt;--OWNER, TABLE_ANME, ROWS_MB, TOTAL_MB&lt;br /&gt;--PROD_DBA,WIZ_CUSTOMER_MAILBOX,19982,26790&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-1258028090002571610?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/1258028090002571610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/06/deleting-from-table-causes.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/1258028090002571610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/1258028090002571610'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/06/deleting-from-table-causes.html' title='deleting from table causes fragmentation'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-5566306126811421191</id><published>2008-05-26T21:00:00.015+03:00</published><updated>2009-11-04T19:24:42.130+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>A Security Hardening Approach for userproof databases</title><content type='html'>What if you have some confusion about some of your database users and want to trace the users or even be notified about their actions in the database or just want to warn them about probable mistakes can be made by db users. Oracle Database software has some solutions about likely cases. Auditing is one of the most used option with tracing. DDL triggers can also be used. There are also some solutions at the opsys level. &lt;br /&gt;&lt;br /&gt;&lt;font size='2'&gt;&lt;b&gt;1- Logon Triggers to Trace Users&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;Oracle database has logon triggers to run on any users login to the database.  DBA can use this feature to set a trace file for the logged in user. tkprof utility can be used to examine users activity.&lt;br /&gt;&lt;pre size='1'&gt;&lt;font size='2'&gt;&lt;br /&gt;CREATE OR REPLACE TRIGGER SYS.TRG_SESSION_LOGON after logon on database&lt;br /&gt;declare&lt;br /&gt;  s_username varchar2(20);&lt;br /&gt;  s_sessid varchar2(20);&lt;br /&gt;  s_stamp varchar2(20);&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;  &lt;font color='#00AA00'&gt;&lt;i&gt;-- obtain sid of the session&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  select distinct(substr(sid,1,20)) into s_sessid from v$mystat;&lt;br /&gt;&lt;br /&gt;  &lt;font color='#00AA00'&gt;&lt;i&gt;-- obtain username of the session&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  select username into s_username from v$session where sid=s_sessid;&lt;br /&gt;&lt;br /&gt;  &lt;font color='#00AA00'&gt;&lt;i&gt;-- create a timestamp to uniquely identify the trace file&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  select to_char(sysdate,'DDMMYYYY_HH24MISS') into s_stamp from dual;&lt;br /&gt;&lt;br /&gt;  &lt;font color='#00AA00'&gt;&lt;i&gt;-- set the tracefile size to unlimited. careful about that (!)&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  execute immediate 'alter session set max_dump_file_size=unlimited';&lt;br /&gt;&lt;br /&gt;  &lt;font color='#00AA00'&gt;&lt;i&gt;-- define an identifier to the tracefile to distinguish the trace files&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  execute immediate 'alter session set tracefile_identifier=' || s_username || &lt;br /&gt;                    '_' || s_sessid || '_' || s_stamp;&lt;br /&gt;&lt;br /&gt;  &lt;font color='#00AA00'&gt;&lt;i&gt;-- i will take 10046 trace level 8 to see the waits &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  &lt;font color='#00AA00'&gt;&lt;i&gt;-- (check timed_statistics init parameter!)&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  &lt;font size='1'&gt;execute immediate 'alter session set events ''10046 trace name context forever, level 8''';&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;  &lt;font color='#00AA00'&gt;&lt;i&gt;-- finally start the trace&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  execute immediate 'alter session set sql_trace=true';&lt;br /&gt;  &lt;br /&gt;  exception&lt;br /&gt;    when others then&lt;br /&gt;      raise;&lt;br /&gt;    &lt;br /&gt;end TRG_LOGON;&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;You can find the trace files from user_dump_dest parameter&lt;br /&gt;&lt;pre size='1'&gt;&lt;br /&gt;SQL&gt; show parameter user_dump_dest;&lt;br /&gt;&lt;br /&gt;NAME                                 TYPE        VALUE&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;user_dump_dest                       string      D:\ORACLEDB10G\ADMIN\ORCL\UDUMP&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To examine the dump file tkprof utility can be used.&lt;br /&gt;&lt;pre size='2'&gt;&lt;br /&gt;tkprof orcl_ora_5412_epeker_148_22052008_162752.trc tkprof.out&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href='http://www.ergem.net/blog/ergemp/tkprof.txt'&gt;tkprof.out file.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size='2'&gt;&lt;b&gt;2- Database Audit&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;To enable audit option, audit_trail init parameter should be set. &lt;br /&gt;&lt;pre size='1'&gt;&lt;br /&gt;select name, value from v$parameter where name = 'audit_trail';&lt;br /&gt;alter system set audit_trail='DB_EXTENTED' scope=spfile;&lt;br /&gt;&lt;font color='#00AA00'&gt;&lt;i&gt;--After changing audit_trail parameter bounce the database.&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;audit select table, insert table, update table, delete table by epeker;&lt;br /&gt;audit session by epeker;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now login to the database with the audited user and make some ddl.&lt;br /&gt;&lt;pre size='1'&gt;&lt;br /&gt;select * from EPEKER.T_TABLE_DBA_TABLES;&lt;br /&gt;insert into EPEKER.T_TABLE_DBA_TABLES select * from DBA_TABLES where rownum&lt;10;&lt;br /&gt;commit;&lt;br /&gt;select * from EPEKER.T_TABLE_DBA_TABLES;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;All the audit information should be in the SYS.AUD$ table&lt;br /&gt;&lt;pre size='1'&gt;&lt;br /&gt;select &lt;br /&gt;  SESSIONID, USERID, USERHOST,TERMINAL, OBJ$CREATOR, OBJ$NAME, NTIMESTAMP#, SCN, SQLTEXT &lt;br /&gt;from &lt;br /&gt;  SYS.AUD$&lt;br /&gt;order by NTIMESTAMP# desc;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre size='1'&gt;&lt;font size='1'&gt;&lt;br /&gt;/*&lt;br /&gt;SESSIONID  USERID     OBJ$CREATOR OBJ$NAME           NTIMESTAMP#           SCN    SQLTEXT&lt;br /&gt;1249       EPEKER     SYS,        USER$              5/23/2008 11:45:00 AM 935996 insert into EPEKER.T_TABLE_DBA_TABLES select * from DBA_TABLES where rownum&lt;10 &lt;br /&gt;1249       EPEKER     SYS,        TS$                5/23/2008 11:45:00 AM 935996 insert into EPEKER.T_TABLE_DBA_TABLES select * from DBA_TABLES where rownum&lt;10 &lt;br /&gt;1249       EPEKER     SYS,        SEG$               5/23/2008 11:45:00 AM 935996 insert into EPEKER.T_TABLE_DBA_TABLES select * from DBA_TABLES where rownum&lt;10 &lt;br /&gt;1249       EPEKER     SYS,        X$KSPPCV           5/23/2008 11:45:00 AM 935996 insert into EPEKER.T_TABLE_DBA_TABLES select * from DBA_TABLES where rownum&lt;10 &lt;br /&gt;1249       EPEKER     SYS,        TAB$               5/23/2008 11:45:00 AM 935996 insert into EPEKER.T_TABLE_DBA_TABLES select * from DBA_TABLES where rownum&lt;10 &lt;br /&gt;1249       EPEKER     SYS,        OBJ$               5/23/2008 11:45:00 AM 935996 insert into EPEKER.T_TABLE_DBA_TABLES select * from DBA_TABLES where rownum&lt;10 &lt;br /&gt;1249       EPEKER     SYS,        DBA_TABLES         5/23/2008 11:45:00 AM 935996 insert into EPEKER.T_TABLE_DBA_TABLES select * from DBA_TABLES where rownum&lt;10 &lt;br /&gt;1249       EPEKER     SYS,        X$KSPPI            5/23/2008 11:45:00 AM 935996 insert into EPEKER.T_TABLE_DBA_TABLES select * from DBA_TABLES where rownum&lt;10 &lt;br /&gt;1249       EPEKER     EPEKER,     T_TABLE_DBA_TABLES 5/23/2008 11:44:10 AM 935944 select * from T_TABLE_DBA_TABLES&lt;br /&gt;1268       EPEKER                                    5/23/2008 12:01:56 PM       &lt;br /&gt;*/&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;You can revoke the audit by noaudit command.&lt;br /&gt;&lt;pre size='2'&gt;&lt;br /&gt;noaudit select table, insert table, update table, delete table by epeker;&lt;br /&gt;noaudit session by epeker;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size='2'&gt;&lt;b&gt;3- DDL Triggers&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;Oracle database has many different trigger options. You have just read about "logon triggers". There is also ddl triggers can be used to disable specific users from mistakenly running dangerous ddl statements. Any user wants to execute a ddl statment (create, truncate.. etc) can be logged and the user can also be warned by the administrator. The following trigger simply disables a user to drop and/or truncate database tables.  &lt;br /&gt;&lt;pre size='2'&gt;&lt;br /&gt;CREATE OR REPLACE TRIGGER SYS.TRG_DDL before ddl&lt;br /&gt;ON DATABASE&lt;br /&gt;declare&lt;br /&gt;  s_sysevent varchar2(32);&lt;br /&gt;  s_owner varchar2(32);&lt;br /&gt;  s_objname varchar2(32);&lt;br /&gt;  s_user varchar2(32);&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;  select ora_sysevent, ora_dict_obj_owner, ora_dict_obj_name, USER &lt;br /&gt;    into s_sysevent, s_owner, s_objname, s_user from dual;&lt;br /&gt;    &lt;br /&gt;  insert into epeker.t_trg_ddl_test values (ora_sysevent);&lt;br /&gt;  if s_sysevent in ('DROP','TRUNCATE') then&lt;br /&gt;    if s_user = 'EPEKER' then&lt;br /&gt;      raise_application_error(-20010,'You are not authorized to drop a segment!.. ');&lt;br /&gt;      null;&lt;br /&gt;    end if;&lt;br /&gt;  end if;&lt;br /&gt;  &lt;br /&gt;end TRG_DDL;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size='2'&gt;&lt;b&gt;4- database privileges&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;Privileges is important (maybe the most important) checklist to be careful about. Privileges and Roles should be carefully assgined and also revoked from users to minimize the mistakenly made data loss in the databases. &lt;br /&gt;&lt;br /&gt;&lt;font size='2'&gt;&lt;b&gt;5- opsys suggested tasks (alias, sudo, execute privileges, op.sys groups)&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;Beside database auditing tasks, some securtiy hardening can be made in operating system side. Aliases can be used as of direct op. sys. commands for auditing and preventing mistakes by end users or application users. Some commands need root privileges, this kind of commands can be run through sudo in unix. Application users should not be in dba group and Oracle Home and datafiles should be protected with op. sys. file permissions. Grid agent like management and monitoring tools can be used to audit or proactively solve the likely problems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-5566306126811421191?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/5566306126811421191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/05/security-hardening-approach-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5566306126811421191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5566306126811421191'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/05/security-hardening-approach-for.html' title='A Security Hardening Approach for userproof databases'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-7945802153952061232</id><published>2008-05-19T14:01:00.006+03:00</published><updated>2008-05-19T14:11:40.827+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>Table Monitoring worked well</title><content type='html'>I was logged in one of our forgotten databases to partition some tables and maintain dba routines. After all my work is done i decided to examine the tables which are not used any more.&lt;br /&gt;&lt;br /&gt;First thing is to find if it worths to spend some time on it. I checked the sizes of the tables and found that one of the unused tables consume approximately 21Gb of space. That should be so valuable to drop this table on this database because of the problematic disk space usage. &lt;br /&gt;&lt;pre size='2'&gt;&lt;br /&gt;select &lt;br /&gt;  segment_name, sum(bytes/1024/1024) as MB&lt;br /&gt;from &lt;br /&gt;  dba_segments &lt;br /&gt;where &lt;br /&gt;  segment_name in ('WAP_STATREC','PAYFORME_TEMP','PAY4ME_TEMP') and &lt;br /&gt;  owner ='PQ'&lt;br /&gt;group by &lt;br /&gt;  segment_name&lt;br /&gt;order by MB desc;&lt;br /&gt;&lt;br /&gt;SEGMENT_NAME    MB&lt;br /&gt;------------    --&lt;br /&gt;WAP_STATREC     21443&lt;br /&gt;PAYFORME_TEMP   145&lt;br /&gt;PAY4ME_TEMP     1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To obtain if these tables are actively used by developers or any application, i altered these tables to enable monitoring and logout the system.&lt;br /&gt;&lt;br /&gt;&lt;pre size='2'&gt;&lt;br /&gt;alter table pq.wap_statrec monitoring&lt;br /&gt;alter table pq.payforme_temp monitoring&lt;br /&gt;alter table pq.pay4me_temp monitoring&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Today, when i remembered what have i done for a few weeks earlier, i logged in the database and check the dba_tab_modifications management view to find if any modifications done to the tables.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;select&lt;br /&gt;  table_owner, table_name, inserts, updates, deletes, timestamp, truncated&lt;br /&gt;from &lt;br /&gt;  sys.dba_tab_modifications &lt;br /&gt;where &lt;br /&gt;  table_name in ('WAP_STATREC','PAYFORME_TEMP','PAY4ME_TEMP');&lt;br /&gt;&lt;font size='1'&gt;&lt;br /&gt;TABLE_OWNER TABLE_NAME    INSERTS  UPDATES DELETES TIMESTAMP  TRUNCATED&lt;br /&gt;----------- ----------    -------  ------- ------- ---------  ---------&lt;br /&gt;PQ          PAYFORME_TEMP 10695476 0       0       5/7/2008   YES&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As you can see only one of the tables is actively used by an application and the others are not used for 2 weeks. Now time to talk with the application operation or development group to drop their unused tables.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-7945802153952061232?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/7945802153952061232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/05/table-monitoring-worked-well.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7945802153952061232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7945802153952061232'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/05/table-monitoring-worked-well.html' title='Table Monitoring worked well'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-2344943728539185836</id><published>2008-05-06T18:43:00.009+03:00</published><updated>2008-12-15T08:21:38.902+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>Handling Partitioned Tables</title><content type='html'>&lt;u&gt;&lt;b&gt;Subject:&lt;/b&gt;&lt;/u&gt; We have lots of partitioned tables to handle manually. Every begining of the month or year we have add new partitions to prevent "ORA-14400: inserted partition key does not map to any partition". As we have a increasing number of partitioned tables, we faced this problem increasingly for last months.&lt;br /&gt;&lt;br /&gt;I decided to write a plsql script that runs in period by a scheduled job. You can find the scheduled job settings in my &lt;a href='http://ergemp.blogspot.com/2008/04/scheduling-datapump-job-in-oracle-10g.html'&gt;previous&lt;/a&gt; postings. In this posting i will share the procedure that automatically creates the new months partition, archives, compresses and deletes the older partitions by the supplied retention. &lt;br /&gt;&lt;br /&gt;&lt;pre size='1'&gt;&lt;br /&gt;CREATE OR REPLACE procedure AVEA_SYSMON.p_check_partition2&lt;br /&gt;  (s_table_name IN varchar2, &lt;br /&gt;   s_schema_name IN varchar2, &lt;br /&gt;   s_archive_ts IN varchar2, &lt;br /&gt;   n_archive_ret number, &lt;br /&gt;   n_delete_ret number) &lt;br /&gt;&lt;font face='tahoma' size='2' color='#00CC00'&gt;&lt;i&gt;/*As i run this procedure from a job. I want running user to own the privileges*/&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;AUTHID CURRENT_USER &lt;br /&gt;AS &lt;br /&gt;  s_compression varchar2(20);&lt;br /&gt;  s_ts_name varchar2(20);&lt;br /&gt;  &lt;br /&gt;  n_max_month number;&lt;br /&gt;  n_max_year number;&lt;br /&gt;    &lt;br /&gt;  n_next_month number;&lt;br /&gt;  n_next_year number;&lt;br /&gt;  &lt;br /&gt;  n_this_year number;&lt;br /&gt;  n_this_month number;&lt;br /&gt;  &lt;br /&gt;  part_next_month number;&lt;br /&gt;  part_next_year number;&lt;br /&gt;  &lt;br /&gt;  n_ctl number;     &lt;br /&gt;  &lt;br /&gt;  d_next_month date;&lt;br /&gt;  s_part_less_than varchar2(200);&lt;br /&gt;  s_cmd varchar2(200);   &lt;br /&gt;begin&lt;br /&gt;  &lt;font face='tahoma' size='2' color='#00CC00'&gt;&lt;i&gt;&lt;br /&gt;  /*I will read the dba_tab_partitions management view to find the table partitions. &lt;br /&gt;  This procedure works with the formatted name of the partition. &lt;br /&gt;  Here you should have YYYYMM at the end of the partition name*/&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  select &lt;br /&gt;    max(substr(partition_name,-6,4)) into n_max_year&lt;br /&gt;  from &lt;br /&gt;    dba_tab_partitions t1 &lt;br /&gt;  where &lt;br /&gt;    table_owner=s_schema_name and &lt;br /&gt;    table_name=s_table_name;&lt;br /&gt;  &lt;font face='tahoma' size='2' color='#00CC00'&gt;&lt;i&gt;&lt;br /&gt;  -- get max month of table partition&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  select &lt;br /&gt;    max(substr(partition_name,-2,2)) into n_max_month&lt;br /&gt;  from &lt;br /&gt;    dba_tab_partitions t1 &lt;br /&gt;  where &lt;br /&gt;    table_owner=s_schema_name and &lt;br /&gt;    table_name=s_table_name and &lt;br /&gt;    substr(partition_name,-6,4) = n_max_year;        &lt;br /&gt;&lt;br /&gt;  -- find this month this year;&lt;br /&gt;  n_this_year := to_number(to_char(sysdate,'YYYY'));&lt;br /&gt;  n_this_month := to_number(to_char(sysdate,'MM'));&lt;br /&gt;  &lt;br /&gt;  -- find next month next year&lt;br /&gt;  n_next_year := to_number(to_char(add_months(sysdate,1),'YYYY'));&lt;br /&gt;  n_next_month := to_number(to_char(add_months(sysdate,1),'MM'));&lt;br /&gt;&lt;br /&gt;  -- partition definition for next month next year should be one more&lt;br /&gt;  part_next_year := to_number(to_char(add_months(sysdate,2),'YYYY'));&lt;br /&gt;  part_next_month :=  to_number(to_char(add_months(sysdate,2),'MM'));&lt;br /&gt;&lt;br /&gt;  &lt;font face='tahoma' size='2' color='#00CC00'&gt;&lt;i&gt;&lt;br /&gt;  -- check if next months partition exists, create it if not exists&lt;/i&gt;&lt;/font&gt;&lt;/pre&gt;&lt;font face="courier new" size="2"&gt;&lt;br /&gt;  if mod(n_this_month,12) = mod(n_max_month,12) then &lt;br /&gt;      &lt;br /&gt;      s_part_less_than := 'to_date(''01.' || trim(to_char(part_next_month,'09')) || '.' || part_next_year || ''',''DD.MM.YYYY'')';              &lt;br /&gt;    &lt;br /&gt;      s_cmd:='alter table ' || s_schema_name || '.' || s_table_name || ' add partition ' || s_table_name || '_' || n_next_year || '_' || trim(to_char(n_next_month,'09')) || ' values less than (' || s_part_less_than || ') ';&lt;/font&gt;&lt;pre&gt;&lt;br /&gt;      --dbms_output.put_line(s_cmd);&lt;br /&gt;      begin&lt;br /&gt;        execute immediate (s_cmd);&lt;br /&gt;      exception&lt;br /&gt;        when others then&lt;br /&gt;          null;&lt;br /&gt;      end; &lt;br /&gt;  end if;&lt;br /&gt;  &lt;font face='tahoma' size='2' color='#00CC00'&gt;&lt;i&gt;&lt;br /&gt;  /*compress and move partitions to archive tablespace which are &lt;conditional&gt; &lt;br /&gt;  months older*/&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  begin    &lt;br /&gt;      select &lt;br /&gt;        compression, tablespace_name into s_compression, s_ts_name&lt;br /&gt;      from &lt;br /&gt;        dba_tab_partitions &lt;br /&gt;      where &lt;br /&gt;        table_owner=s_schema_name and &lt;br /&gt;        table_name=s_table_name and &lt;br /&gt;        substr(partition_name,-6,4)=to_char(add_months(sysdate,n_archive_ret),'YYYY') and &lt;br /&gt;        substr(partition_name,-2,2)=to_char(add_months(sysdate,n_archive_ret),'MM');&lt;br /&gt;      &lt;font face='tahoma' size='2' color='#00CC00'&gt;&lt;i&gt;&lt;br /&gt;      /*first i should be sure if the partition to be compressed and archived &lt;br /&gt;      is exists. And move the partition to archive tablespace if it is not already &lt;br /&gt;      there and compress if it is not already compresses*/&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;      if s_ts_name!=s_archive_ts then&lt;br /&gt;         s_cmd := 'alter table ' || s_schema_name || '.' || s_table_name || &lt;br /&gt;                  ' move partition ' || s_table_name || '_' || &lt;br /&gt;                  trim(to_char(add_months(sysdate,n_archive_ret),'YYYY')) || '' || &lt;br /&gt;                  trim(to_char(add_months(sysdate,n_archive_ret),'MM')) || &lt;br /&gt;                  ' tablespace ' || s_archive_ts;&lt;br /&gt;         if s_compression!='ENABLED' then&lt;br /&gt;           s_cmd := s_cmd || ' COMPRESS';              &lt;br /&gt;        end if;&lt;br /&gt;        s_cmd := s_cmd || ' update global indexes';&lt;br /&gt;        execute immediate (s_cmd);&lt;br /&gt;      end if;           &lt;br /&gt; &lt;br /&gt;      s_cmd:='';&lt;br /&gt;  exception&lt;br /&gt;    when no_data_found then &lt;br /&gt;        null;        &lt;br /&gt;  end;&lt;br /&gt;  &lt;font face='tahoma' size='2' color='#00CC00'&gt;&lt;i&gt;&lt;br /&gt;  -- drop partitions of &lt;conditional&gt; year old&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  select &lt;br /&gt;    count(*) into n_ctl&lt;br /&gt;  from &lt;br /&gt;    dba_tab_partitions &lt;br /&gt;  where &lt;br /&gt;    table_owner=s_schema_name and &lt;br /&gt;    table_name=s_table_name and &lt;br /&gt;    substr(partition_name,-6,4)=to_char(add_months(sysdate,n_delete_ret),'YYYY') and &lt;br /&gt;    substr(partition_name,-2,2)=to_char(add_months(sysdate,n_delete_ret),'MM');  &lt;br /&gt;  &lt;font face='tahoma' size='2' color='#00CC00'&gt;&lt;i&gt;&lt;br /&gt;  /* if the partition to be dropped exists then drop it */&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  if n_ctl=1 then&lt;br /&gt;      s_cmd := 'alter table ' || s_schema_name || '.' || s_table_name || &lt;br /&gt;               ' drop partition ' || s_table_name || '_' || &lt;br /&gt;               to_char(add_months(sysdate,n_delete_ret),'YYYY') || '' || &lt;br /&gt;               to_char(add_months(sysdate,n_delete_ret),'MM') || &lt;br /&gt;               ' update global indexes';&lt;br /&gt;     &lt;br /&gt;      execute immediate (s_cmd);&lt;br /&gt;  end if; &lt;br /&gt;   &lt;br /&gt;end p_check_partition2;&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The procedure is OK now. You should now be careful to give the right parameters. Be sure not to drop something should not be dropped. In our site our delete retention is one year and archive retention is 3 months. I run this procedure like the following parameters;&lt;br /&gt;&lt;pre size='1'&gt;&lt;br /&gt;begin&lt;br /&gt;  p_check_partition2('PAYFORME','PQ','PQ_ARCHIVE',-3,-12);&lt;br /&gt;end;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-2344943728539185836?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/2344943728539185836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/05/handling-partitioned-tables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/2344943728539185836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/2344943728539185836'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/05/handling-partitioned-tables.html' title='Handling Partitioned Tables'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-4070034837835826637</id><published>2008-04-16T23:49:00.010+03:00</published><updated>2008-05-06T18:43:16.287+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Enterprise Manager Grid Control'/><title type='text'>Resetting Timezone of a Grid Agent 10.2</title><content type='html'>&lt;b&gt;&lt;u&gt;Problem:&lt;/u&gt;&lt;/b&gt; Operating system Timezone is changed after an Oracle Grid Agent installation. This problem occured on an IBM AIX 5.3 host. Maybe one of our UNIX administrators decided to change the Timezone setting $TZ in our UNIX environment. Our Oracle Grid Agent couldnt be opened after that. &lt;br /&gt;&lt;br /&gt;#&gt; $AGENT_HOME/bin/emctl start agent&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;font color='#CC0000'&gt;Starting agent ....... failed.&lt;/font&gt;&lt;br /&gt;The agentTZRegion value in /oracle/product/10.2.0/agent/agent10g/dwhnserp0/sysman/config/emd.properties is not in agreement with what agent thinks it should be.Please verify your environment to make sure that TZ setting has not changed since the last start of the agent.&lt;br /&gt;If you modified the timezone setting in the environment, please stop the agent and exectute 'emctl resetTZ agent' and also execute the script mgmt_target.set_agent_tzrgn(&lt;agent_name&gt;, &lt;new_tz_rgn&gt;) to get the value propagated to repository.&lt;br /&gt;Consult the log files in: /oracle/product/10.2.0/agent/agent10g/dwhnserp0/sysman/log&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#&gt; echo $TZ&lt;br /&gt;MEST-2MEDT,M3.5.0,M10.5.0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#&gt; export TZ=+2:00&lt;br /&gt;&lt;br /&gt;#&gt; $AGENT_HOME/bin/emctl resetTZ agent&lt;br /&gt;&lt;br /&gt;&lt;font face='courier' size='2' color='#0000CC'&gt;emctl resetTZ agent&lt;/font&gt; command automatically changes the agentTZRegion entry of the emd.properties file. But here I also changed the last row of the file $AGENT_HOME/sysman/config/emd.properties to '+2:00' manually. &lt;br /&gt;#agentTZRegion=Etc/GMT-3&lt;br /&gt;agentTZRegion=+2:00&lt;br /&gt;&lt;br /&gt;Now &lt;u&gt;on the Grid Server&lt;/u&gt; run the following command. First parameter is the name of the target, and the second one is timezone value. Name of the target is usually nodename:portnumber.&lt;br /&gt;&lt;pre size='2'&gt;&lt;br /&gt;#&gt; sqlplus "/ as sysdba"&lt;br /&gt;sqlplus&gt; exec mgmt_target.set_agent_tzrgn('dwhnserp0:3872', '-2:00');&lt;br /&gt;sqlplus&gt; exit;&lt;br /&gt;#&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can also check the registered timezone property of the target with the following query. Again from the Grid Server:&lt;br /&gt;&lt;pre size='2'&gt;&lt;br /&gt;#&gt; sqlplus "/ as sysdba"&lt;br /&gt;sqlplus&gt; select timezone_region from mgmt_targets &lt;br /&gt;         where target_name = 'dwhserp00:3872';&lt;br /&gt;sqlplus&gt; exit;&lt;br /&gt;#&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;#&gt; $AGENT_HOME/bin/emctl start agent&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;Starting agent ............... started.&lt;br /&gt;&lt;br /&gt;#&gt; $AGENT_HOME/bin/emctl status agent&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;Agent Version     : 10.2.0.3.0&lt;br /&gt;OMS Version       : 10.2.0.3.0&lt;br /&gt;Protocol Version  : 10.2.0.2.0&lt;br /&gt;Agent Home        : /oracle/product/10.2.0/agent/agent10g/dwhnserp0&lt;br /&gt;Agent binaries    : /oracle/product/10.2.0/agent/agent10g&lt;br /&gt;Agent Process ID  : 525810&lt;br /&gt;Parent Process ID : 143586&lt;br /&gt;Agent URL         : https://dwhnserp0:3872/emd/main&lt;br /&gt;Repository URL    : https://oragrid:1159/em/upload&lt;br /&gt;Started at        : 2008-04-11 16:28:27&lt;br /&gt;Started by user   : oracle&lt;br /&gt;Last Reload       : 2008-04-11 16:28:27&lt;br /&gt;Last successful upload                       : (none)&lt;br /&gt;Last attempted upload                        : (none)&lt;br /&gt;Total Megabytes of XML files uploaded so far :     0.00&lt;br /&gt;Number of XML files pending upload           :        6&lt;br /&gt;Size of XML files pending upload(MB)         :     0.34&lt;br /&gt;Available disk space on upload filesystem    :    41.66%&lt;br /&gt;Last successful heartbeat to OMS             : 2008-04-11 16:28:46&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;Agent is Running and Ready&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can find the supported Timezone values in a file under sysman directory&lt;br /&gt;&lt;br /&gt;cat $AGENT_HOME/sysman/admin/supportedtzs.lst | more&lt;br /&gt;# Timezone regions with +02:00 standard offset from GMT&lt;br /&gt;Africa/Cairo&lt;br /&gt;Africa/Johannesburg&lt;br /&gt;Africa/Khartoum&lt;br /&gt;Africa/Tripoli&lt;br /&gt;Africa/Windhoek&lt;br /&gt;Asia/Beirut&lt;br /&gt;Asia/Damascus&lt;br /&gt;Asia/Gaza&lt;br /&gt;Asia/Istanbul&lt;br /&gt;Asia/Jerusalem&lt;br /&gt;Asia/Nicosia&lt;br /&gt;Asia/Tel_Aviv&lt;br /&gt;EET&lt;br /&gt;Egypt&lt;br /&gt;Etc/GMT-2&lt;br /&gt;Europe/Athens&lt;br /&gt;Europe/Bucharest&lt;br /&gt;Europe/Helsinki&lt;br /&gt;Europe/Istanbul&lt;br /&gt;Europe/Kaliningrad&lt;br /&gt;Europe/Kiev&lt;br /&gt;Europe/Minsk&lt;br /&gt;Europe/Riga&lt;br /&gt;Europe/Simferopol&lt;br /&gt;Europe/Sofia&lt;br /&gt;Europe/Tallinn&lt;br /&gt;Europe/Vilnius&lt;br /&gt;Israel&lt;br /&gt;Libya&lt;br /&gt;&lt;font color='#CC0000'&gt;Turkey&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;# Timezone regions with +03:00 standard offset from GMT&lt;br /&gt;Africa/Djibouti&lt;br /&gt;Africa/Mogadishu&lt;br /&gt;Africa/Nairobi&lt;br /&gt;Asia/Aden&lt;br /&gt;Asia/Amman&lt;br /&gt;Asia/Baghdad&lt;br /&gt;Asia/Bahrain&lt;br /&gt;Asia/Kuwait&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-4070034837835826637?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/4070034837835826637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/04/resetting-timezone-of-grid-agent-102.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/4070034837835826637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/4070034837835826637'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/04/resetting-timezone-of-grid-agent-102.html' title='Resetting Timezone of a Grid Agent 10.2'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-5513798173151416939</id><published>2008-04-16T23:34:00.029+03:00</published><updated>2008-05-05T20:24:32.920+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>Scheduling a datapump job in Oracle 10g - Part2</title><content type='html'>&lt;a href='http://ergemp.blogspot.com/2008/02/scheduling-datapump-in-oracle-10g.html'&gt;Previous part&lt;/a&gt; of this article was about exporting a table data by using dbms_datapump via plsql. You can obtain information about creating a procedure that exports a table or group of table to an operationg system file.&lt;br /&gt;&lt;br /&gt;This part includes information about creating a Scheduled Job to run the export procedure periodically. As Scheduled Jobs come with Oracle 10g, scripts in this article will work on databases later than Oracle 10.1.x.x&lt;br /&gt;&lt;br /&gt;The sys package we will mainly use is DBMS_SCHEDULER. First we should create a job. You can find the following command that i used to create a job. Alternate parameters are explained with comments.&lt;br /&gt;&lt;pre&gt;&lt;font size='2'&gt;&lt;br /&gt;BEGIN &lt;br /&gt;    DBMS_SCHEDULER.CREATE_JOB(&lt;br /&gt;       job_name           =&gt;  'log_to_table',&lt;br /&gt;       job_type           =&gt;  'STORED_PROCEDURE',   &lt;br /&gt;                              &lt;font color='#008800' size='1'&gt;&lt;i&gt;&lt;br /&gt;                              -- Possible values could be:&lt;br /&gt;                              -- PLSQL_BLOCK, &lt;br /&gt;                              -- STORED_PROCEDURE, &lt;br /&gt;                              -- EXECUTABLE, &lt;br /&gt;                              -- CHAIN.&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;       job_action         =&gt;  'D_EPEKER.p_test_01', &lt;font color='#008800' size='1'&gt;&lt;i&gt;-- procedure name to run&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;       start_date         =&gt;  'sysdate', &lt;font color='#008800' size='1'&gt;&lt;i&gt;-- date_to_start_execution date&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;       repeat_interval    =&gt;  'FREQ=HOURLY', &lt;font color='#008800' size='1'&gt;&lt;i&gt;-- every other day&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;                              &lt;font color='#008800' size='1'&gt;&lt;i&gt;&lt;br /&gt;                              -- Possible values could be:&lt;br /&gt;                              -- "FREQ = YEARLY" | "MONTHLY" | "WEEKLY" | &lt;br /&gt;                              -- "DAILY" | "HOURLY" | "MINUTELY" | "SECONDLY" &lt;br /&gt;                              -- INTERVAL = 1 through 99 &lt;br /&gt;         &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;       end_date           =&gt;  'sysdate+1',     &lt;font color='#008800' size='1'&gt;&lt;i&gt;-- date_to_end_execution&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;       job_class          =&gt;  'logging_class',  &lt;br /&gt;       comments           =&gt;  'job_logs_something');&lt;font color='#008800' size='1'&gt;&lt;i&gt;-- explanation of the job&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;END;&lt;br /&gt;&lt;font face='tahoma' color='#008800' size='2'&gt;&lt;i&gt;&lt;br /&gt;/*&lt;br /&gt;Jobs are created disabled by default and need to be enabled to run. You can find the&lt;br /&gt;following procedure to alter a Scheduled Jobs attribute. By default a scheduled job&lt;br /&gt;drops itself after its execution ends. You should set "auto_drop" attribute to &lt;br /&gt;FALSE to hold the Scheduled Job after its execution ends.&lt;br /&gt;*/&lt;br /&gt;-- &lt;br /&gt;-- enabling a job &lt;br /&gt;-- &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;BEGIN&lt;br /&gt;  SYS.DBMS_SCHEDULER.ENABLE &lt;br /&gt;    (name =&gt; 'D_EPEKER.LOG_TO_TABLE');&lt;br /&gt;END;&lt;br /&gt;&lt;font color='#008800'&gt;&lt;i&gt;&lt;br /&gt;-- &lt;br /&gt;-- altering a job attribute&lt;br /&gt;-- &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;BEGIN&lt;br /&gt;    DBMS_SCHEDULER.SET_ATTRIBUTE(&lt;br /&gt;        name =&gt; 'log_to_table',  -- name of the job&lt;br /&gt;        attribute =&gt; 'auto_drop',  -- attribute name&lt;br /&gt;        value =&gt; FALSE  -- new value of the attribute&lt;br /&gt;        );&lt;br /&gt;END;&lt;br /&gt;&lt;font face='tahoma' color='#008800' size='2'&gt;&lt;i&gt;&lt;br /&gt;/*&lt;br /&gt;As you can schedule a job, you can also run any Scheduled Job before its Scheduled&lt;br /&gt;time comes. To run or stop a job immediately you can use the following command.&lt;br /&gt;*/&lt;br /&gt;-- &lt;br /&gt;-- executing a job immediately &lt;br /&gt;-- &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;exec DBMS_SCHEDULER.RUN_JOB('log_to_table',FALSE);&lt;br /&gt;exec DBMS_SCHEDULER.STOP_JOB('log_to_table',TRUE);&lt;br /&gt;&lt;font face='tahoma' color='#008800' size='2'&gt;&lt;i&gt;&lt;br /&gt;/*&lt;br /&gt;The most likely property of this newly "Scheduled Job" is that they can be easily&lt;br /&gt;maintained and monitored by system views. You can find the related view in the&lt;br /&gt;following.&lt;br /&gt;*/&lt;br /&gt;-- schedued jobs whichs owner is D_EPEKER&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;select * from dba_scheduler_jobs where owner='D_EPEKER';&lt;br /&gt;&lt;font face='tahoma' color='#008800' size='2'&gt;&lt;i&gt;&lt;br /&gt;-- you can also user user_scheduled_jobs view to find out the jobs and their properties&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;select * from user_scheduler_jobs;&lt;br /&gt;&lt;font face='tahoma' color='#008800' size='2'&gt;&lt;i&gt;&lt;br /&gt;-- run details of the scheduled jobs&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;select * from DBA_SCHEDULER_JOB_RUN_DETAILS &lt;br /&gt;  where lower(job_name) = 'log_to_file_external;&lt;br /&gt;&lt;font face='tahoma' color='#008800' size='2'&gt;&lt;i&gt;&lt;br /&gt;/*&lt;br /&gt;There is a lot of way to determine the repeat interval. There is lots of examples &lt;br /&gt;in the following and you can also find the explanations of the frequencies.&lt;br /&gt;*/&lt;br /&gt;-- &lt;br /&gt;-- setting repeat_interval &lt;br /&gt;-- &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;--Run every Friday&lt;br /&gt;FREQ=DAILY; BYDAY=FRI;&lt;br /&gt;FREQ=WEEKLY; BYDAY=FRI;&lt;br /&gt;FREQ=YEARLY; BYDAY=FRI;&lt;br /&gt;&lt;br /&gt;--Run every other Friday&lt;br /&gt;FREQ=WEEKLY; INTERVAL=2; BYDAY=FRI;&lt;br /&gt;&lt;br /&gt;--Run on the last day of every month.&lt;br /&gt;FREQ=MONTHLY; BYMONTHDAY=-1;&lt;br /&gt;&lt;br /&gt;--Run on the next to last day of every month.&lt;br /&gt;FREQ=MONTHLY; BYMONTHDAY=-2;&lt;br /&gt;&lt;br /&gt;--Run every 10 days&lt;br /&gt;FREQ=DAILY; INTERVAL=10;&lt;br /&gt;&lt;br /&gt;--Run daily at 4, 5, and 6PM.&lt;br /&gt;FREQ=DAILY; BYHOUR=16,17,18;&lt;br /&gt;&lt;br /&gt;--Run on the 15th day of every other month&lt;br /&gt;FREQ=MONTHLY; INTERVAL=2; BYMONTHDAY=15;&lt;br /&gt;&lt;br /&gt;--Run on the 29th day of every month&lt;br /&gt;FREQ=MONTHLY; BYMONTHDAY=29;&lt;br /&gt;&lt;br /&gt;--Run on the second Wednesday of each month&lt;br /&gt;FREQ=MONTHLY; BYDAY=2WED;&lt;br /&gt;&lt;br /&gt;--Run on the last Friday of the year.&lt;br /&gt;FREQ=YEARLY; BYDAY=-1FRI;&lt;br /&gt;&lt;br /&gt;--Run every 50 hours.&lt;br /&gt;FREQ=HOURLY; INTERVAL=50;&lt;br /&gt;&lt;br /&gt;--Run on the last day of every other month.&lt;br /&gt;FREQ=MONTHLY; INTERVAL=2; BYMONTHDAY=-1;&lt;br /&gt;&lt;br /&gt;--Run hourly for the first three days of every month.&lt;br /&gt;FREQ=HOURLY; BYMONTHDAY=1,2,3;&lt;br /&gt;&lt;br /&gt;--Run on the last workday of every month, excluding company holidays &lt;br /&gt;--(This example references an existing named schedule called Company_Holidays.)&lt;br /&gt;FREQ=MONTHLY; BYDAY=MON,TUE,WED,THU,FRI; EXCLUDE=Company_Holidays; BYSETPOS=-1&lt;br /&gt;&lt;br /&gt;--Run at noon every Friday and on company holidays.&lt;br /&gt;FREQ=YEARLY;BYDAY=FRI;BYHOUR=12;INCLUDE=Company_Holidays&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-5513798173151416939?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/5513798173151416939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/04/scheduling-datapump-job-in-oracle-10g.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5513798173151416939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5513798173151416939'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/04/scheduling-datapump-job-in-oracle-10g.html' title='Scheduling a datapump job in Oracle 10g - Part2'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-8279605608489288324</id><published>2008-02-18T00:00:00.039+02:00</published><updated>2008-05-06T19:06:10.795+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>Scheduling a datapump job in Oracle 10g - Part1</title><content type='html'>&lt;u&gt;&lt;b&gt;Subject: &lt;/b&gt;&lt;/u&gt; Periodically exporting a table data using dbms_datapump and scheduled with dbms_scheduler. We will first create a procedure that exports the table data and then set a scheduled job calls the procedure. &lt;br /&gt;&lt;br /&gt;First of all we need an Oracle Directory to export the data. As dbms_datapump runs database side, dbms_datapump package uses database directories and objects to export objects. &lt;br /&gt;&lt;pre&gt;&lt;font size='2'&gt;&lt;br /&gt;create or replace directory expdp_dir as '/oradata/exports/';&lt;br /&gt;grant read,write to public on directory expdp_dir;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;One should also have EXP_FULL_DATABASE and IMP_FULL_DATABASE to export and import any other schema object except his own schema. &lt;br /&gt;&lt;pre&gt;&lt;font  size='2'&gt;&lt;br /&gt;grant EXP_FULL_DATABASE to &lt;user_name&gt;;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can find the rest of the explanations as comments in the following procedure.&lt;br /&gt;&lt;pre size='2'&gt;&lt;br /&gt;DECLARE &lt;br /&gt;&lt;br /&gt;  -- handle number comes with DBMS_DATAPUMP.OPEN procedure&lt;br /&gt;  n_dp_handle number;&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;  &lt;font face='tahoma' size='2' color='#008800'&gt;&lt;i&gt;&lt;br /&gt;  /*&lt;br /&gt;  First thing to do is to open a datapump session.&lt;br /&gt;  &lt;br /&gt;  operation: EXPORT | IMPORT | SQL_FILE (DBMS_DATAPUMP.ADD_FILE should be run before)&lt;br /&gt;  export modes: FULL | SCHEMA | TABLE | TABLESPACE | TRANSPORTABLE&lt;br /&gt;  version: COMPATIBLE (default) | LATEST | 10.0.0&lt;br /&gt;  */&lt;br /&gt;  &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  n_dp_handle := DBMS_DATAPUMP.open(&lt;br /&gt;    operation=&gt;'EXPORT',&lt;br /&gt;    job_mode=&gt;'TABLE',&lt;br /&gt;    remote_link=&gt;NULL,&lt;br /&gt;    job_name=&gt;'LOGVRM_TMP_EXPORT',&lt;br /&gt;    version=&gt;'COMPATIBLE'); &lt;br /&gt;  &lt;font face='tahoma' size='2' color='#008800'&gt;&lt;i&gt;&lt;br /&gt;  /*&lt;br /&gt;  add the export file to opened datapump session&lt;br /&gt;  you must use '%U' in the filename, incase of parallel export&lt;br /&gt;  */&lt;br /&gt;  &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  DBMS_DATAPUMP.add_file(&lt;br /&gt;    handle    =&gt; l_dp_handle,&lt;br /&gt;    filename  =&gt; s_file || '.dmp', --dump file name&lt;br /&gt;    directory =&gt; 'EP_EXPORT'); --oracle directory &lt;br /&gt;  &lt;font face='tahoma' size='2' color='#008800'&gt;&lt;i&gt;&lt;br /&gt;  /*&lt;br /&gt;  now we start filtering the objects we want to export&lt;br /&gt;  name: INCLUDE_NAME_EXPR | EXCLUDE_NAME_EXPR | SCHEMA_EXPR | TABLESPACE_EXPR&lt;br /&gt;        INCLUDE_PATH_EXPR | EXCLUDE_PATH_EXPR&lt;br /&gt;&lt;br /&gt;  in the following example we filter schema, object and partition objects &lt;br /&gt;  respectively&lt;br /&gt;  */&lt;br /&gt;  &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  DBMS_DATAPUMP.metadata_filter(&lt;br /&gt;    handle =&gt; l_dp_handle,&lt;br /&gt;    name   =&gt; 'SCHEMA_EXPR',&lt;br /&gt;    value  =&gt; 'IN (''VERIM'')');&lt;br /&gt;        &lt;br /&gt;  DBMS_DATAPUMP.metadata_filter(&lt;br /&gt;    handle =&gt; l_dp_handle,&lt;br /&gt;    name   =&gt; 'NAME_EXPR',&lt;br /&gt;    value  =&gt; 'IN (''BIR_GERI_ODEME_LOG_VRM'', &lt;br /&gt;                   ''BIR_TEKLIF_LOG_VRM'', &lt;br /&gt;                   ''M_D_HESAP_LOG_VRM'', &lt;br /&gt;                   ''T_GNK_TESIS_LOG_VRM'')',&lt;br /&gt;    object_type =&gt; 'TABLE');&lt;br /&gt;                &lt;br /&gt;  DBMS_DATAPUMP.data_filter(&lt;br /&gt;    handle =&gt; l_dp_handle,&lt;br /&gt;    name   =&gt; 'PARTITION_EXPR',&lt;br /&gt;    value  =&gt; 'IN (''PAR_TEMP'')');   &lt;br /&gt;  &lt;font face='tahoma' size='2' color='#008800'&gt;               &lt;i&gt;&lt;br /&gt;  /*&lt;br /&gt;  you can set parallelism in datapump jobs&lt;br /&gt;  every thread of parallel job writes to its own part of file&lt;br /&gt;  so dont forget to use %U parameter in the filename&lt;br /&gt;  */&lt;br /&gt;  &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  DBMS_DATAPUMP.SET_PARALLEL(&lt;br /&gt;    handle =&gt; l_dp_handle,&lt;br /&gt;    degree =&gt; 1); &lt;br /&gt;  &lt;font face='tahoma' size='2' color='#008800'&gt;&lt;i&gt;&lt;br /&gt;  /*&lt;br /&gt;  now we can start the job&lt;br /&gt;  */  &lt;br /&gt;  &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  DBMS_DATAPUMP.start_job(l_dp_handle); &lt;br /&gt;  &lt;font face='tahoma' size='2' color='#008800'&gt;&lt;i&gt;&lt;br /&gt;  /*&lt;br /&gt;  perodically check the expdp job for the status  &lt;br /&gt;  s_le_log is the final varchar2 variable that holds the last status of the job&lt;br /&gt;  you can check the 'error' string in the s_le_log variable to determine &lt;br /&gt;  if the end status has any errors&lt;br /&gt;  */&lt;br /&gt;  &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  job_state := 'UNDEFINED';&lt;br /&gt;  WHILE (job_state != 'COMPLETED') AND (job_state != 'STOPPED') &lt;br /&gt;  LOOP&lt;br /&gt;    dbms_datapump.get_status(l_dp_handle, &lt;br /&gt;                             dbms_datapump.ku$_status_job_error +&lt;br /&gt;                             dbms_datapump.ku$_status_job_status +&lt;br /&gt;                             dbms_datapump.ku$_status_wip, -1, job_state, sts);&lt;br /&gt;           &lt;br /&gt;    IF (BITAND(sts.mask,dbms_datapump.ku$_status_wip) != 0) &lt;br /&gt;    THEN&lt;br /&gt;      le := sts.wip; --work is still in progress &lt;br /&gt;    ELSE&lt;br /&gt;      IF (BITAND(sts.mask,dbms_datapump.ku$_status_job_error) != 0) &lt;br /&gt;      THEN&lt;br /&gt;        le := sts.error; --work get an error &lt;br /&gt;      ELSE&lt;br /&gt;        le := NULL;&lt;br /&gt;      END IF;&lt;br /&gt;    END IF;&lt;br /&gt;  END LOOP;        &lt;br /&gt; &lt;br /&gt;  &lt;font face='tahoma' size='2' color='#008800'&gt;&lt;i&gt;                       &lt;br /&gt;  /*&lt;br /&gt;  check the log entry of the job status         &lt;br /&gt;  */&lt;br /&gt;  &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  IF le IS NOT NULL &lt;br /&gt;  THEN &lt;br /&gt;    le_ind := le.first;&lt;br /&gt;    s_le_log := ''; &lt;br /&gt;    WHILE le_ind IS NOT NULL LOOP&lt;br /&gt;      s_le_log := s_le_log || ' ' || le(le_ind).LogText;&lt;br /&gt;      le_ind := le.next(le_ind);&lt;br /&gt;    END LOOP;&lt;br /&gt;  END IF;  &lt;br /&gt;  &lt;font face='tahoma' size='2' color='#008800'&gt;&lt;i&gt;&lt;br /&gt;  /*&lt;br /&gt;  if job hangs drop the master table of the job &lt;br /&gt;  every datapump job creates table for itself for logging and monitoring issues&lt;br /&gt;  if the job end the table should be dropped automatically, &lt;br /&gt;  if not drop the table manual else oracle doesnt allow to run the same job again&lt;br /&gt;  */&lt;br /&gt;  &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  select &lt;br /&gt;    count(*) into n_ctl2 &lt;br /&gt;  from &lt;br /&gt;    dba_datapump_jobs &lt;br /&gt;  where &lt;br /&gt;    job_name = 'LOGVRM_TMP_EXPORT' and&lt;br /&gt;    owner_name='MARDATA';  &lt;br /&gt;&lt;br /&gt;  IF n_ctl2 &gt; 0 THEN&lt;br /&gt;    execute immediate ('drop table MARDATA.LOGVRM_TMP_EXPORT');&lt;br /&gt;  END IF;&lt;br /&gt;  &lt;font face='tahoma' size='2' color='#008800'&gt;&lt;i&gt;&lt;br /&gt;  /*&lt;br /&gt;  Check the s_le_log for any error messages&lt;br /&gt;  You can also insert the log with a date column &lt;br /&gt;  to know what happened during the export  &lt;br /&gt;  */&lt;br /&gt;  &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  IF (INSTR(LOWER(s_le_log),'error',1) &gt; 0 OR &lt;br /&gt;      INSTR(LOWER(s_le_log),'hata',1) &gt; 0)  &lt;br /&gt;  THEN&lt;br /&gt;    NULL;&lt;br /&gt;  END IF;&lt;br /&gt;  &lt;br /&gt;  &lt;font face='tahoma' size='2' color='#008800'&gt;&lt;i&gt;&lt;br /&gt;  /*       &lt;br /&gt;  log the export log to know what happened during export&lt;br /&gt;  */&lt;br /&gt;  &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  UPDATE DBA_LOGVRM_EXPORT_LOG SET &lt;br /&gt;    ENDDATE=SYSDATE, &lt;br /&gt;    MSG=substr(s_le_log,1,1000) &lt;br /&gt;    WHERE FILENAME=s_full_file; --dump file name with full path&lt;br /&gt;  COMMIT;&lt;br /&gt;&lt;br /&gt;  &lt;font face='tahoma' size='2' color='#008800'&gt;&lt;i&gt;&lt;br /&gt;  /*&lt;br /&gt;  Dont forget to detach from the job&lt;br /&gt;  */&lt;br /&gt;  &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;  DBMS_DATAPUMP.DETACH(l_dp_number);&lt;br /&gt;&lt;br /&gt;END;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Second Part of this article will cover dbms_scheduler to schedule this procedure to perodically backup any database object with datapump.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-8279605608489288324?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/8279605608489288324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/02/scheduling-datapump-in-oracle-10g.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/8279605608489288324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/8279605608489288324'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/02/scheduling-datapump-in-oracle-10g.html' title='Scheduling a datapump job in Oracle 10g - Part1'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-165580890131878732</id><published>2008-01-29T22:27:00.000+02:00</published><updated>2008-02-03T20:33:22.268+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Enterprise Manager Grid Control'/><title type='text'>When the Grid Agent couldnt find any target on host...</title><content type='html'>&lt;u&gt;&lt;b&gt;Subject:&lt;/b&gt;&lt;/u&gt; Manually adding targets to EM Grid Agent installed on a host.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;/u&gt; As the installation procedure finishes successfully on a target host, EM agent examines "/etc/oratab" file (on UNIX operating system) to find the installed oracle products on the host. What if the specified file doesnt exist or somehow agent couldnt read the file?&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;/u&gt; Before the installation, you should check "/etc/oratab" file if it exists. If not, check the "/var/oracle" directory for the oratab file and make symbolic link named oratab under "/etc" directory.&lt;br /&gt;&lt;br /&gt;If the agent cannot find any target on the host in all circumstances you can try adding the targets manually after installation. You will find configuration file, template entry for a "database" and a "listener". &lt;br /&gt;&lt;br /&gt;EM Agent stores target information in targets.xml file located at "$AGENT_HOME/sysman/emd" directory. A sample file without any targets can be find as follows. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font face="tahoma" size="1"&gt;&lt;br /&gt;&amp;lt;Targets AGENT_TOKEN="e7244b84afad62c94aad53fe407af2514e3b7f04"&amp;gt;&lt;br /&gt;        &amp;lt;Target TYPE="oracle_emd" NAME="oragrid:3872"/&amp;gt;&lt;br /&gt;        &amp;lt;Target TYPE="host" NAME="oragrid"/&amp;gt;&lt;br /&gt;&amp;lt;/Targets&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can add a listener as a target to targets.xml file by using the following template. (values between the three stars - *** *** - are system specific. You should use your own systems parameters instead of *** *** values)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font face="tahoma" size="1"&gt;&lt;br /&gt;&amp;lt;Target TYPE="oracle_listener" NAME="***LISTENER_NAME***"&amp;gt;&lt;br /&gt;        &amp;lt;Property NAME="ListenerOraDir" VALUE="$ORACLE_HOME/network/admin"/&amp;gt;&lt;br /&gt;        &amp;lt;Property NAME="LsnrName" VALUE="***LISTENER_NAME***"/&amp;gt;&lt;br /&gt;        &amp;lt;Property NAME="Machine" VALUE="***HOSTNAME***"/&amp;gt;&lt;br /&gt;        &amp;lt;Property NAME="OracleHome" VALUE="***$ORACLE_HOME***"/&amp;gt;&lt;br /&gt;        &amp;lt;Property NAME="Port" VALUE="***LISTENER_PORT***"/&amp;gt;&lt;br /&gt;&amp;lt;/Target&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The following template is for manually entering database target to a EM Agent. (values between the three stars - *** *** - are system specific. You should use your own systems parameters instead of *** ... *** values)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font face="tahoma" size="1"&gt;&lt;br /&gt;&amp;lt;Target TYPE="oracle_database" NAME="***DB_NAME***"/&amp;gt;&lt;br /&gt;        &amp;lt;Property NAME="OracleHome" VALUE="***$ORACLE_HOME***"/&amp;gt;&lt;br /&gt;        &amp;lt;Property NAME="UserName" VALUE="dbsnmp"/&amp;gt;&lt;br /&gt;        &amp;lt;Property NAME="MachineName" VALUE="***HOSTNAME***"/&amp;gt;&lt;br /&gt;        &amp;lt;Property NAME="Port" VALUE="1521"/&amp;gt;&lt;br /&gt;        &amp;lt;Property NAME="SID" VALUE="***$ORACLE_SID***"/&amp;gt;&lt;br /&gt;        &amp;lt;Property NAME="ServiceName" VALUE="***$SERVICE_NAME***"/&amp;gt;&lt;br /&gt;        &amp;lt;Property NAME="password" VALUE="***PASSWORD***" ENCRYPTED="FALSE"/&amp;gt;&lt;br /&gt;        &amp;lt;Property NAME="Role" VALUE="NORMAL"/&amp;gt;&lt;br /&gt;&amp;lt;/Target&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After you are done with your "targets.xml" file you should run &lt;font face="courier" size="1" style='background:#FFFF00'&gt;emctl reload agent&lt;/font&gt; to read the configuration files from scratch. You can check the defined targets by running &lt;font face="courier" size="1" style='background:#FFFF00'&gt;emctl config agent listtargets&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-165580890131878732?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/165580890131878732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/01/when-em-agent-couldnt-find-any-target.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/165580890131878732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/165580890131878732'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/01/when-em-agent-couldnt-find-any-target.html' title='When the Grid Agent couldnt find any target on host...'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-3302445162419695115</id><published>2008-01-13T00:44:00.000+02:00</published><updated>2008-11-13T04:57:10.614+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Enterprise Manager Grid Control'/><title type='text'>Installing Grid Agent to a target host</title><content type='html'>&lt;u&gt;&lt;b&gt;Subject:&lt;/b&gt;&lt;/u&gt; Installing Oracle Enterprise Manager Grid Control 10.2.0.3 agent on a target host.&lt;br /&gt;&lt;br /&gt;I will examine the installation process in three main part. Preinstallation part, is a group of work should be done before executing runInstaller installation script. There is some work to to on OMS Server and on the TARGET side. The second part includes some screenshots and it is actually the time after you execute runInstaller script. Tha last part is the postinstallation part stands for some settings. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;PREINSTALLATION&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;OMS&lt;br /&gt;&lt;br /&gt;First you should enter a host record for the target host. IP and HOSTNAME record should be entered to /etc/hosts operating system file. One thing to remember, IP number should be the one listener executes on. Ping should answer after the configuration.&lt;br /&gt;&lt;br /&gt;&lt;font face='courier' size='1'&gt;&lt;br /&gt;[oracle@oragrid ~]$ &lt;font style='background:#00FF00'&gt;ping fmsserp1&lt;/font&gt;&lt;br /&gt;&lt;font style='background:#FFFF00'&gt;ping: unknown host fmsserp1&lt;/font&gt;&lt;br /&gt;[oracle@oragrid ~]$ &lt;font style='background:#00FF00'&gt;su - &lt;/font&gt;&lt;br /&gt;Password:&lt;br /&gt;[root@oragrid ~]# cat /etc/hosts | grep fmsserp1&lt;br /&gt;[root@oragrid ~]# &lt;font style='background:#00FF00'&gt;vi /etc/hosts&lt;/font&gt;&lt;br /&gt;[root@oragrid ~]# ping fmsserp1&lt;br /&gt;PING fmsserp1 (10.4.9.83) 56(84) bytes of data.&lt;br /&gt;64 bytes from fmsserp1 (10.4.9.83): icmp_seq=0 ttl=254 time=0.219 ms&lt;br /&gt;64 bytes from fmsserp1 (10.4.9.83): icmp_seq=1 ttl=254 time=0.197 ms&lt;br /&gt;64 bytes from fmsserp1 (10.4.9.83): icmp_seq=2 ttl=254 time=0.198 ms&lt;br /&gt;64 bytes from fmsserp1 (10.4.9.83): icmp_seq=3 ttl=254 time=0.193 ms&lt;br /&gt;64 bytes from fmsserp1 (10.4.9.83): icmp_seq=4 ttl=254 time=0.197 ms&lt;br /&gt;&lt;br /&gt;--- fmsserp1 ping statistics ---&lt;br /&gt;5 packets transmitted, 5 received, 0% packet loss, time 4000ms&lt;br /&gt;rtt min/avg/max/mdev = 0.193/0.200/0.219/0.020 ms, pipe 2&lt;br /&gt;[root@oragrid ~]# &lt;font style='background:#00FF00'&gt;cat /etc/hosts | grep fmsserp1&lt;/font&gt;&lt;br /&gt;&lt;font style='background:#FFFF00'&gt;10.4.9.83       fmsserp1&lt;/font&gt;&lt;br /&gt;[root@oragrid ~]#&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;AGENT&lt;br /&gt;&lt;br /&gt;Agent should also know the IP HOSTNAME pair of the OMS Server. You can also find the listening IP address to enter the OMS Server host file. &lt;br /&gt;&lt;br /&gt;$AGENT_HOME should be exported. It is not a must but nice to have especially while searching the setup directory of the agent. &lt;br /&gt;&lt;br /&gt;Be sure /etc/oratab file exists. On some operating systems the file exists on /var/oracle directory, if so you should create a soft link /etc/oratab for /var/oracle/oratab because agent will find the targets installed on the host by looking this file. &lt;br /&gt;&lt;br /&gt;You can now go the installer directory to run the runInstaller. Be sure you have enough space in /tmp directory. If not you can delete older oracle installer logs.&lt;br /&gt;&lt;br /&gt;&lt;font face='courier'&gt;&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;hostname&lt;/font&gt;&lt;br /&gt;&lt;font style='background:#FFFF00'&gt;fmsserp1&lt;/font&gt;&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;netstat -ni&lt;/font&gt;&lt;br /&gt;Name      Mtu  Network         Address         Ipkts   Ierrs Opkts   Oerrs Coll&lt;br /&gt;lan0:1    1500 10.4.9.0        &lt;font style='background:#00FF99'&gt;10.4.9.83&lt;/font&gt;       31833330 0     2849543 0     0   &lt;br /&gt;lan2*     1500 none            none            0       0     0       0     0   &lt;br /&gt;lan1      1500 192.168.0.0     192.168.0.2     6331944 0     11558318 0     0   &lt;br /&gt;lan0      1500 10.4.9.0        &lt;font style='background:#00FF99'&gt;10.4.9.82&lt;/font&gt;       2445705484 0     1271175018 0     0   &lt;br /&gt;lo0       4136 127.0.0.0       127.0.0.1       206103084 0     206104962 0     0   &lt;br /&gt;$ ping oragrid&lt;br /&gt;sh: ping:  not found.&lt;br /&gt;$ su - &lt;br /&gt;Password:&lt;br /&gt;fmsserp1:/#ping oragrid&lt;br /&gt;ping: unknown host oragrid&lt;br /&gt;fmsserp1:/# &lt;br /&gt;fmsserp1:/#cat /etc/hosts | grep oragrid&lt;br /&gt;fmsserp1:/#&lt;br /&gt;fmsserp1:/#&lt;font style='background:#00FF00'&gt;cat /etc/hosts | grep oragrid&lt;/font&gt;&lt;br /&gt;&lt;font style='background:#FFFF00'&gt;10.4.46.70      oragrid&lt;/font&gt;&lt;br /&gt;fmsserp1:/#&lt;font style='background:#00FF00'&gt;tail -2 /etc/hosts &lt;/font&gt;&lt;br /&gt;&lt;font style='background:#FFFF00'&gt;#EM Agent&lt;br /&gt;10.4.46.70      oragrid&lt;/font&gt;&lt;br /&gt;fmsserp1:/#&lt;br /&gt;fmsserp1:/#id    &lt;br /&gt;uid=0(root) gid=3(sys) groups=0(root),1(other),2(bin),4(adm),5(daemon),6(mail),7(lp),20(users)&lt;br /&gt;fmsserp1:/#exit&lt;br /&gt;logout root&lt;br /&gt;$ id&lt;br /&gt;uid=106(oradet) gid=104(dba)&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;cd $ORACLE_HOME/network/admin&lt;/font&gt;&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;cat listener.ora&lt;/font&gt;&lt;br /&gt;&lt;font style='background:#00FF99'&gt;LISTENER_ARCHIVE&lt;/font&gt; =&lt;br /&gt;      (ADDRESS_LIST =&lt;br /&gt;        (ADDRESS = (PROTOCOL = TCP)(HOST = 10.4.9.83)(PORT = 1521))&lt;br /&gt;        (ADDRESS = (PROTOCOL = TCP)(HOST = 10.4.9.83)(PORT = 1526))&lt;br /&gt;      )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SID_LIST_LISTENER_ARCHIVE =&lt;br /&gt;  (SID_LIST =&lt;br /&gt;    (SID_DESC =&lt;br /&gt;      (GLOBAL_DBNAME = AVEA93_C )&lt;br /&gt;      (ORACLE_HOME = /fmsarch_ora/product/9.2.0 )&lt;br /&gt;      (SID_NAME = AVEA93_C)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;lsnrctl status LISTENER_ARCHIVE&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;LSNRCTL for HPUX: Version 9.2.0.6.0 - Production on 10-JAN-2008 11:42:22&lt;br /&gt;&lt;br /&gt;Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=10.4.9.83)(PORT=1521))&lt;br /&gt;STATUS of the LISTENER&lt;br /&gt;------------------------&lt;br /&gt;Alias                     LISTENER_ARCHIVE&lt;br /&gt;Version                   TNSLSNR for HPUX: Version 9.2.0.6.0 - Production&lt;br /&gt;Start Date                20-NOV-2007 06:19:08&lt;br /&gt;Uptime                    51 days 5 hr. 23 min. 14 sec&lt;br /&gt;Trace Level               off&lt;br /&gt;Security                  OFF&lt;br /&gt;SNMP                      OFF&lt;br /&gt;Listener Parameter File   /fmsarch_ora/product/9.2.0/network/admin/listener.ora&lt;br /&gt;Listener Log File         /fmsarch_ora/product/9.2.0/network/log/listener_archive.log&lt;br /&gt;Listening Endpoints Summary...&lt;br /&gt;  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=&lt;font style='background:#00FF99'&gt;10.4.9.83&lt;/font&gt;)(PORT=1521)))&lt;br /&gt;  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=&lt;font style='background:#00FF99'&gt;10.4.9.83&lt;/font&gt;)(PORT=1526)))&lt;br /&gt;Services Summary...&lt;br /&gt;Service "AVEA93_C" has 1 instance(s).&lt;br /&gt;  Instance "AVEA93_C", status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;The command completed successfully&lt;br /&gt;$ echo $AGENT_HOME&lt;br /&gt;&lt;br /&gt;$ cd&lt;br /&gt;$ export AGENT_HOME=/fmsarch_ora/product/agent10g/agent10g&lt;br /&gt;$ echo $AGENT_HOME&lt;br /&gt;/fmsarch_ora/product/agent10g/agent10g&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;cat /etc/oratab&lt;/font&gt;&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;# This file is used by ORACLE utilities.  It is created by root.sh&lt;br /&gt;# and updated by the Database Configuration Assistant when creating&lt;br /&gt;# a database.&lt;br /&gt;&lt;br /&gt;# A colon, ':', is used as the field terminator.  A new line terminates&lt;br /&gt;# the entry.  Lines beginning with a pound sign, '#', are comments.&lt;br /&gt;#&lt;br /&gt;# Entries are of the form:&lt;br /&gt;#   $ORACLE_SID:$ORACLE_HOME:&lt;N|Y&gt;:&lt;br /&gt;#&lt;br /&gt;# The first and second fields are the system identifier and home&lt;br /&gt;# directory of the database respectively.  The third filed indicates&lt;br /&gt;# to the dbstart utility that the database should , "Y", or should not,&lt;br /&gt;# "N", be brought up at system boot time.&lt;br /&gt;#&lt;br /&gt;# Multiple entries with the same $ORACLE_SID are not allowed.&lt;br /&gt;#&lt;br /&gt;#&lt;br /&gt;*:/fmsarch_ora/product/9.2.0:N&lt;br /&gt;$&lt;br /&gt;$ cd oracle_setup&lt;br /&gt;$ ls&lt;br /&gt;HPI_Grid_Control_agent_download_10_2_0_3_0.zip  hpi&lt;br /&gt;agent_download.rsp.bak                          instructions.txt&lt;br /&gt;agentdeployroot.sh&lt;br /&gt;$ cd hpi&lt;br /&gt;$ ls&lt;br /&gt;addons             agentDownload.hpi  agentdeploy        prereqs&lt;br /&gt;agent              agent_scripts.jar  oui                response&lt;br /&gt;$ cd agent&lt;br /&gt;$ ls&lt;br /&gt;install       runInstaller  stage&lt;br /&gt;$ DISPLAY=10.1.22.210:0.0&lt;br /&gt;$ export DISPLAY&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;./runInstaller&lt;/font&gt;&lt;br /&gt;Starting Oracle Universal Installer...&lt;br /&gt;&lt;br /&gt;Checking installer requirements...&lt;br /&gt;&lt;br /&gt;Checking operating system version: must be B.11.23.    Actual B.11.23&lt;br /&gt;                                      Passed&lt;br /&gt;&lt;br /&gt;Checking swap space: must be greater than 250 MB.   Actual 4096 MB    Passed&lt;br /&gt;&lt;font style='background:#FF0000'&gt;Checking temp space: 257 MB available, 500 MB required.    Failed &lt;&lt;&lt;&lt; &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Some requirement checks failed. You must fulfill these requirements before&lt;br /&gt;&lt;br /&gt;continuing with the installation,at which time they will be rechecked.&lt;br /&gt;&lt;br /&gt;Continue? (y/n) [n] n&lt;br /&gt;&lt;br /&gt;User Selected: No&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;cd /tmp&lt;/font&gt;&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;ls -l | grep Ora&lt;/font&gt;&lt;br /&gt;drwxrwxr-x   4 fmsarch    fms             96 Jun  7  2006 OraInstall2006-06-07_01-03-59PM&lt;br /&gt;drwxrwxr-x   4 oraarch    fms           8192 Jun  7  2006 OraInstall2006-06-07_01-08-20PM&lt;br /&gt;drwxrwxr-x   4 oraarch    fms           8192 Jun  7  2006 OraInstall2006-06-07_01-27-41PM&lt;br /&gt;drwxr-xr-x   4 oraarch    fms           8192 Jun  7  2006 OraInstall2006-06-07_01-34-00PM&lt;br /&gt;drwxr-xr-x   4 oraarch    fms           8192 Jun  7  2006 OraInstall2006-06-07_01-50-37PM&lt;br /&gt;drwxrwxr-x   4 fmsarch    fms           8192 Jun  7  2006 OraInstall2006-06-07_11-42-22AM&lt;br /&gt;drwxrwxr-x   4 fmsarch    fms           8192 Jun  7  2006 OraInstall2006-06-07_11-44-54AM&lt;br /&gt;drwxrwx---   2 oraarch    dba             96 Jan 10 09:49 OraInstall2008-01-10_09-49-20AM&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;ls -l | grep Ora | awk '{print $9}'&lt;/font&gt;&lt;br /&gt;OraInstall2006-06-07_01-03-59PM&lt;br /&gt;OraInstall2006-06-07_01-08-20PM&lt;br /&gt;OraInstall2006-06-07_01-27-41PM&lt;br /&gt;OraInstall2006-06-07_01-34-00PM&lt;br /&gt;OraInstall2006-06-07_01-50-37PM&lt;br /&gt;OraInstall2006-06-07_11-42-22AM&lt;br /&gt;OraInstall2006-06-07_11-44-54AM&lt;br /&gt;OraInstall2008-01-10_09-49-20AM&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;ls -l | grep Ora | awk '{print $9}' | xargs rm –r&lt;/font&gt;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;RUNINSTALLER&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;This is the easiest part of the installation once you pass the "system check" screen. You should only know the IP address of the OMS Server and registration password, the one you obtain while installing the Grid Server. &lt;br /&gt;&lt;br /&gt;After the root.sh script runs successfully there is only a few things to do.&lt;br /&gt;&lt;br /&gt;&lt;font face='courier'&gt;&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;./runInstaller&lt;/font&gt;&lt;br /&gt;Starting Oracle Universal Installer...&lt;br /&gt;&lt;br /&gt;Checking installer requirements...&lt;br /&gt;&lt;br /&gt;Checking operating system version: must be B.11.23.    Actual B.11.23&lt;br /&gt;                                      Passed&lt;br /&gt;&lt;br /&gt;Checking swap space: must be greater than 250 MB.   Actual 4096 MB    Passed&lt;br /&gt;Checking Temp space: must be greater than 500 MB.   Actual 640 MB    Passed&lt;br /&gt;&lt;br /&gt;All installer requirements met.&lt;br /&gt;&lt;br /&gt;Preparing to launch Oracle Universal Installer from /tmp/OraInstall2008-01-10_09-52-44AM. Please wait ...&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4pUXxgXO4I/AAAAAAAAAL8/M47biRQxX5c/s1600-h/figure_1.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4pUXxgXO4I/AAAAAAAAAL8/M47biRQxX5c/s400/figure_1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5155025490881756034" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_fSrIpdF1Zdk/R4pYBRgXO5I/AAAAAAAAAME/MEyQT7aq0wg/s1600-h/figure_2.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_fSrIpdF1Zdk/R4pYBRgXO5I/AAAAAAAAAME/MEyQT7aq0wg/s400/figure_2.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5155029502381210514" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4pYJxgXO6I/AAAAAAAAAMM/3M07upHlhEs/s1600-h/figure_3.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4pYJxgXO6I/AAAAAAAAAMM/3M07upHlhEs/s400/figure_3.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5155029648410098594" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_fSrIpdF1Zdk/R4pZJBgXO7I/AAAAAAAAAMU/8fSsUfdj7kI/s1600-h/figure_4.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_fSrIpdF1Zdk/R4pZJBgXO7I/AAAAAAAAAMU/8fSsUfdj7kI/s400/figure_4.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5155030735036824498" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_fSrIpdF1Zdk/R4pZkRgXO8I/AAAAAAAAAMc/RsZEISQhQlI/s1600-h/figure_5.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_fSrIpdF1Zdk/R4pZkRgXO8I/AAAAAAAAAMc/RsZEISQhQlI/s400/figure_5.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5155031203188259778" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4pZqxgXO9I/AAAAAAAAAMk/golPVMIvZPY/s1600-h/figure_6.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4pZqxgXO9I/AAAAAAAAAMk/golPVMIvZPY/s400/figure_6.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5155031314857409490" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4pZ8xgXO-I/AAAAAAAAAMs/Ex4LhvEbEok/s1600-h/figure_7.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4pZ8xgXO-I/AAAAAAAAAMs/Ex4LhvEbEok/s400/figure_7.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5155031624095054818" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_fSrIpdF1Zdk/R4paVBgXO_I/AAAAAAAAAM0/-wQuAacmeF8/s1600-h/figure_8.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_fSrIpdF1Zdk/R4paVBgXO_I/AAAAAAAAAM0/-wQuAacmeF8/s400/figure_8.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5155032040706882546" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_fSrIpdF1Zdk/R4pachgXPAI/AAAAAAAAAM8/R-9KmcptYAo/s1600-h/figure_9.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_fSrIpdF1Zdk/R4pachgXPAI/AAAAAAAAAM8/R-9KmcptYAo/s400/figure_9.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5155032169555901442" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4paixgXPBI/AAAAAAAAANE/Uhd70q0SBOw/s1600-h/figure_10.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4paixgXPBI/AAAAAAAAANE/Uhd70q0SBOw/s400/figure_10.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5155032276930083858" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;font face='courier'&gt;&lt;br /&gt;fmsserp1:/fmsarch_ora/product/agent10g/agent10g #&lt;br /&gt;$ id&lt;br /&gt;uid=109(oraarch) gid=104(dba) groups=105(fms)&lt;br /&gt;$ su - root&lt;br /&gt;Password:&lt;br /&gt;fmsserp1:/#&lt;br /&gt;fmsserp1:/#cd /fmsarch_ora/product/agent10g/agent10g&lt;br /&gt;fmsserp1:/fmsarch_ora/product/agent10g/agent10g#./root.sh&lt;br /&gt;Running Oracle10 root.sh script...&lt;br /&gt;&lt;br /&gt;The following environment variables are set as:&lt;br /&gt;    ORACLE_OWNER= oraarch&lt;br /&gt;    ORACLE_HOME=  /fmsarch_ora/product/agent10g/agent10g&lt;br /&gt;&lt;br /&gt;Enter the full pathname of the local bin directory: [/usr/local/bin]: &lt;br /&gt;The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: &lt;br /&gt;The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: &lt;br /&gt;The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: &lt;br /&gt;&lt;br /&gt;Entries will be added to the /etc/oratab file as needed by&lt;br /&gt;Database Configuration Assistant when a database is created&lt;br /&gt;Finished running generic part of root.sh script.&lt;br /&gt;Now product-specific root actions will be performed.&lt;br /&gt;Finished product-specific root actions.&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4pbGxgXPCI/AAAAAAAAANM/rfmQfKRpxeM/s1600-h/figure_11.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4pbGxgXPCI/AAAAAAAAANM/rfmQfKRpxeM/s400/figure_11.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5155032895405374498" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4pbMxgXPDI/AAAAAAAAANU/CJ7F6TMj9Do/s1600-h/figure_12.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4pbMxgXPDI/AAAAAAAAANU/CJ7F6TMj9Do/s400/figure_12.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5155032998484589618" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;POSTINSTALLATION&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Agent software uses dbsnmp user to obtain information from the database instances. So you should unlock the user if it is locked. Here I also change the password for security. &lt;br /&gt;&lt;br /&gt;After unlocking and chaning the password of the dbsnmp user you should also inform the agent software about the changes. Rest of the subject is as follows :)&lt;br /&gt;&lt;br /&gt;&lt;font face='courier' size='1'&gt;&lt;br /&gt;fmsserp1:/fmsarch_ora/product/agent10g/agent10g#exit&lt;br /&gt;logout root&lt;br /&gt;$ id&lt;br /&gt;uid=109(oraarch) gid=104(dba) groups=105(fms)&lt;br /&gt;$ sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 9.2.0.6.0 - Production on Thu Jan 10 10:17:18 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP and Oracle Data Mining options&lt;br /&gt;JServer Release 9.2.0.6.0 – Production&lt;br /&gt;&lt;br /&gt;SQL&gt; select name from v$database;&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;---------&lt;br /&gt;AVEA93_C&lt;br /&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;SQL&gt; &lt;font style='background:#00FF00'&gt;alter user dbsnmp account unlock;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;User altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; &lt;font style='background:#00FF00'&gt;alter user dbsnmp identified by ****;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;User altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP and Oracle Data Mining options&lt;br /&gt;JServer Release 9.2.0.6.0 - Production&lt;br /&gt;&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;./emctl config agent listtargets&lt;/font&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;[fmsserp1:3872, oracle_emd]&lt;br /&gt;[fmsserp1, host]&lt;br /&gt;[LISTENER_ARCHIVE, oracle_listener]&lt;br /&gt;&lt;font style='background:#00FF99'&gt;[AVEA93_C, oracle_database]&lt;/font&gt;&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;./emctl config agent credentials AVEA93_C:oracle_database&lt;/font&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;Name = AVEA93_C, Type = oracle_database&lt;br /&gt;Want to change for "UserName" (y/n):n&lt;br /&gt;Want to change for "password" (y/n):y&lt;br /&gt;Enter the new value for "password" :*******************&lt;br /&gt;Re-enter the new value for "password" :*******************&lt;br /&gt;EMD reload completed successfully&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;./emctl reload agent&lt;/font&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;EMD reload completed successfully&lt;br /&gt;$ &lt;font style='background:#00FF00'&gt;./emctl upload agent&lt;/font&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;EMD upload completed successfully&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;When the works done successfully everything should be fine. Now is the time to wait a little while for Grid Server (OMS) to discovery newly installed target.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-3302445162419695115?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/3302445162419695115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/01/installing-em-agent-to-target-host.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/3302445162419695115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/3302445162419695115'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/01/installing-em-agent-to-target-host.html' title='Installing Grid Agent to a target host'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4pUXxgXO4I/AAAAAAAAAL8/M47biRQxX5c/s72-c/figure_1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-7830713828442966202</id><published>2008-01-11T22:35:00.002+02:00</published><updated>2008-05-04T17:45:52.823+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>Mining Archived Logs with DBMS_LOGMNR_D</title><content type='html'>Oracle Database Logminer utility helps you to read your archived logs for what is running in your database at a specific time period. &lt;br /&gt;&lt;br /&gt;-- following script comes with a fresh installation of oracle database. You can find it under your ORACLE_HOME/rdbms/admin directory. Script simply creates DBMS_LOGMNR_D package under SYS schema.&lt;br /&gt;&lt;font face='courier'&gt;--@?/rdbms/admin/dbmslogmnrd.sql; &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;-- Contents of the mined archived logs can be examined via the following view.&lt;br /&gt;&lt;b&gt;&lt;font face='courier'&gt;SELECT * FROM V$LOGMNR_CONTENTS; &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;-- To determine which redo logs are being analyzed in the current Logminer session&lt;br /&gt;&lt;b&gt;&lt;font face='courier'&gt;SELECT * FROM V$LOGMNR_LOGS;&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;-- Shows information about the Logminer DICTIONARY FILE, provided the DICTIONARY was created USING the STORE_IN_FLAT_FILE OPTION. &lt;br /&gt;-- The information shown includes the DATABASE name AND status information.&lt;br /&gt;&lt;b&gt;&lt;font face='courier'&gt;SELECT * FROM V$LOGMNR_DICTIONARY;&lt;br /&gt;&lt;br /&gt;SELECT * FROM V$LOGMNR_PARAMETERS &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;The TYPE OF CHANGE made TO the DATABASE (INSERT, UPDATE, DELETE, OR DDL). &lt;br /&gt;The SCN AT which a CHANGE was made (SCN COLUMN). &lt;br /&gt;The SCN AT which a CHANGE was committed (COMMIT_SCN COLUMN). &lt;br /&gt;The TRANSACTION TO which a CHANGE belongs (XIDUSN, XIDSLT, AND XIDSQN COLUMNS). &lt;br /&gt;The TABLE AND SCHEMA name OF the modified OBJECT (SEG_NAME AND SEG_OWNER COLUMNS). &lt;br /&gt;The name OF the USER who issued the DDL OR DML STATEMENT TO make the CHANGE (USERNAME COLUMN). &lt;br /&gt;&lt;br /&gt;Reconstructed SQL statements showing SQL that IS equivalent (but NOT necessarily identical) TO the SQL used TO generate the redo records (SQL_REDO COLUMN). IF a PASSWORD IS part OF the STATEMENT IN a SQL_REDO COLUMN, the PASSWORD IS encrypted.&lt;br /&gt;    &lt;br /&gt;Reconstructed SQL statements showing the SQL statements needed TO undo the CHANGE (SQL_UNDO COLUMN). SQL_UNDO COLUMNS that &lt;br /&gt;correspond TO DDL statements are always NULL. Similarly, the SQL_UNDO COLUMN may be NULL FOR SOME datatypes AND FOR rolled back operations&lt;br /&gt;&lt;br /&gt;You will need to add supplemental logging to mine your logs. By this way oracle database stores updated data by updated row data instead of ROWID basis. Logical update information is more meaningful rather than obtaining ROWID basis update statements. If a primary key or a unique index exists on the table, mined data will have these values as keys. In absence of these keys values will have all the row to identifiy updated data. &lt;br /&gt;&lt;br /&gt;Another key factor is; if you mine your archived logs in a different database instead of mining in the production database ROWID information will worth nothing. In this kind of situation one needs to know the logical statements to mine meaningfully. &lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;----------------------------------------&lt;br /&gt;-- adding supplemental logging and types&lt;br /&gt;----------------------------------------&lt;br /&gt;-- minimal supplemental logging &lt;br /&gt;&lt;font face='courier'&gt;ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;-- Identification key logging enables database-wide before-image logging of primary keys or unique indexes (in the absence of primary keys) &lt;br /&gt;-- for all updates. With this type of logging, an application can identify updated rows logically rather than resorting to ROWIDs&lt;br /&gt;-- i.e. logical standby &lt;br /&gt;&lt;font face='courier'&gt;ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY, UNIQUE INDEX) COLUMNS;&lt;br /&gt;ALTER DATABASE DROP SUPPLEMENTAL LOG DATA;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;-- table supplemental logging&lt;br /&gt;-- These columns will be logged every time an UPDATE statement &lt;br /&gt;-- is executed on scott.emp, regardless of whether or not the update affected them&lt;br /&gt;&lt;font face='courier'&gt;ALTER TABLE scott.emp ADD SUPPLEMENTAL LOG GROUP emp_parttime (empno, ename, deptno) ALWAYS;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;-- before images of the columns will be logged only if at least one of the columns is updated.&lt;br /&gt;&lt;font face='courier'&gt;ALTER TABLE scott.emp ADD SUPPLEMENTAL LOG GROUP emp_parttime (empno, ename, deptno);&lt;br /&gt;ALTER TABLE scott.emp DROP SUPPLEMENTAL LOG GROUP emp_parttime;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;-- to create all logminer objects in to the specified tablespace&lt;br /&gt;&lt;font face='courier'&gt;EXECUTE DBMS_LOGMNR_D.SET_TABLESPACE('logmnrts$');&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;------------------------&lt;br /&gt;-- to extract dictionary&lt;br /&gt;------------------------&lt;br /&gt;-- extracting to a flat file&lt;br /&gt;-- You could also specify a filename and location without specifying the STORE_IN_FLAT_FILE option. The result would be the same.&lt;br /&gt;-- alter system set UTL_FILE_DIR=&lt;opsys path&gt;; should be executed first&lt;br /&gt;&lt;font face='courier'&gt;EXECUTE DBMS_LOGMNR_D.BUILD('dictionary.ora', '/oracle/database/', OPTIONS =&gt; DBMS_LOGMNR_D.STORE_IN_FLAT_FILE);&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;-- to extract dictionary to online redologs&lt;br /&gt;-- database must be in archive mode and archiving should be enabled &lt;br /&gt;&lt;font face='courier'&gt;EXECUTE DBMS_LOGMNR_D.BUILD (OPTIONS=&gt;DBMS_LOGMNR_D.STORE_IN_REDO_LOGS);&lt;br /&gt;&lt;br /&gt;SELECT NAME FROM V$ARCHIVED_LOG WHERE DICTIONARY_BEGIN='YES';&lt;br /&gt;SELECT NAME FROM V$ARCHIVED_LOG WHERE DICTIONARY_END='YES';&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;-- dont need to extract dictionary&lt;br /&gt;-- with this command logminer uses online dictionary which is in the schema sys &lt;br /&gt;-- The online catalog option is not valid with the DDL_DICT_TRACKING option.&lt;br /&gt;&lt;font face='courier'&gt;EXECUTE DBMS_LOGMNR.START_LOGMNR(OPTIONS =&gt; DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG);&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;-- tracking ddl statements&lt;br /&gt;-- applies ddl commands in logminer internal dictionary&lt;br /&gt;&lt;font face='courier'&gt;EXECUTE DBMS_LOGMNR.START_LOGMNR(OPTIONS =&gt; DBMS_LOGMNR.DDL_DICT_TRACKING);&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;-- With this option set, LogMiner applies any DDL statements seen in the redo logs to its internal dictionary. &lt;br /&gt;-- For example, to see all the DDLs executed by user SYS, you could issue the following query&lt;br /&gt;&lt;font face='courier'&gt;SELECT USERNAME, SQL_REDO FROM V$LOGMNR_CONTENTS WHERE USERNAME = 'SYS' AND OEPRATION = 'DDL';&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;-----------------------------&lt;br /&gt;-- filtering redo_log actions&lt;br /&gt;-----------------------------&lt;br /&gt;-- If long-running transactions are present in the redo logs being analyzed, &lt;br /&gt;-- use of this option may cause an "Out of Memory" error.&lt;br /&gt;&lt;font face='courier'&gt;EXECUTE DBMS_LOGMNR.START_LOGMNR(OPTIONS =&gt; DBMS_LOGMNR.COMMITTED_DATA_ONLY);&lt;br /&gt;&lt;br /&gt;EXECUTE DBMS_LOGMNR.START_LOGMNR(OPTIONS =&gt; DBMS_LOGMNR.SKIP_CORRUPTION);&lt;br /&gt;EXECUTE DBMS_LOGMNR.START_LOGMNR( DICTFILENAME =&gt; '/oracle/dictionary.ora', &lt;br /&gt;                                  STARTTIME =&gt; TO_DATE('01-Jan-1998 08:30:00', 'DD-MON-YYYY HH:MI:SS'), &lt;br /&gt;                                  ENDTIME =&gt; TO_DATE('01-Jan-1998 08:45:00', 'DD-MON-YYYY HH:MI:SS'));&lt;br /&gt;&lt;br /&gt;EXECUTE DBMS_LOGMNR.START_LOGMNR( DICTFILENAME =&gt; '/oracle/dictionary.ora', &lt;br /&gt;                                  STARTSCN =&gt; 100, &lt;br /&gt;                                  ENDSCN =&gt; 150);&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;-----------------------------&lt;br /&gt;-- querying v$logmnr_contents&lt;br /&gt;-----------------------------                                  &lt;br /&gt;&lt;font face='courier'&gt;SELECT OPERATION, SQL_REDO, SQL_UNDO FROM V$LOGMNR_CONTENTS&lt;br /&gt;  WHERE SEG_OWNER = 'SCOTT' AND SEG_NAME = 'ORDERS' AND&lt;br /&gt;  OPERATION = 'DELETE' AND USERNAME = 'RON';                                                                                                                                                                          &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;-- MINE_VALUE example&lt;br /&gt;&lt;font face='courier'&gt;SELECT SQL_REDO FROM V$LOGMNR_CONTENTS&lt;br /&gt;  WHERE&lt;br /&gt;  SEG_NAME = 'emp' AND&lt;br /&gt;  SEG_OWNER = 'SCOTT' AND&lt;br /&gt;  OPERATION = 'UPDATE' AND&lt;br /&gt;  DBMS_LOGMNR.MINE_VALUE(REDO_VALUE, 'SCOTT.EMP.SAL') &gt;&lt;br /&gt;  2*DBMS_LOGMNR.MINE_VALUE(UNDO_VALUE, 'SCOTT.EMP.SAL');&lt;/font&gt;&lt;br /&gt;  &lt;br /&gt;-- COLUMN_PRESENT example&lt;br /&gt;&lt;font face='courier'&gt;SELECT &lt;br /&gt;  (XIDUSN || '.' || XIDSLT || '.' || XIDSQN) AS XID,&lt;br /&gt;  (DBMS_LOGMNR.MINE_VALUE(REDO_VALUE, 'SCOTT.EMP.SAL') -&lt;br /&gt;  DBMS_LOGMNR.MINE_VALUE(UNDO_VALUE, 'SCOTT.EMP.SAL')) AS INCR_SAL&lt;br /&gt;  FROM V$LOGMNR_CONTENTS&lt;br /&gt;  WHERE&lt;br /&gt;  DBMS_LOGMNR.COLUMN_PRESENT(REDO_VALUE, 'SCOTT.EMP.SAL') = 1 AND&lt;br /&gt;  DBMS_LOGMNR.COLUMN_PRESENT(UNDO_VALUE, 'SCOTT.EMP.SAL') = 1 AND&lt;br /&gt;  OPERATION = 'UPDATE';&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;-- a session example&lt;br /&gt;--------------------&lt;br /&gt;&lt;font face='courier'&gt;ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;&lt;br /&gt;&lt;br /&gt;EXECUTE DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME =&gt; 'log1orc1.ora', OPTIONS =&gt; DBMS_LOGMNR.NEW);&lt;br /&gt;EXECUTE DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME =&gt; 'log2orc1.ora', OPTIONS =&gt; DBMS_LOGMNR.ADDFILE);&lt;br /&gt;&lt;br /&gt;EXECUTE DBMS_LOGMNR.START_LOGMNR(DICTFILENAME =&gt;'/oracle/database/dictionary.ora');&lt;br /&gt;EXECUTE DBMS_LOGMNR.START_LOGMNR(OPTIONS =&gt; DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG + DBMS_LOGMNR.COMMITTED_DATA_ONLY);&lt;br /&gt;EXECUTE DBMS_LOGMNR.START_LOGMNR(OPTIONS =&gt; DBMS_LOGMNR.DICT_FROM_REDO_LOGS + DBMS_LOGMNR.COMMITTED_DATA_ONLY);&lt;br /&gt;&lt;br /&gt;EXECUTE DBMS_LOGMNR.START_LOGMNR(DICTFILENAME =&gt; 'orcldict.ora', &lt;br /&gt;                                 STARTTIME =&gt; TO_DATE('01-Jan-1998 08:30:00', 'DD-MON-YYYY HH:MI:SS'), &lt;br /&gt;                                 ENDTIME =&gt; TO_DATE('01-Jan-1998 08:45:00', 'DD-MON-YYYY HH:MI:SS'));&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;--START_LOGMNR options&lt;br /&gt;DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG&lt;br /&gt;-- If you specify DICT_FROM_REDO_LOGS, LogMiner expects to find a dictionary in the redo logs &lt;br /&gt;-- that you specified with the DBMS_LOGMNR.ADD_LOGFILE procedure before starting logmnr&lt;br /&gt;DBMS_LOGMNR.DICT_FROM_REDO_LOGS&lt;br /&gt;DBMS_LOGMNR.COMMITTED_DATA_ONLY&lt;br /&gt;DBMS_LOGMNR.SKIP_CORRUPTION&lt;br /&gt;DBMS_LOGMNR.DDL_DICT_TRACKING&lt;br /&gt;-- DBMS_LOGMNR.ADD_LOGFILE options&lt;br /&gt;DBMS_LOGMNR.NEW, DBMS_LOGMNR.ADDFILE, AND DBMS_LOGMNR.REMOVEFILE -- See Specify Redo Logs for Analysis&lt;br /&gt;DBMS_LOGMNR.NO_SQL_DELIMITER&lt;br /&gt;DBMS_LOGMNR.PRINT_PRETTY_SQL&lt;br /&gt;DBMS_LOGMNR.CONTINUOUS_MINE&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;&lt;font face='courier'&gt;SELECT * FROM v$logmnr_contents;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;-- table hit statistics&lt;br /&gt;&lt;font face='courier'&gt;SELECT SEG_OWNER, SEG_NAME, COUNT(*) AS Hits FROM&lt;br /&gt;  V$LOGMNR_CONTENTS WHERE SEG_NAME NOT LIKE '%$' GROUP BY&lt;br /&gt;  SEG_OWNER, SEG_NAME;&lt;br /&gt;&lt;br /&gt;EXECUTE DBMS_LOGMNR.END_LOGMNR;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-7830713828442966202?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/7830713828442966202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/01/mining-archived-logs-for-past-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7830713828442966202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/7830713828442966202'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/01/mining-archived-logs-for-past-sql.html' title='Mining Archived Logs with DBMS_LOGMNR_D'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-5735312100225088831</id><published>2008-01-05T21:17:00.000+02:00</published><updated>2008-11-13T04:57:10.637+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Enterprise Manager Grid Control'/><title type='text'>Endless Status Pending in OMS Console</title><content type='html'>&lt;u&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;/u&gt; When I logged in the OMS console, i realized that one of the cluster instances has a problem with one of its nodes. Node_1 seems to be up but when i examine Node_2 the status seems like "Status Pending" in the &lt;a href="http://2.bp.blogspot.com/_fSrIpdF1Zdk/R4Jd3hgXOzI/AAAAAAAAALU/RPz7J9SbMZE/s1600-h/figure_2.jpg"&gt;OMS console of the Node_2&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;When i check the agent on the target host, there was not any problem and the agent uploads metrics successfully.&lt;br /&gt;&lt;br /&gt;&lt;font face='courier' size='1'&gt;&lt;br /&gt;&lt;font style='background-color:#00FF00'&gt;[oracle@be02 bin]$ ./emctl status agent&lt;/font&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;Agent Version     : 10.2.0.3.0&lt;br /&gt;OMS Version       : 10.2.0.3.0&lt;br /&gt;Protocol Version  : 10.2.0.2.0&lt;br /&gt;Agent Home        : /oracle/product/10.2.0/agent10g/ACTV_ACTV2&lt;br /&gt;Agent binaries    : /oracle/product/10.2.0/agent10g&lt;br /&gt;Agent Process ID  : 28158&lt;br /&gt;Parent Process ID : 28049&lt;br /&gt;Agent URL         : https://be02:3872/emd/main&lt;br /&gt;Repository URL    : https://oragrid:1159/em/upload&lt;br /&gt;Started at        : 2008-01-04 10:47:17&lt;br /&gt;Started by user   : oracle&lt;br /&gt;Last Reload       : 2008-01-04 10:47:17&lt;br /&gt;&lt;font style='background-color:#FFFF00'&gt;Last successful upload                       : 2008-01-04 10:49:05&lt;/font&gt;&lt;br /&gt;Total Megabytes of XML files uploaded so far :    22.89&lt;br /&gt;Number of XML files pending upload           :      741&lt;br /&gt;Size of XML files pending upload(MB)         :    35.85&lt;br /&gt;Available disk space on upload filesystem    :    70.56%&lt;br /&gt;Collection Status                            : Disabled by Upload Manager&lt;br /&gt;Last successful heartbeat to OMS             : 2008-01-04 10:48:30&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;&lt;font style='background-color:#FFFF00'&gt;Agent is Running and Ready&lt;/font&gt;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;While i was scratching the OMS console to find a clue about the problem i realized that the target host has been restarted for a week ago and the last upload made by target agent was &lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4J3OxgXO0I/AAAAAAAAALc/QGsWiFXDJT8/s1600-h/figure_1.jpg"&gt; further then the current date &lt;/a&gt;. OMS console shows the last upload date four days   future. How could it be? I decided to check the date and TZ environment variable for both target and OMS hosts.&lt;br /&gt;&lt;br /&gt;&lt;font face='courier' size='1'&gt;&lt;br /&gt;-- target op sys date&lt;br /&gt;[oracle@be02 bin]$ date&lt;br /&gt;Fri Jan  4 14:53:38 EET 2008&lt;br /&gt;&lt;br /&gt;-- OMS op sys date&lt;br /&gt;[oracle@oragrid ~]$ date&lt;br /&gt;Fri Jan  4 14:55:40 EET 2008&lt;br /&gt;&lt;br /&gt;-- TZ Parameter of target&lt;br /&gt;[oracle@be02 bin]$ echo $TZ&lt;br /&gt;&lt;br /&gt;[oracle@be02 bin]$&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;It seems there is not any problem about the date settings of the host operationg systems. Let's have a look at the agent and OMS timezone regions. &lt;br /&gt;&lt;br /&gt;&lt;font face='courier' size='1'&gt;&lt;br /&gt;-- Agents Timezone value &lt;br /&gt;&lt;font style='background-color:#00FF00'&gt;[oracle@be02 bin]$ ./emctl config agent getTZ&lt;/font&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;font style='background-color:#FFFF00'&gt;Turkey&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;--emd.properties Timezone parameter value&lt;br /&gt;&lt;font style='background-color:#00FF00'&gt;[oracle@be02 config]$ tail -10 emd.properties&lt;/font&gt;&lt;br /&gt;# at startup and reload. Currently this applies only to "Critical" marked dynamic&lt;br /&gt;# properties. The following two values are applicable per target and not per&lt;br /&gt;# dynamic property&lt;br /&gt;#&lt;br /&gt;# dynamicPropReComputeInterval --&gt; time difference between a failed dynamic property&lt;br /&gt;# computation and the next try to compute the property in seconds. The default value is 120 seconds.&lt;br /&gt;#&lt;br /&gt;# dynamicPropReComputeMaxTries --&gt; maximum number of reties for calculating failed&lt;br /&gt;# dynamic properties. The default value is 4 retires.&lt;br /&gt;&lt;font style='background-color:#FFFF00'&gt;agentTZRegion=Turkey&lt;/font&gt;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Timezone values are also the same. There should not be any problem. Then what is the "Status Pending" state and the last upload date of the target in OMS. I decided to reset timezone settings of the agent and the oms.&lt;br /&gt;&lt;br /&gt;&lt;font face='courier' size='1'&gt;&lt;br /&gt;-- Changing agents timezone&lt;br /&gt;[oracle@be02 bin]$ &lt;font style='background-color:#00FF00'&gt;./emctl resetTZ agent&lt;/font&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;Agent is running. Stop the agent and rerun the command.&lt;br /&gt;&lt;br /&gt;[oracle@be02 bin]$ &lt;font style='background-color:#00FF00'&gt;./emctl stop agent&lt;/font&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;Stopping agent ... stopped.&lt;br /&gt;&lt;br /&gt;[oracle@be02 bin]$ &lt;font style='background-color:#00FF00'&gt;./emctl resetTZ agent&lt;/font&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;Updating /oracle/product/agent10g/agent10g/sysman/config/emd.properties...&lt;br /&gt;Successfully updated /oracle/product/agent10g/agent10g/sysman/config/emd.properties.&lt;br /&gt;&lt;font style='background-color:#FFFF00'&gt;&lt;br /&gt;Login as the em repository user and run the  script:&lt;br /&gt;exec mgmt_target.set_agent_tzrgn('be02:3872','Turkey')&lt;br /&gt;This can be done for example by logging into sqlplus and doing&lt;br /&gt;SQL&gt; exec mgmt_target.set_agent_tzrgn('be02:3872','Turkey')&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;[oracle@be02 bin]$ &lt;font style='background-color:#00FF00'&gt;./emctl start agent&lt;/font&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;Starting agent ..... started.&lt;br /&gt;&lt;br /&gt;[oracle@be02 bin]$ &lt;font style='background-color:#00FF00'&gt;./emctl upload agent&lt;/font&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;EMD upload completed successfully&lt;br /&gt;&lt;br /&gt;-- Executing OMS Script&lt;br /&gt;[oracle@oragrid ~]$ &lt;font style='background-color:#00FF00'&gt;sqlplus sysman/&lt;password&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.3.0 - Production on Fri Jan 4 14:19:19 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP and Data Mining options&lt;br /&gt;&lt;br /&gt;SQL&gt; &lt;font style='background-color:#00FF00'&gt;exec mgmt_target.set_agent_tzrgn('be02:3872','Turkey');&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Lets check if everything is OK. When i check the &lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4KP8xgXO1I/AAAAAAAAALk/XGVMjP0bvNk/s1600-h/figure_3.jpg"&gt;OMS console&lt;/a&gt; for the status of the Node_2 of my cluster instance it seems to be recovered from the "Status Pending". Node_2 seems to be up in the &lt;a href="http://4.bp.blogspot.com/_fSrIpdF1Zdk/R4KQnBgXO2I/AAAAAAAAALs/kE-RXQpanbU/s1600-h/figure_4.jpg"&gt;cluster instances home page&lt;/a&gt; also. Everything went fine but one thing to notice. When i click to &lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R4KRpxgXO3I/AAAAAAAAAL0/KxM9-djx2PE/s1600-h/figure_5.jpg"&gt;Node_2 home page in the OMS console&lt;/a&gt; weird thing i noticed. Latest Data Collected changed further than before. It now shows 11 days future for the last upload date. Everything goes fine but i still could not find an answer for this strange issue. Maybe somehow target hosts operating system date changed temporarily by unix administrators or by developers for accidentally or for test purposes and then reset to the current date.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;You can check the following Oracle document for details of the commands used here:&lt;/u&gt;&lt;br /&gt;Oracle® Enterprise Manager Advanced Configuration&lt;br /&gt;10g Release 2 (10.2)&lt;br /&gt;Part Number B16242-02&lt;br /&gt;Chapter 10 - Reconfiguring the Management Agent and Management Service&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-5735312100225088831?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/5735312100225088831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2008/01/oracle-em-grid-control-endless-status.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5735312100225088831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/5735312100225088831'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2008/01/oracle-em-grid-control-endless-status.html' title='Endless Status Pending in OMS Console'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-249290405314959280</id><published>2007-12-29T23:33:00.000+02:00</published><updated>2008-01-13T00:52:58.927+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Enterprise Manager Grid Control'/><title type='text'>Metric collection Error in targets status page at OMS Console</title><content type='html'>&lt;b&gt;&lt;u&gt;Problem:&lt;/u&gt;&lt;/b&gt; &lt;font style="COLOR=#000000;BACKGROUND-COLOR:#FFFF00"&gt;Metric Collection Error&lt;/font&gt; in Oracle EM Grid Control Server (OMS) console&lt;br /&gt;&lt;br /&gt;Possible problem in dbsnmp password &lt;u&gt;on target host&lt;/u&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Solution:&lt;/u&gt;&lt;/b&gt; Oracle Enterprise Manager Agent uses dbsnmp account to gather database wide information. If the user locked or its password other than something non default, you should unlock the user and configure agent with the new password. Check out the following steps.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter user dbnsmp account unlock;&lt;br /&gt;SQL&gt; alter user dbnsmp identified by &lt;password&gt;;&lt;br /&gt;&lt;br /&gt;[oracle@raquality00 bin]$ &lt;font style="COLOR=#000000;BACKGROUND-COLOR:#00FF00"&gt;./emctl config agent listtargets&lt;/font&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 3 Grid Control 10.2.0.3.0.  &lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;[raquality00:3872, oracle_emd]&lt;br /&gt;[raquality00, host]&lt;br /&gt;[raqcrs, cluster]&lt;br /&gt;[&lt;font style="COLOR=#000000;BACKGROUND-COLOR:#00FFFF"&gt;RADB_RADB1, oracle_database&lt;/font&gt;]&lt;br /&gt;[RADB, rac_database]&lt;br /&gt;[LISTENER_RAQUALITY00_raquality00, oracle_listener]&lt;br /&gt;&lt;br /&gt;$PROMPT&gt; &lt;font style="COLOR=#000000;BACKGROUND-COLOR:#00FF00"&gt;./emctl config agent credentials&lt;/font&gt; &lt;font style="COLOR=#000000;BACKGROUND-COLOR:#00FFFF"&gt;RADB_RADB1:oracle_database&lt;/font&gt;&lt;br /&gt;Oracle Enterprise Manager 10g Release 10.1.0.2.0&lt;br /&gt;Copyright (c) 2002, 2003 Oracle Corporation.  All rights reserved.&lt;br /&gt;Name = emrep10.us.oracle.com, Type = oracle_database&lt;br /&gt;&lt;font style="COLOR=#000000;BACKGROUND-COLOR:#FFFF00"&gt;&lt;br /&gt;Want to change for "UserName" (y/n):n&lt;br /&gt;Want to change for "password" (y/n):y&lt;br /&gt;Enter the value for "password" :*******&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;EMD reload completed successfully&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-249290405314959280?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/249290405314959280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2007/12/oracle-em-grid-control-metric.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/249290405314959280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/249290405314959280'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2007/12/oracle-em-grid-control-metric.html' title='Metric collection Error in targets status page at OMS Console'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-6260800527256732820</id><published>2007-12-29T22:25:00.001+02:00</published><updated>2008-11-13T04:57:10.659+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Enterprise Manager Grid Control'/><title type='text'>Oracle EM Grid Control – Notification Rules</title><content type='html'>Notification Rules are the way of Enterprise Manager warns you. You may want to be warned about “tablespace space usage percentage”,  “data block corruption alert log entries” or anything else that you think it is critical for you. You can create a rule from scratch or you can also use Public Rules. Public Rules are also customizable for your needs. Here, I will create a rule from scratch for an example. Extenting and customizing a Public Rule has no differences in logical manner. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_fSrIpdF1Zdk/R3a00BgXOpI/AAAAAAAAAJU/FuJm6rxckD8/s1600-h/figure_1.jpg"&gt;figure_1&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- In “Preferences” Page, click to “My Rules” under “Notification” Tab. “My Notification Rules” page will appear. &lt;br /&gt;- Click “Create” button to create a rule (figure_1)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R3a1gxgXOqI/AAAAAAAAAJc/R3orczwcaC4/s1600-h/figure_2.jpg"&gt;figure_2&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- There are six tabs on the screen. First one is “General”, here you should enter the “Name” of the rule, and the “Target Type” you want to apply the rule (in this example the Target Type is Database Instance). &lt;br /&gt;&lt;br /&gt;- You can also identify which targets you want to apply the rule you created. To do this you should select one of the two choices. You can apply the rule to all of the database instances or you can apply the rule to only one instance (figure_2)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R3a2KxgXOrI/AAAAAAAAAJk/cAqSlbRsVaQ/s1600-h/figure_3.jpg"&gt;figure_3&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- If you select to apply the rule to a specific database instance click the second radio button. A new list appears. This is the list of the database instances that your rule will apply. &lt;br /&gt;&lt;br /&gt;- Click “Add” Button to add database instances (figure_3)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R3a2fxgXOsI/AAAAAAAAAJs/fdgU5qwIjVE/s1600-h/figure_4.jpg"&gt;figure_4&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- Target selector appears when you click to the “Add” button. Here you can select which target(s) you want to apply your rule. Select “Target Type” and Targets you want to apply the rule and click “Select” button to make your choice permanent. &lt;br /&gt;&lt;br /&gt;- After you complete with this tab click to the next tab “Availability” (figure_4)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R3a24xgXOtI/AAAAAAAAAJ0/jKhfcMyW_cE/s1600-h/figure_5.jpg"&gt;figure_5&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- You can set the availability of the agent states and you can be notified by the state changes. You can set “agent unreachable” , “metric error” and “blackout” states and their cleared problems to notify you (figure_5)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_fSrIpdF1Zdk/R3a3YRgXOuI/AAAAAAAAAJ8/224VdEQ9nR8/s1600-h/figure_6.jpg"&gt;figure_6&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- “Metrics” tab is probably the most handy tab here. By this tab you can add more than a hundred metric to watch an instance. We will add “Generic Alert Log Error” metric in this example.  By using this metric, one would never need to write a script to search alert&lt;SID&gt;.log for errors and send email instead this metric does the same thing four you. &lt;br /&gt;- Click “Add” button to add a metric (figure_6)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R3a3zxgXOvI/AAAAAAAAAKE/Ht4bCuOimE0/s1600-h/figure_7.jpg"&gt;figure_7&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- You can find the metrics by clicking “next” link for every 10 records until you find the “Generic Alert Log Error” &lt;br /&gt;- After selecting the specified metric go to the bottom of the page (figure_7)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_fSrIpdF1Zdk/R3a4HRgXOwI/AAAAAAAAAKM/6FQZEmGdKD0/s1600-h/figure_8.jpg"&gt;figure_8&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- You will find “Severity States” section here. Select any state you want to be within this metric. In this example I will select both “Critical” and “Warning” levels.&lt;br /&gt;- You may want to be informed when the problem is cleared. Look “Corrective Action States” section to select which corrective actions should inform you. &lt;br /&gt;- After your selections are complete Click “Continue” Button (figure_8)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R3a4ZxgXOxI/AAAAAAAAAKU/lU3D2YaPoHQ/s1600-h/figure_9.jpg"&gt;figure_9&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- You will see the added Metric in the “Metrics” Tab.&lt;br /&gt;- Click “OK” button to complete the rule creation.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_fSrIpdF1Zdk/R3a4phgXOyI/AAAAAAAAAKc/lbhD7ZotOLI/s1600-h/figure_10.jpg"&gt;figure_10&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- If the rule is created successfully you should see a rule in the “My Rules” Tab. &lt;br /&gt;- If you want to be informed with this rule select the “Subscribe (Send Email)” column and click “Apply” button.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-6260800527256732820?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/6260800527256732820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2007/12/oracle-enterprise-manager-grid-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6260800527256732820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/6260800527256732820'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2007/12/oracle-enterprise-manager-grid-control.html' title='Oracle EM Grid Control – Notification Rules'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5510749163670835379.post-3127349721344742440</id><published>2007-12-29T20:39:00.003+02:00</published><updated>2008-11-13T04:57:10.669+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Enterprise Manager Grid Control'/><title type='text'>Oracle EM Grid Control – Changing User Password</title><content type='html'>How to change your own user password and preferences in Oracle Enterprise Manager Grid Control (OMS) Console. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_fSrIpdF1Zdk/R3aXMRgXOlI/AAAAAAAAAIU/eaghyHuKhmc/s1600-h/figure_1.jpg"&gt;Figure_1&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- To change your password, one should use “Preferences” Link above the tabs as shown in the figure_1. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_fSrIpdF1Zdk/R3aYzxgXOmI/AAAAAAAAAIc/V1_T1MGsaLQ/s1600-h/figure_2.jpg"&gt;Figure_2&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- To change your password, you should first enter your “current password” to the related field. And then you can enter your “New Password” twice to the related fields. After you finished filling the boxes simply click to “Apply” button (figure_2) &lt;br /&gt;&lt;br /&gt;- You can also change your contact information by using “E-Mail Addresses”  section in the page. You can add new email address by clicking “Add Another Row” button.  New row will appear instantly under your existing email address. You should write your new email address and click apply button as shown in the figure (figure_2)&lt;br /&gt;&lt;br /&gt;- To remove an email address, select the address you want to delete and simply click “Remove” button. Selected email address will disappear immediately. You must click “Apply” button to make the changes permanent (figure_2)&lt;br /&gt;&lt;br /&gt;- You can also test your contact email address by selecting your email address and click on the “Test” button. A test email will be sent to your email address (figure_2)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_fSrIpdF1Zdk/R3ahDhgXOoI/AAAAAAAAAIs/1uFwAhsKuB8/s1600-h/figure_4.jpg"&gt;figure_3&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- “Information Page” after your password successfully changes (figure_3)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_fSrIpdF1Zdk/R3agtBgXOnI/AAAAAAAAAIk/_rbLum2SvzE/s1600-h/figure_3.jpg"&gt;figure_4&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;- “Information Page” after you test your email address (figure_4)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5510749163670835379-3127349721344742440?l=ergemp.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ergemp.blogspot.com/feeds/3127349721344742440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ergemp.blogspot.com/2007/12/oracle-enterprise-manager-changing-user.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/3127349721344742440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5510749163670835379/posts/default/3127349721344742440'/><link rel='alternate' type='text/html' href='http://ergemp.blogspot.com/2007/12/oracle-enterprise-manager-changing-user.html' title='Oracle EM Grid Control – Changing User Password'/><author><name>Ergem Peker</name><uri>http://www.blogger.com/profile/11162102189453894198</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://1.bp.blogspot.com/_fSrIpdF1Zdk/SOyZOka48RI/AAAAAAAAAoE/rLyzjXMDGgY/S220/ep_ptmo_profile_pic2.jpg'/></author><thr:total>0</thr:total></entry></feed>
