<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dbsnaps &#187; Oded Raz</title>
	<atom:link href="http://www.dbsnaps.com/author/oded-raz/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dbsnaps.com</link>
	<description>database video tutorials</description>
	<lastBuildDate>Sun, 13 Nov 2011 13:50:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Parallel New Features in Oracle 11gR2</title>
		<link>http://www.dbsnaps.com/oracle/parallel-new-features-in-oracle-11gr2/</link>
		<comments>http://www.dbsnaps.com/oracle/parallel-new-features-in-oracle-11gr2/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 10:14:40 +0000</pubDate>
		<dc:creator>Oded Raz</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle - Latest Articles]]></category>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=690</guid>
		<description><![CDATA[Oracle 11gR2 brings us new features related to parallelism. 
The new features are controlled by the PARALLEL_DEGREE_POLICY initialization parameter. Learn how to use these new features to leverage your needs.]]></description>
			<content:encoded><![CDATA[<p>Oracle 11gR2 brings us new features related to parallelism.The new features are controlled by the PARALLEL_DEGREE_POLICY initialization parameter. Learn how to use these new features to leverage your needs.</p>
<h2>Automatic Parallel Degree</h2>
<p>When PARALLEL_DEGREE_POLICY is set to AUTO, automatic parallel degree is enabled. Oracle will evaluate the execution time of the statement, and if it exceeds the value of PARALLEL_MIN_TIME_THRESHOLD parameter (10 seconds by default) Oracle will calculate an automatic degree of parallelism (DOP) for this statement.</p>
<p>Oracle calculates the DOP based on the statement requirements and the load on the server. The DOP can be limited by the parameter PARALLEL_DEGREE_LIMIT:</p>
<ul>
<li>CPU (default) &#8211; will set the maximum DOP to the value of PARALLEL_THREADS_PER_CPU * CPU_COUNT * # of instances.</li>
<li>IO  - will limit the DOP according to the I/O of the system (available only after running DBMS_RESOURCE_MANAGER.CALIBRATE_IO).</li>
<li>Integer value &#8211; will limit the DOP to this integer.</li>
</ul>
<p>When PARALLEL_DEGREE_POLICY is set to LIMITED, Oracle will automatically determine the DOP for the statements. However, statements that are not specified to run in parallel, will run in serial.</p>
<h2>Statement Queuing</h2>
<p>When a statement is executed, Oracle determines the DOP for this statement. If creating the calculated number of parallel processes will cause the total number of active parallel processes in the system to exceed the PARALLEL_SERVERS_TARGET, this statement will be queued.</p>
<p>The queue of statements is based on the simple “first in first out” mechanism. Once there are enough parallel processes available, the statement will start executing.</p>
<p>Using resource manager, we can set priority in the statement queue, timeout for statements and manage the amount of parallel processes for statements.</p>
<h2>In Memory Parallel Execution</h2>
<p>When running a parallel operation, the server process is reading the data from the file using direct operation into its PGA. The data blocks are not cached in the SGA and are not read from it. The in memory parallel execution feature enables the server processes to load the blocks to the SGA and read them from the SGA.</p>
<p>If the object is too large to fit in the buffer cache, Oracle will still use direct read.</p>
<h2>Disable Automatic Parallel Features</h2>
<p>Enabling and disabling the automatic parallel features is made using the PARALLEL_DEGREE_POLICY parameter:</p>
<ul>
<li>AUTO &#8211; all of the above features are enabled.</li>
<li>LIMITED &#8211; in memory parallel execution and statement queuing will be disabled, the automatic DOP will be enabled only for queries that were set to run in parallel.</li>
<li>MANUAL &#8211; disable all the automatic parallel features and revert parallel behavior to pre-11gR2</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/parallel-new-features-in-oracle-11gr2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle 11g Performance Features</title>
		<link>http://www.dbsnaps.com/oracle/oracle-11g-performance-features/</link>
		<comments>http://www.dbsnaps.com/oracle/oracle-11g-performance-features/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 13:42:24 +0000</pubDate>
		<dc:creator>Oded Raz</dc:creator>
				<category><![CDATA[Main-Performance]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle - Latest Articles]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[instance caging]]></category>
		<category><![CDATA[invisible indexes]]></category>
		<category><![CDATA[parallel]]></category>
		<category><![CDATA[pending statistics]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[real application testing]]></category>
		<category><![CDATA[sql plan management]]></category>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=631</guid>
		<description><![CDATA[Oracle 11g brings us many performance related features. In this article we will cover several of these features.]]></description>
			<content:encoded><![CDATA[<h3>Pending Statistics (11.1)</h3>
<p>Starting in Oracle 11.1, we have the option to gather statistics without publishing them to the optimizer. When using pending statistics we can allow the optimizer to use these statistics by setting the parameter OPTIMIZER_USE_PENDING_STATISTICS to true. After checking the new statistics we can publish or delete them.</p>
<h3>SQL Plan Management (11.1)</h3>
<p>SQL Plan Management allows the optimizer to maintain execution plan history for repeating SQL statements. Using this history, the optimizer can prevent plan changes for these SQL statements. The optimizer will save the new plan and will verify that the performance of the new plan is better than the old ones. After the verification, the optimizer can accept the plan and start using it.</p>
<h3>Invisible Indexes (11.1)</h3>
<p>Invisible indexes are regular indexes that are not used by the optimizer. We can create invisible indexes (or change indexes to be invisible) to verify how a new index or the deletion of an index will change the SQL plans. An index can be set to visible or invisible using the “create index” or “alter index” commands. To allow the optimizer to use invisible indexes, set the OPTIMIZER_USE_INVISIBLE_INDEXES parameter to true.</p>
<h3>Real Application Testing (11.1)</h3>
<p>Oracle Real Application Testing option contains two components, Database Replay and SQL Performance Analyzer. These features help us to identify performance issues before hardware and software changes.</p>
<ul>
<li>Database Replay: Database replay allows us to capture the real workload of the production system and replay it on a test environment. The test environment can have different hardware, Oracle version, parameters, etc. This way we can assess the impact of these changes on our production database.</li>
<li>SQL Performance Analyzer (SPA): the SPA allows us to identify SQL performance changes between the production and test environments. Using SPA we run the same SQL statements on both environments and see the actual improvement or degradation of these statements in the new environment.</li>
</ul>
<h3>Instance Caging (11.2)</h3>
<p>Instance caging in 11.2 allows us to limit the amount of CPUs the instance can use. To use instance caging, we set the CPU_COUNT parameter to the desired amount of CPUs. This feature allows us to have better load sharing when having several instances running on the same server.</p>
<h3>Automatic Parallelism (11.2)</h3>
<p>Automatic parallelism in 11.2 consists of three features:</p>
<ul>
<li>Automatic degree of parallelism: Oracle will decide which statements to run in parallel and the parallel degree</li>
<li>Statement queuing: long statements that can’t get enough parallel slaves will not be executed in serial, but will be queued until they can get the desired parallel degree</li>
<li>In memory parallel execution: enables the parallel slaves to use the buffer cache when accessing data blocks, instead of performing direct read from the physical disks.</li>
</ul>
<p>To fully enable this feature the PARALLEL_DEGREE_POLICY parameter should be set to AUTO. When the parameter is set to LIMITED, only the automatic parallel degree is enabled, and only for queries that we set to run in parallel.</p>
<p>To entirely disable this feature and revert to pre 11.2 behavior, set the PARALLEL_DEGREE_POLICY to MANUAL.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/oracle-11g-performance-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Determine query for Linux process</title>
		<link>http://www.dbsnaps.com/oracle/determine-query-for-linux-process/</link>
		<comments>http://www.dbsnaps.com/oracle/determine-query-for-linux-process/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 14:29:17 +0000</pubDate>
		<dc:creator>Oded Raz</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle - Latest Articles]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[most CPU consuming process]]></category>
		<category><![CDATA[oraproc]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=348</guid>
		<description><![CDATA[In this article we will demonstrate how to retrieve the SQL statement of the most CPU consuming process in Linux/Unix]]></description>
			<content:encoded><![CDATA[<p>How many times a co-worker comes to you and tells you that the database is running slowly?<br />
Of course there are many reasons that can cause the database to slug, for example:</p>
<ol>
<li>High concurrency of active sessions</li>
<li>Queries using a lot of disk time such as full table scans</li>
<li>Long duration locks on rows</li>
<li>Hardware failure such as disks defect</li>
</ol>
<p>Another reason could be because there is a very CPU intensive query that is effecting the performance of the entire database.</p>
<p>This post will demonstrate how to determine which process is taking the most CPU in the system and how to retrieve the SQL statement it is currently running in the database.</p>
<p>** This post applies to Unix/Linux and Oracle 10g, 11g</p>
<p>In order to reach are goal we have to do the following things:</p>
<ol>
<li>Determine which process is consuming the most CPU in the system – we can use the TOP Linux/Unix command.</li>
<li>Finding out the query this process is running – we can prepare a script in advance to help us.</li>
</ol>
<p>Let’s begin with the preparations – preparing the script that will display the actual activity of the session within the database. The script will be a shell script that incorporates an SQL script within (you can find out more on this topic here <a href="http://www.dbsnaps.com/oracle/oracle-running-sqlplus-from-unix-bash-scripts/">oracle-running-sqlplus-from-unix-bash-scripts/</a>). The script receives an argument which is the Linux/Unix process ID of the process we want to examine. I usually put such scripts in a folder that is part of my $PATH such as ~/bin (or /home/oracle/bin).</p>
<p>Create a run-able script in Linux:</p>
<pre class="brush: bash;">
touch /home/oracle/bin/oraproc
chmod +x /home/oracle/bin/oraproc
vi /home/oracle/bin/oraproc
</pre>
<p>In this file write the a copy of the following snippet</p>
<pre class="brush: bash;">

#!/bin/bash
if [ $# -ne 1 ];then
	echo &quot;Usage: oraproc &lt;Unix Process ID&gt;&quot;
	exit
fi

unix_pid=$1

sqlplus -s -l / as sysdba &lt;&lt;EOF
set head off feed off time off timing off
set serveroutput on lines 10000
DECLARE
	stmt VARCHAR2(32000) := '';
	report BOOLEAN := TRUE;
	SPACECHAR CONSTANT CHAR(1) := ' ';
	TABLEN CONSTANT NUMBER(2) := 10;
BEGIN
	dbms_output.enable(99999);
	FOR rec IN (
		SELECT  s.sid, s.username, s.osuser, s.machine,
				nvl(s.module, s.program) prog, s.event, t.sql_text
		FROM    v\$process p
		JOIN    v\$session s ON s.paddr = p.addr
		LEFT JOIN v\$sqltext_with_newlines t
				ON	t.address = s.sql_address
				AND	t.hash_value = s.sql_hash_value
		WHERE   p.spid = ${unix_pid}
		ORDER BY t.piece ) LOOP

		stmt := stmt || rec.SQL_TEXT;
		IF report THEN
			DBMS_OUTPUT.PUT_LINE(RPAD('SID:', TABLEN, spacechar) || rec.sid);
			DBMS_OUTPUT.PUT_LINE(RPAD('USERNAME:', TABLEN, spacechar) || rec.username);
			DBMS_OUTPUT.PUT_LINE(RPAD('OSUSER:', TABLEN, spacechar) || rec.osuser);
			DBMS_OUTPUT.PUT_LINE(RPAD('MACHINE:', TABLEN, spacechar) || rec.machine);
			DBMS_OUTPUT.PUT_LINE(RPAD('PROGRAM:', TABLEN, spacechar) || rec.prog);
			DBMS_OUTPUT.PUT_LINE(RPAD('EVENT:', TABLEN, spacechar) || rec.event);
			DBMS_OUTPUT.PUT_LINE('---------------------------------------');
			report := FALSE;
		END IF;
	END LOOP;
	IF NOT report THEN
		IF LENGTH(stmt) &gt; 0 THEN
			DBMS_OUTPUT.PUT_LINE(stmt);
		ELSE
			DBMS_OUTPUT.PUT_LINE('No current running statement');
		END IF;
	ELSE
		DBMS_OUTPUT.PUT_LINE('Unix PID ${unix_pid} not found');
	END IF;
END;
/
EXIT
EOF
</pre>
<p>Now let’s see this script at work. I have written a PL/SQL anonymous block that uses a lot of CPU. It looks like this:</p>
<pre class="brush: sql;">
declare
	start_date date;
	end_time date;
	dum number;
begin
	start_date := sysdate;
	end_time := sysdate + 1/24/60; -- minute
	while end_time &gt; sysdate loop
		dum := 0;
		for i in 1..10000 loop
			dum := dum + 1;
		end loop;
	end loop;
	dbms_output.put_line (start_date || ' ' || end_time);
end;
/
</pre>
<p>This script runs for a minute in a loop so it uses CPU very intensively. I run it from one session and run the TOP command from another session like this:</p>
<p><a class="highslide" onclick="return vz.expand(this)" href="http://www.dbsnaps.com/wp-content/uploads/2010/07/top.jpg"><img class="alignnone size-medium wp-image-365" title="top" src="http://www.dbsnaps.com/wp-content/uploads/2010/07/top-300x186.jpg" alt="" width="300" height="186" /></a></p>
<p>Notice that we see the process ID 9530 takes 98% CPU time.</p>
<p>We use this PID as an argument to our script by calling it from shell like this:</p>
<p><strong>$ oraproc 9530</strong></p>
<p>This will display the actual statement this process is currently running in the database (with some additional info I like to add). It looks like this:</p>
<pre>$ oraproc 9503
SID:      1
USERNAME: DEMO
OSUSER:   oracle
MACHINE:  ora2
PROGRAM:  SQL Developer
EVENT:    SQL*Net message from client
---------------------------------------
declare
	start_date date;
	end_time date;
	dum number;
begin
	start_date := sysdate;
	end_time := sysdate + 1/24/60; -- minute
	while end_time &gt; sysdate loop
		dum := 0;
		for i in 1..10000 loop
			dum := dum + 1;
		end loop;
	end loop;
	dbms_output.put_line (start_date || ' ' || end_time);
end;</pre>
<p>Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/determine-query-for-linux-process/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oracle &#8211; How to kill orphan sessions easily</title>
		<link>http://www.dbsnaps.com/oracle/oracle-how-to-kill-session-from-specific-application/</link>
		<comments>http://www.dbsnaps.com/oracle/oracle-how-to-kill-session-from-specific-application/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 20:14:12 +0000</pubDate>
		<dc:creator>Oded Raz</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle - Latest Articles]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[kill orphan sessions]]></category>
		<category><![CDATA[Procedure]]></category>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=291</guid>
		<description><![CDATA[In this article we'll see a script that will help developers to kill applicaitions orphan sessions, even on RAC environment.]]></description>
			<content:encoded><![CDATA[<p>Working with application developers, I am often asked to kill orphan sessions stuck in Oracle. These sessions sometime use a lot of resources or lock objects and rows. Developers usually work with unstable applications that crash a lot, or debuggers allowing the developer to stop the application process abruptly so they skip the commit/rollback part and even the disconnect part of the code. The client program is killed and does not report to Oracle server to cancel the statement and disconnect in a proper manner. This might produce an orphan process in the database. True, Oracle (PMON background process) will kill these orphan processes by itself, but it can take a while before they are identified and killed, and the developers could be facing locks or the database could be heavily loaded. When the development environment is relatively small, it is easy to identify the sessions that need to be killed. But in a large environment with numerous developers connected to the same database server with sometimes the same username, it is a little bit tricky. Moreover, a RAC environment makes this job of “killing sessions” more tedious. Addressing this time consuming repetitive task, I have created a very easy to use mechanism that will allow a developer to kill his/her own sessions without my help. My assumptions are:</p>
<ol>
<li>Developers are not granted the alter system / alter user privileges.</li>
<li>When creating users for developers the DBA can add a prefix to the name (DEV_USER1, DEV_JOHN, DEV_RACHEL …).</li>
<li>Developers do not share the same username.</li>
<li>Multiple developers can run from the same client using different usernames to login to Oracle.</li>
<li>A developer can run from multiple client machines – in this case he/she will want to kill sessions opened only from one specific client machine</li>
</ol>
<p>Tested on:</p>
<ol>
<li>Oracle 10g</li>
<li>Oracle 10g RAC</li>
<li>Oracle 11g</li>
<li>Oracle 11g RAC</li>
</ol>
<p>Now, I will display the setup code, followed by an explanation: Create owner for the procedure (schema)</p>
<pre class="brush: sql;">
create user killer identified by killer;
grant alter system to killer;
grant select on v_$session, gv_$session to killer;
alter user killer account lock;
</pre>
<p>Create the procedure</p>
<pre>
<div>
<pre class="brush: sql;">
create or replace PROCEDURE killer.KILL_MY_CLIENTS AUTHID DEFINER AS
   job_no number;
   user_prefix varchar(20);
   domain_name varchar(20);
   num_of_kills number := 0;
   BACKSLASH constant char(1) := chr(92);
begin
   user_prefix := 'DEV';       -- All my developer username prefixed with DEV
                               -- (DEV_USER1, DEV_USER2, DEV_MIKE, DEV_JOHN ...)
   domain_name := 'WORKGROUP'; -- We work in a workgroup.
                               -- Once we work in a windows domain this variable should
                               -- hold the domain name

   for REC in
       (SELECT SID, SERIAL#, INST_ID, MODULE,
               SYS_CONTEXT('USERENV', 'INSTANCE') MY_INST_ID
        from gv$session s
        where s.username like user_prefix || '%'                  -- precaution
          and s.username = sys_context('USERENV', 'SESSION_USER') -- only my username
          and not (S.SID = SYS_CONTEXT('USERENV', 'SID')          -- excluding my session
          and INST_ID = SYS_CONTEXT('USERENV', 'INSTANCE'))
          and replace(upper(machine), domain_name || BACKSLASH, '')     -- my machine
                 = replace(upper(sys_context('USERENV', 'HOST')), domain_name || BACKSLASH, '')
          and s.module not in ('SQL*Plus', 'SQL Developer')       -- not sqlplus
                                                                  -- nor sql developer
          and s.module not like 'sqlplus@%'
          and S.LOGON_TIME &lt; sysdate-(1/24/60/60)                 -- logged-on more
                                                                  -- than a second
        ORDER BY inst_id asc
       ) LOOP
      if rec.inst_id = rec.my_inst_id then
         ---------------------------------------------------------------------------
         -- kill local sessions immediately
         ---------------------------------------------------------------------------
         dbms_output.put('LOCAL SID ' || rec.sid || '(' || rec.module || ')');
         execute immediate 'alter system kill session ''' || rec.sid || ', ' ||
                            rec.serial# || '''' ;
         dbms_output.put_line('. killed locally ' || job_no);
      ELSE
         ---------------------------------------------------------------------------
         -- kill remote sessions (for RAC) as a job
         ---------------------------------------------------------------------------
         DBMS_OUTPUT.PUT('REMOTE SID ' || REC.SID || ' on instance ' || REC.INST_ID  ||
                         '(' || rec.module || ')');
         DBMS_JOB.SUBMIT (
                 job =&gt; job_no,
                 what =&gt; 'execute immediate ''alter system kill session ''''' || rec.sid ||', ' ||
                          rec.serial# || ''''''';',
                 INSTANCE =&gt; rec.inst_id);
         dbms_output.put_line('. killed with job ' || job_no);
         COMMIT;
      end if;
      num_of_kills := num_of_kills + 1;
   end loop;
   dbms_output.put_line ('number of killed sessions: ' || num_of_kills);
end kill_my_clients;
</pre>
</div>
</pre>
<p>Make procedure available to all</p>
<pre class="brush: sql;">
create public synonym kill_my_clients for killer.kill_my_clients;
grant execute on killer.kill_my_clients to public;
alter user killer account lock;
</pre>
<p>Use it: login as the developer from client machine to any application that can run statements like SQL*Plus</p>
<pre class="brush: sql;">
exec kill_my_clients
</pre>
<p>Explanation: The commands in the first section create a user called “killer”. This user is the owner of the procedure described in the next section. Notice that this user is very powerful because it can kill any user with the permission “alter system”. That is why we must limit access to it so it is locked. The grants on v_$session and gv_$session must be done by sys or other user with admin options on these views. The second section is the procedure itself. It should be compiled under “killer” (as the code demonstrates). Here is an explanation of this procedure:</p>
<ol>
<li>Identify all sessions running from the developer’s machine from his/hers username except for the session running this query in the current node and remote RAC nodes.
<ol>
<li>If the session is on the same instance of the current connection – kill it immediately.</li>
<li>If the session is on a different RAC node – kill it by submitting a job on that node.</li>
</ol>
<p>There are 2 variables that I usually change when I deploy this procedure in an environment:</p>
<ul>
<li><strong><em>USER_PREFIX</em></strong> – I try naming all the developer users with a prefix such as DEV_USER1, DEV_USER2, DEV_MIKE, DEV_JOHN &#8230; I use this prefix as a measure of precaution – I don’t want my procedure to kill any users not beginning with this prefix. This way if my developer is running this procedure from user sys or system by mistake it will do no harm.</li>
<li><em><strong>DOMAIN_NAME</strong></em> – when working with windows clients sometimes the application is prefixed with the domain name (such as SQL Developer) and sometimes not (such as SQL*Plus). This variable will become crucial to identifying sessions opened from the developer’s machine.</li>
</ul>
</li>
<li>Execute kill command on the local instance.</li>
<li>Execute kill command on all remote instances of RAC by submitting jobs with instance affinity.</li>
</ol>
<p>Another factor I take into account is that I don’t want to kill connections from SQL*Plus or from SQL Developer. If you are working with other programs such as PL/SQL Developer or Toad you might want to include them in the where clause as well.</p>
<p>The third section demonstrates how to use this mechanism: You just have to login as the developer from the client machine to any application that can run statements like SQL*Plus and execute the procedure (you do not have to use the owner’s name in the call because you have declared a public synonym for it).</p>
<p>Enjoy ﻿</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/oracle-how-to-kill-session-from-specific-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Database Vault tutorial &#8211; Step By Step</title>
		<link>http://www.dbsnaps.com/oracle/oracle-database-vault-tutorial-step-by-step/</link>
		<comments>http://www.dbsnaps.com/oracle/oracle-database-vault-tutorial-step-by-step/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 13:02:57 +0000</pubDate>
		<dc:creator>Oded Raz</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Database Vault]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://dbsnaps.oracletutorialvideos.com/?p=157</guid>
		<description><![CDATA[Learn how to protect oracle database using ORACLE's revolutionary feature - Database Vault.
In this first chapter we will show you how to install ORACLE Database Vault, and PROTECT schema objects using DV REALMS.]]></description>
			<content:encoded><![CDATA[<p>Oracle Database Vault, part of Oracle&#8217;s comprehensive portfolio of database security solutions, helps organizations address regulatory mandates and increase the security of existing applications. Regulations such as Sarbanes-Oxley, Payment Card Industry (PCI) Data Security Standard (DSS), Health Insurance Portability and Accountability Act (HIPAA), Gramm-Leach-Bliley Act (GLBA) and similar global directives call for separation-of-duties and other preventive controls to ensure data integrity and data privacy. With Oracle Database Vault, organizations can pro-actively safeguard application data stored in the Oracle database from being accessed by privileged database users. Application data can be further protected using Oracle Database Vault&#8217;s multi-factor policies that control access based on built-in factors such as time of day, IP address, application name, and authentication method, preventing unauthorized ad-hoc access and application by-pass</p>
<ul>
<li>Pro-actively safeguard application data stored in the Oracle database—Restrict access by unauthorized database users &#8211; even privileged users &#8211; by using powerful access controls built into the Oracle database.</li>
<li>Address regulatory requirements—Implement separation-of-duty and other real-time preventive controls.</li>
<li>Restrict ad-hoc access to application data— Prevent application-bypass with multi-factor policies that are enforced in the database for high security and performance.</li>
<li>Deploy with confidence—Use certified default policies for Oracle E-Business Suite, Oracle PeopleSoft, and Oracle Siebel CRM applications.</li>
</ul>
<p><!-- End Section Content--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/oracle-database-vault-tutorial-step-by-step/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Shrink Oracle Tables Online</title>
		<link>http://www.dbsnaps.com/oracle/shrink-oracle-tables-online/</link>
		<comments>http://www.dbsnaps.com/oracle/shrink-oracle-tables-online/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 12:45:34 +0000</pubDate>
		<dc:creator>Oded Raz</dc:creator>
				<category><![CDATA[Main-Performance]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Enable row movement]]></category>
		<category><![CDATA[Online]]></category>
		<category><![CDATA[Shrink Tables]]></category>

		<guid isPermaLink="false">http://dbsnaps.oracletutorialvideos.com/?p=154</guid>
		<description><![CDATA[Oracle 10g Supply a new alter table option that enables online table reorganization, this option is shrink]]></description>
			<content:encoded><![CDATA[<p>Oracle Tables that undergo significant data manipulation (DML) activity, such as <tt>UPDATE</tt> and <tt>DELETE</tt> operations, can become fragmented and contain free space &#8220;Islands&#8221; inside the table seegments.</p>
<p>Such fragmentation reduces the efficiency of scaning opreations like full table scans of index scans. Before oracle 10g one should have used &#8220;MOVE TABLE&#8221; in order to solve this problem.</p>
<p>Oracle 10g inturduced us with new online feature, shrink table.</p>
<p>In order to use the shrink command we need to enable row movment:</p>
<p><code>
<pre class="brush: sql;">
alter table &lt;Table_Name&gt; enable row movement;
--Then we can use shrink table command:
alter table &lt;Table_Name&gt; shrink space;
</pre>
<pre>Shrink opration does the following :
<ul>
<li>Segment data is compacted</li>
<li>High-water mark (HWM) is adjusted to an appropriate location</li>
</ul>
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/shrink-oracle-tables-online/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Paging Oracle Query Result</title>
		<link>http://www.dbsnaps.com/oracle/paging-oracle-query-result/</link>
		<comments>http://www.dbsnaps.com/oracle/paging-oracle-query-result/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 12:44:14 +0000</pubDate>
		<dc:creator>Oded Raz</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Split query result sets]]></category>

		<guid isPermaLink="false">http://dbsnaps.oracletutorialvideos.com/?p=152</guid>
		<description><![CDATA[Programmers often retrieve big result set using queries and need to split them up in order to display the result correctly. This tip shows you how to split oracle query result sets into pages.]]></description>
			<content:encoded><![CDATA[<p>Programmers often retrieve big result set using queries and need to split them up in order to display the result correctly.  Just replace the inner query with the original one see tag /* PUT YOUR MAIN QUERY */, and :UPPERBUOND, :LOWERBOUND with the boundary of the results you want to display.</p>
<pre class="brush: sql;">
SELECT *
FROM (
       SELECT a.*, rownum rnum
       FROM ( /* PUT YOUR MAIN QUERY */) a
       WHERE rownum &lt;= :UPPERBUOND
     )
WHERE rnum &gt;= :LOWERBOUND
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/paging-oracle-query-result/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Connect as an Oracle User Without Knowing the Password</title>
		<link>http://www.dbsnaps.com/oracle/connect-as-an-oracle-user-without-knowing-the-password/</link>
		<comments>http://www.dbsnaps.com/oracle/connect-as-an-oracle-user-without-knowing-the-password/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 12:30:35 +0000</pubDate>
		<dc:creator>Oded Raz</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Connect through]]></category>
		<category><![CDATA[Connect Without Password]]></category>

		<guid isPermaLink="false">http://dbsnaps.oracletutorialvideos.com/?p=145</guid>
		<description><![CDATA[In some cases we have to connect to the database as a specific user, but don't know the password.

There are two ways to handle this problem:]]></description>
			<content:encoded><![CDATA[<p>In some cases we have to connect to the database as a specific user, but don&#8217;t know the password.</p>
<p>There are two ways to handle this problem:</p>
<p>1. There is a system privilege called &#8220;connect through&#8221;. Let&#8217;s say we have the user called &#8220;master&#8221; and we wish to connect as &#8220;app&#8221;. We will grant the privilege using the following syntax:</p>
<div id="_mcePaste">
<pre class="brush: sql;">
Alter user app grant connect through master;
</pre>
</div>
<pre><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: small;"><span style="line-height: 19px; white-space: normal;">
</span></span></pre>
<p>After granting this privilege, the user &#8220;master&#8221; can connect as the user &#8220;app&#8221; without the password of &#8220;app&#8221; user.</p>
<p>To connect as &#8220;app&#8221; user, use the following syntax:</p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;"> </span></p>
<pre class="brush: sql;">
sqlplus master[app]/pwd@db
</pre>
<p>Note that the password given is the password of &#8220;master&#8221; user. But in this sqlplus session we are connected as &#8220;app&#8221; user.</p>
<p>2. If we can allow ourselves to change the password, but don&#8217;t want to change it permanently, there is a way to change the password back.</p>
<p>The DBA_USERS table contains the PASSWORD column. This column contains the encrypted password of the user.<br />
Follow these steps to change the user&#8217;s password:</p>
<ol>
<li>Get the encrypted password of the user from DBA_USERS table and save it.</li>
<li>Change the password by using the &#8220;alter user &lt;user&gt; identified by &lt;pwd&gt;&#8221; command.</li>
</ol>
<p>Perform the following step to change the password back:</p>
<ol>
<li>Use the &#8220;alter user &lt;user&gt; identified by values &lt;encrypted_password&gt;&#8221; command.</li>
</ol>
<p>Use the encrypted password you have and pay attention to the &#8220;values&#8221; keyword in the command, it specifies that the password given in the command is already encrypted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/connect-as-an-oracle-user-without-knowing-the-password/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL Server 2005 Log Shipping tutorial</title>
		<link>http://www.dbsnaps.com/videos/sql-server-2005-log-shipping/</link>
		<comments>http://www.dbsnaps.com/videos/sql-server-2005-log-shipping/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 19:18:51 +0000</pubDate>
		<dc:creator>Oded Raz</dc:creator>
				<category><![CDATA[High Availability]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server - Latest Articles]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Log Shipping Video]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://dbsnaps.oracletutorialvideos.com/?p=105</guid>
		<description><![CDATA[Log shipping is the process of automating transaction log copy and apply in order to maintain identical database copy for high-availability or disaster recovery proposes. ]]></description>
			<content:encoded><![CDATA[<p>Log shipping is the process of automating transaction log copy and apply in order to maintain identical database copy for high-availability or disaster recovery proposes.</p>
<p>Transaction log files are copied from the production SQL server, and then restoring them onto a standby server. But this is not all. The key feature of log shipping is that is will automatically backup transaction logs throughout the day (for whatever interval you specify) and automatically restore them on the standby server. This in effect keeps the two SQL Servers in &#8220;synch&#8221;. Should the production server fail, all you have to do is point the users to the new server, and you are all set. Well, its not really that easy, but it comes close if you put enough effort into your log shipping setup.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/videos/sql-server-2005-log-shipping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server Login Audit tutorial</title>
		<link>http://www.dbsnaps.com/videos/sql-server-login-audit/</link>
		<comments>http://www.dbsnaps.com/videos/sql-server-login-audit/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 19:07:45 +0000</pubDate>
		<dc:creator>Oded Raz</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server - Latest Articles]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Audit Login]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://dbsnaps.oracletutorialvideos.com/?p=101</guid>
		<description><![CDATA[Learn how to audit sql server's login, its simple and its quick.]]></description>
			<content:encoded><![CDATA[<p>Learn how to audit sql server&#8217;s login, its simple and its quick.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/videos/sql-server-login-audit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

