<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Pythian Group Blog</title>
	
	<link>http://www.pythian.com/news</link>
	<description>News and views from Pythian DBAs</description>
	<pubDate>Fri, 03 Jul 2009 19:20:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/PythianGroupBlog" type="application/rss+xml" /><item>
		<title>Connecting to Oracle with SQL Server 2005 x64</title>
		<link>http://feedproxy.google.com/~r/PythianGroupBlog/~3/Nc9Z7rBlxNs/connecting-to-oracle-with-sql-server-2005-x64</link>
		<comments>http://www.pythian.com/news/3005/connecting-to-oracle-with-sql-server-2005-x64#comments</comments>
		<pubDate>Fri, 03 Jul 2009 19:20:05 +0000</pubDate>
		<dc:creator>Chris Presley</dc:creator>
		
		<category><![CDATA[SQL Server]]></category>

		<category><![CDATA[connectivity]]></category>

		<category><![CDATA[Linked Servers]]></category>

		<category><![CDATA[OLE DB]]></category>

		<category><![CDATA[sql]]></category>

		<category><![CDATA[sqlplus]]></category>

		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=3005</guid>
		<description><![CDATA[The quirks of connecting to Oracle from SQL 2005 64 bit]]></description>
			<content:encoded><![CDATA[<p>Using OLE DB to get SQL Server to connect to Oracle servers can be done quite easily, but there are a few little tricks you should know to make it go smoothly. Once it&#8217;s working it seems to work quite well. I hope this blog post will save you a few headaches.</p>
<p>Recently a client asked me to create a simple SSIS package that would connect to Oracle, pick up some data with queries they provided, import it to SQL Server, and eventually export the data as flat, delimited text files. </p>
<p>With SSIS you can use the OLE DB provider that Oracle provides. If your SQL Server is 32-bit, you can install the 32-bit Oracle client and stop there. </p>
<p>If it&#8217;s 64-bit, there are a couple different ways to get the Oracle providers working. <span id="more-3005"></span> The method I&#8217;ve had the most success with, is to install both the 32- and 64-bit Oracle clients (in separate directories). I&#8217;m not sure <em>why</em> you have to have both clients. The only explanation I&#8217;ve seen is that part of SQL Server 64 is still 32-bit. I&#8217;m not sure if this is true, but if you look at the shortcuts, SSMS and Visual Studio&#8217;s EXEs reside in the 32-bit Program Files folder:</p>
<p>SQL Server Management Studio and DTEXECUI.exe can be found in: <code>C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\VSShell\Common7\IDE\</code></p>
<p>Visual Studio: <code>C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\Devenv.exe</code></p>
<p>If you look at SQL Server and SQL Agent, they both reside in the 64-bit folder: <code>C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\</code></p>
<p>Once both clients were installed, I was able to access the provider in SSIS, and also successfully schedule and run package. The trouble started when the requirements for the project changed, and we decided to use SQL in a stored procedure with a linked server instead of SSIS. I thought this would be very simple to get working, since I already had the providers installed and working in SSIS. I was wrong.</p>
<p>We created the linked server and used <code>OPENROWSET</code> to pass in the queries that the client had written and tested in SQLPlus running against their test system. Now it was time to try out our linked server. I passed it a simple query and instead of seeing some records, got this error:</p>
<blockquote><p>Msg 7399, Level 16, State 1, Line 1<br />
The OLE DB provider &#8220;OraOLEDB.Oracle&#8221; for linked server [Oracle Server Name Withheld] reported an error. <strong>Access denied.</strong></p>
<p>Msg 7301, Level 16, State 2, Line 1<br />
Cannot obtain the required interface (&#8221;IID_IDBCreateCommand&#8221;) from OLE DB provider &#8220;OraOLEDB.Oracle&#8221; for linked server [Oracle Server Name Witheld]</p></blockquote>
<p>Naturally, I thought something had changed with our credentials used to access Oracle, so we tested the query and credentials in SQLPlus, which worked. Thinking something had gotten messed up on the SQL Server, I decided to check the providers, and ran the query from SSIS against the provider/Oracle data source. This worked.</p>
<p>We tried creating the linked servers with different settings, and even tried creating them on different servers. Nothing worked. </p>
<p>At this point, I was very frustrated, and thinking about how best to do what we wanted in SSIS. I did some research on the web and eventually stumbled on <a href="http://www.tech-archive.net/Archive/SQL-Server/microsoft.public.sqlserver.olap/2006-03/msg00261.html"><em>OPENQUERY - Access denied</em></a> which suggested the &#8220;Allow InProcess&#8221; option be enabled on the provider. I enabled this option (instructions below), closed all open query windows, opened a new one and then re-tested my simple/test query using
<pre>
OPENROWSET</pre>
<p> and everything worked like a charm.</p>
<p>Happy cross-platform querying.<br />
Chris.</p>
<p>Here are the step by step instructions to enable this:</p>
<ol>
<li>Expand Linked Servers | Providers.</li>
<li>Right click on the Ora provider and go to Properties.</li>
<li>Find the &#8220;Allow InProcess&#8221; option and tick it.</li>
<li>Then make a new connection window and run your query (I had to close my open connection windows).</li>
</ol>
<img src="http://feeds.feedburner.com/~r/PythianGroupBlog/~4/Nc9Z7rBlxNs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/3005/connecting-to-oracle-with-sql-server-2005-x64/feed</wfw:commentRss>
		<feedburner:origLink>http://www.pythian.com/news/3005/connecting-to-oracle-with-sql-server-2005-x64</feedburner:origLink></item>
		<item>
		<title>Log Buffer #152: a Carnival of the Vanities for DBAs</title>
		<link>http://feedproxy.google.com/~r/PythianGroupBlog/~3/TeTtJsL0iqc/log-buffer-152-a-carnival-of-the-vanities-for-dbas</link>
		<comments>http://www.pythian.com/news/3268/log-buffer-152-a-carnival-of-the-vanities-for-dbas#comments</comments>
		<pubDate>Fri, 03 Jul 2009 16:46:52 +0000</pubDate>
		<dc:creator>David Edwards</dc:creator>
		
		<category><![CDATA[Log Buffer]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Non-Tech Articles]]></category>

		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[PostgreSQL]]></category>

		<category><![CDATA[SQL Server]]></category>

		<category><![CDATA[NoSQL]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=3268</guid>
		<description><![CDATA[Welcome to the 152nd edition of Log Buffer, the weekly review of database blogs.
PostgreSQL
Courtesy the United States PostgreSQL Association, the big news: PostgreSQL 8.4 Released!.
Josh Berkus writes, &#8220;Now that PostgreSQL 8.4 is out, I thought I&#8217;d write a little about my favorite 8.4 feature. As Mr. Performance Whack-a-Mole, what makes me happy about 8.4 is [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to the 152<sup>nd</sup> edition of <a href="http://www.pythian.com/news/about-log-buffer"><em>Log Buffer</em></a>, the weekly review of database blogs.</p>
<h3>PostgreSQL</h3>
<p>Courtesy the <a href="https://www.postgresql.us"><strong>United States PostgreSQL Association</strong></a>, the big news: <a href="https://www.postgresql.us/node/91">PostgreSQL 8.4 Released!</a>.</p>
<p><a href="http://it.toolbox.com/blogs/database-soup"><strong>Josh Berkus</strong></a> writes, &#8220;Now that PostgreSQL 8.4 is out, I thought I&#8217;d write a little about my favorite 8.4 feature. As Mr. Performance Whack-a-Mole, what makes me happy about 8.4 is the ability to whack moles faster &#8230; which is why I&#8217;m very fond of <a href="http://it.toolbox.com/blogs/database-soup/pg_stat_statements-in-84-32648">pg_stat_statements</a>.&#8221;</p>
<p>On ad&#8217;s corner, <a href="http://andreas.scherbaum.la/blog"><strong>Andreas Scherbaum</strong></a> says, &#8220;Up to PostgreSQL 8.3 it was only possible to grant (and revoke) permissions on the entire table. If column level permissions were needed, a workaround like a view solved (more or less) the problem&nbsp;.&nbsp;.&nbsp;.&nbsp; This&nbsp;.&nbsp;.&nbsp;.&nbsp;is uneloquent, error prone and does not scale well. &nbsp;.&nbsp;.&nbsp;.&nbsp; PostgreSQL 8.4 solves the problem with a shiny new feature: <a href="http://andreas.scherbaum.la/blog/archives/577-PostgreSQL-8.4-Column-Permissions.html">column level permissions</a>.&#8221;</p>
<p><a href="http://people.planetpostgresql.org/dfetter"><strong>David Fetter</strong></a> looks into <a href="http://people.planetpostgresql.org/dfetter/index.php?/archives/22-WITH-so-much-drama-in-the-CTE.html">WITH (so much drama in the CTE)</a>: &#8221; By now, you&#8217;ve probably seen that PostgreSQL 8.4 can produce Mandelbrot sets&nbsp;.&nbsp;.&nbsp;.&nbsp;but what are Common Table Expressions really about? <span id="more-3268"></span>  [They]  are just views you create at run time. Oh, and they can refer to themselves. That latter capability is powerful and flexible (read confusing), so I&#8217;ll go over that one later. Run-time views are pretty handy, though.&#8221;</p>
<p><a href="http://people.planetpostgresql.org/andrew">Andrew&#8217;s PostgreSQL blog</a> introduces <a href="http://people.planetpostgresql.org/andrew/index.php?/archives/27-Parallel-pg_restore-for-PostgreSQL-8.4.html">parallel pg_restore for PostgreSQL 8.4</a>: &#8220;I try to complete at least one significant feature item per PostgreSQL release. This time the feature is making pg_restore run in parallel. This is quite important for many users, particularly some large enterprise users.&#8221;</p>
<h3>SQL Server</h3>
<p><a href="http://sqlblog.com/blogs/eric_johnson"><strong>Eric Johnson</strong></a> introduces <a href="http://sqlblog.com/blogs/eric_johnson/archive/2009/07/01/ssis-2008-and-the-new-lookup.aspx">SSIS 2008 and the new lookup</a>: &#8220;SSIS is a pretty useful tool for designing ETL processes. One of the transformations I was disappointed with in 2005 was the lookup. I found it a little better than the lookup functionality in DTS, but not too much better. Well, Microsoft must have read my mind because SQL Server 2008 has a new shiny Lookup transformation that is, in my opinion, much improved.&#8221;</p>
<p><a href="http://www.sqlskills.com/BLOGS/KIMBERLY"><strong>Kimberly L. Tripp</strong></a> was thinking about <a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Looking-for-security-vulnerabilities-in-database-code.aspx">looking for security vulnerabilities in database code</a>. &#8220;I&#8217;ve always been concerned with security and I&#8217;ve always stressed the importance of auditing the REAL user context not just the current user&nbsp;.&nbsp;.&nbsp;.&nbsp; So, I generally try to avoid using dynamic string execution and if necessary create well tested/protected parameters&nbsp;.&nbsp;.&nbsp;.&nbsp; Having said that, what if I&#8217;m looking at a database for the first time&nbsp;.&nbsp;.&nbsp;.&nbsp; I&#8217;ve come up with a quick query&#8230; And, while it&#8217;s not going to &#8220;solve&#8221; your problem&nbsp;.&nbsp;.&nbsp;.&nbsp;or even truly verify if you&#8217;re vulnerable, it gives you a &#8216;quick list&#8217; of where you should look first! &#8221;</p>
<p><a href="http://sqlblog.com/blogs/adam_machanic"><strong>Adam Machanic</strong></a> exposed <a href="http://sqlblog.com/blogs/adam_machanic/archive/2009/06/25/the-hidden-costs-of-insert-exec.aspx">the hidden costs of INSERT EXEC</a>, beginning, &#8220;INSERT and EXEC: relational brothers in arms, helping you get your data and then put it somewhere. But like all brothers, their relationship has its ups and downs and sometimes you need to look just below the surface to see the real issues. In this post I will cover hidden penalties that a decision&#8211;seemingly purely aesthetic&#8211;can bring to the fore.&#8221;</p>
<p><a href="http://sqlblogcasts.com/blogs/martinbell"><strong>Martin Bell</strong></a> offered the reminder, <a href="http://sqlblogcasts.com/blogs/martinbell/archive/2009/06/29/After-disabling-tde-you-still-requires-certificates-to-restore-the-database.aspx">after disabling TDE you still requires the certificate to restore the database</a>.</p>
<p><a href="http://blogs.lessthandot.com/index.php/DataMgmt">Data Management</a> has a first-rate HOWTO on <a href="http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/dynamic-column-names-and-fields-in-ssrs-">dynamic column names and fields in SSRS</a>. &#8220;I had no choice but to do work with creating dynamic column headings and dynamically determine what field in my dataset should go where in a report today. Sense [sic] this is the second time I’ve gone through this exercise and knowing the lack of information out there on really how to do it, I thought it deserves a blog entry. &nbsp;.&nbsp;.&nbsp;.&nbsp; So here is the basis of the requirements. You have a query that uses PIVOT but thrown into the mix is the need for dynamic columns in the PIVOT.&#8221;</p>
<h3>MySQL</h3>
<p>Here on the Pythian Blog, <a href="http://www.pythian.com/news/author/sheeri/"><strong>Sheeri Cabral</strong></a> expressed some <a href="http://www.pythian.com/news/3241/concerns-and-what-does-not-work-in-xtradb-backup">concerns and what does not work in XtraDB backup</a>. </p>
<p>On <a href="http://www.xaprb.com/blog">xaprb</a>, <strong>Baron Schwartz</strong> has <a href="http://www.xaprb.com/blog/2009/06/30/a-review-of-mysql-administrators-bible/">a review of MySQL Administrator’s Bible</a>. &#8220;I think that MySQL Administrator’s Bible is a very good complement to High Performance MySQL, 2nd Edition.  The former is useful to people who have varying levels of knowledge, while the latter assumes a lot of experience and doesn’t cover introductory material much.  &nbsp;.&nbsp;.&nbsp;.&nbsp; So if you’re new to databases, or if you’re new to MySQL, you might do well to start with Sheeri’s book&nbsp;.&nbsp;.&nbsp;.&nbsp;&#8221;</p>
<p>Over on the <a href="http://www.mysqlperformanceblog.com/">MySQL Performance Blog</a>, Baron looked into <a href="http://www.mysqlperformanceblog.com/2009/07/01/gathering-queries-from-a-server-with-maatkit-and-tcpdump/">gathering queries from a server with Maatkit and tcpdump</a>: &#8220;For the last couple of months, we&#8217;ve been quietly developing a MySQL protocol parser for Maatkit. It isn&#8217;t an implementation of the protocol: it&#8217;s an observer of the protocol. This lets us gather queries from servers that don&#8217;t have a slow query log enabled, at very high time resolution.&#8221;</p>
<p><a href="http://ronaldbradford.com/blog"><strong>Ronald Bradford</strong></a> looked at <a href="http://ronaldbradford.com/blog/verifying-mysql-replication-in-action-2009-06-28/">verifying MySQL replication in action</a>, with &#8220;&nbsp;.&nbsp;.&nbsp;.&nbsp;a very simple test to show MySQL replication in action and to also better understand the basics of MySQL Replication. With a configured MySQL environment we can run the following test on your MySQL master, and monitor the MySQL slave.&#8221;</p>
<p><a href="http://dev.mysql.com/workbench">The MySQL Workbench Team Blog</a> says, <a href="http://dev.mysql.com/workbench/?p=247">Time To Upgrade - MySQL Workbench 5.1 Is Here on Win, Mac &#038; Linux</a>.  Perty pictures follow.</p>
<h3>Oracle</h3>
<p><a href="http://tonguc.wordpress.com"><strong>H. Tonguç Yilmaz</strong></a> asserted, <a href="http://tonguc.wordpress.com/2009/07/01/how-to-generate-session-level-ash-reports/">Instrumented Code is Better: An Example on How to Generate Session Level ASH Reports</a>. &#8221; After 10g if you have its license ASH based performance monitoring is an alternative to the traditional SQL Tracing in my opinion. You may either use EM to generate ASH reports or directly query ASH dictionary. The handy additional hint here is that you can set filters to ASH data in order to focus on a specific session, the filter options at ASH report screen at EM can be used for this purpose or below is an example to monitor the waits from v$active_session_history view.&#8221;</p>
<p><a href="http://oracledoug.com/serendipity"><strong>Doug Burns</strong></a> responded with his item on <a href="http://oracledoug.com/serendipity/index.php?/archives/1505-Session-Level-ASH-Reports.html">session-level ASH reports</a>: &#8220;I think [Tonguç's] post is really showing two different things, one more successfully than the other.&#8221;</p>
<p><a href="http://oracle-randolf.blogspot.com"><strong>Randolf Geist</strong></a> reports a <a href="http://oracle-randolf.blogspot.com/2009/06/dynamic-sampling-and-set-currentschema.html">Dynamic sampling and set current_schema anomaly</a>: &#8220;If I&#8217;m now supposed to analyse a rather complex SQL with dozens of table and/or view references I like to use the ALTER SESSION SET CURRENT_SCHEMA command&nbsp;.&nbsp;.&nbsp;.&nbsp; This basically works just fine, but I recently have come across an interesting anomaly in 10.2.0.4: If the optimizer uses dynamic sampling as part of the parsing then it doesn&#8217;t do so anymore if the CURRENT_SCHEMA has been altered to a non-default schema.&#8221;</p>
<p>On <a href="http://www.oramoss.com/blog">the Oramoss Blog</a>, <strong>Jeff Moss</strong> looks at the case of <a href="http://www.oramoss.com/blog/2009/06/no-pruning-for-minmax-of-partition-key.html">no pruning for MIN/MAX of partition key column</a>: &#8220;Recently, I wanted to work out the maximum value of a column on a partitioned table. The column I wanted the maximum value for, happened to be the (single and only) partition key column. The table in question was range partitioned on this single key column, into monthly partitions for 2009, with data in all the partitions behind the current date, i.e. January through mid June were populated. There were no indexes on the table.&#8221; Jeff and his readers examine the evidence and discuss some workarounds to the problem.</p>
<p>Oracle, MySQL, PostgreSQL, SQL Server.  How&#8217;bout&nbsp;.&nbsp;.&nbsp;.&nbsp;</p>
<h3>NoSQL</h3>
<p>(No SQL?!?  Edwards, you&#8217;re mad!)  Well, it&#8217;s not me.  Here&#8217;s <a href="http://www.dbms2.com/2009/07/01/nosql-sql-alternative/"><strong>Curt Monash</strong> on NoSQL</a>: &#8220;Eric Lai emailed today to ask what I thought about the NoSQL folks, and especially whether I thought their ideas were useful for enterprises in general, as opposed to just Web 2.0 companies. That was the first I heard of NoSQL, which seems to be a community discussing SQL alternatives popular among the cloud/big-web-company set, such as BigTable, Hadoop, Cassandra and so on.&#8221;</p>
<p><a href="http://postgresql.blogg.se">PostgreSQL stuff</a> also had some thoughts on those who say <a href="http://postgresql.blogg.se/2009/july/no-to-sql.html">No to SQL</a>.  &#8220;Every time I see something or hear something like this I sigh a little bit. Not only when it&#8217;s related to SQL but in the world of computer professionals in general. &#8216;The right tool for the job&#8217; seems to be a hard concept to understand sometimes. I wonder why?&#8221;</p>
<p>Back to Oracle for a moment.  <a href="http://blog.tanelpoder.com"><strong>Tanel Poder</strong></a> has a <a href="http://blog.tanelpoder.com/2009/06/27/secret-preview-oracle-12g-cbo-leaked-from-oracle-labs">secret preview of Oracle 12g CBO leaked from Oracle labs</a>. Would <em>you</em> like fries with your cost-based optimizer?</p>
<p>That&#8217;s all for now.  See you in a week&#8217;s time!</p>
<img src="http://feeds.feedburner.com/~r/PythianGroupBlog/~4/TeTtJsL0iqc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/3268/log-buffer-152-a-carnival-of-the-vanities-for-dbas/feed</wfw:commentRss>
		<feedburner:origLink>http://www.pythian.com/news/3268/log-buffer-152-a-carnival-of-the-vanities-for-dbas</feedburner:origLink></item>
		<item>
		<title>Oracle 11g SE Switch-Over</title>
		<link>http://feedproxy.google.com/~r/PythianGroupBlog/~3/nill_3gttso/oracle-11g-se-switch-over</link>
		<comments>http://www.pythian.com/news/3140/oracle-11g-se-switch-over#comments</comments>
		<pubDate>Thu, 02 Jul 2009 17:08:44 +0000</pubDate>
		<dc:creator>Alisher Yuldashev</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[controlfile]]></category>

		<category><![CDATA[Oracle 11g]]></category>

		<category><![CDATA[standby]]></category>

		<category><![CDATA[switchover]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=3140</guid>
		<description><![CDATA[Recently, I tested a switchover on Oracle 11g SE1.
As you know, Oracle Database Standard Edition One&#8212;as well as Standard Edition&#8212;does not have the Data Guard feature. Therefore, I had to do everything manually.
The whole process took less than 15 minutes. This includes less than five minutes of full downtime to restart the database in READ-ONLY [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I tested a switchover on Oracle 11g SE1.</p>
<p>As you know, Oracle Database Standard Edition One&#8212;as well as Standard Edition&#8212;does not have the Data Guard feature. Therefore, I had to do everything manually.</p>
<p>The whole process took less than 15 minutes. This includes less than five minutes of full downtime to restart the database in READ-ONLY mode, and less than 10 minutes of READ-ONLY downtime.</p>
<p>Of course, it depends on the size of Redo logs and the network speed to move Redo logs from the primary server to standby.</p>
<p>Here is what I had. The primary database and one physical standby database:</p>
<ul>
<li><strong>OS - SUSE Linux ES10 (SP2) x86_64</strong></li>
<li><strong>Oracle - Release 11.1.0.7.0 64bit SE1</strong></li>
</ul>
<p>First of all, I switched the standby database to the primary role.</p>
<p><span id="more-3140"></span></p>
<p><strong>Step 1. Shutdown the primary database</strong></p>
<pre>
oracle@ora1 /u01/app/oracle/testdb/oradata&gt; sqlplus / as sysdba

SQL*Plus: Release 11.1.0.7.0 - Production

Copyright (c) 1982, 2008, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Release 11.1.0.7.0 - 64bit Production

SQL&gt; shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.</pre>
<p><strong>Step 2. Make a copy of the control file, the spfile, and the redo logs:</strong></p>
<pre>
SQL&gt; !cp control01.ctl copy/control01.ctl.primary
SQL&gt; !cp /u01/app/oracle/product/11.1.0/db_1/dbs/spfiletestdb.ora copy/spfiletestdb.ora.primary
SQL&gt; !cp *.log copy/</pre>
<p><strong>Step 3. Startup the primary database in READ-ONLY mode:</strong></p>
<pre>
SQL&gt; startup mount
ORACLE instance started.

Total System Global Area 1269366784 bytes
Fixed Size                  2159312 bytes
Variable Size             754978096 bytes
Database Buffers          503316480 bytes
Redo Buffers                8912896 bytes
Database mounted.
SQL&gt; alter database open read only;

Database altered.
SQL&gt; exit
Disconnected from Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
</pre>
<p><strong>Step 4. Copy all needed archive logs, the copy of the control file, the spfile, and the redo logs to the standby server ora2:</strong></p>
<pre>
oracle@ora1 /u01/app/oracle/testdb/oradata&gt; scp ../archivelogs/1_152_333215132.dbf oracle@ora2:/u01/app/oracle/testdb/archivelogs/
oracle@ora1 /u01/app/oracle/testdb/oradata&gt; scp copy/control01.ctl.primary oracle@ora2:/u01/app/oracle/testdb/oradata/copy/
oracle@ora1 /u01/app/oracle/testdb/oradata&gt; scp copy/spfilepb.ora.primary oracle@ora2:/u01/app/oracle/testdb/oradata/copy/
oracle@ora1 /u01/app/oracle/testdb/oradata&gt; scp copy/redo01.log oracle@ora2:/u01/app/oracle/testdb/oradata/
oracle@ora1 /u01/app/oracle/testdb/oradata&gt; scp copy/redo02.log oracle@ora2:/u01/app/oracle/testdb/oradata/
oracle@ora1 /u01/app/oracle/testdb/oradata&gt; scp copy/redo03.log oracle@ora2:/u01/app/oracle/testdb/oradata/
</pre>
<p><strong>Step 5. Apply all needed archive logs on the standby database:</strong></p>
<pre>
oracle@ora2 /u01/app/oracle/testdb/oradata&gt; sqlplus / as sysdba

SQL*Plus: Release 11.1.0.7.0 - Production

Copyright (c) 1982, 2008, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Release 11.1.0.7.0 - 64bit Production

SQL&gt; recover standby database until cancel;
ORA-00279: change 2244877 generated at 10/07/2008 14:40:18 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/testdb/archivelogs/1_152_333215132.dbf
ORA-00280: change 2244877 for thread 1 is in sequence #152

Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00279: change 2245162 generated at 10/07/2008 14:53:27 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/testdb/archivelogs/1_153_333215132.dbf
ORA-00280: change 2245162 for thread 1 is in sequence #153
ORA-00278: log file '/u01/app/oracle/testdb/archivelogs/1_152_333215132.dbf' no
longer needed for this recovery

Specify log: {=suggested | filename | AUTO | CANCEL}
CANCEL
Media recovery cancelled.
</pre>
<p><strong>Step 6. Shutdown the standby database:</strong></p>
<pre>
SQL&gt; shutdown
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
</pre>
<p><strong>Step 7. Make a copy of the controlfile and the spfile.</strong></p>
<p>To make it easier I just switched spfiles.</p>
<pre>
SQL&gt; !cp control01.ctl copy/control01.ctl.stndby
SQL&gt; !scp copy/control01.ctl.stndby oracle@ora1:/u01/app/oracle/testdb/oradata/copy/
SQL&gt; !cp /u01/app/oracle/product/11.1.0/db_1/dbs/spfiletestdb.ora copy/spfiletestdb.ora.stndby
SQL&gt; !scp copy/spfilepb.ora.stndby oracle@ora1:/u01/app/oracle/testdb/oradata/copy/
</pre>
<p><strong>Step 8. Replace the standby controlfile and spfile with the copy of the primary control file and spfile:</strong></p>
<pre>
SQL&gt; !rm control*.ctl
SQL&gt; !rm /u01/app/oracle/product/11.1.0/db_1/dbs/spfiletestdb.ora
SQL&gt; !cp copy/spfiletestdb.ora.primary /u01/app/oracle/product/11.1.0/db_1/dbs/spfiletestdb.ora
SQL&gt; !cp copy/control01.ctl.primary control01.ctl
SQL&gt; !cp copy/control01.ctl.primary control02.ctl
SQL&gt; !cp copy/control01.ctl.primary control03.ctl
</pre>
<p><strong>Step 9. Switch the standby database to the primary role:</strong></p>
<pre>
SQL&gt; startup mount
ORACLE instance started.

Total System Global Area 1269366784 bytes
Fixed Size                  2159312 bytes
Variable Size             754978096 bytes
Database Buffers          503316480 bytes
Redo Buffers                8912896 bytes
Database mounted.
SQL&gt; recover database;
Media recovery complete.
SQL&gt; alter database tempfile '/u01/app/oracle/testdb/oradata/temp01.dbf' drop;

Database altered.

SQL&gt; alter database open;

Database altered.

SQL&gt; alter tablespace temp add tempfile '/u01/app/oracle/testdb/oradata/temp01.dbf' size 100m reuse autoextend on next 100m maxsize 2048m;

Tablespace altered.

SQL&gt; select CONTROLFILE_TYPE, OPEN_MODE, DATABASE_ROLE, STANDBY_BECAME_PRIMARY_SCN from v$database;

CONTROL OPEN_MODE  DATABASE_ROLE    STANDBY_BECAME_PRIMARY_SCN
------- ---------- ---------------- --------------------------
CURRENT READ WRITE PRIMARY                             2244877

SQL&gt; exit
Disconnected from Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
</pre>
<p>And finally, I switched the old primary database to the standby role.</p>
<p><strong>Step 10. Shutdown the old primary database:</strong></p>
<pre>
oracle@ora1 /u01/app/oracle/testdb/oradata&gt; sqlplus / as sysdba

SQL*Plus: Release 11.1.0.7.0 - Production

Copyright (c) 1982, 2008, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Release 11.1.0.7.0 - 64bit Production

SQL&gt; shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
</pre>
<p><strong>Step 11. Replace the old primary control file and spfile with the copy of the standby control file and spfile</strong></p>
<pre>
SQL&gt; !rm control*.ctl
SQL&gt; !rm /u01/app/oracle/product/11.1.0/db_1/dbs/spfiletestdb.ora
SQL&gt; !rm temp01.dbf
SQL&gt; !rm *.log
SQL&gt; !cp copy/spfiletestdb.ora.stndby /u01/app/oracle/product/11.1.0/db_1/dbs/spfiletestdb.ora
SQL&gt; !cp copy/control01.ctl.stndby control01.ctl
SQL&gt; !cp copy/control01.ctl.stndby control02.ctl
SQL&gt; !cp copy/control01.ctl.stndby control03.ctl
</pre>
<p><strong>Step 12. Switch the old primary database to the standby role:</strong></p>
<pre>
SQL&gt; startup mount
ORACLE instance started.

Total System Global Area 1269366784 bytes
Fixed Size                  2159312 bytes
Variable Size             754978096 bytes
Database Buffers          503316480 bytes
Redo Buffers                8912896 bytes
Database mounted.

SQL&gt; select CONTROLFILE_TYPE, OPEN_MODE, DATABASE_ROLE from v$database;

CONTROL OPEN_MODE  DATABASE_ROLE
------- ---------- ----------------
STANDBY MOUNTED    PHYSICAL STANDBY

SQL&gt; exit
Disconnected from Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
</pre>
<p>So you can see that Oracle 11g SE1 (SE) switchover of primary database and one physical database located on different servers is a very simple process. But if you have the physical standby on the same server and use OMF, you should consider two things.</p>
<ol>
<li>How to change the path to the datafiles and redo logs in the control files;
<p><strong>Solution:</strong>In Step 9, after the database is mounted and before it is opened, all datafiles and redo logs should be renamed using the <code>ALTER DATABASE RENAME FILE</code> command.</li>
<li>How not to remove the old datafiles. OMF will remove the old files after the <code>RENAME</code> command.
<p><strong>Workaround:</strong> Move the files to a temporary directory and move them back after the <code>RENAME</code> command. The old primary database should be down.
</li>
</ol>
<p>The same process can be done with a RAC database. </p>
<p>And do not forget to make a database backup in case something goes wrong.</p>
<img src="http://feeds.feedburner.com/~r/PythianGroupBlog/~4/nill_3gttso" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/3140/oracle-11g-se-switch-over/feed</wfw:commentRss>
		<feedburner:origLink>http://www.pythian.com/news/3140/oracle-11g-se-switch-over</feedburner:origLink></item>
		<item>
		<title>Concerns and What Does Not Work in XtraDB Backup</title>
		<link>http://feedproxy.google.com/~r/PythianGroupBlog/~3/vB-Y9gwg6tg/concerns-and-what-does-not-work-in-xtradb-backup</link>
		<comments>http://www.pythian.com/news/3241/concerns-and-what-does-not-work-in-xtradb-backup#comments</comments>
		<pubDate>Tue, 30 Jun 2009 23:06:53 +0000</pubDate>
		<dc:creator>Sheeri Cabral</dc:creator>
		
		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Non-Tech Articles]]></category>

		<category><![CDATA[backup]]></category>

		<category><![CDATA[InnoDB]]></category>

		<category><![CDATA[innodb hot backup]]></category>

		<category><![CDATA[xtrabackup]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=3241</guid>
		<description><![CDATA[A short time ago I posted how I was Using XtraDB Backup to backup InnoDB.  Overall, the blog post was positive, but experiences that others have had (and commented to on that blog post) have made me want to put out another short article about using XtraDB backup.
The first few points remain the same [...]]]></description>
			<content:encoded><![CDATA[<p>A short time ago I posted how I was <A HREF=http://www.pythian.com/news/2850/using-xtradb-backup>Using XtraDB Backup</A> to backup InnoDB.  Overall, the blog post was positive, but experiences that others have had (and commented to on that blog post) have made me want to put out another short article about using XtraDB backup.</p>
<p>The first few points remain the same &#8212; the backup process is stable, we were able to use the binaries without compiling, and using Innobackupex as the wrapper script, analogous to Innobackup.pl.  </p>
<p>However, we did figure out why Xtrabackup had to be run as the mysql user:</p>
<p>Xtrabackup writes to the data dictionary file (ibdata1, for example).  We have not examined if it also writes to the data and index files (still ibdata1 by default, or the .ibd files when using innodb_file_per_table).  [<strong>EDIT</strong>: The authors of Xtrabackup have commented below as to why the write occurs:</p>
<blockquote><p>xtrabackup is kind of very small and restricted instance of InnoDB, and reuses a lot of InnoDB code.</p>
<p>InnoDB by default requires O_RDWR option on ibdata1 files at start, and xtrabackup therefore also did that. In the latest push to trunk it was fixed, now xtrabackup opens file with O_RDONLY flag.</p></blockquote>
<p>When the new version is released, we will be sure to test it so that we can run the backup as a read-only user, and report back.]</p>
<p>On the one hand, Xtrabackup is a free tool.  On the other hand, modifying InnoDB&#8217;s underlying files risks corrupting all the InnoDB tables in the system.  Which is a tricky situation when it is your backup tool that might cause corruption that is beyond repair, as you do not know if you can trust your backups.<br />
<span id="more-3241"></span></p>
<p>Regarding the complaint Dan R commented on the previous post that innobackupex could stream the backup to gzip, and helpfully gave the syntax.  Shlomi Noach also pointed out streaming as a feature of Xtrabackup that ibbackup does not have.  However, Gerry Narvaja, a co-worker noted (and commented): </p>
<blockquote><p>
I&#8217;ve been trying to install xtrabackup/innobackupex for a customer and I&#8217;m finding a few glitches, especially w/ streaming:</p>
<p>      We use innoback(ex) wrapped in our own scripts to allow for rotation and other operations. We also use ZRM for some installations, so this would apply to integration with this tool as well. These are the glitches I found:</p>
<p>      1. Using streaming by piping it into &#8216;gzip&#8217; masks the return code from innobackupex.pl. Since gzip will almost always return 0, you can’t rely on it to determine backup success.</p>
<p>      2. The next alternative would be to review the innobackupex.pl&#8217;s output for the OK at the end. But since it redirects the output to &#8217;stderr&#8217; to allow for streaming, you need to add &#8220;2> innobackupex.log&#8221; before piping and grep for the &#8220;OK&#8221; at the end.</p></blockquote>
<p>and noted that there were some limitations:</p>
<blockquote><p>innobackupex script is limited in the type of options you can specify compared to what the xtrabackup executable supports. I find this annoying since it limits the directories where you can have the backups, data directories and logs.</p>
<p>Xtrabackup doesn&#8217;t work for MySQL v4.1. In the Percona forums there was a suggestion that the 5.0 patch should work. This is true, but xtrabackup.c has other dependencies on 5.x definitions and structures I didn’t have time to review. Baron Schwartz correctly suggested that these dependencies might be trivial in a tweet directed to myself. I&#8217;ll post my findings to the Percona forums and hopefully we can soon have a patched version.
</p></blockquote>
<img src="http://feeds.feedburner.com/~r/PythianGroupBlog/~4/vB-Y9gwg6tg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/3241/concerns-and-what-does-not-work-in-xtradb-backup/feed</wfw:commentRss>
		<feedburner:origLink>http://www.pythian.com/news/3241/concerns-and-what-does-not-work-in-xtradb-backup</feedburner:origLink></item>
		<item>
		<title>Pythian Goes to FISL 10</title>
		<link>http://feedproxy.google.com/~r/PythianGroupBlog/~3/XrZ3zZ2dHos/pythian-goes-to-fisl-10</link>
		<comments>http://www.pythian.com/news/3136/pythian-goes-to-fisl-10#comments</comments>
		<pubDate>Tue, 30 Jun 2009 16:53:35 +0000</pubDate>
		<dc:creator>Augusto Bott</dc:creator>
		
		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Non-Tech Articles]]></category>

		<category><![CDATA[appearances]]></category>

		<category><![CDATA[conferences]]></category>

		<category><![CDATA[FISL]]></category>

		<category><![CDATA[papers]]></category>

		<category><![CDATA[presentations]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=3136</guid>
		<description><![CDATA[Hi All!
This year, the International Free Software Forum celebrated its 10th anniversary. It happened last week in Porto Alegre.
Pythian presented a session on Thursday called 8 Rules for Designing More Secure Applications with MySQL. 
As promised, here are the slides we used on that session: 8 Simple Rules to Design Secure Apps with MySQL (PDF).
Cheers!
]]></description>
			<content:encoded><![CDATA[<p>Hi All!</p>
<p>This year, the <a href="http://www.fisl.org.br/10/www/">International Free Software Forum</a> celebrated its 10<sup>th</sup> anniversary. It happened last week in <a href="http://en.wikipedia.org/wiki/Porto_Alegre">Porto Alegre</a>.</p>
<p>Pythian presented a session on Thursday called <a href="http://fisl.softwarelivre.org/10/papers/pub/programacao/526">8 Rules for Designing More Secure Applications with MySQL</a>. </p>
<p>As promised, here are the slides we used on that session: <a href='http://www.pythian.com/news/wp-content/uploads/fisl-8-rules.pdf'>8 Simple Rules to Design Secure Apps with MySQL (PDF)</a>.</p>
<p>Cheers!</p>
<img src="http://feeds.feedburner.com/~r/PythianGroupBlog/~4/XrZ3zZ2dHos" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/3136/pythian-goes-to-fisl-10/feed</wfw:commentRss>
		<feedburner:origLink>http://www.pythian.com/news/3136/pythian-goes-to-fisl-10</feedburner:origLink></item>
		<item>
		<title>Log Buffer #151: a Carnival of the Vanities for DBAs</title>
		<link>http://feedproxy.google.com/~r/PythianGroupBlog/~3/ZqOBBNdgLj0/log-buffer-151-a-carnival-of-the-vanities-for-dbas</link>
		<comments>http://www.pythian.com/news/3205/log-buffer-151-a-carnival-of-the-vanities-for-dbas#comments</comments>
		<pubDate>Fri, 26 Jun 2009 16:45:27 +0000</pubDate>
		<dc:creator>David Edwards</dc:creator>
		
		<category><![CDATA[Log Buffer]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Non-Tech Articles]]></category>

		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[PostgreSQL]]></category>

		<category><![CDATA[SQL Server]]></category>

		<category><![CDATA[DB2]]></category>

		<category><![CDATA[Firebird]]></category>

		<category><![CDATA[Informix]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=3205</guid>
		<description><![CDATA[Welcome to the 151st edition of Log Buffer, the weekly review of database blogs.  We&#8217;re going to take a fast tour through the best blogs from the week gone by, beginning this time, with Oracle.
Jonathan Lewis writes, &#8220;It occurred to me recently that I might be making casual use of terms that weren’t necessarily [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to the 151<sup>st</sup> edition of <a href="http://www.pythian.com/news/about-log-buffer"><em>Log Buffer</em></a>, the weekly review of database blogs.  We&#8217;re going to take a fast tour through the best blogs from the week gone by, beginning this time, with <strong>Oracle</strong>.</p>
<p><a href="http://jonathanlewis.wordpress.com"><strong>Jonathan Lewis</strong></a> writes, &#8220;It occurred to me recently that I might be making casual use of terms that weren’t necessarily very well known to the less experienced user. So I’ve decided to build a <a href="http://jonathanlewis.wordpress.com/2009/06/23/glossary/">glossary of terms</a> – and I’ll try to add to it from time to time whenever I have a few minutes.&#8221;</p>
<p>Jonathan might want to add &#8220;Method R&#8221; to the glossary. <a href="http://carymillsap.blogspot.com"><strong>Cary Millsap</strong></a> was making it understood, as he shows in <a href="http://carymillsap.blogspot.com/2009/06/profiling-with-my-boy.html">Profiling with my Boy</a>: &#8220;Today I&#8217;m going to raise the stakes, because yesterday I think I explained Method R so that an eleven year-old could understand it.&#8221;</p>
<p><a href="http://viveklsharma.blogspot.com"><strong>Vivek Sharma</strong></a> offers a thorough look at the <a href="http://viveklsharma.blogspot.com/2009/06/cost-based-optimizer-inefficient-input.html">Cost-Based Optimizer: Inefficient Input yields Inefficient Output</a>. Vivek begins, &#8220;Cost Based Optimizer has always been a mystery for most of the Database Administrators and Developers. &nbsp;.&nbsp;.&nbsp;.&nbsp; Cost Based Optimizer has improved a lot in previous few versions. Therefore, it can be said that CBO is still undergoing some enhancements. With these enhancements, Oracle Users have accepted the fact that the Application Performance might degrade after version upgrade&nbsp;.&nbsp;.&nbsp;.&nbsp;&#8221;</p>
<p><a href="http://oracle-randolf.blogspot.com"><strong>Randolf Geist</strong></a> had some info to share on the matter of <a href="http://oracle-randolf.blogspot.com/2008/08/locked-table-statistics-and-subsequent.html">locked table statistics and subsequent create index</a>. &#8220;&nbsp;.&nbsp;.&nbsp;.&nbsp;in 10g and later index statistics are generated along with an index creation &nbsp;.&nbsp;.&nbsp;.&nbsp; so a newly created index usually has computed statistics. 10g also introduced the option to lock table statistics.  Now if you lock statistics in 10g in later &nbsp;.&nbsp;.&nbsp;.&nbsp; and create an index on a locked table the statistics for the index will not be generated along with the CREATE INDEX command.&#8221;</p>
<p><a href="http://rwijk.blogspot.com"><strong>Rob van Wijk</strong></a> gave us part three of his series on <a href="http://rwijk.blogspot.com/2009/06/fast-refreshable-materialized-view.html">fast refreshable materialized view errors: aggregate MV&#8217;s</a>. &#8220;In the third part I&#8217;m going to examine all restrictions for aggregate materialized views, as described in the documentation.  &nbsp;.&nbsp;.&nbsp;.&nbsp; So this will be quite a lengthy and even tedious post, as you can imagine by the list above &#8230; but for a good cause.&#8221;</p>
<p><span id="more-3205"></span></p>
<p>In <strong>MySQL</strong> blogs, the <a href="http://www.mysqlperformanceblog.com">MySQL Performance Blog</a> <a href="http://www.mysqlperformanceblog.com/2009/06/18/announcing-perconatv">announced Percona.tv</a>.  Ryan Loew writes, &#8220;We’ll be uploading technical screencasts, conference video, and anything else cool we can think up.&#8221;</p>
<p><a href="http://openquery.com/blog/">The Open Query blog</a> published <a href="http://openquery.com/blog/good-practice-bad-practice-table-aliases">Good Practice/Bad Practice: Table Aliases</a>. &#8220;When writing queries, try making a habit out of using short table aliases, no matter how small the query is.&#8221; An example using the World DB follows, as does a worthwhile discussion.</p>
<p><a href="http://rpbouman.blogspot.com"><strong>Roland Bouman</strong></a> examined <a href="http://rpbouman.blogspot.com/2009/06/mysql-stored-functions-impact-of.html">MySQL stored functions: the impact of DECLARE HANDLER on performance</a>, responding to <a href="http://blogs.mysql.com/peterg/2009/06/17/get-the-error-return-value-in-a-variable/"><em>Get the error return value in a variable</em></a> by Peter Gulutzan.</p>
<p><a href="http://ronaldbradford.com/blog"><strong>Ronald Bradford</strong></a> looked into <a href="http://ronaldbradford.com/blog/using-statpack-with-show-status-2009-06-18">using statpack with SHOW STATUS</a>. He writes: &#8220;Mark Leith, on of the MySQL Support Team managers wrote some time ago a very nice utility I use often called Statpack.  &nbsp;.&nbsp;.&nbsp;.&nbsp;  Over time I’ve grown to love it’s simplicity, but notice a number of shortcomings.   &nbsp;.&nbsp;.&nbsp;.&nbsp; This post is more about detailing those little annoyances that I’d like to improve, or see improved.&#8221;</p>
<p><a href="http://mtocker.livejournal.com"><strong>Morgan Tocker</strong></a> writes, &#8220;I think 5.1 gets some bad press for not being a compelling upgrade. It&#8217;s not the big features that make the difference, but the subtle ones. I wanted to highlight some of the these that may make your life easier when it&#8217;s time to upgrade&nbsp;.&nbsp;.&nbsp;.&nbsp;&#8221; The post is <a href="http://mtocker.livejournal.com/50441.html"><em>Hidden gems in 5.1</em></a>.</p>
<p>Let&#8217;s turn to SQL Server now, starting with a post from <strong>Aaron Alton</strong>, <a href="http://thehobt.blogspot.com">The HOBT</a>. He writes, &#8220;If you’ve been working with SQL Server for any length of time, you’ve probably seen a number of different variations of the UPDATE command.  &nbsp;.&nbsp;.&nbsp;.&nbsp; Anyway, today’s blog post is more like a public service announcement. It seems that all too many developers are still dangerously unaware of the ability to create very ambiguous UPDATE statements in TSQL.&#8221; Click through for <a href="http://thehobt.blogspot.com/2009/06/tricky-updates-weird-wacky-and.html">Tricky Updates: Weird, Wacky, and Wonderful UPDATE Syntax Variations in SQL Server</a>.</p>
<p><a href="http://sqlblog.com/blogs/louis_davidson"><strong>Louis Davidson</strong></a> looked into the question of <a href="http://sqlblog.com/blogs/louis_davidson/archive/2009/06/20/read-write-ratio-versus-read-write-ratio.aspx">read/write ratio versus read/write ratio</a>.  That&#8217;s what it says, really.  </p>
<p><a href="http://sqlblog.com/blogs/alexander_kuznetsov"><strong>Alexander Kuznetsov</strong></a> posted one of those skill-testing quizzes&#8212;<a href="http://sqlblog.com/blogs/alexander_kuznetsov/archive/2009/06/21/calculating-third-wednesday-of-the-month-with-inline-udfs.aspx">calculating third Wednesday of the month with inline UDFs</a>. Alexander begins, &#8220;Problems such as calculating third Wednesday of the month or the last day of the month are very common. Recently Peter Larsson posted a scalar UDF that solves problems such as &#8216;third Wednesday of the month&#8217;, and Uri Dimant added a comment with a solution by Steve Kass. Unfortunately, all these solutions use scalar UDFs and as such are very slow, so I decided to post some very fast inline UDFs that I find very useful.&#8221;</p>
<p><a href="http://sqlblog.com/blogs/linchi_shea/archive"><strong>Linchi Shea</strong></a> also was working the paradoxes: <a href="http://sqlblog.com/blogs/linchi_shea/archive/2009/06/22/performance-impact-logical-scan-fragmentation-100-may-not-be-as-bad-as-85.aspx"><em>Performance impact: Logical scan fragmentation &#8212; 100% may not be as bad as 85%</em></a>. &#8220;In [a] previous post I asked whether 100% logical scan fragmentation is always worse than 85% local scan fragmentation for table/index scans. &nbsp;.&nbsp;.&nbsp;.&nbsp; The answer is no. 100% logical scan fragmentation is not always worse than 85% logical scan fragmentation in terms of table or clustered index scans. And the following is an example.&#8221;</p>
<p>Reading is cool.  I learned this from <a href="http://en.wikipedia.org/wiki/The_fonz">the Fonz</a>.  But look at this, <a href="http://facility9.com"><strong>Jeremiah Peschka</strong></a> says there are circumstances <a href="http://facility9.com/2009/06/18/when-less-reading-is-a-good-thing">when less reading is a good thing</a>. I&#8217;m confused! What else does he say?  &#8220;Less reading is a good thing when you’re reading from a physical disk.&#8221;  Ahhh. &#8220;During some recent performance tuning, I stumbled across a little gem of a stored procedure that was producing between 4,000 and 11,000 physical reads every time it was called. &nbsp;.&nbsp;.&nbsp;.&nbsp; It returns a list of state abbreviations. I’m not proud to say that I wrote it, but I have to come clean: I wrote it. So, how did I fix this travesty of my youthful ignorance?&#8221;  I bet he hits his server machine in just the right way.</p>
<p>In <strong>PostgreSQL</strong> blogs, <a href="http://justatheory.com"><strong>David Wheeler</strong></a> and his readers discussed the <a href="http://justatheory.com/computers/databases/postgresql/set_testing_update.html">pgTAP Set-Testing Update</a>.</p>
<p><a href="http://www.postgresonline.com/journal">The Postgres OnLine</a> Journal exposed a <a href="http://www.postgresonline.com/journal/index.php?/archives/121-Restore-of-functional-indexes-gotcha.html">restore of functional indexes gotcha</a>.</p>
<p>In the <strong>DB2</strong> world, <a href="http://www.db2portal.com"><strong>Craig Mullins</strong></a> advised: <a href="http://www.db2portal.com/2009/06/know-your-isolation-levels.html">know your ISOLATION levels</a>.  Craig writes, &#8220;Did you know that DB2 provides a way to change the way that a program or SQL statement acquires locks? That way is known as the isolation level and it can be set to specify the locking behavior for a transaction or statement.&#8221;</p>
<p><a href="http://it.toolbox.com/blogs/db2zos"><strong>Willie Favero</strong></a> published the second of a couple articles collecting <a href="http://it.toolbox.com/blogs/db2zos/continuing-on-with-last-fridays-post-32395">resources for both DB2 z/OS and DB2 LUW</a>.</p>
<p>That&#8217;s all for now.  Please add your favourite blogs from this week to the comments.  And of course, don&#8217;t forget that you can publish an edition of <em>Log Buffer</em> on your own blog.  Just <a href="mailto://logbuffercoordinator@pythian.com?Subject=Log%20Buffer">send me an email</a> to get started.</p>
<p>Till next time!</p>
<img src="http://feeds.feedburner.com/~r/PythianGroupBlog/~4/ZqOBBNdgLj0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/3205/log-buffer-151-a-carnival-of-the-vanities-for-dbas/feed</wfw:commentRss>
		<feedburner:origLink>http://www.pythian.com/news/3205/log-buffer-151-a-carnival-of-the-vanities-for-dbas</feedburner:origLink></item>
		<item>
		<title>Sydney MySQL User Group: SMUG#7 — The Reboot</title>
		<link>http://feedproxy.google.com/~r/PythianGroupBlog/~3/jVnIBrb3tnA/sydney-mysql-user-group-smug7-the-reboot</link>
		<comments>http://www.pythian.com/news/3192/sydney-mysql-user-group-smug7-the-reboot#comments</comments>
		<pubDate>Fri, 26 Jun 2009 09:17:02 +0000</pubDate>
		<dc:creator>Alex Gorbachev</dc:creator>
		
		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Australia]]></category>

		<category><![CDATA[Heartbeat]]></category>

		<category><![CDATA[meetup]]></category>

		<category><![CDATA[migrations]]></category>

		<category><![CDATA[SMUG]]></category>

		<category><![CDATA[Sydney]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=3192</guid>
		<description><![CDATA[Reanimating the Sydney MySQL User Group!
What: Sydney MySQL User Group meetup #7 - The Reboot
When: July 16, 2009 5:30 PM (please don&#8217;t forget to RSVP yes/no/maybe)
Where: Sydney, CBD - join the meetup for exact location.
We are back! After 3 years of being silent, SMUG (can I call it so? I know there are conflicts with [...]]]></description>
			<content:encoded><![CDATA[<p>Reanimating the <a href="http://www.sydneymysql.com.au/">Sydney MySQL User Group</a>!</p>
<p><strong>What:</strong> <a href="http://www.sydneymysql.com.au/calendar/10739905/">Sydney MySQL User Group meetup #7 - The Reboot</a></p>
<p><strong>When:</strong> July 16, 2009 5:30 PM (please don&#8217;t forget to <a href="http://www.sydneymysql.com.au/calendar/10739905/">RSVP yes/no/maybe</a>)</p>
<p><strong>Where:</strong> <a href="http://www.sydneymysql.com.au/venue/996766/">Sydney, CBD</a> - join the meetup for exact location.</p>
<p><b>We are back!</b> After 3 years of being silent, <a href="http://www.sydneymysql.com.au/">SMUG</a> <i>(can I call it so? I know there are conflicts with other acronyms)</i> resurrects the meetings.</p>
<p>The logistic of the meetup is the following:</p>
<ul>
<li>5:30pm &#8212; the gathering starts and we have pizza and beers and talking your peers</li>
<li>6:00pm &#8212; we start the presentation</li>
<li>7:00pm &#8212; break and peer networking consuming the leftovers</li>
<li>7:30pm &#8212; we have an open (but slightly moderated) discussion. Topic is TBC. Perhaps, we can talk about future of MySQL now that Oracle&#8217;s bought Sun?</li>
</ul>
<p><span id="more-3192"></span><br />
The schedule is very approximate and we will be quite flexible. We should finish about 8:30pm.</p>
<p><u>Presentation: <b>Migrating 1 Terabyte Database to MySQL &#8212; Case Study</b> by Alex Gorbachev</u> <em>(well, that&#8217;s me)</em>.</p>
<p>This presentation is based on the real project migrating from RDB on OpenVMS to MySQL on Linux. We will review the migration of the data itself and what infrastructure has been setup &#8212; high availability cluster with Heartbeat, DR site replication, organizing backup for 1 TB database. The system has been successfully put in production few months ago.</p>
<p>The attendance is completely free but of course someone need to cover the venue and that great stuff we are going to eat and drink so&#8230;</p>
<p>My company, <a href="http://www.pythian.com/">The Pythian Group</a>, is sponsoring the SMUG for now. You probably heard of Pythian, the leading provider of <a href="http://www.pythian.com/services/">database services</a> for MySQL as well as Oracle and SQL Server.</p>
<p>Nice people from <a href="http://www.navicat.com/>PremiumSoft</a>, the creator of <a href="http://www.navicat.com/en/products.html>Navicat</a>, kindly offered to join us sponsoring the pizza and drinks. If you happen to manage MySQL databases you probably heard for Navicat, an award-winning database administration tool. More details - <a href="http://www.navicat.com/en/products/navicat_mysql/mysql_overview.html">http://www.navicat.com/en/products/navicat_mysql/mysql_overview.html</a></p>
<p>Those of you in Sydney &#8212; looking forward to see you all there.</p>
<img src="http://feeds.feedburner.com/~r/PythianGroupBlog/~4/jVnIBrb3tnA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/3192/sydney-mysql-user-group-smug7-the-reboot/feed</wfw:commentRss>
		<feedburner:origLink>http://www.pythian.com/news/3192/sydney-mysql-user-group-smug7-the-reboot</feedburner:origLink></item>
		<item>
		<title>Scalable Internet Architectures</title>
		<link>http://feedproxy.google.com/~r/PythianGroupBlog/~3/OwhnlixXgLw/scalable-internet-architectures</link>
		<comments>http://www.pythian.com/news/3186/scalable-internet-architectures#comments</comments>
		<pubDate>Thu, 25 Jun 2009 16:08:35 +0000</pubDate>
		<dc:creator>Paul Vallee</dc:creator>
		
		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[PostgreSQL]]></category>

		<category><![CDATA[SQL Server]]></category>

		<category><![CDATA[SysAdmin]]></category>

		<category><![CDATA[Architecture]]></category>

		<category><![CDATA[omniti]]></category>

		<category><![CDATA[scalability]]></category>

		<category><![CDATA[systems]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=3186</guid>
		<description><![CDATA[My old friend and collaborator Theo Schlossnagle at OmniTI posted his slides from his Scalable Internet Architectures talk at VelocityConf 2009.
The slides are brilliant even without seeing Theo talk and I highly recommend the time it takes to flip through them, for anyone who is interested in systems performance. If anyone took an mp3 of [...]]]></description>
			<content:encoded><![CDATA[<p>My old friend and collaborator <a href=http://lethargy.org/~jesus/>Theo Schlossnagle</a> at <a href=http://www.omniti.com>OmniTI</a> posted his slides from his Scalable Internet Architectures talk at VelocityConf 2009.</p>
<p>The slides are brilliant even without seeing Theo talk and I highly recommend the time it takes to flip through them, for anyone who is interested in systems performance. If anyone took an mp3 of this talk I&#8217;m dying to hear it, please let me know.</p>
<p>For those of you unfamiliar with OmniTI, Theo is the CEO of this rather remarkable company specializing in Internet-scale architecture consulting. They generalize on Internet-scale architecture, not on one specific dimension the way Pythian specializes on the database tier. This allows them to see Internet-scale workloads from a unique systemic, multidisciplinary point of view; from the user experience all the way up the stack, through the load balancer (or not), the front-end cache, the application server, the database server, the operating system, the storage, and so on. This approach lets them build Internet architectures and solve scalability problems in a unique and powerful, wholistic way. </p>
<p>Pythian first collaborated with OmniTI in 2001, and they deserve all of their success and profile that they&#8217;ve built since then. Trivia: both Pythian and OmniTI were founded in September 1997 and both companies continue to be majority-owned and controlled by founders (in Pythian&#8217;s case, yours truly).</p>
<p>Here&#8217;s the slide deck. Let me know your thoughts. </p>
<div style="width:425px;text-align:left" id="__ss_1626251"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/postwait/scalable-internet-architecture?type=presentation" title="Scalable Internet Architecture">Scalable Internet Architecture</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=scalable2009-090623110653-phpapp02&#038;stripped_title=scalable-internet-architecture" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=scalable2009-090623110653-phpapp02&#038;stripped_title=scalable-internet-architecture" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/postwait">postwait</a>.</div>
</div>
<img src="http://feeds.feedburner.com/~r/PythianGroupBlog/~4/OwhnlixXgLw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/3186/scalable-internet-architectures/feed</wfw:commentRss>
		<feedburner:origLink>http://www.pythian.com/news/3186/scalable-internet-architectures</feedburner:origLink></item>
		<item>
		<title>Installing Oracle 11gR1 on Ubuntu 9.04 Jaunty Jackalope</title>
		<link>http://feedproxy.google.com/~r/PythianGroupBlog/~3/bYqApFnJzjc/installing-oracle-11gr1-on-ubuntu-904-jaunty-jackalope</link>
		<comments>http://www.pythian.com/news/2329/installing-oracle-11gr1-on-ubuntu-904-jaunty-jackalope#comments</comments>
		<pubDate>Tue, 23 Jun 2009 17:50:11 +0000</pubDate>
		<dc:creator>Augusto Bott</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[debian]]></category>

		<category><![CDATA[Installing]]></category>

		<category><![CDATA[Jackalope]]></category>

		<category><![CDATA[jaunty]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[parted]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<category><![CDATA[upgrade]]></category>

		<category><![CDATA[VirtualBox]]></category>

		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=2329</guid>
		<description><![CDATA[Welcome, readers! It&#8217;s time for another update to our series of posts on installing Oracle on Ubuntu Linux. In this edition, we&#8217;ll be installing Oracle 11g R1 on Ubuntu 9.04, both 32-bit. 
This time, I&#8217;ve used VirtualBox to run a virtual machine (VM) to perform our work. (Virtualization has a number of advantages; in this [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome, readers! It&#8217;s time for another update to our series of posts on installing Oracle on Ubuntu Linux. In this edition, we&#8217;ll be installing Oracle 11g R1 on Ubuntu 9.04, both 32-bit. </p>
<p>This time, I&#8217;ve used <a href="http://www.virtualbox.org/">VirtualBox</a> to run a virtual machine (VM) to perform our work. (<a href="http://www.pythian.com/news/tag/virtualization">Virtualization</a> has a number of advantages; in this case, I made several trial installs, trying different combinations and configurations.  Having a pristine, basic set-up accelerated the whole process, since I didn&#8217;t had to reinstall from scratch on every new attempt.)</p>
<p>You might want to review the previous editions of this series, as there are technical references on this text fully detailed on previous posts. See these HOWTOs for Ubuntu:</p>
<ul>
<li><a href="http://www.pythian.com/news/1355/installing-oracle-11gr1-on-ubuntu-810-intrepid-ibex">8.10 - Intrepid Ibex</a></li>
<li><a href="http://www.pythian.com/news/968/installing-oracle-11g-on-ubuntu-804-lts-hardy-heron">8.04 - Hardy Heron</a></li>
<li><a href="http://www.pythian.com/news/654/installing-oracle-11g-on-ubuntu-linux-710-gutsy-gibbon">7.10 - Gutsy Gibbon</a></li>
<li><a href="http://www.pythian.com/news/549/installing-oracle-11g-on-ubuntu-linux-704">7.04 - Feisty Fawn</a></li>
</ul>
<p>Since we&#8217;re installing on a VM, we&#8217;ll be using <a href="http://www.ubuntu.com/getubuntu/download-server">Ubuntu 9.04 32-bit Server edition, </a>, so let&#8217;s download it and check the <a href="http://en.wikipedia.org/wiki/MD5">MD5sum</a>:</p>
<pre>
user@jackalope:/media/trezentos/downloads$ md5sum ubuntu-9.04-server-i386.iso
20480057590ff8b80ad9094f40698030  ubuntu-9.04-server-i386.iso
user@jackalope:/media/trezentos/downloads$
</pre>
<p>Download Oracle Database 11g Release 1 (11.1.0.6.0), and verify the  provided <a href="http://en.wikipedia.org/wiki/Cksum">cksum</a>:</p>
<p><span id="more-2329"></span></p>
<pre>
user@jackalope:/media/trezentos/downloads$ cksum linux_11gR1_database_1013.zip
1044354138 1844527800 linux_11gR1_database_1013.zip
user@jackalope:/media/trezentos/downloads$
</pre>
<p>Also, do not unzip this file on a Windows system or on a network share&#8212;unpack it on the target box or another Linux box, as there might issues with permissions on the filesystem (mostly related to the execution bit, relevant only on *NIX systems). After installing Ubuntu 9.04 Jaunty Jackalope from scratch, let&#8217;s update our software sources:</p>
<pre>
user@jackalope:~$ sudo su -
[sudo] password for user:
root@jackalope:~# apt-get update
Hit http://us.archive.ubuntu.com jaunty Release.gpg
Ign http://us.archive.ubuntu.com jaunty/main Translation-en_US
Hit http://security.ubuntu.com jaunty-security Release.gpg
Ign http://security.ubuntu.com jaunty-security/main Translation-en_US
Ign http://security.ubuntu.com jaunty-security/restricted Translation-en_US
(...)
Hit http://us.archive.ubuntu.com jaunty-updates/universe Sources
Hit http://us.archive.ubuntu.com jaunty-updates/multiverse Packages
Hit http://us.archive.ubuntu.com jaunty-updates/multiverse Sources
Reading package lists... Done
root@jackalope:~#
</pre>
<p>Then, upgrade everything:</p>
<pre>
root@jackalope:~# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  acpid consolekit libck-connector0 libmpfr1ldbl libpam-ck-connector
  libvolume-id1 ntpdate screen-profiles ubuntu-serverguide udev
  update-manager-core
11 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 1565kB of archives.
After this operation, 24.6kB disk space will be freed.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com jaunty-updates/main ubuntu-serverguide 9.04.10 [284kB]
Get:2 http://us.archive.ubuntu.com jaunty-updates/main libvolume-id1 141-1.1 [102kB]
(...)
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.28-11-generic
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
root@jackalope:~#
</pre>
<p>It might be not necessary, but I do suggest you reboot now so that we&#8217;re on the same page. After logging in again, let&#8217;s install a few packages:</p>
<pre>
user@jackalope:~$ sudo apt-get install unzip build-essential x11-utils \
&gt; rpm ksh lsb-rpm libaio1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  binutils defoma dpkg-dev fontconfig-config g++ g++-4.3 gcc gcc-4.3
  libbeecrypt6 libc6-dev libdrm2 libfontconfig1 libfontenc1 libfreetype6
  libgl1-mesa-glx libgomp1 libice6 libneon27 librpm4.4 libsm6
  libstdc++6-4.3-dev libxaw7 libxdamage1 libxfixes3 libxft2 libxi6
  libxinerama1 libxmu6 libxpm4 libxrender1 libxt6 libxtst6 libxv1 libxxf86dga1
  libxxf86vm1 linux-libc-dev make ttf-dejavu ttf-dejavu-core ttf-dejavu-extra
Suggested packages:
  binutils-doc defoma-doc psfontmgr x-ttcidfont-conf dfontmgr libft-perl
  debian-keyring g++-multilib g++-4.3-multilib gcc-4.3-doc libstdc++6-4.3-dbg
  gcc-multilib manpages-dev autoconf automake1.9 libtool flex bison gdb
  gcc-doc gcc-4.3-multilib libmudflap0-4.3-dev gcc-4.3-locales libgcc1-dbg
  libgomp1-dbg libmudflap0-dbg glibc-doc libstdc++6-4.3-doc make-doc alien zip
  mesa-utils
The following NEW packages will be installed:
  binutils build-essential defoma dpkg-dev fontconfig-config g++ g++-4.3 gcc
  gcc-4.3 ksh libaio1 libbeecrypt6 libc6-dev libdrm2 libfontconfig1
  libfontenc1 libfreetype6 libgl1-mesa-glx libgomp1 libice6 libneon27
  librpm4.4 libsm6 libstdc++6-4.3-dev libxaw7 libxdamage1 libxfixes3 libxft2
  libxi6 libxinerama1 libxmu6 libxpm4 libxrender1 libxt6 libxtst6 libxv1
  libxxf86dga1 libxxf86vm1 linux-libc-dev lsb-rpm make rpm ttf-dejavu
  ttf-dejavu-core ttf-dejavu-extra unzip x11-utils
0 upgraded, 47 newly installed, 0 to remove and 0 not upgraded.
Need to get 26.6MB of archives.
After this operation, 81.9MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://us.archive.ubuntu.com jaunty/main libdrm2 2.4.5-0ubuntu4 [377kB]
Get:2 http://us.archive.ubuntu.com jaunty/main libxfixes3 1:4.0.3-2 [9634B]
(...)
Setting up g++ (4:4.3.3-1ubuntu1) ...

Setting up build-essential (11.4) ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
user@jackalope:~$
</pre>
<p>Time to do a few changes on the OS. Since the <code>Oracle Universal Installer</code> prefers <a href="http://en.wikipedia.org/wiki/Bash">bash</a>, let&#8217;s get rid of <a href="http://en.wikipedia.org/wiki/Debian_Almquist_shell">dash</a> :</p>
<pre>
user@jackalope:~$ sudo su -
root@jackalope:~# cd /bin
root@jackalope:/bin# ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2009-05-26 12:58 /bin/sh -&gt; dash
root@jackalope:/bin# ln -sf /bin/bash /bin/sh
root@jackalope:/bin# ls -l /bin/sh
lrwxrwxrwx 1 root root 9 2009-05-26 13:27 /bin/sh -&gt; /bin/bash
root@jackalope:/bin#
</pre>
<p>Let&#8217;s add a user and a couple of groups, as well as do some adjustments on our Ubuntu system so that it has a more Red Hat-ish layout:</p>
<pre>
root@jackalope:/bin# cd
root@jackalope:~# addgroup oinstall
Adding group `oinstall' (GID 1001) ...
Done.
root@jackalope:~# addgroup dba
Adding group `dba' (GID 1002) ...
Done.
root@jackalope:~# addgroup nobody
Adding group `nobody' (GID 1003) ...
Done.
root@jackalope:~# usermod -g nobody nobody
root@jackalope:~# useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
root@jackalope:~# mkdir /home/oracle
root@jackalope:~# chown -R oracle:dba /home/oracle
root@jackalope:~# ln -s /usr/bin/awk /bin/awk
root@jackalope:~# ln -s /usr/bin/rpm /bin/rpm
root@jackalope:~# ln -s /usr/bin/basename /bin/basename
root@jackalope:~# mkdir /etc/rc.d
root@jackalope:~# for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
root@jackalope:~# mkdir -p /u01/app/oracle
root@jackalope:~# chown -R oracle:dba /u01
root@jackalope:~#
</pre>
<p>Let&#8217;s change some system-wide configuration files, starting with <code>/etc/sysctl.conf</code>:</p>
<pre>
root@jackalope:~# cd /etc
root@jackalope:/etc# cp sysctl.conf sysctl.conf.original
root@jackalope:/etc#
</pre>
<p>Edit it, adding the following lines to the bottom of the file:</p>
<pre>
fs.file-max = 65535
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65535
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
</pre>
<p>Now let’s modify <code>/etc/security/limits.conf</code>:</p>
<pre>
root@jackalope:/etc# cd /etc/security/
root@jackalope:/etc/security# cp limits.conf limits.conf.original
root@jackalope:/etc/security# vi limits.conf
root@jackalope:/etc/security#
</pre>
<p>Add the following lines to the bottom of the file:</p>
<pre>
oracle soft nproc 2047
oracle hard nproc 16383
oracle soft nofile 1023
oracle hard nofile 65535
</pre>
<p>There is no need to change <code>/etc/pam.d/login</code> as on the previous versions of this HOWTO. You should reload all those <code>sysctl</code> changes, log out and log in again (I&#8217;m hitting <code>^d</code> instead of typing <code>exit</code>):</p>
<pre>
root@jackalope:/etc/pam.d# sysctl -p
fs.file-max = 65535
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65535
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
root@jackalope:/etc/pam.d# logout
user@jackalope:~$ logout
Connection to 192.168.254.118 closed.
user@jackalope:~$
</pre>
<p>Time to unpack our ZIP file containing the database software on our target machine:</p>
<pre>
user@jackalope:~$ unzip linux_11gR1_database_1013.zip
Archive:  linux_11gR1_database_1013.zip
   creating: database/
   creating: database/doc/
   creating: database/doc/dcommon/
   creating: database/doc/dcommon/css/
  inflating: database/doc/dcommon/css/blafdoc.css
  inflating: database/doc/dcommon/css/bp_layout.css
(...)
  inflating: database/stage/properties/oracle.server_Custom.properties
  inflating: database/stage/properties/oracle.server_PE.properties
  inflating: database/welcome.html
user@jackalope:~$
</pre>
<p>And now it&#8217;s time to install Oracle:</p>
<pre>
user@jackalope:~$ whoami
user
user@jackalope:~$ sudo su -
root@jackalope:~# su - oracle
oracle@jackalope:~$ export DISPLAY=192.168.254.12:0.0
oracle@jackalope:~$ cd /home/user/database
oracle@jackalope:/home/user/database$ ./runInstaller -ignoreSysPrereqs
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 80 MB.   Actual 10236 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 729 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-05-04_01-51-00PM. Please wait ...oracle@jackalope:/home/user/database$ Oracle Universal Installer, Version 11.1.0.6.0 Production
Copyright (C) 1999, 2007, Oracle. All rights reserved.
(...)
</pre>
<p>And this screen should appear for you:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_00.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_00-300x234.png" alt="jaunty_oui_00" title="jaunty_oui_00" width="300" height="234" class="alignleft size-medium wp-image-3073" /></a></p>
<p>It might spit some errors like this during the installation&#8212;just ignore these, as we&#8217;re not supposed to have a package DB anyway:</p>
<pre>
rpm: To install rpm packages on Debian systems, use alien. See README.Debian.
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
</pre>
<p>We leave it as it is:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_01.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_01-300x234.png" alt="jaunty_oui_01" title="jaunty_oui_01" width="300" height="234" class="alignleft size-medium wp-image-3074" /></a></p>
<p>And we&#8217;re going with a full-blown Enterprise Edition:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_02.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_02-300x234.png" alt="jaunty_oui_02" title="jaunty_oui_02" width="300" height="234" class="alignleft size-medium wp-image-3075" /></a></p>
<p>Now, here&#8217;s the part where we choose our <code>ORACLE_HOME</code></p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_03.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_03-300x234.png" alt="jaunty_oui_03" title="jaunty_oui_03" width="300" height="234" class="alignleft size-medium wp-image-3076" /></a></p>
<p>It will check a few system requirements:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_04.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_04-300x234.png" alt="jaunty_oui_04" title="jaunty_oui_04" width="300" height="234" class="alignleft size-medium wp-image-3077" /></a></p>
<p>I just clicked on all the pending issues so that the status would read &#8220;User Verified&#8221;, then hit &#8220;Next&#8221;:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_05.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_05-300x234.png" alt="jaunty_oui_05" title="jaunty_oui_05" width="300" height="234" class="alignleft size-medium wp-image-3078" /></a></p>
<p>We&#8217;re not creating a database now:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_06.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_06-300x234.png" alt="jaunty_oui_06" title="jaunty_oui_06" width="300" height="234" class="alignleft size-medium wp-image-3079" /></a></p>
<p>And we set all groups to be <code>dba</code>:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_07.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_07-300x234.png" alt="jaunty_oui_07" title="jaunty_oui_07" width="300" height="234" class="alignleft size-medium wp-image-3080" /></a></p>
<p>It will show you a summary. This time, we&#8217;ll hit &#8220;Install&#8221;:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_08.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_08-300x234.png" alt="jaunty_oui_08" title="jaunty_oui_08" width="300" height="234" class="alignleft size-medium wp-image-3081" /></a></p>
<p>Go get yourself a good cup of tea, as it might take a while, but eventually you&#8217;ll be presented with a request to run two scripts as <code>root</code>.</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_12.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_12-300x222.png" alt="jaunty_oui_12" title="jaunty_oui_12" width="300" height="222" class="alignleft size-medium wp-image-3085" /></a></p>
<p>For your reference, here&#8217;s a sample output from my box:</p>
<pre>
root@jackalope:~# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory to 770.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete
root@jackalope:~# /u01/app/oracle/product/11.1.0/jaunty11/root.sh
Running Oracle 11g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/11.1.0/jaunty11

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
root@jackalope:~#
</pre>
<p>After hitting OK, we have nothing else to do but to exit the installer.</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_13.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty_oui_13-300x234.png" alt="jaunty_oui_13" title="jaunty_oui_13" width="300" height="234" class="alignleft size-medium wp-image-3086" /></a></p>
<p>And this concludes the database software installation.</p>
<p>Now, let&#8217;s create a <code>listener</code> so we can accept incoming <code>TCP</code> connections from other boxes. Notice that <code>/u01/app/oracle/product/11.1.0/jaunty11</code> is our <code>ORACLE_HOME</code>. This tool might spit out some errors (see below):</p>
<pre>
oracle@jackalope:/home/user/database$ export ORACLE_HOME=/u01/app/oracle/product/11.1.0/jaunty11
oracle@jackalope:/home/user/database$ export PATH=$PATH:$ORACLE_HOME/bin
oracle@jackalope:/home/user/database$ netca

Oracle Net Services Configuration:
Xlib:  extension "Generic Event Extension" missing on display "192.168.254.12:0.0".
Xlib:  extension "Generic Event Extension" missing on display "192.168.254.12:0.0".
Xlib:  extension "Generic Event Extension" missing on display "192.168.254.12:0.0".
</pre>
<p>The messages above are safely ignorable, but the first screen may take a couple of minutes to show up. We&#8217;re setting up a <code>listener</code>:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_00.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_00-300x200.png" alt="jaunty-netca_00" title="jaunty-netca_00" width="300" height="200" class="alignleft size-medium wp-image-3040" /></a></p>
<p>That&#8217;s right, we&#8217;re adding a <code>listener</code>, as we have none configured so far:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_01.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_01-300x200.png" alt="jaunty-netca_01" title="jaunty-netca_01" width="300" height="200" class="alignleft size-medium wp-image-3041" /></a></p>
<p>Choose a name for your <code>listener</code> (it&#8217;s okay to leave the default if you&#8217;re configuring only one listener):</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_02.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_02-300x200.png" alt="jaunty-netca_02" title="jaunty-netca_02" width="300" height="200" class="alignleft size-medium wp-image-3042" /></a></p>
<p>And we want to be able to accept connections via <code>TCP</code>:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_03.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_03-300x200.png" alt="jaunty-netca_03" title="jaunty-netca_03" width="300" height="200" class="alignleft size-medium wp-image-3043" /></a></p>
<p>On the standard port:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_04.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_04-300x200.png" alt="jaunty-netca_04" title="jaunty-netca_04" width="300" height="200" class="alignleft size-medium wp-image-3044" /></a></p>
<p>And we&#8217;re good with one <code>listener</code>:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_05.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_05-300x200.png" alt="jaunty-netca_05" title="jaunty-netca_05" width="300" height="200" class="alignleft size-medium wp-image-3045" /></a></p>
<p>Now we want to get back to the starting screen:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_06.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_06-300x200.png" alt="jaunty-netca_06" title="jaunty-netca_06" width="300" height="200" class="alignleft size-medium wp-image-3046" /></a></p>
<p>To then quit (by hittting <code>Finish</code>):</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_07.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-netca_07-300x200.png" alt="jaunty-netca_07" title="jaunty-netca_07" width="300" height="200" class="alignleft size-medium wp-image-3046" /></a></p>
<p>You&#8217;ll notice on the terminal window you fired up <code>netca</code> that it started the <code>listener</code> we just created (but the system ins&#8217;t ready yet&#8212;keep reading!)</p>
<pre>
Configuring Listener:LISTENER
Listener configuration complete.
Oracle Net Listener Startup:
    Running Listener Control:
      /u01/app/oracle/product/11.1.0/jaunty11/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Oracle Net Services configuration successful. The exit code is 0
</pre>
<p>Time to create our database with <code>dbca</code>. On the same session, we call <code>dbca</code>.  Just as with <code>netca</code>, the first screen will take some time to show:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_01.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_01-300x211.png" alt="jaunty-dbca_01" title="jaunty-dbca_01" width="300" height="211" class="alignleft size-medium wp-image-3051" /></a></p>
<p>A general purpose database fits our needs for now:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_03.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_03-300x211.png" alt="jaunty-dbca_03" title="jaunty-dbca_03" width="300" height="211" class="alignleft size-medium wp-image-3053" /></a></p>
<p>We&#8217;re calling ours <code>ORA11DEV</code>:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_04.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_04-300x211.png" alt="jaunty-dbca_04" title="jaunty-dbca_04" width="300" height="211" class="alignleft size-medium wp-image-3054" /></a></p>
<p>We&#8217;re not configuring Enterprise Manager this time:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_05.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_05-300x211.png" alt="jaunty-dbca_05" title="jaunty-dbca_05" width="300" height="211" class="alignleft size-medium wp-image-3055" /></a></p>
<p>Set a password (or different passwords, if you prefer):</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_06.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_06-300x211.png" alt="jaunty-dbca_06" title="jaunty-dbca_06" width="300" height="211" class="alignleft size-medium wp-image-3056" /></a></p>
<p>We&#8217;re using a classic filesystem for this setup (no <code>ASM</code> or <code>RAW</code> devices:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_07.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_07-300x211.png" alt="jaunty-dbca_07" title="jaunty-dbca_07" width="300" height="211" class="alignleft size-medium wp-image-3057" /></a></p>
<p>We&#8217;ll be using the suggested template:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_08.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_08-300x211.png" alt="jaunty-dbca_08" title="jaunty-dbca_08" width="300" height="211" class="alignleft size-medium wp-image-3058" /></a></p>
<p>And we&#8217;re not configuring the Flash Recovery Area or Archiving on this setup:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_09.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_09-300x211.png" alt="jaunty-dbca_09" title="jaunty-dbca_09" width="300" height="211" class="alignleft size-medium wp-image-3059" /></a></p>
<p>We don&#8217;t want the sample schemas nor to run any custom scripts:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_10.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_10-300x211.png" alt="jaunty-dbca_10" title="jaunty-dbca_10" width="300" height="211" class="alignleft size-medium wp-image-3060" /></a></p>
<p>I&#8217;ve specified 250MB of RAM be used:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_11.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_11-300x211.png" alt="jaunty-dbca_11" title="jaunty-dbca_11" width="300" height="211" class="alignleft size-medium wp-image-3061" /></a></p>
<p>And on low-memory machines, it might be a good idea to limit the maximum number of running processes to a lower value:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_12.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_12-300x211.png" alt="jaunty-dbca_12" title="jaunty-dbca_12" width="300" height="211" class="alignleft size-medium wp-image-3062" /></a></p>
<p>I&#8217;ve gone with UTF&nbsp;.&nbsp;.&nbsp;.&nbsp;</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_13.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_13-300x211.png" alt="jaunty-dbca_13" title="jaunty-dbca_13" width="300" height="211" class="alignleft size-medium wp-image-3063" /></a></p>
<p>&nbsp;.&nbsp;.&nbsp;.&nbsp;and running the database in dedicated server mode:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_14.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_14-300x211.png" alt="jaunty-dbca_14" title="jaunty-dbca_14" width="300" height="211" class="alignleft size-medium wp-image-3064" /></a></p>
<p>We&#8217;re going with the default security settings for Oracle 11g:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_15.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_15-300x211.png" alt="jaunty-dbca_15" title="jaunty-dbca_15" width="300" height="211" class="alignleft size-medium wp-image-3065" /></a></p>
<p>You may want to enable automatic maintenance tasks (I haven&#8217;t):</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_16.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_16-300x211.png" alt="jaunty-dbca_16" title="jaunty-dbca_16" width="300" height="211" class="alignleft size-medium wp-image-3066" /></a></p>
<p>It will show you a preview of the what is about to be created:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_17.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_17-300x211.png" alt="jaunty-dbca_17" title="jaunty-dbca_17" width="300" height="211" class="alignleft size-medium wp-image-3067" /></a></p>
<p>If you want, you might want to ask the database creation assistant to save the scripts to review later. At this point, we hit &#8220;Finish&#8221;:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_18.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_18-300x211.png" alt="jaunty-dbca_18" title="jaunty-dbca_18" width="300" height="211" class="alignleft size-medium wp-image-3068" /></a></p>
<p>After asking for a final review&nbsp;.&nbsp;.&nbsp;.&nbsp;</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_191.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_191-300x300.png" alt="jaunty-dbca_191" title="jaunty-dbca_191" width="300" height="300" class="alignleft size-medium wp-image-3107" /></a></p>
<p>.&nbsp;.&nbsp;.&nbsp;your database will be created and started in a few moments:</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_21.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_21-300x209.png" alt="jaunty-dbca_21" title="jaunty-dbca_21" width="300" height="209" class="alignleft size-medium wp-image-3071" /></a></p>
<p>When you see this, you&#8217;re database has been created and is running (but we&#8217;re not done yet).</p>
<p><a href="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_22.png"><img src="http://www.pythian.com/news/wp-content/uploads/jaunty-dbca_22-300x172.png" alt="jaunty-dbca_22" title="jaunty-dbca_22" width="300" height="172" class="alignleft size-medium wp-image-3072" /></a></p>
<p>Cool! So far, we have:</p>
<ul>
<li>the Oracle 11gR1 database software installed</li>
<li>a <code>listener</code> configured and started</li>
<li>an empty <code>Oracle 11g</code> database configured and started</li>
</ul>
<p>It&#8217;s time to make all work we did so far start on every boot of this box, automatically. Before proceeding, what we want is to make sure everything works (you will notice I&#8217;m not using &#8220;exit&#8221; to exit <code>SQLPLUS</code>, but rather <code>control+d</code>):</p>
<pre>
oracle@jackalope:~$ export ORACLE_SID=ORA11DEV
oracle@jackalope:~$ . oraenv
ORACLE_SID = [ORA11DEV] ?
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.1.0/jaunty11 is /u01/app/oracle
oracle@jackalope:~$ sqlplus '/as sysdba'

SQL*Plus: Release 11.1.0.6.0 - Production on Mon May 4 19:17:46 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL&gt; SELECT INSTANCE_NAME, VERSION, STATUS FROM V$INSTANCE;

INSTANCE_NAME	 VERSION	   STATUS
---------------- ----------------- ------------
ORA11DEV	 11.1.0.6.0	   OPEN

SQL&gt; shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL&gt; startup nomount;
ORACLE instance started.

Total System Global Area  196681728 bytes
Fixed Size		    1298836 bytes
Variable Size		  130027116 bytes
Database Buffers	   62914560 bytes
Redo Buffers		    2441216 bytes
SQL&gt; alter database mount;

Database altered.

SQL&gt; alter database open;

Database altered.

SQL&gt; shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL&gt; Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle@jackalope:~$
</pre>
<p>Next, we make it start on boot by editing <code>/etc/oratab</code>:</p>
<pre>
root@jackalope:~# cat /etc/oratab | tail -1
ORA11DEV:/u01/app/oracle/product/11.1.0/jaunty11:N
root@jackalope:~#
</pre>
<p>See that <code>N</code> on the line starting with <code>ORA11DEV</code>? Change it to <code>Y</code> &#8212; that will make it start on boot with the script we&#8217;re about to deploy.</p>
<p>Create a file called <code>/etc/init.d/oracledb</code> (as <code>root</code>). Inside, put this:</p>
<pre>
#!/bin/bash
#
# /etc/init.d/oracledb
#
# Run-level Startup script for the Oracle Listener and Instances
# It relies on the information on /etc/oratab

# these are the paths for our base installation
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/jaunty11
export ORACLE_OWNR=oracle
export PATH=$PATH:$ORACLE_HOME/bin

if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
    echo "Oracle startup: cannot start"
    exit 1
fi

case "$1" in
    start)
        # Oracle listener and instance startup
        echo -n "Starting Oracle: "
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
        touch /var/lock/oracle
        echo "OK"
        ;;
    stop)
        # Oracle listener and instance shutdown
        echo -n "Shutdown Oracle: "
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
        rm -f /var/lock/oracle
        echo "OK"
        ;;
    reload|restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: `basename $0` start|stop|restart|reload"
        exit 1
esac

exit 0
</pre>
<p>Do not forget to make it executable:</p>
<pre>
root@jackalope:~# chmod a+x /etc/init.d/oracledb
root@jackalope:~#
</pre>
<p>That script will take care of startup for us, as soon as you run <code>update-rc.d</code>:</p>
<pre>
root@jackalope:~# update-rc.d oracledb defaults
update-rc.d: warning: /etc/init.d/oracledb missing LSB information
update-rc.d: see http://wiki.debian.org/LSBInitScripts
 Adding system startup for /etc/init.d/oracledb ...
   /etc/rc0.d/K20oracledb -&gt; ../init.d/oracledb
   /etc/rc1.d/K20oracledb -&gt; ../init.d/oracledb
   /etc/rc6.d/K20oracledb -&gt; ../init.d/oracledb
   /etc/rc2.d/S20oracledb -&gt; ../init.d/oracledb
   /etc/rc3.d/S20oracledb -&gt; ../init.d/oracledb
   /etc/rc4.d/S20oracledb -&gt; ../init.d/oracledb
   /etc/rc5.d/S20oracledb -&gt; ../init.d/oracledb
root@jackalope:~#
</pre>
<p>Also, you might want to add yourself to the <code>dba</code> group and change ownership of the inventory (we chose group <code>oinstall</code> above, remember?):</p>
<pre>
root@jackalope:~# usermod -G dba -a user
root@jackalope:~# chgrp -R dba /u01/app/oracle/product/11.1.0/jaunty11/inventory
root@jackalope:~#
</pre>
<p>There&#8217;s one last thing to do&#8212;reboot and make sure everything starts at boot time. So, on your next boot, you should try:</p>
<pre>
user@jackalope:~$ export ORACLE_SID=ORA11DEV
user@jackalope:~$ . oraenv
ORACLE_SID = [ORA11DEV] ?
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.1.0/jaunty11 is /u01/app/oracle
user@jackalope:~$ sqlplus '/as sysdba'

SQL*Plus: Release 11.1.0.6.0 - Production on Thu May 28 17:12:13 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL&gt; SELECT INSTANCE_NAME, VERSION, STATUS FROM V$INSTANCE;

INSTANCE_NAME	 VERSION	   STATUS
---------------- ----------------- ------------
ORA11DEV	 11.1.0.6.0	   OPEN

SQL&gt;
</pre>
<p>And we&#8217;re done.<br />
Cheers!</p>
<img src="http://feeds.feedburner.com/~r/PythianGroupBlog/~4/bYqApFnJzjc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/2329/installing-oracle-11gr1-on-ubuntu-904-jaunty-jackalope/feed</wfw:commentRss>
		<feedburner:origLink>http://www.pythian.com/news/2329/installing-oracle-11gr1-on-ubuntu-904-jaunty-jackalope</feedburner:origLink></item>
		<item>
		<title>Announcement: Sydney Oracle Meetup #7 - Advanced Queuing in E-Business Suite</title>
		<link>http://feedproxy.google.com/~r/PythianGroupBlog/~3/w4riIQEF0jc/announcement-sydney-oracle-meetup-7-advanced-queuing-in-e-business-suite</link>
		<comments>http://www.pythian.com/news/3014/announcement-sydney-oracle-meetup-7-advanced-queuing-in-e-business-suite#comments</comments>
		<pubDate>Mon, 22 Jun 2009 07:21:39 +0000</pubDate>
		<dc:creator>Alex Gorbachev</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[Oracle E-Business Suite]]></category>

		<category><![CDATA[Sydney Oracle Meetup]]></category>

		<category><![CDATA[AQ]]></category>

		<category><![CDATA[Australia]]></category>

		<category><![CDATA[e-business suite]]></category>

		<category><![CDATA[meetup]]></category>

		<category><![CDATA[OEBS]]></category>

		<category><![CDATA[Sydney]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=3014</guid>
		<description><![CDATA[
What: Sydney Oracle Meetup #7 - Advanced Queuing in E-Business Suite
When:Tuesday,  June 30, 2009 5:30 PM (please, make sure to RSVP yes/no/maybe)
Where: Our standard location in Sydney CBD
Welcome to our meetup #7! This meetup will be focused on Oracle Advanced Queuing (AQ) feature and its usage in Oracle E-Business Suite. 
For inexperienced SOM members, [...]]]></description>
			<content:encoded><![CDATA[<p>
<strong>What:</strong> <a href="http://www.sydneyoracle.com.au/calendar/10705542/">Sydney Oracle Meetup #7 - Advanced Queuing in E-Business Suite</a><br />
<strong>When:</strong>Tuesday,  June 30, 2009 5:30 PM (<em>please, make sure to <a href="http://www.sydneyoracle.com.au/calendar/10705542/">RSVP yes/no/maybe</a></em>)<br />
<strong>Where:</strong> Our <a href="http://www.sydneyoracle.com.au/venue/907606/?eventId=10705542&#038;popup=true">standard location</a> in Sydney CBD</p>
<p>Welcome to our meetup #7! This meetup will be focused on Oracle Advanced Queuing (AQ) feature and its usage in Oracle E-Business Suite. </p>
<p>For inexperienced SOM members, we are starting with the meet &#038; greet and pizza+drinks at 5:30 pm and move to smart things at 6:00 pm. We will be there until about 8:30pm (some are sticking around a bit longer while some might take off a bit earlier) and will have a break in the middle. The second half is generally more open-ended as most of you already know.</p>
<p>So what are the goodies at this meetup?<br />
<span id="more-3014"></span><br />
We will start with an overview of the AQ technology in Oracle database - what it is and what it let you do. Then we will see how it&#8217;s used in Oracle E-Business Suite and how to manage it.</p>
<p>Our speakers for the evening are your fellow SOM members - Jurijs Velikanovs and Warwick Sands. TBC.</p>
<p>Warwick has been working with AQ quite extensively and doing quite a bit of development with AQ recently and will be glad to share his experience. Jurijs has been working with AQ a lot as part of Apps DBA administering OEBS and he will have a lot to say for both AQ in general and in relation to E-Business Suite. If we come to that, I would be glad to add few points from my own experience and what happened as we tried to scale on using AQ technology with transaction rate of thousands per second.</p>
<img src="http://feeds.feedburner.com/~r/PythianGroupBlog/~4/w4riIQEF0jc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/3014/announcement-sydney-oracle-meetup-7-advanced-queuing-in-e-business-suite/feed</wfw:commentRss>
		<feedburner:origLink>http://www.pythian.com/news/3014/announcement-sydney-oracle-meetup-7-advanced-queuing-in-e-business-suite</feedburner:origLink></item>
	</channel>
</rss>
