<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Database on bytebang</title><link>https://bytebang.at/categories/database/</link><description>Recent content in Database on bytebang</description><generator>Hugo</generator><language>de-AT</language><lastBuildDate>Mon, 29 Jun 2015 10:00:45 +0200</lastBuildDate><atom:link href="https://bytebang.at/categories/database/index.xml" rel="self" type="application/rss+xml"/><item><title>Reset GLPI passwords in the database</title><link>https://bytebang.at/blog/reset-glpi-passwords-in-the-database/</link><pubDate>Sun, 28 Jun 2015 09:15:16 +0200</pubDate><guid>https://bytebang.at/blog/reset-glpi-passwords-in-the-database/</guid><description>&lt;h1 id="the-problem"&gt;The Problem&lt;/h1&gt;&#10;&lt;p&gt;Recently i had to login into an abandoned instance of &lt;a href="http://www.glpi-project.org"&gt;GLPI&lt;/a&gt;. GLPI is an Information Resource-Manager with an additional Administration- Interface. You can use it to build up a database with an inventory for your company (computer, software, printers&amp;hellip;). It has enhanced functions to make the daily life for the administrators easier, like a job-tracking-system with mail-notification and methods to build a database with basic information about your network-topology. Unfortunately the administrator who set up the instance had quit his job without writing down the passwords to log into the system. So i had to find a way how to reset the password.&lt;/p&gt;</description></item><item><title>SqlServer CPU utilization</title><link>https://bytebang.at/blog/sqlserver-cpu-utilization/</link><pubDate>Wed, 03 Jun 2015 13:49:28 +0200</pubDate><guid>https://bytebang.at/blog/sqlserver-cpu-utilization/</guid><description>&lt;h1 id="the-problem"&gt;The Problem&lt;/h1&gt;&#10;&lt;p&gt;Sometimes it is interesting how much CPU time your SQL Server is consuming. Well - you can look it up in the Taskmanager, but there is another solution for this: A simple query tells you the CPU time the SQL Server uses. The trick is that you query the &lt;a href="https://msdn.microsoft.com/de-at/library/ms175048.aspx"&gt;sys.dm_os_sys_info&lt;/a&gt; table for it. For those who are interested: There are a lot of other tables with information about the SQL Server like memory, cache and other statistics. Have a look at the &lt;a href="https://msdn.microsoft.com/en-US/en-en/library/ms176083.aspx"&gt;MSDN Article about the SQLServer Operating System&lt;/a&gt; !&lt;/p&gt;</description></item><item><title>Truncate a MSSQL Server Database Logfile</title><link>https://bytebang.at/blog/truncate-a-mssql-server-database-logfile/</link><pubDate>Fri, 26 Dec 2014 17:14:17 +0100</pubDate><guid>https://bytebang.at/blog/truncate-a-mssql-server-database-logfile/</guid><description>&lt;h1 id="mssql-server-101"&gt;MSSQL Server 101&lt;/h1&gt;&#10;&lt;p&gt;In the world of the Microsoft Sql Server a database consists (in the simplest setup) of two &lt;a href="http://msdn.microsoft.com/en-us/library/ms179316.aspx"&gt;kind of files&lt;/a&gt;. The &lt;a href="http://msdn.microsoft.com/en-us/library/ms189563.aspx"&gt;database files&lt;/a&gt; (*.mdf) and the logfiles (*.ldf). Without going into the details of the server one can say that the database file holds the information of the database and the logfiless tores the transactions that made up the data in the dabase. Whenever a transaction is started then the server starts to write the modifications into the logfile. As soon as the transaction is commited then the content is copied into the database file.&lt;/p&gt;</description></item><item><title>MSSQL 2012 - Database in Recovery Pending State</title><link>https://bytebang.at/blog/mssql-2012-database-in-recovery-pending-state/</link><pubDate>Tue, 19 Aug 2014 09:36:55 +0200</pubDate><guid>https://bytebang.at/blog/mssql-2012-database-in-recovery-pending-state/</guid><description>&lt;p&gt;Recently after a VMware recovery of a database server i found my database in the &amp;ldquo;Recovery Pending&amp;rdquo; state. In this state nobody could connect to the db - which renders it pretty useless. After some googling i found &lt;a href="http://social.msdn.microsoft.com/Forums/sqlserver/en-US/835dee9b-0993-433f-baf7-a646dfa7f8f7/how-to-resolve-the-issue-of-a-database-that-was-in-recovery-pending-mode?forum=sqldatabaseengine"&gt;here &lt;/a&gt;the simple and working solution.&lt;/p&gt;&#10;&lt;p&gt;Start the MSSQL Server Management Studio, connect to the server and run the following statements&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;pre&gt;&lt;code&gt;ALTER DATABASE [DB_Name] SET  SINGLE_USER WITH NO_WAIT;&#10;ALTER DATABASE [DB_Name] SET EMERGENCY;&#10;DBCC checkdb ([DB_Name], REPAIR_ALLOW_DATA_LOSS);&#10;ALTER DATABASE [DB_Name] SET online;&#10;ALTER DATABASE [DB_Name] SET  Multi_USER WITH NO_WAIT;&#10;&lt;/code&gt;&lt;/pre&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;After that it was possible to bring the database online again and it worked like a charm.&lt;/p&gt;</description></item><item><title>Efficient CSV analysis with H2</title><link>https://bytebang.at/blog/efficient-csv-analysis-with-h2/</link><pubDate>Mon, 04 Aug 2014 09:04:11 +0200</pubDate><guid>https://bytebang.at/blog/efficient-csv-analysis-with-h2/</guid><description>&lt;h1 id="installation-of-h2"&gt;Installation of H2&lt;/h1&gt;&#10;&lt;p&gt;If you try to analyze a huge amount of &lt;a href="http://en.wikipedia.org/wiki/Comma-separated_values"&gt;CSV &lt;/a&gt;data then Excel becomes pretty slow in some scenarios. This article shows how to import a csv file into a &lt;a href="http://www.h2database.com"&gt;H2&lt;/a&gt; in-memory database in order to perform analysis with database-power!&lt;/p&gt;&#10;&lt;p&gt;The installation is straight forward. Got to &lt;a href="https://www.h2database.com"&gt;www.h2database.com&lt;/a&gt; and download the right installer for your operating system. I personally prefer the &amp;ldquo;All Platforms&amp;rdquo; zipfile because i often switch the operatingsystem. Once you have downloaded the files you have to start the database and point a webbrowser to the &amp;ldquo;Management Console&amp;rdquo; of the h2 database by entering the url http://localhost:8082&lt;/p&gt;</description></item><item><title>Lazy mans oracle update guide (10g -&gt; 11g)</title><link>https://bytebang.at/blog/lazy-mans-oracle-update-guide-10g-11g/</link><pubDate>Mon, 14 Jul 2014 09:36:07 +0200</pubDate><guid>https://bytebang.at/blog/lazy-mans-oracle-update-guide-10g-11g/</guid><description>&lt;p&gt;For compatibility reasons we had to upgrade the oracle database from one of our customers. They where running a oracle 10g on an old Windows 2003R2 server and have to migrate to 11g on an windows 2012 Server.&lt;/p&gt;&#10;&lt;p&gt;Possible attempts:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Upgrade the OS of the old server and afterwards upgrade the batabse version &amp;hellip; Wenn seems to be possible but since the machines are not virtualized this is somehow risky. Rolling back is difficult.&lt;/li&gt;&#10;&lt;li&gt;Setup another machine with Win2012, install Oracle there and import the data from the oter instance &amp;hellip; Well that sounds good. If something fails then the original system is not tainted. Lets go with this one.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The next few sections are describing what we have done to git it running (and where we failed).&lt;/p&gt;</description></item></channel></rss>