<?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>OraQA &#187; Administration</title>
	<atom:link href="http://oraqa.com/category/administration/feed/" rel="self" type="application/rss+xml" />
	<link>http://oraqa.com</link>
	<description>Oracle Question and Answer</description>
	<lastBuildDate>Tue, 06 Jul 2010 00:08:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How Do I Verify that the Redo File is Being Used?</title>
		<link>http://oraqa.com/2008/08/03/redo-log/</link>
		<comments>http://oraqa.com/2008/08/03/redo-log/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 22:18:36 +0000</pubDate>
		<dc:creator>tushar.chitnis</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Question]]></category>

		<guid isPermaLink="false">http://oraqa.com/?p=263</guid>
		<description><![CDATA[I have a table on which when I run a procedure for computation through sql*plus it runs fine. But the same when I run it from my application server the redo log file gets full. I don&#8217;t understand the reason behind this. So I changed the logging property of the table to no so that [...]]]></description>
			<content:encoded><![CDATA[<p>I have a table on which when I run a procedure for computation through sql*plus it runs fine. But the same when I run it from my application server the redo log file gets full. I don&#8217;t understand the reason behind this. So I changed the logging property of the table to no so that it doesn&#8217;t write anything in redo log. How do i verify that the redo file is being used by the table or not apart from the processing result?</p>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2008/08/03/redo-log/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Blocking IP Address from Logging on to Database Server?</title>
		<link>http://oraqa.com/2008/07/20/blocking-the-ip-address/</link>
		<comments>http://oraqa.com/2008/07/20/blocking-the-ip-address/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 17:28:57 +0000</pubDate>
		<dc:creator>tushar.chitnis</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Question]]></category>

		<guid isPermaLink="false">http://oraqa.com/?p=261</guid>
		<description><![CDATA[Can I block a particular IP address to prevent it from logging into an Oracle 9i server?
]]></description>
			<content:encoded><![CDATA[<p>Can I block a particular IP address to prevent it from logging into an Oracle 9i server?</p>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2008/07/20/blocking-the-ip-address/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to rollback committed data based on a group ID in SQL</title>
		<link>http://oraqa.com/2007/12/04/how-to-rollback-committed-data-based-on-the-group-id-in-sql/</link>
		<comments>http://oraqa.com/2007/12/04/how-to-rollback-committed-data-based-on-the-group-id-in-sql/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 05:13:04 +0000</pubDate>
		<dc:creator>Frank Zhou</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://oraqa.com/2007/12/04/how-to-rollback-committed-data-based-on-the-group-id-in-sql/</guid>
		<description><![CDATA[The following SQL pattern can be used to rollback committed data based on the group ID in a SQL.
(The restriction of this pattern is that the primary key (id) should not be modified)

create table flash_tab as
select 10 groupId, 1 id , 'A' name from dual
union all
select 10 groupId, 2 id , 'B' name from dual
union [...]]]></description>
			<content:encoded><![CDATA[<p>The following SQL pattern can be used to rollback committed data based on the group ID in a SQL.<br />
(The restriction of this pattern is that the primary key (id) should not be modified)</p>
<pre>
create table flash_tab as
select 10 groupId, 1 id , 'A' name from dual
union all
select 10 groupId, 2 id , 'B' name from dual
union all
select 10 groupId, 3 id , 'C' name from dual
union all
select 10 groupId, 4 id , 'D' name from dual
union all
select 20 groupId, 5 id , 'E' name from dual
union all
select 20 groupId, 6 id , 'F' name from dual
union all
select 20 groupId, 7 id , 'group_20_testing_row_data' name from dual;

ALTER TABLE flash_tab ADD (CONSTRAINT pk_id PRIMARY KEY (id));

select * from flash_tab order by groupId, id;

   GROUPID         ID NAME
---------- ---------- -------------------------
        10          1 A
        10          2 B
        10          3 C
        10          4 D ---**All group 10 data will be rollback later.
        20          5 E
        20          6 F
        20          7 group_20_testing_row_data

7 rows selected.
update flash_tab set name = 'group_name_changed' where id = 1;
delete flash_tab where id = 2;
update flash_tab set groupId= 30,name ='group_num_changed'where id = 3;
update flash_tab set groupId= 40, name ='group_num_name_changed' where id = 4;
insert into flash_tab(groupId, id, name ) values (10, 99, 'group_10_newRow');
delete flash_tab where id = 5;
update flash_tab set name = 'No_RollBack_group_20' where id = 6;
insert into flash_tab ( groupId, id, name ) values (20, 28, 'group_20_newRow');

SQL&gt; commit;

select * from flash_tab order by groupId;

   GROUPID         ID NAME
---------- ---------- -------------------------
        10          1 group_name_changed
        10         99 group_10_newRow
        20          6 No_RollBack_group_20
        20          7 group_20_testing_row_data
        20         28 group_20_newRow
        30          3 group_num_changed
        40          4 group_num_name_changed

7 rows selected.
variable groupId_input  number
exec :groupId_input  := 10;
</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-SQL Solution&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<pre>
MERGE INTO flash_tab tgt
USING (SELECT src.groupId, src.id, src.name,
              tgt.groupId AS tgt_groupId,
              tgt.id AS tgt_id, tgt.name AS tgt_name
        FROM flash_tab AS OF
             TIMESTAMP (SYSTIMESTAMP - INTERVAL '30' SECOND) src
        FULL OUTER JOIN flash_tab tgt ON (src.id = tgt.id)
      ) src
ON (src.tgt_id = tgt.id)
WHEN MATCHED THEN
UPDATE
SET tgt.groupId= src.groupId, tgt.name = src.name
WHERE (LNNVL(tgt.groupId = src.groupId) OR LNNVL(tgt.name = src.name))
  AND (NVL(src.groupId, tgt.groupId) = :groupId_input )
DELETE
WHERE LNNVL(src.id = tgt.id)
  AND tgt.groupId IS NULL AND tgt.name IS NULL
WHEN NOT MATCHED THEN
  INSERT (tgt.groupId, tgt.id, tgt.name)
  VALUES (src.groupId, src.id, src.name)
WHERE src.groupId= :groupId_input;

SQL&gt; commit;

select * from flash_tab order by groupId, id;

  GROUPID         ID NAME
---------- ---------- -------------------------
        10          1 A
        10          2 B
        10          3 C
        10          4 D ---** Roll back only the group 10 data **------
        20          6 No_RollBack_group_20
        20          7 group_20_testing_row_data
        20         28 group_20_newRow
</pre>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2007/12/04/how-to-rollback-committed-data-based-on-the-group-id-in-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add a new VIP in Oracle 10g RAC instance?</title>
		<link>http://oraqa.com/2007/07/21/how-to-add-a-new-vip-in-oracle-10g-rac-instance/</link>
		<comments>http://oraqa.com/2007/07/21/how-to-add-a-new-vip-in-oracle-10g-rac-instance/#comments</comments>
		<pubDate>Sat, 21 Jul 2007 23:17:11 +0000</pubDate>
		<dc:creator>agerby</dc:creator>
				<category><![CDATA[Administration]]></category>

		<guid isPermaLink="false">http://oraqa.com/2007/07/21/how-to-add-a-new-vip-in-oracle-10g-rac-instance/</guid>
		<description><![CDATA[I want add a new VIP (not modify) in oracle 10g RAC instance.
but I don&#8217;t know how to do it.
Anybody can teach me?
Thanks.
]]></description>
			<content:encoded><![CDATA[<p>I want add a new VIP (not modify) in oracle 10g RAC instance.</p>
<p>but I don&#8217;t know how to do it.</p>
<p>Anybody can teach me?</p>
<p>Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2007/07/21/how-to-add-a-new-vip-in-oracle-10g-rac-instance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get complete sessions information</title>
		<link>http://oraqa.com/2007/02/05/how-to-get-complete-sessions-information/</link>
		<comments>http://oraqa.com/2007/02/05/how-to-get-complete-sessions-information/#comments</comments>
		<pubDate>Mon, 05 Feb 2007 17:27:39 +0000</pubDate>
		<dc:creator>Claudiu Ariton</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://oraqa.com/2007/02/05/how-to-get-complete-sessions-information/</guid>
		<description><![CDATA[The following script provides a complete information about the active sessions on your Oracle database (useful for 9i version).

/*
SID                     - Session identifier
SERIAL              [...]]]></description>
			<content:encoded><![CDATA[<p>The following script provides a complete information about the active sessions on your Oracle database (useful for 9i version).</p>
<pre>
/*
SID                     - Session identifier
SERIAL                  - Session serial number
USERNAME                - Oracle username
HOLDING_SESSION         - Blocker SID
           (holding a lock on an object for which another session is waiting)
TIME_MIN                - Active time (minutes)
TIME_SEC                - Active time (seconds)
UNDO_RECORDS            - Number of Undo Records
PROGRESS                - progress of work done so far
           (only for longops operation)
WAIT_EVENT              - current wait event
PGA_SIZE                - PGA size
UGA_SIZE                - UGA size
COMMITS                 - number of commits
SQL_USED                - current/last SQL
LONG_OPS                - Statistics summary message
            (only for longops operation)
TRACE_FILE_NAME         - name of the trace filename
RESOURCE_CONSUMER_GROUP - Name of the session's current resource consumer group
            (Resource Manager feature)
STATUS                  - Status of the session
SERVER                  - Server type
OSUSER                  - Operating system client user name
PROGRAM                 - Operating system program name
MODULE                  - Name of the currently executing module
ACTION                  - Name of the currently executing action
MACHINE                 - Operating system machine name
*/

SELECT   SID,
         serial#,
         username,
         (SELECT holding_session
            FROM dba_waiters
           WHERE waiting_session = s.SID
             AND ROWNUM = 1
             AND holding_session NOT IN (SELECT waiting_session
                                           FROM dba_waiters))
                                                        holding_session,
         DECODE (s.status,
                 'ACTIVE', ROUND (last_call_et / 60),
                 0
                ) time_min,
         DECODE (s.status,
                 'ACTIVE', last_call_et,
                 0
                ) time_sec,
         (SELECT used_urec
            FROM v$transaction t
           WHERE t.addr = s.taddr) undo_records,
         (SELECT ROUND (sl.sofar / sl.totalwork * 100, 2)
            FROM v$session_longops sl
           WHERE s.SID = sl.SID
             AND s.serial# = sl.serial#
             AND s.status = 'ACTIVE'
             AND sl.time_remaining > 0) progress,
         (SELECT event
            FROM v$session_wait w
           WHERE w.SID = s.SID) wait_event,
         (SELECT ROUND (VALUE / 1024 / 1024, 2) || 'M'
            FROM v$sesstat
           WHERE SID = s.SID
             AND statistic# = 20) pga_size,
         (SELECT ROUND (VALUE / 1024 / 1024, 2) || 'M'
            FROM v$sesstat
           WHERE SID = s.SID
             AND statistic# = 15) uga_size,
         (SELECT VALUE
            FROM v$sesstat
           WHERE SID = s.SID
             AND statistic# = 4) commits,
         (SELECT sql_text
            FROM v$sql t
           WHERE s.sql_address = t.address
             AND s.sql_hash_value = t.hash_value
             AND ROWNUM = 1) sql_used,
         (SELECT MESSAGE
            FROM v$session_longops sl
           WHERE s.SID = sl.SID
             AND s.serial# = sl.serial#
             AND s.status = 'ACTIVE'
             AND sl.time_remaining > 0) long_ops,
         (SELECT    LOWER (ins.instance_name)
                 || '_ora_'
                 || LTRIM (TO_CHAR (a.spid))
                 || '.trc' filename
            FROM v$process a
           WHERE a.addr = s.paddr) trace_file_name,
         resource_consumer_group,
         s.status,
         server,
         osuser,
         program,
         module,
         action,
         NVL (LOWER (s.machine), ins.host_name) machine
    FROM v$session s,
         v$instance ins
   WHERE username IS NOT NULL
     AND s.status = 'ACTIVE'
     AND s.audsid <> USERENV ('sessionid')
ORDER BY DECODE (s.status,
                 'ACTIVE', ROUND (last_call_et),
                 0
                ) DESC
/
</pre>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2007/02/05/how-to-get-complete-sessions-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Avoid Starting up Oracle XE at System Startup</title>
		<link>http://oraqa.com/2006/12/21/how-to-avoid-starting-up-oracle-xe-at-system-startup/</link>
		<comments>http://oraqa.com/2006/12/21/how-to-avoid-starting-up-oracle-xe-at-system-startup/#comments</comments>
		<pubDate>Thu, 21 Dec 2006 23:09:30 +0000</pubDate>
		<dc:creator>dweller</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Question]]></category>

		<guid isPermaLink="false">http://oraqa.com/2006/12/21/how-to-avoid-starting-up-oracle-xe-at-system-startup/</guid>
		<description><![CDATA[I am using Oracle Database 10g Express Edition and I don&#8217;t want it to run at system startup because it really slows my computer down. What can I do for it?
]]></description>
			<content:encoded><![CDATA[<p>I am using Oracle Database 10g Express Edition and I don&#8217;t want it to run at system startup because it really slows my computer down. What can I do for it?</p>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2006/12/21/how-to-avoid-starting-up-oracle-xe-at-system-startup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Startup Oracle at System Startup</title>
		<link>http://oraqa.com/2006/11/21/how-to-startup-oracle-at-system-startup/</link>
		<comments>http://oraqa.com/2006/11/21/how-to-startup-oracle-at-system-startup/#comments</comments>
		<pubDate>Tue, 21 Nov 2006 17:10:42 +0000</pubDate>
		<dc:creator>Imran</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Question]]></category>

		<guid isPermaLink="false">http://oraqa.com/2006/11/21/how-to-startup-oracle-at-system-startup/</guid>
		<description><![CDATA[I am running Oracle Database 10g Release 2 on Redhat Enterprise 4. I want my database to startup at system startup. How can I do this?
Thanks
Imran
]]></description>
			<content:encoded><![CDATA[<p>I am running Oracle Database 10g Release 2 on Redhat Enterprise 4. I want my database to startup at system startup. How can I do this?</p>
<p>Thanks<br />
Imran</p>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2006/11/21/how-to-startup-oracle-at-system-startup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to get information about the current session</title>
		<link>http://oraqa.com/2006/09/13/how-to-get-information-about-the-current-session/</link>
		<comments>http://oraqa.com/2006/09/13/how-to-get-information-about-the-current-session/#comments</comments>
		<pubDate>Wed, 13 Sep 2006 22:31:43 +0000</pubDate>
		<dc:creator>Eddie Awad</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://oraqa.com/2006/09/13/how-to-get-information-about-the-current-session/</guid>
		<description><![CDATA[One way is to use the built-in function SYS_CONTEXT. For example:

select
    sys_context('USERENV','AUTHENTICATION_TYPE')
    ,sys_context('USERENV','CURRENT_SCHEMA')
    ,sys_context('USERENV','CURRENT_SCHEMAID')
    ,sys_context('USERENV','CURRENT_USER')
    ,sys_context('USERENV','CURRENT_USERID')
    ,sys_context('USERENV','DB_DOMAIN')
    ,sys_context('USERENV','DB_NAME')
    ,sys_context('USERENV','HOST')
    ,sys_context('USERENV','INSTANCE')
    ,sys_context('USERENV','IP_ADDRESS')
    ,sys_context('USERENV','ISDBA')
 [...]]]></description>
			<content:encoded><![CDATA[<p>One way is to use the built-in function <a href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/functions165.htm#SQLRF06117">SYS_CONTEXT</a>. For example:</p>
<pre>
select
    sys_context('USERENV','AUTHENTICATION_TYPE')
    ,sys_context('USERENV','CURRENT_SCHEMA')
    ,sys_context('USERENV','CURRENT_SCHEMAID')
    ,sys_context('USERENV','CURRENT_USER')
    ,sys_context('USERENV','CURRENT_USERID')
    ,sys_context('USERENV','DB_DOMAIN')
    ,sys_context('USERENV','DB_NAME')
    ,sys_context('USERENV','HOST')
    ,sys_context('USERENV','INSTANCE')
    ,sys_context('USERENV','IP_ADDRESS')
    ,sys_context('USERENV','ISDBA')
    ,sys_context('USERENV','LANG')
    ,sys_context('USERENV','LANGUAGE')
    ,sys_context('USERENV','NETWORK_PROTOCOL')
    ,sys_context('USERENV','NLS_CALENDAR')
    ,sys_context('USERENV','NLS_CURRENCY')
    ,sys_context('USERENV','NLS_DATE_FORMAT')
    ,sys_context('USERENV','NLS_DATE_LANGUAGE')
    ,sys_context('USERENV','NLS_TERRITORY')
    ,sys_context('USERENV','OS_USER')
    ,sys_context('USERENV','SESSION_USER')
    ,sys_context('USERENV','SESSION_USERID')
    ,sys_context('USERENV','SESSIONID')
    ,sys_context('USERENV','TERMINAL')
from dual;
</pre>
<p>Another way is to query the <a href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2088.htm#REFRN30223">V$SESSION</a> dynamic performance view.</p>
<pre>
EDDIE@XE> desc v$session;
 Name                                      Null?    Type
 ----------------------------------------- -------- ---------------

 SADDR                                              RAW(4)
 SID                                                NUMBER
 SERIAL#                                            NUMBER
 AUDSID                                             NUMBER
 PADDR                                              RAW(4)
 USER#                                              NUMBER
 USERNAME                                           VARCHAR2(30)
 COMMAND                                            NUMBER
 OWNERID                                            NUMBER
 TADDR                                              VARCHAR2(8)
 LOCKWAIT                                           VARCHAR2(8)
 STATUS                                             VARCHAR2(8)
 SERVER                                             VARCHAR2(9)
 SCHEMA#                                            NUMBER
 SCHEMANAME                                         VARCHAR2(30)
 OSUSER                                             VARCHAR2(30)
 PROCESS                                            VARCHAR2(12)
 MACHINE                                            VARCHAR2(64)
 TERMINAL                                           VARCHAR2(16)
 PROGRAM                                            VARCHAR2(64)
 TYPE                                               VARCHAR2(10)
 SQL_ADDRESS                                        RAW(4)
 SQL_HASH_VALUE                                     NUMBER
 SQL_ID                                             VARCHAR2(13)
 SQL_CHILD_NUMBER                                   NUMBER
 PREV_SQL_ADDR                                      RAW(4)
 PREV_HASH_VALUE                                    NUMBER
 PREV_SQL_ID                                        VARCHAR2(13)
 PREV_CHILD_NUMBER                                  NUMBER
 MODULE                                             VARCHAR2(48)
 MODULE_HASH                                        NUMBER
 ACTION                                             VARCHAR2(32)
 ACTION_HASH                                        NUMBER
 CLIENT_INFO                                        VARCHAR2(64)
 FIXED_TABLE_SEQUENCE                               NUMBER
 ROW_WAIT_OBJ#                                      NUMBER
 ROW_WAIT_FILE#                                     NUMBER
 ROW_WAIT_BLOCK#                                    NUMBER
 ROW_WAIT_ROW#                                      NUMBER
 LOGON_TIME                                         DATE
 LAST_CALL_ET                                       NUMBER
 PDML_ENABLED                                       VARCHAR2(3)
 FAILOVER_TYPE                                      VARCHAR2(13)
 FAILOVER_METHOD                                    VARCHAR2(10)
 FAILED_OVER                                        VARCHAR2(3)
 RESOURCE_CONSUMER_GROUP                            VARCHAR2(32)
 PDML_STATUS                                        VARCHAR2(8)
 PDDL_STATUS                                        VARCHAR2(8)
 PQ_STATUS                                          VARCHAR2(8)
 CURRENT_QUEUE_DURATION                             NUMBER
 CLIENT_IDENTIFIER                                  VARCHAR2(64)
 BLOCKING_SESSION_STATUS                            VARCHAR2(11)
 BLOCKING_INSTANCE                                  NUMBER
 BLOCKING_SESSION                                   NUMBER
 SEQ#                                               NUMBER
 EVENT#                                             NUMBER
 EVENT                                              VARCHAR2(64)
 P1TEXT                                             VARCHAR2(64)
 P1                                                 NUMBER
 P1RAW                                              RAW(4)
 P2TEXT                                             VARCHAR2(64)
 P2                                                 NUMBER
 P2RAW                                              RAW(4)
 P3TEXT                                             VARCHAR2(64)
 P3                                                 NUMBER
 P3RAW                                              RAW(4)
 WAIT_CLASS_ID                                      NUMBER
 WAIT_CLASS#                                        NUMBER
 WAIT_CLASS                                         VARCHAR2(64)
 WAIT_TIME                                          NUMBER
 SECONDS_IN_WAIT                                    NUMBER
 STATE                                              VARCHAR2(19)
 SERVICE_NAME                                       VARCHAR2(64)
 SQL_TRACE                                          VARCHAR2(8)
 SQL_TRACE_WAITS                                    VARCHAR2(5)
 SQL_TRACE_BINDS                                    VARCHAR2(5)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2006/09/13/how-to-get-information-about-the-current-session/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is the difference between a schema and a user?</title>
		<link>http://oraqa.com/2006/08/01/what-is-the-difference-between-a-schema-and-a-user/</link>
		<comments>http://oraqa.com/2006/08/01/what-is-the-difference-between-a-schema-and-a-user/#comments</comments>
		<pubDate>Tue, 01 Aug 2006 14:22:21 +0000</pubDate>
		<dc:creator>Eddie Awad</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://oraqa.com/2006/08/01/what-is-the-difference-between-a-schema-and-a-user/</guid>
		<description><![CDATA[
A schema is collection of database objects, including logical structures such as tables, views, sequences, stored procedures, synonyms, indexes, clusters, and database links. 
A user owns a schema.
A user and a schema have the same name.
The CREATE USER command creates a user. It also automatically creates a schema for that user.
The CREATE SCHEMA command does [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li>A <a href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14220/glossary.htm#sthref4206">schema</a> is collection of database objects, including logical structures such as tables, views, sequences, stored procedures, synonyms, indexes, clusters, and database links. </li>
<li>A user owns a schema.</li>
<li>A user and a schema have the same name.</li>
<li>The <a href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_8003.htm#i2065278">CREATE USER</a> command creates a user. It also automatically creates a schema for that user.</li>
<li>The <a href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_6014.htm#i2154127">CREATE SCHEMA</a> command does not create a &quot;schema&quot; as it implies, it just allows you to create multiple tables and views and perform multiple grants in your own schema in a single transaction.</li>
<li>For all intents and purposes you can consider a user to be a schema and a schema to be a user.</li>
</ul>
<p>Resources:</p>
<ul>
<li><a href="http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:6162110256950">Tom Kyte</a></li>
<li><a href="http://www.petefinnigan.com/weblog/archives/00000198.htm">Pete Finnigan</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2006/08/01/what-is-the-difference-between-a-schema-and-a-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Self Exporting Database, how to export the database using DBMS_SCHEDULER</title>
		<link>http://oraqa.com/2006/05/21/the-self-exporting-database-how-to-export-the-database-using-dbms_scheduler/</link>
		<comments>http://oraqa.com/2006/05/21/the-self-exporting-database-how-to-export-the-database-using-dbms_scheduler/#comments</comments>
		<pubDate>Mon, 22 May 2006 06:58:53 +0000</pubDate>
		<dc:creator>Karl Reitschuster</dc:creator>
				<category><![CDATA[Administration]]></category>

		<guid isPermaLink="false">http://oraqa.com/2006/05/21/the-self-exporting-database-how-to-export-the-database-using-dbms_scheduler/</guid>
		<description><![CDATA[I always dreamed of a self exporting oracle database. Now with the new Oracle scheduler it is possible. Due to the possibility to start external programs like shell scripts or any other&#160;OS executables you can start an export job exporting your database.
Oracle Scheduler allows definition of Program objects. A program can be a PL/SQL Unit [...]]]></description>
			<content:encoded><![CDATA[<p><font face="Verdana" size="2">I always dreamed of a self exporting oracle database. Now with the new Oracle scheduler it is possible. Due to the possibility to start external programs like shell scripts or any other&nbsp;OS executables you can start an export job exporting your database.</font></p>
<p><font face="Verdana" size="2">Oracle Scheduler allows definition of Program objects. A program can be a PL/SQL Unit or an external operating system executable. Also the parameter of&nbsp;a scheduler program can be defined. You should use VARCHAR2 or a NUMBER type as parameter. Other types for&nbsp; example BOOLEAN are not supported with DB Console yet but bypassing the GUI on PL/SQL level they are. Any operation of the Oracle scheduler is manged with the DBMS_SCHEDULER package.</font></p>
<p><font face="Verdana" size="2">You need </font></p>
<ul>
<li><font face="Verdana" size="2">one&nbsp;external program definition </font></li>
<li><font face="Verdana" size="2">one&nbsp;job definition per database </font></li>
</ul>
<p><font face="Verdana"><font size="2"><font face="Verdana" color="#800000"><strong></strong></font></font></font></p>
<p><font face="Verdana"><font size="2"><font face="Verdana" color="#800000"><strong>Creating the Scheduler Program</strong></font></font></font></p>
<p><font size="2">You define on the <u>Scheduler Programs/Create Program</u> Page :</font></p>
<ul>
<li><font face="Verdana" size="2">the <em>name</em> of tee program unit</font> </li>
<li><font face="Verdana"><font size="2">if it should be <em>enabled</em></font></font> </li>
<li><font face="Verdana" size="2">the programs <em>description</em></font> </li>
<li><font face="Verdana" size="2">the <em>program type</em></font>
<ul>
<li><font face="Verdana" size="2">EXECUTABLE</font> </li>
<li><font face="Verdana" size="2">PL_SQL_BLOCK</font> </li>
<li><font face="Verdana" size="2">STORED_PROCEDURE</font> </li>
</ul>
</li>
<li><font face="Verdana" size="2">the <em>executable name</em> &#8211; better the command line with optional parameter switches</font>
<ul>
<li><font face="Verdana" size="2">always put the output to NULL devices under UNIX to&nbsp;<font color="#808080">/dev/null <font color="#000000">and</font> </font>under Windows to&nbsp;<font color="#808080">nul</font></font> </li>
</ul>
</li>
<li><font face="Verdana" size="2">some additional <em>arguments</em></font> </li>
</ul>
<p><font size="2"></font>&nbsp;</p>
<p align="center"><a href="http://www.orcasoracle.org/wp-content/uploads/2006/04/PROG_EXP_FULL_EXT.jpg"><img height="463" alt="Scheduler program definition page" hspace="1" width="600" align="middle" vspace="1" border="2" src="http://www.orcasoracle.org/wp-content/uploads/2006/04/PROG_EXP_FULL_EXT.jpg" /></a></p>
<p><font face="Verdana" size="2"><br /></font></p>
<p><font face="Verdana" size="2"><strong><font color="#993300"></font></strong></font></p>
<p><font face="Verdana" size="2"><strong><font color="#993300">The DDL for the external program calling a command script&nbsp;starting the Oracle export utility</font></strong></font></p>
<blockquote>
<div>
<p><strong><font size="2">BEGIN</font></strong><br /><font size="2">&nbsp; Dbms_Scheduler.Create_Program</font><font size="2">(</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Program_Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; &#8216;PROG_EXP_FULL_EXT&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Program_Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; &#8216;EXECUTABLE&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Program_Action&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; &#8216;C:\WINDOWS\SYSTEM32\CMD.EXE /C C:\oracle\Scripts\Cmd\exp_full.cmd &gt; nul&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Number_Of_Arguments </font><font size="2">=&gt; 1,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Enabled&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; <strong>FALSE</strong>,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Comments&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; &#8216;Full export of the ISISM database&#8217;</font><br /><font size="2">&nbsp; </font><font size="2">);</font></p>
<p><font size="2">&nbsp; Dbms_Scheduler.Define_Program_Argument</font><font size="2">(</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Program_Name&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;</font><font size="2">=&gt; &#8216;PROG_EXP_FULL_EXT&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Argument_Name&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; &#8216;SID&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Argument_Position </font><font size="2">=&gt; 1,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Argument_Type&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; &#8216;CHAR&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Default_Value&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; &#8221;</font><br /><font size="2">&nbsp; </font><font size="2">);</font><br /><font size="2">&nbsp; Dbms_Scheduler.</font><font size="2"><strong>Enable</strong>(<strong>NAME</strong> =&gt; &#8216;PROG_EXP_FULL_EXT&#8217;);</font><br /><font size="2"><strong>END</strong>;</font><br /><font size="2">/</font></p>
</div>
</blockquote>
<p><font color="#000000"><font face="Verdana" size="2"></font></font></p>
<p><font color="#000000"><font face="Verdana" size="2"></font></font></p>
<p><strong><font face="Verdana" color="#800000" size="2"></font></strong></p>
<p><strong><font face="Verdana" color="#800000" size="2">Creating the Job/General Page</font></strong></p>
<p><font face="Verdana" size="2">On the Scheduler <u>Jobs/Create Job/General</u> Page you start to define a job. Jobs are identified by a job name. A job can execute some PL/SQL directly or in our case the defined program <font color="#808080">PROG_EXP_FULL_EXT</font> with the value for the Instance&nbsp;for the <font color="#808080">SID</font> parameter.</font></p>
<p><font face="Verdana" size="2">Enter following Properties :</font></p>
<ul>
<li><font face="Verdana" size="2"><em>Job name</em>&nbsp; : JOB_EXP_FULL_ISISM<br />For all&nbsp; job operations the job name will be used</font> </li>
<li><font face="Verdana" size="2"><em>Job owner</em> : SYSTEM<br />Other user the system could need some additional grants for creating jobs</font> </li>
<li><font face="Verdana" size="2"><em>ENABLED</em>&nbsp; : Yes<br />Enabled is to be ready to start</font> </li>
<li><font face="Verdana" size="2"><em>Description</em> : The description of the job</font> </li>
<li><font face="Verdana" size="2"><em>LOGGING&nbsp; LEVEL</em> : FULL<br />Would do this if your create a new job</font> </li>
<li><font face="Verdana" size="2"><em>Job class</em><br />is needed for collecting performance metrics dependent&nbsp;&nbsp;of the job class&nbsp;</font> </li>
<li><font face="Verdana" size="2"><em>AutoDrop</em> : FALSE<br />I you have a job with run once frequency you should set this property to TRUE</font> </li>
<li><font face="Verdana" size="2"><em>Restartable</em> : FALSE</font> </li>
</ul>
<p align="center"><a href="http://www.orcasoracle.org/wp-content/uploads/2006/05/CREATE_JOB_EXP_FULL_ISISM_001.jpg"><img height="547" alt="Creating the Job Step 1" width="600" align="middle" src="http://www.orcasoracle.org/wp-content/uploads/2006/05/CREATE_JOB_EXP_FULL_ISISM_001.jpg" /></a></p>
<p><font color="#000000"><font face="Verdana" size="2"></font></font></p>
<p><font face="Verdana" color="#800000" size="2"><strong></strong></font></p>
<p><font face="Verdana" color="#800000" size="2"><strong>Creating the Job/Schedule</strong></font> </p>
<p><font face="Verdana" size="2">On the <u>Scheduler Jobs/Create Job/Schedule</u> Page&nbsp; you can set scheduling parameters for your job. Either you specify all Parameters like </font></p>
<ul>
<li><font face="Verdana" size="2"><em>Time Zone</em></font> </li>
<li><font face="Verdana" size="2"><em>Repeating</em> : the interval of you job is running</font> </li>
<li><font face="Verdana" size="2"><em>Available to start</em> : first starting time of the job</font> </li>
<li><font face="Verdana" size="2"><em>Not Available After</em> : the job is scheduled until the specified time</font> </li>
</ul>
<p><font face="Verdana" size="2">&nbsp;or you could assign a predefined schedule (a scheduling template) which stores all the parameter mentioned above.</font></p>
<p><font face="Verdana" color="#000000" size="2"></font></p>
<p align="center"><font color="#000000"><font face="Verdana" size="2"><a href="http://www.orcasoracle.org/wp-content/uploads/2006/05/CREATE_JOB_EXP_FULL_ISISM_002.jpg"><img height="547" alt="" width="600" src="http://www.orcasoracle.org/wp-content/uploads/2006/05/CREATE_JOB_EXP_FULL_ISISM_002.jpg" /></a></font></font></p>
<p><font color="#000000"><font face="Verdana" size="2"></font></font></p>
<p><font face="Verdana" color="#800000" size="2"><strong></strong></font></p>
<p><font face="Verdana" color="#800000" size="2"><strong>Creating the Job/Options</strong></font></p>
<p><font color="#000000">On the</font> <font face="Verdana" color="#000000" size="2"><u>Scheduler Jobs/Create Job/Options</u> Page following job options can be specified</font></p>
<ul>
<li><font face="Verdana"><font size="2"><font color="#000000"><em>Priority</em> : now it&#8217;s possible to give jobs priorities</font> </font></font></li>
<li><font face="Verdana"><font size="2"><font color="#000000"><em>Schedule Limit (minutes)</em> : Time after which a job that has not been run on the scheduled time will be rescheduled. Only valid for repeating jobs</font> </font></font></li>
<li><font face="Verdana"><font size="2"><font color="#000000"><em>Maximum Runs</em> : Maximum number of consecutive times this job is allowed to run after which its state will be changed to &#8216;COMPLETED&#8217;</font></font></font> </li>
<li><font face="Verdana"><font size="2"><font color="#000000"></font><font color="#000000">Maximum Failures</font> : Number of times a job can fail on consecutive scheduled runs before it is automatically disabled</font></font> </li>
<li><font face="Verdana"><font size="2"><font color="#000000"><em>Job Weight</em> : Job which include parallel queries should set this to the number of parallel slaves they expect to spawn</font> </font></font></li>
<li><font face="Verdana"><font size="2"><font color="#000000"><em>Instance Stickiness</em> : A switch which enables load balancing on RAC</font> </font></font></li>
</ul>
<p><font color="#000000"></font></p>
<p align="center"><a href="http://www.orcasoracle.org/wp-content/uploads/2006/05/CREATE_JOB_EXP_FULL_ISISM_003.jpg"><img height="463" alt="" width="600" src="http://www.orcasoracle.org/wp-content/uploads/2006/05/CREATE_JOB_EXP_FULL_ISISM_003.jpg" /></a></p>
<p><font color="#000000"><font face="Verdana" color="#800000" size="2"><strong></strong></font></font></p>
<p><font color="#000000"><font face="Verdana" color="#800000" size="2"><strong>The DDL for the job definition. The database is specified by the Parameters SID</strong></font></font></p>
<p><font color="#000000"></font></p>
<p>&nbsp;</p>
<blockquote>
<p><strong><font size="2">BEGIN</font></strong><br /><font size="2">&nbsp; Dbms_Scheduler.Create_Job</font><font size="2">(</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Job_Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; &#8216;&quot;SYSTEM&quot;.&quot;JOB_EXP_FULL_ISISM&quot;&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Program_Name&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; &#8216;SYSTEM.PROG_EXP_FULL_EXT&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Repeat_Interval </font><font size="2">=&gt; &#8216;FREQ=DAILY;BYHOUR=2;BYMINUTE=10;BYSECOND=0&#8242;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Start_Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; To_Timestamp_Tz(&#8217;2006-04-07 Europe/Berlin&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">&#8216;YYYY-MM-DD TZR&#8217;),</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Job_Class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; &#8216;DEFAULT_JOB_CLASS&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Comments&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; &#8216;Full Export of ISISM database&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Auto_Drop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; <strong>FALSE</strong>,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Enabled&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; <strong>FALSE</strong></font><br /><font size="2">&nbsp; </font><font size="2">);</font></p>
<p><font size="2">&nbsp; Dbms_Scheduler.Set_Attribute</font><font size="2">(</font><br /><font size="2">&nbsp;&nbsp;&nbsp; </font><font size="2"><strong>NAME</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; &#8216;&quot;SYSTEM&quot;.&quot;JOB_EXP_FULL_ISISM&quot;&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; </font><font size="2"><strong>Attribute</strong> =&gt; &#8216;logging_level&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; </font><font size="2"><strong>VALUE</strong>&nbsp;&nbsp;&nbsp;&nbsp; =&gt;</font><font size="2"> Dbms_Scheduler.Logging_Full<br />&nbsp; );</font></p>
<p><font size="2">&nbsp; Dbms_Scheduler.Set_Attribute</font><font size="2">(</font><br /><font size="2">&nbsp;&nbsp;&nbsp; </font><font size="2"><strong>NAME</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; &#8216;&quot;SYSTEM&quot;.&quot;JOB_EXP_FULL_ISISM&quot;&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; </font><font size="2"><strong>Attribute</strong> =&gt; &#8216;job_weight&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; </font><font size="2"><strong>VALUE</strong>&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 1</font><br /><font size="2">&nbsp; </font><font size="2">);</font></p>
<p><font size="2">&nbsp; Dbms_Scheduler.Set_Job_Argument_Value</font><font size="2">(</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Job_Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font size="2">=&gt; &#8216;&quot;SYSTEM&quot;.&quot;JOB_EXP_FULL_ISISM&quot;&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Argument_Name&nbsp; </font><font size="2">=&gt; &#8216;SID&#8217;,</font><br /><font size="2">&nbsp;&nbsp;&nbsp; Argument_Value </font><font size="2">=&gt; &#8216;ISISM&#8217;</font><br /><font size="2">&nbsp; </font><font size="2">);</font></p>
<p><font size="2">&nbsp; Dbms_Scheduler.</font><font size="2"><strong>Enable</strong>(&#8217;&quot;SYSTEM&quot;.&quot;JOB_EXP_FULL_ISISM&quot;&#8217;);</font><br /><font size="2"><strong>END</strong>;</font><br /><font size="2">/</font></p>
</blockquote>
<p><font face="Verdana" color="#993300" size="2"><strong>Creating the Job/Scheduler Jobs</strong></font></p>
<p><font face="Verdana" size="2">After&nbsp;the job is created &nbsp;it appears on the Page <u>Scheduler Jobs</u>. From this point you can monitor the current job status and the history of runs a jobs has done.</font></p>
<p align="center"><a href="http://www.orcasoracle.org/wp-content/uploads/2006/05/CREATE_JOB_EXP_FULL_ISISM_004.jpg"><img height="463" alt="" width="600" src="http://www.orcasoracle.org/wp-content/uploads/2006/05/CREATE_JOB_EXP_FULL_ISISM_004.jpg" /></a></p>
<p><font face="Verdana" size="2">Finally the Windows Command script exp_full.sh which is&nbsp;called&nbsp;as external program</font></p>
<blockquote>
<p><font face="Courier New" size="2">SET INSTANCE=%1<br />SET MODE=FULL<br />echo %1<br />pause<br />SET ORACLE_SID=%INSTANCE%<br />exp system/***** FULL=Y GRANTS=Y FILE=C:\TEMP\Exp\Exp.Stage\%MODE%_%INSTANCE%.dmp log=C:\TEMP\Exp\Exp.Stage\%MODE%_%INSTANCE%.log COMPRESS=N BUFFER=4000000<br /></font></p>
</blockquote>
<p><font face="Verdana" size="2">Currently i&nbsp;export all local databases&nbsp;driven by dbms_scheduler&nbsp;scheduled on one instance. Even non database tasks could be scheduled with the oracle scheduler.</font></p>
<p><font face="Verdana" size="2">HTH Karl</font></p>
<p>&nbsp;</p>
<hr />
<p>&nbsp;</p>
<p><font face="Verdana" size="2">Further Documentation</font></p>
<ul>
<li><a href="http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14231/jobtosched.htm"><font face="Verdana" size="2">Moving from DBMS_JOB to DBMS_SCHEDULER</font></a><font face="Verdana" size="2"> </font></li>
<li><a href="http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sched.htm"><font face="Verdana" size="2">Using DBMS_SCHEDULER</font></a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2006/05/21/the-self-exporting-database-how-to-export-the-database-using-dbms_scheduler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
