tag:blogger.com,1999:blog-30950734416667215932024-03-06T09:39:44.632+05:30Learn Oracle Teach OracleThis blog is dedicated to all who are willing to learn & teach oracle.
It's our encouragement that what make us what we are.
I can be contacted at navneetsingh89@gmail.com for any type of queries/suggestions.Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-3095073441666721593.post-85434470154270170992013-02-22T18:49:00.003+05:302013-02-25T11:58:58.233+05:30Audit Users Logon & Logoff<div dir="ltr" style="text-align: left;" trbidi="on">
We design a trigger that can be used <span class="contentText"><span style="font-size: 12pt;">for single
table to record both logon
and logoff events in ORACLE. This table will contain distinct username , session ID , Host name , including Log ON/OFF time. Trigger will check the existence for user, if user already exists in table then it will update only its Log ON/OFF time depending upon the happening.</span></span><br />
<span class="contentText"><span style="font-size: 12pt;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS65gkVH0OyPd2bNaLprp3ipxcpw2uaZKgrvHW7ceU_wxysdwR_GkNo-0NZ8c1Sh2U2gJEYapqC8FG-8Coj9IQqKxv2WKiiuoXkrhlbIHGJwna9OFtGxA48C99r__25NOK2TSItKEkUNHK/s1600/Fire_meaney.gif" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS65gkVH0OyPd2bNaLprp3ipxcpw2uaZKgrvHW7ceU_wxysdwR_GkNo-0NZ8c1Sh2U2gJEYapqC8FG-8Coj9IQqKxv2WKiiuoXkrhlbIHGJwna9OFtGxA48C99r__25NOK2TSItKEkUNHK/s320/Fire_meaney.gif" width="269" /></a></div>
<span style="background-color: #76a5af;"><span style="font-family: "Courier New",Courier,monospace;">CREATE TABLE STATS_USER<br />(<br /> USER_ID VARCHAR2(30),<br /> SESSION_ID NUMBER(8),<br /> HOST VARCHAR2(30),<br /> LOGON_TIME TIMESTAMP,<br /> LOGOFF_TIME TIMESTAMP<br />);</span></span><br />
<br />
<br />
<br />
<br />
<span style="background-color: #93c47d;"><br /><span style="font-family: "Courier New",Courier,monospace;">CREATE OR REPLACE TRIGGER<br /> logoff_audit_trigger<br /> BEFORE LOGOFF ON DATABASE<br />DECLARE<br /> puser VARCHAR2(20) := USER;<br /> pcount NUMBER(2);<br /> BEGIN<br /> SELECT COUNT(1) INTO pcount FROM stats_user WHERE user_id = puser;<br /> IF pcount>=1 THEN<br /> UPDATE stats_user SET LOGOFF_TIME = SYSDATE WHERE user_id= puser;<br /> ELSE<br /> INSERT INTO stats_user VALUES(<br /> user,<br /> sys_context('USERENV','</span></span><br />
<div>
<wbr></wbr><span style="background-color: #93c47d;"><span style="font-family: "Courier New",Courier,monospace;">SESSIONID'),<br /> sys_context('USERENV','HOST'),<br /> null,<br /> sysdate<br /> );<br /> end if;<br /> end;<br /> /</span></span><br />
<br />
<span style="background-color: #93c47d;"><span style="font-family: "Courier New",Courier,monospace;"><br /> create or replace trigger<br /> logon_audit_trigger<br /> BEFORE LOGOFF ON DATABASE<br /> declare<br /> puser varchar2(20) := user;<br /> pcount number(2);<br /> Begin<br /> select count(1) into pcount from stats_user where user_id = puser;<br /> if pcount>=1 then<br /> update stats_user set LOGON_time = SYSDATE WHERE user_id= puser;<br /> ELSE<br /> INSERT INTO stats_user values(<br /> USER,<br /> SYS_CONTEXT('USERENV','</span></span><wbr></wbr><span style="background-color: #93c47d;"><span style="font-family: "Courier New",Courier,monospace;">SESSIONID'),<br /> SYS_CONTEXT('USERENV','HOST'),<br /> SYSDATE,<br /> null<br /> );<br /> end if;<br /> end;<br /> / </span></span></div>
<div>
<span style="background-color: #93c47d;"><span style="font-family: "Courier New",Courier,monospace;"></span></span></div>
<div>
<span style="background-color: #93c47d;"><span style="font-family: "Courier New",Courier,monospace;"></span></span></div>
<div>
<span style="background-color: #93c47d;"><span style="font-family: "Courier New",Courier,monospace;"></span></span></div>
<div>
<span style="background-color: #93c47d;"><span style="font-family: "Courier New",Courier,monospace;"></span></span></div>
<div>
<span style="background-color: #93c47d;"><span style="font-family: "Courier New",Courier,monospace;"></span></span></div>
<div>
<span style="background-color: #93c47d;"><span style="font-family: "Courier New",Courier,monospace;"></span></span></div>
<div>
<span style="background-color: #93c47d;"><span style="font-family: "Courier New",Courier,monospace;"></span></span></div>
<div>
<span style="background-color: #93c47d;"><span style="font-family: "Courier New",Courier,monospace;"></span></span></div>
<div>
<span style="background-color: #93c47d;"><span style="font-family: "Courier New",Courier,monospace;"></span></span></div>
<div>
<span style="background-color: #93c47d;"><span style="font-family: "Courier New",Courier,monospace;"></span></span></div>
<div>
<br />
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="background-color: white;">For detail info kindly visit</span></span><br />
<span style="background-color: white;"><span style="font-family: "Courier New",Courier,monospace;"><a href="http://www.dba-oracle.com/art_builder_sec_audit.htm" rel="nofollow" target="_blank"><span style="font-family: Arial,Helvetica,sans-serif;">http://www.dba-oracle.com/art_builder_sec_audit.htm </span></a></span></span></div>
<div>
</div>
<div>
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="background-color: white;">Made by </span></span></div>
<div>
<div>
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="background-color: white;">www.j4info.blogspot.in is</span></span></div>
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="background-color: white;"></span></span>gurjeetkamboj@gmail.com</div>
</div>
Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com0tag:blogger.com,1999:blog-3095073441666721593.post-72196325773829585342012-11-06T14:54:00.001+05:302012-11-06T14:54:12.534+05:30ORA-12560: TNS:protocol adapter error (Windows)<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 class="post-title entry-title" itemprop="name">
</h3>
<div class="post-header">
</div>
<b>ORA-12560: TNS:protocol adapter error:</b><br />
<br />
<br />
<br />
This error often strikes anytime then i list out what to do<br />
1. Check networking wires<br />
2. Check ping <br />
3. Ensure listener is started<br />
4.. Oracle variables configured correctly<br />
<br />
In Windows OS:<br />
---------------<br />
C:\Users\Home>set ORACLE_HOME=F:\app\Home2\product\11.2.0\dbhome_1<br />
<br />
C:\Users\Home>SET ORACLE_SID=ORCL<br />
<br />
C:\Users\Home>sqlplus "/as sysdba"<br />
<br />
SQL*Plus: Release 11.2.0.1.0 Production on Sat Dec 3 23:32:18 2011<br />
<br />
Copyright (c) 1982, 2010, Oracle. All rights reserved.<br />
<br />
ERROR:<br />
ORA-12560: TNS:protocol adapter error<br />
<br />
<br />
Enter user-name:<br />
ERROR:<br />
ORA-12560: TNS:protocol adapter error<br />
<br />
<br />
Enter user-name:<br />
ERROR:<br />
ORA-12560: TNS:protocol adapter error<br />
<br />
<br />
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus<br />
<br />
C:\Users\Home>oradim -start -sid XE<br />
<br />
C:\Users\Home>sqlplus "/as sysdba"<br />
<br />
SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 00:08:27 2011<br />
<br />
Copyright (c) 1982, 2010, Oracle. All rights reserved.<br />
<br />
Connected to an idle instance.<br />
<br />
SQL> startup<br />
ORACLE instance started.<br />
<br />
Total System Global Area 64086720 bytes<br />
Fixed Size 137492 bytes<br />
Variable Size 21313364 bytes<br />
Database Buffers 41930400 bytes<br />
Redo Buffers 556464 bytes<br />
Database mounted.<br />
Database opened.<br />
<br />
SQL> conn sys@orcl as sysdba<br />
Enter password:<br />
Connected.<br />
SQL><br />
<br />
<br />
<br />
<pre style="font-family: Georgia,"Times New Roman",serif;">Your suggestions and queries are always warm welcomed. <span style="font-size: xx-small;"> </span></pre>
</div>
Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com0tag:blogger.com,1999:blog-3095073441666721593.post-83103344162904083312012-09-21T09:55:00.000+05:302012-09-21T09:55:17.899+05:30Status of Primary & Standby server<div dir="ltr" style="text-align: left;" trbidi="on">
-----run on primary <br />spool 'C:\dg_Primary_output.log'<br />--spool dg_Primary_output.log<br />set feedback off<br />set trimspool on<br />set line 500<br />set pagesize 50<br />column name for a30<br />column display_value for a30<br />column ID format 99<br />column "SRLs" format 99<br />column active format 99<br />col type format a4<br />column ID format 99<br />column "SRLs" format 99<br />column active format 99<br />col type format a4<br />col PROTECTION_MODE for a20<br />col RECOVERY_MODE for a20<br />col db_mode for a15<br />SELECT name, display_value FROM v$parameter WHERE name IN ('db_name','db_unique_name','log_archive_config','log_archive_dest_2','log_archive_dest_state_2','fal_client','fal_server','standby_file_management','standby_archive_dest','db_file_name_convert','log_file_name_convert','remote_login_passwordfile','local_listener','dg_broker_start','dg_broker_config_file1','dg_broker_config_file2','log_archive_max_processes') order by name;<br />col name for a10<br />col DATABASE_ROLE for a10<br />SELECT name,db_unique_name,protection_mode,DATABASE_ROLE,OPEN_MODE,switchover_status from v$database;<br />select thread#,max(sequence#) from v$archived_log group by thread#;<br />SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference"<br />FROM<br />(SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,<br />(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL<br />WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;<br />col severity for a15<br />col message for a70<br />col timestamp for a20<br />select severity,error_code,to_char(timestamp,'DD-MON-YYYY HH24:MI:SS') "timestamp" , message from v$dataguard_status where dest_id=2;<br />select ds.dest_id id<br />, ad.status<br />, ds.database_mode db_mode<br />, ad.archiver type<br />, ds.recovery_mode<br />, ds.protection_mode<br />, ds.standby_logfile_count "SRLs"<br />, ds.standby_logfile_active active<br />, ds.archived_seq#<br />from v$archive_dest_status ds<br />, v$archive_dest ad<br />where ds.dest_id = ad.dest_id<br />and ad.status != 'INACTIVE'<br />order by<br />ds.dest_id;<br />column FILE_TYPE format a20<br />col name format a60<br />select name<br />, floor(space_limit / 1024 / 1024) "Size MB"<br />, ceil(space_used / 1024 / 1024) "Used MB"<br />from v$recovery_file_dest<br />order by name;<br />spool off<br /><br /><br /><br /><br /><br />----run on standby <br /><br />spool 'C:\dg_standby_output.log'<br />--spool dg_standby_output.log<br />set feedback off<br />set trimspool on<br />set line 500<br />set pagesize 50<br />set linesize 200<br />column name for a30<br />column display_value for a30<br />col value for a10<br />col PROTECTION_MODE for a15<br />col DATABASE_Role for a15<br />SELECT name, display_value FROM v$parameter WHERE name IN ('db_name','db_unique_name','log_archive_config','log_archive_dest_2','log_archive_dest_state_2','fal_client','fal_server','standby_file_management','standby_archive_dest','db_file_name_convert','log_file_name_convert','remote_login_passwordfile','local_listener','dg_broker_start','dg_broker_config_file1','dg_broker_config_file2','log_archive_max_processes') order by name;<br />col name for a10<br />col DATABASE_ROLE for a10<br />SELECT name,db_unique_name,protection_mode,DATABASE_ROLE,OPEN_MODE from v$database;<br />select thread#,max(sequence#) from v$archived_log where applied='YES' group by thread#;<br />select process, status,thread#,sequence# from v$managed_standby;<br />col name for a30<br />select * from v$dataguard_stats;<br />select * from v$archive_gap;<br />col name format a60<br />select name<br />, floor(space_limit / 1024 / 1024) "Size MB"<br />, ceil(space_used / 1024 / 1024) "Used MB"<br />from v$recovery_file_dest<br />order by name;<br />spool off<br /><br /><br /><br /></div>
Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com0tag:blogger.com,1999:blog-3095073441666721593.post-6075236178064088812012-09-14T11:56:00.000+05:302012-09-14T11:56:06.691+05:30Find any NUMBER or TEXT from all DB<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
These are the repository from where i can consult. Thanks for using this.<br />
<br />
-----------------------------------------------------------------------------------------------------------------<br />Below Pl/Sql to find any NUMBER from all DB<br />-----------------------------------------------------------------------------------------------------------------<br />set serveroutput on size unlimited;<br /><br />DECLARE<br /> v_id NUMBER := 1001249;<br /> v_sql1 VARCHAR (1000);<br /> cnt NUMBER (10);<br />BEGIN<br /> FOR t IN (SELECT column_name, table_name<br /> FROM user_tab_columns<br /> WHERE column_name LIKE '%_ID' and data_type='NUMBER')<br /> LOOP<br /> v_sql1 :=<br /> 'SELECT COUNT('<br /> || t.column_name<br /> || ') FROM '<br /> || t.table_name<br /> || ' WHERE '<br /> || t.column_name<br /> || ' = '<br /> || v_id;<br /> EXECUTE IMMEDIATE v_sql1<br /> INTO cnt;<br /> IF (cnt > 0)<br /> THEN<br /> DBMS_OUTPUT.put_line ('..' || cnt);<br /> DBMS_OUTPUT.put_line ('..' || v_sql1);<br /> END IF;<br /> END LOOP;<br />END;<br />/<br /><br /><br /><br /><br />----------------------------------------------------------------------------------------------------------------<br />Below Pl/Sql to find any TEXT from all DB<br />---------------------------------------------------------------------------------------------------------------<br /><br /><br />SET serveroutput ON size unlimited;<br />DECLARE<br /> v_id VARCHAR (1000) := '% is Invo%';<br /> v_sql1 VARCHAR (1000);<br /> cnt NUMBER (10);<br />BEGIN<br /> FOR t IN<br /> (SELECT column_name,<br /> table_name<br /> FROM user_tab_columns<br /> WHERE data_type IN ('CHAR', 'NCHAR', 'NVARCHAR2', 'VARCHAR2')<br /> )<br /> LOOP<br /> v_sql1 :='SELECT COUNT(' || t.column_name || ') FROM '|| t.table_name|| ' WHERE '|| t.column_name|| ' like '''|| v_id||'''';<br /> EXECUTE IMMEDIATE V_SQL1 INTO CNT;<br /> IF (cnt > 0) THEN<br /> DBMS_OUTPUT.put_line ('..' || cnt);<br /> DBMS_OUTPUT.PUT_LINE ('..' || V_SQL1);<br /> END IF;<br /> END LOOP;<br />END;<br />/</div>
Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com2tag:blogger.com,1999:blog-3095073441666721593.post-25426801261529508922012-08-29T15:55:00.002+05:302012-08-29T15:55:57.756+05:30pl sql<div dir="ltr" style="text-align: left;" trbidi="on">
========================comma seperated to rows OR used IN clause==========================<br />
<br />
<br />
<br />
WITH T AS (SELECT &V_USERID AS USERID FROM DUAL)<br />
SELECT TRIM(REGEXP_SUBSTR (USERID, '[^,]+', 1, LEVEL)) ID FROM T<br />
CONNECT BY regexp_substr(USERID, '[^,]+', 1, level) is not null<br />
/<br />
<br />
Enter value for v_userid: '1000,10001,10002,10003,10004'<br />
<br />
ID<br />
-------<br />
1000<br />
10001<br />
10002<br />
10003<br />
10004<br />
<br />
<br />
<br />
===========================converting days \into week====================================<br />
<br />
<br />
SELECT TRUNC(TO_DATE('sysdate'),'d'), <br />
TRUNC(TO_DATE('sysdate'),'Y'),<br />
7+TRUNC(TO_DATE('sysdate'),'d')- <br />
TRUNC(TO_DATE('sysdate'),'Y') AS S,<br />
CEIL((7+(TRUNC(TO_DATE('sysdate'),'d'))- <br />
TRUNC(TO_DATE('sysdate'),'Y'))/7) as a FROM DUAL;<br />
<br />
<br />
=====================================Changing Timezone=================================<br />
<br />
<br />
set serveroutput on size 1000000;<br />
<br />
declare<br />
v_sql varchar(10000);<br />
BEGIN<br />
FOR t IN (SELECT ut.table_name, utc.column_name<br />
FROM user_tab_columns utc join user_tables ut on utc.table_name=ut.table_name<br />
WHERE utc.data_type = 'DATE' and utc.table_name not like 'AD_%')<br />
LOOP<br />
v_sql:= 'UPDATE '<br />
|| t.table_name<br />
|| ' SET '<br />
|| t.column_name<br />
|| ' = TO_DATE(TO_CHAR((FROM_TZ(CAST('<br />
|| t.column_name<br />
|| ' AS TIMESTAMP), ''+5:30'') AT TIME ZONE ''&TO_TIMEZONE'')'<br />
|| ',''DD-MM-RRRR HH24:MI:SS''),''DD-MM-RRRR HH24:MI:SS'')';<br />
<br />
EXECUTE IMMEDIATE v_sql;<br />
COMMIT;<br />
DBMS_OUTPUT.put_line('..'||v_sql||';');<br />
DBMS_OUTPUT.put_line('COMMIT;');<br />
<br />
END LOOP;<br />
END;<br />
<br />
<br />
=======================================================================================</div>
Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com6tag:blogger.com,1999:blog-3095073441666721593.post-42431906428082066102012-08-28T13:35:00.003+05:302012-08-28T13:39:00.951+05:30Buffer Hit Ratio <div dir="ltr" style="text-align: left;" trbidi="on">
<span class="comment-body" data-li-comment-text=""><u><b>Buffer Hit Ratio
</b></u><br />
<br />
Hit Ratio should be > 80%, else increase DB_BLOCK_BUFFERS in init.ora
<br />
<br />
select sum(decode(NAME, 'consistent gets',VALUE, 0)) "Consistent Gets",
<br />
sum(decode(NAME, 'db block gets',VALUE, 0)) "DB Block Gets",
<br />
sum(decode(NAME, 'physical reads',VALUE, 0)) "Physical Reads",
<br />
round((sum(decode(name, 'consistent gets',value, 0)) + <br />
sum(decode(name, 'db block gets',value, 0)) - <br />
sum(decode(name, 'physical reads',value, 0))) / <br />
(sum(decode(name, 'consistent gets',value, 0)) + <br />
sum(decode(name, 'db block gets',value, 0))) * 100,2) "Hit Ratio"
<br />
from v$sysstat
;</span><br />
<span class="comment-body" data-li-comment-text=""><br />
<br />
<u><b>Data Dict Hit Ratio
</b></u><br />
<br />
Hit Ratio should be > 90%, else increase SHARED_POOL_SIZE in init.ora
<br />
<br />
select sum(GETS),
<br />
sum(GETMISSES),
<br />
round((1 - (sum(GETMISSES) / sum(GETS))) * 100,2)
<br />
from v$rowcache
;<br />
</span><br />
<span class="comment-body" data-li-comment-text=""></span><br />
<span class="comment-body" data-li-comment-text=""><br />
<u><b>SQL Cache Hit Ratio
</b></u><br />
<br />
Hit Ratio should be > 85%
<br />
<br />
select sum(PINS) Pins,
<br />
sum(RELOADS) Reloads,
<br />
round((sum(PINS) - sum(RELOADS)) / sum(PINS) * 100,2) Hit_Ratio
<br />
from v$librarycache;
<br />
<br />
<u><b></b></u></span><br />
<br />
<br />
<span class="comment-body" data-li-comment-text=""><u><b>Library Cache Miss Ratio</b></u>
<br />
<br />
Hit Ratio should be < 1%, else increase SHARED_POOL_SIZE in init.ora
<br />
<br />
select sum(PINS) Executions,
<br />
sum(RELOADS) cache_misses,
<br />
sum(RELOADS) / sum(PINS) miss_ratio
<br />
from v$librarycache;</span><br />
<br />
<br />
<br />
<pre style="font-family: Georgia,"Times New Roman",serif;">Your suggestions and queries are always warm welcomed. <span style="font-size: small;"> </span></pre>
</div>
Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com0tag:blogger.com,1999:blog-3095073441666721593.post-43262155227198074512012-08-16T17:57:00.001+05:302012-08-28T13:47:41.788+05:30Useful syntax DB<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
<div>
<b> -----------------------------------ts_extent_map.sql--------------------------------------</b></div>
<div>
<br /></div>
<div>
-- -----------------------------------------------------------------------------------</div>
<div>
-- File Name : http://www.oracle-base.com/dba/monitoring/ts_extent_map.sql</div>
<div>
-- Author : DR Timothy S Hall</div>
<div>
-- Description : Displays gaps (empty space) in a tablespace or specific datafile.</div>
<div>
-- Requirements : Access to the DBA views.</div>
<div>
-- Call Syntax : @ts_extent_map (tablespace-name) [all | file_id]</div>
<div>
-- Last Modified: 25/01/2003</div>
<div>
-- -----------------------------------------------------------------------------------</div>
<div>
SET SERVEROUTPUT ON SIZE 1000000</div>
<div>
SET FEEDBACK OFF</div>
<div>
SET TRIMOUT ON</div>
<div>
SET VERIFY OFF</div>
<div>
<br /></div>
<div>
DECLARE</div>
<div>
l_tablespace_name VARCHAR2(30) := UPPER('&1');</div>
<div>
l_file_id VARCHAR2(30) := UPPER('&2');</div>
<div>
<br /></div>
<div>
CURSOR c_extents IS</div>
<div>
SELECT owner,</div>
<div>
segment_name,</div>
<div>
file_id,</div>
<div>
block_id AS start_block,</div>
<div>
block_id + blocks - 1 AS end_block</div>
<div>
FROM dba_extents</div>
<div>
WHERE tablespace_name = l_tablespace_name</div>
<div>
AND file_id = DECODE(l_file_id, 'ALL', file_id, TO_NUMBER(l_file_id))</div>
<div>
ORDER BY file_id, block_id;</div>
<div>
<br /></div>
<div>
l_block_size NUMBER := 0;</div>
<div>
l_last_file_id NUMBER := 0;</div>
<div>
l_last_block_id NUMBER := 0;</div>
<div>
l_gaps_only BOOLEAN := TRUE;</div>
<div>
l_total_blocks NUMBER := 0;</div>
<div>
BEGIN</div>
<div>
SELECT block_size</div>
<div>
INTO l_block_size</div>
<div>
FROM dba_tablespaces</div>
<div>
WHERE tablespace_name = l_tablespace_name;</div>
<div>
<br /></div>
<div>
DBMS_OUTPUT.PUT_LINE('Tablespace Block Size (bytes): ' || l_block_size);</div>
<div>
FOR cur_rec IN c_extents LOOP</div>
<div>
IF cur_rec.file_id != l_last_file_id THEN</div>
<div>
l_last_file_id := cur_rec.file_id;</div>
<div>
l_last_block_id := cur_rec.start_block - 1;</div>
<div>
END IF;</div>
<div>
</div>
<div>
IF cur_rec.start_block > l_last_block_id + 1 THEN</div>
<div>
DBMS_OUTPUT.PUT_LINE('*** GAP *** (' || l_last_block_id || ' -> ' || cur_rec.start_block || ')' ||</div>
<div>
' FileID=' || cur_rec.file_id ||</div>
<div>
' Blocks=' || (cur_rec.start_block-l_last_block_id-1) || </div>
<div>
' Size(MB)=' || ROUND(((cur_rec.start_block-l_last_block_id-1) * l_block_size)/1024/1024,2)</div>
<div>
);</div>
<div>
l_total_blocks := l_total_blocks + cur_rec.start_block - l_last_block_id-1;</div>
<div>
END IF;</div>
<div>
l_last_block_id := cur_rec.end_block;</div>
<div>
IF NOT l_gaps_only THEN</div>
<div>
DBMS_OUTPUT.PUT_LINE(RPAD(cur_rec.owner || '.' || cur_rec.segment_name, 40, ' ') ||</div>
<div>
' (' || cur_rec.start_block || ' -> ' || cur_rec.end_block || ')');</div>
<div>
END IF;</div>
<div>
END LOOP;</div>
<div>
DBMS_OUTPUT.PUT_LINE('Total Gap Blocks: ' || l_total_blocks);</div>
<div>
DBMS_OUTPUT.PUT_LINE('Total Gap Space (MB): ' || ROUND((l_total_blocks * l_block_size)/1024/1024,2));</div>
<div>
END;</div>
<div>
/</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<div>
<br /></div>
<div>
<b>---------------------------- maxshrink.sql ----------------------------------</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
set verify off</div>
<div>
column file_name format a50 word_wrapped</div>
<div>
column smallest format 999,990 heading "Smallest|Size|Poss."</div>
<div>
column currsize format 999,990 heading "Current|Size"</div>
<div>
column savings format 999,990 heading "Poss.|Savings"</div>
<div>
break on report</div>
<div>
compute sum of savings on report</div>
<div>
<br /></div>
<div>
column value new_val blksize</div>
<div>
select value from v$parameter where name = 'db_block_size'</div>
<div>
/</div>
<div>
<br /></div>
<div>
select file_name,</div>
<div>
ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) smallest,</div>
<div>
ceil( blocks*&&blksize/1024/1024) currsize,</div>
<div>
ceil( blocks*&&blksize/1024/1024) -</div>
<div>
ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) savings</div>
<div>
from dba_data_files a,</div>
<div>
( select file_id, max(block_id+blocks-1) hwm</div>
<div>
from dba_extents</div>
<div>
group by file_id ) b</div>
<div>
where a.file_id = b.file_id(+)</div>
<div>
/</div>
<div>
<br /></div>
<div>
column cmd format a75 word_wrapped</div>
<div>
<br /></div>
<div>
select 'alter database datafile '''||file_name||''' resize ' ||</div>
<div>
ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) || 'm;' cmd</div>
<div>
from dba_data_files a,</div>
<div>
( select file_id, max(block_id+blocks-1) hwm</div>
<div>
from dba_extents</div>
<div>
group by file_id ) b</div>
<div>
where a.file_id = b.file_id(+)</div>
<div>
and ceil( blocks*&&blksize/1024/1024) -</div>
<div>
ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) > 0</div>
<div>
/</div>
<br />
<br />
<div>
<br /></div>
</div>
<div>
<b>----------------------------------AUDITING SCHEMA VISE------------------------------------</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
declare</div>
<div>
v_object_schema varchar2(50) :='VIENNAPRODUCTIVE';</div>
<div>
v_table_name varchar2(255);</div>
<div>
v_policy_name varchar2(255);</div>
<div>
begin</div>
<div>
for t in (select table_name, 'POL_'||table_name as policy_name from dba_tables where owner = v_object_schema)</div>
<div>
loop</div>
<div>
v_table_name := t.table_name;</div>
<div>
v_policy_name := t.policy_name;</div>
<div>
dbms_fga.add_policy (</div>
<div>
object_schema => v_object_schema,</div>
<div>
object_name => v_table_name,</div>
<div>
policy_name => v_policy_name,</div>
<div>
statement_types => 'SELECT, INSERT, DELETE, UPDATE'</div>
<div>
);</div>
<div>
end loop;</div>
<div>
end;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
SQL> select object_schema, object_name, policy_name, policy_text from dba_audit_policies;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
SQL> select count(1) from fga_log$;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
SQL> select db_user, to_char(timestamp, 'DD-MM-rr, hh:MI:SS'), sql_text from dba_fga_audit_trail;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
declare </div>
<div>
v_object_schema varchar2(5) :='MAHIR'; </div>
<div>
v_table_name varchar2(255);</div>
<div>
v_policy_name varchar2(255);</div>
<div>
begin</div>
<div>
for t in (select table_name, 'POL_'||table_name as policy_name from dba_tables where owner = v_object_schema)</div>
<div>
loop </div>
<div>
<br /></div>
<div>
v_table_name := t.table_name;</div>
<div>
v_policy_name := t.policy_name;</div>
<div>
<br /></div>
<div>
dbms_fga.drop_policy (</div>
<div>
object_schema => v_object_schema,</div>
<div>
object_name<span class="Apple-tab-span" style="white-space: pre;"> </span> => v_table_name,</div>
<div>
policy_name => v_policy_name,</div>
<div>
);</div>
<div>
end loop;</div>
<div>
end;</div>
<div>
<br /></div>
<div>
<b>---------------------------Explain plan---------------------------</b></div>
<div>
<br /></div>
<div>
explain plan for </div>
<div>
select * from emp;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
select * from table(dbms_xplan.display)</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>-------------------------rebuilding indexes after compression---------------</b></div>
<div>
<br /></div>
<div>
BEGIN</div>
<div>
FOR idx IN (SELECT owner||'.'||index_name indexname FROM all_indexes WHERE owner = 'VIENNACRM')</div>
<div>
LOOP</div>
<div>
EXECUTE IMMEDIATE 'ALTER INDEX '||idx.indexname||' REBUILD';</div>
<div>
END LOOP;</div>
<div>
END ;</div>
<div>
<br /></div>
<div>
<b>--------------------------spool file to o/p------------------------------</b></div>
<div>
<br /></div>
<div>
spool 'C:\spool.txt'</div>
<div>
select * from v$instance; </div>
<div>
select * from v$database; </div>
<div>
show parameter spfile </div>
<div>
--alter system checkpoint; </div>
<div>
--alter system switch logfile; </div>
<div>
select * from v$version; </div>
<div>
select * from sys.registry$history order by action_time; </div>
<div>
select comp_id, comp_name , version, status FROM dba_registry; </div>
<div>
select distinct status from dba_data_files; </div>
<div>
select distinct status from v$datafile; </div>
<div>
select distinct status from dba_temp_files; </div>
<div>
select distinct status from v$tempfile; </div>
<div>
select * from v$log; </div>
<div>
select * from v$logfile; </div>
<div>
select * from v$controlfile; </div>
<div>
select distinct status from v$backup; </div>
<div>
select * from v$recover_file; </div>
<div>
select * from v$datafile where name like '%MISSING%'; </div>
<div>
select * from dba_data_files where file_name like '%MISSING%'; </div>
<div>
select machine, username, osuser, count(*) from v$session group by machine, username, osuser order by machine, username, osuser; </div>
<div>
select owner, object_type, count(*) from dba_objects where status = 'INVALID' group by owner, object_type; </div>
<div>
select owner, object_type, object_name from dba_objects where status = 'INVALID' order by owner, object_type, object_name; </div>
<div>
select distinct status from dba_indexes; </div>
<div>
select owner, table_name, index_name from dba_indexes where status='UNUSABLE'; </div>
<div>
--alter system checkpoint; </div>
<div>
--alter system switch logfile; </div>
<div>
select * from V$DATABASE_BLOCK_CORRUPTION; </div>
<div>
spool off;</div>
<div>
<br /></div>
<br />
<div>
<div>
<br /></div>
<div>
<b>---------------------------create pfile---------------------------------</b></div>
<br />
create pfile= 'C:\pfile.ora' from spfile;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>---------------------------creating DB link---------------------------------</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
CREATE DATABASE LINK "lga1"</div>
<div>
CONNECT TO system</div>
<div>
IDENTIFIED BY system</div>
<div>
USING '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.147)(PORT = 1521)))(CONNECT_DATA = (SID = orcl)))'</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>----------------------converting timestamp to scn & viceversa--------------------</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
select scn_to_timestamp(884871) as timestamp from dual;</div>
<div>
<br /></div>
<div>
select timestamp_to_scn(to_timestamp('20/1/2012 14:24:54','DD/MM/YYYY HH24:MI:SS')) as scn from dual;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>--------------------------------to view sql-----------------------------------</b></div>
<div>
<br /></div>
<div>
select sesion.sid,</div>
<div>
sesion.username,</div>
<div>
optimizer_mode,</div>
<div>
hash_value,</div>
<div>
address,</div>
<div>
cpu_time,</div>
<div>
elapsed_time,</div>
<div>
sql_text</div>
<div>
from v$sqlarea sqlarea, v$session sesion</div>
<div>
where sesion.sql_hash_value = sqlarea.hash_value</div>
<div>
and sesion.sql_address = sqlarea.address</div>
<div>
and sesion.username is not null </div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
select sesion.sid,</div>
<div>
sql_text</div>
<div>
from v$sqltext sqltext, v$session sesion</div>
<div>
where sesion.sql_hash_value = sqltext.hash_value</div>
<div>
and sesion.sql_address = sqltext.address</div>
<div>
and sesion.username is not null</div>
<div>
order by sqltext.piece </div>
<div>
<br /></div>
<div>
<b>------------------------------changing timezone---------------------------</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
SELECT TO_char(sysdate,'DD-MM-RRRR HH24:MI:SS'), </div>
<div>
FROM_TZ(CAST(to_date(TO_char(sysdate,'DD-MM-RRRR HH24:MI:SS'),'DD-MM-RRRR HH24:MI:SS') </div>
<div>
AS TIMESTAMP), '+5:30') AT TIME ZONE '+4:00' </div>
<div>
FROM dual</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>--------------------------------any dictionary table--------------------</b></div>
<div>
<br /></div>
<div>
select * from dictionary where table_name LIKE '%CONTROL%' ; - with dba user</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>------------------------------session & processes-------------------------</b></div>
<div>
<br /></div>
<div>
SELECT MACHINE, COUNT(*) FROM V$SESSION where status = 'ACTIVE' GROUP BY MACHINE;</div>
<div>
<br /></div>
<div>
select count(*) from v$processes;</div>
<div>
<br /></div>
<div>
<b>-----------------------increase session & parameters-------------------</b></div>
<div>
<br /></div>
<div>
show parameter processes</div>
<div>
show parameter sessions</div>
<div>
show parameter transactions</div>
<div>
<br /></div>
<div>
A basic formula for determining these parameter values is as follows:</div>
<div>
if processes=x</div>
<div>
sessions=x*1.1+5</div>
<div>
transactions=sessions*1.1</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
alter system set processes=500, 1000 scope=spfile;</div>
<div>
alter system set sessions=555, 1105 scope=spfile;</div>
<div>
alter system set transactions=610, 1216 scope=spfile;</div>
<div>
<br /></div>
<div>
<b>--------------------to kill session userwise------------------------------</b></div>
<div>
<br /></div>
<div>
select inst_id,sid,serial# from gv$session where username='SCOTT';</div>
<div>
<br /></div>
<div>
alter system kill session '130,620,@1';</div>
<div>
<br /></div>
<div>
<b>---------------------------valid the invalid objects-----------------------</b></div>
<div>
<br /></div>
<div>
EXEC DBMS_STATS.gather_database_stats;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
also run the utlrp.sql script and then take the fresh export</div>
<div>
<br /></div>
<div>
<b>----------------------------DBF size---------------------------------------</b></div>
<div>
<br /></div>
<div>
select file_id,sum(bytes)/1024/1024 from dba_data_files group by file_id;</div>
<div>
<br /></div>
<div>
<b>------------------------------TEMP FILE SIZE----------------------------</b></div>
<div>
<br /></div>
<div>
select sum(bytes)/1024/1024 "Meg" from dba_temp_files;</div>
<div>
<br /></div>
<div>
<b>------------------------------LOG SIZE---------------------------------</b></div>
<div>
<br /></div>
<div>
select sum(bytes)/1024/1024 "Meg" from v$log;</div>
<div>
<br /></div>
<div>
<b>--------------------------TOTAL DB SIZE-----------------------------------</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
select a.data_size+b.temp_size+c.redo_size+d.controlfile_size "total_size in MB"</div>
<div>
from ( select sum(bytes)/1024/1024 data_size</div>
<div>
from dba_data_files ) a,</div>
<div>
( select nvl(sum(bytes),0)/1024/1024 temp_size</div>
<div>
from dba_temp_files ) b,</div>
<div>
( select sum(bytes)/1024/1024 redo_size</div>
<div>
from sys.v_$log ) c,</div>
<div>
( select sum(BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024 controlfile_size</div>
<div>
from v$controlfile) d;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>------------------------user & their tbsp------------------------------</b></div>
<div>
<br /></div>
<div>
select owner, tablespace_name, count(*), sum(bytes)/1024/1024 size_mb</div>
<div>
from dba_segments</div>
<div>
group by owner, tablespace_name</div>
<div>
order by 4 desc;</div>
<div>
<br /></div>
<div>
<b>------------------------ users on TBSP-------------------------------</b></div>
<div>
<br /></div>
<div>
select username from dba_users where default_tablespace='USERS';</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>-------------------table or index belongs to which DBF-----------------</b></div>
<div>
<br /></div>
<div>
Use DBA_SEGMENTS to find the table or index </div>
<div>
Use DBA_EXTENTS to see the extents that make up the segment </div>
<div>
and inside see FILE_ID to look at the file </div>
<div>
it is described in DBA_DATA_FILES </div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>----------------- datafile relates to tablespace------------------------</b></div>
<div>
<br /></div>
<div>
select tablespace_name,file_name from dba_data_files;</div>
<div>
<br /></div>
<div>
<b>---------------------------details of DB------------------------------</b></div>
<div>
<br /></div>
<div>
select * from dba_objects where object_name like '%JAVA%';</div>
<div>
<br /></div>
<div>
select * from DBA_REGISTRY;</div>
<div>
<br /></div>
<div>
select * from V$OPTIONFsize</div>
<div>
<br /></div>
<div>
<b>---------------------details of tbsp autoextend or not--------------------</b></div>
<div>
<br /></div>
<div>
set pagesize 100</div>
<div>
<br /></div>
<div>
column file_name format a32</div>
<div>
column tablespace_name format a15</div>
<div>
column status format a3 trunc</div>
<div>
column t format 999,999.000 heading "Total MB"</div>
<div>
column a format a4 heading "Aext"</div>
<div>
column p format 990.00 heading "% Free"</div>
<div>
<br /></div>
<div>
SELECT df.file_name,</div>
<div>
df.tablespace_name,</div>
<div>
df. status,</div>
<div>
(df.bytes/1024000) t,</div>
<div>
(fs.s/df.bytes*100) p,</div>
<div>
decode (ae.y,1,'YES','NO') a</div>
<div>
FROM dba_data_files df,</div>
<div>
(SELECT file_id,SUM(bytes) s</div>
<div>
FROM dba_free_space</div>
<div>
GROUP BY file_id) fs,</div>
<div>
(SELECT file#, 1 y</div>
<div>
FROM sys.filext$</div>
<div>
GROUP BY file#) ae</div>
<div>
WHERE df.file_id = fs.file_id</div>
<div>
AND ae.file#(+) = df.file_id</div>
<div>
ORDER BY df.tablespace_name, df.file_id;</div>
<div>
<br /></div>
<div>
column file_name clear</div>
<div>
column tablespace_name clear</div>
<div>
column status clear</div>
<div>
column t clear</div>
<div>
column a clear</div>
<div>
column p clear</div>
<div>
ttitle off</div>
<div>
<br /></div>
<div>
<b>------------- if drive is full & extend TBSP----------------</b></div>
<div>
<br /></div>
<div>
create folder in d drive say oracle or anything and fire the below command</div>
<div>
alter tablespace users add datafile 'D:\oracle\user02.dbf' size 3G;</div>
<div>
i have assume that the folder name is oracle</div>
<div>
<pre class="code"><b>alter tablespace</b> ts_sth
add datafile 'c:\xx\sth_04.dbf' size 4M autoextend off;</pre>
</div>
<div>
<br /></div>
<div>
<b>------------------ Space of TBSP-----------------------------</b></div>
<div>
set linesize 150</div>
<div>
column tablespace_name format a20 heading 'Tablespace'</div>
<div>
column sumb format 999,999,999</div>
<div>
column extents format 9999</div>
<div>
column bytes format 999,999,999,999</div>
<div>
column largest format 999,999,999,999</div>
<div>
column Tot_Size format 999,999 Heading 'Total| Size(Mb)'</div>
<div>
column Tot_Free format 999,999,999 heading 'Total Free(MB)'</div>
<div>
column Pct_Free format 999.99 heading '% Free'</div>
<div>
column Chunks_Free format 9999 heading 'No Of Ext.'</div>
<div>
column Max_Free format 999,999,999 heading 'Max Free(Kb)'</div>
<div>
set echo off</div>
<div>
PROMPT FREE SPACE AVAILABLE IN TABLESPACES</div>
<div>
SPACE AVAILABLE IN TABLESPACES</div>
<div>
select a.tablespace_name,sum(a.tots/1048576) Tot_Size,</div>
<div>
sum(a.sumb/1048576) Tot_Free,</div>
<div>
sum(a.sumb)*100/sum(a.tots) Pct_Free,</div>
<div>
sum(a.largest/1024) Max_Free,sum(a.chunks) Chunks_Free</div>
<div>
from</div>
<div>
(</div>
<div>
select tablespace_name,0 tots,sum(bytes) sumb,</div>
<div>
max(bytes) largest,count(*) chunks</div>
<div>
from dba_free_space a</div>
<div>
group by tablespace_name</div>
<div>
union</div>
<div>
select tablespace_name,sum(bytes) tots,0,0,0 from</div>
<div>
dba_data_files</div>
<div>
group by tablespace_name) a</div>
<div>
group by a.tablespace_name</div>
<div>
order by pct_free;</div>
<div>
<br /></div>
<div>
<b>-----------------------Size of schema-------------------------------</b></div>
<div>
<br /></div>
<div>
SELECT owner,SUM (BYTES) / (1024 * 1024 * 1024) SIZE_IN_GB</div>
<div>
FROM dba_segments </div>
<div>
GROUP BY owner;</div>
<div>
<br /></div>
<div>
<b>------------------------autoextend on-------------------------------</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
alter database datafile 'C:\ORACLEXE\ORADATA\XE\SYSTEM.DBF' autoextend on;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>----------------------Add datafile to TBSP--------------------------</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
alter tablespace system add datafile 'C:\ORACLEXE\ORADATA\XE\SYSTEM.DBF' size 500M autoextend on;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>-----------------------------------indexes---------------------------</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
SELECT I.INDEX_NAME,</div>
<div>
I.INDEX_TYPE,</div>
<div>
I.TABLE_NAME,</div>
<div>
IC.COLUMN_NAME,</div>
<div>
DBMS_METADATA.GET_DDL('INDEX',I.INDEX_NAME)</div>
<div>
FROM DBA_INDEXES I,</div>
<div>
DBA_IND_COLUMNS IC</div>
<div>
WHERE I.OWNER ='HIMLIVE'</div>
<div>
AND I.INDEX_NAME = IC.INDEX_NAME</div>
<div>
AND I.TABLE_NAME = IC.TABLE_NAME</div>
<div>
AND I.TABLE_NAME='M_PRODUCT';</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>----------------------constraint------------------------------------</b></div>
<div>
<br /></div>
SELECT p.table_name AS PARENT, <br />
col.column_name,<br />
p.constraint_name,<br />
c.table_name AS CHILD,<br />
cols.column_name, <br />
c.constraint_name,<br />
c.status<br />
FROM user_constraints c JOIN user_constraints p<br />
ON c.r_constraint_name = p.constraint_name<br />
JOIN user_cons_columns col<br />
ON col.owner = p.owner<br />
AND p.constraint_name = col.constraint_name<br />
AND col.table_name = p.table_name<br />
JOIN user_cons_columns cols<br />
ON cols.owner = c.owner<br />
AND c.constraint_name = cols.constraint_name<br />
AND cols.table_name = c.table_name<br />
AND c.r_owner = p.owner<br />
where c.status='DISABLED' ;<br />
<div>
ORDER BY c.constraint_name;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>---------------delete duplicate rows-----------------</b></div>
<div>
<br /></div>
<div>
DELETE FROM emp a</div>
<div>
WHERE ROWID NOT IN (SELECT MAX (ROWID)</div>
<div>
FROM emp b</div>
<div>
WHERE a.empno = b.empno</div>
<div>
GROUP BY empno);</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>-------------------------All views-------------------------------</b></div>
<div>
<br /></div>
<div>
SELECT TYPE_TEXT FROM ALL_VIEWS WHERE VIEW_NAME = 'SMPRODUCT_V';</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>------------------user_constraints---------------------------------------</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
select</div>
<div>
parent.owner || '.' ||</div>
<div>
parent.table_name "Parent table",</div>
<div>
'is parent of' " ",</div>
<div>
child.owner || '.' ||</div>
<div>
child.table_name "Child table"</div>
<div>
from</div>
<div>
user_constraints child join user_constraints parent on </div>
<div>
child.r_constraint_name = parent.constraint_name and</div>
<div>
child.r_owner = parent.owner</div>
<div>
where</div>
<div>
child.table_name like 'AD_PINSTANCE_LOG%' escape '\' --';</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>-----------------------------valid/invalid objects-------------------------</b></div>
<div>
<br /></div>
<div>
select owner, object_name, object_type, status from dba_objects where status!='VALID' order by 1;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>-------------------To add timestamp in export ---------------------------------</b></div>
<div>
</div>
<div>
exp system/system file=d:\expdp.%date:~4,2%%date:~7,2%%date:~10,4%%time:~0,2%%time:~3,2%%time:~6,2%.dmp</div>
<div>
<br /></div>
<div>
https://forums.oracle.com/forums/thread.jspa?threadID=959681</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>-----------------------------expdp all users-----------------------------------------</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
SELECT 'expdp SYSTEM/system DUMPFILE=' || owner || '_%U.dmp LOGFILE=' || owner ||'.log schemas= ' || owner SQL</div>
<div>
FROM (</div>
<div>
SELECT owner, ROUND(SUM(size_mb)) MBytes FROM </div>
<div>
(</div>
<div>
SELECT owner, segment_name, segment_type, partition_name, ROUND(bytes/(1024*1024),2) SIZE_MB, tablespace_name </div>
<div>
FROM DBA_SEGMENTS </div>
<div>
WHERE SEGMENT_TYPE IN ('TABLE', 'TABLE PARTITION', 'TABLE SUBPARTITION') </div>
<div>
--AND TABLESPACE_NAME LIKE 'COSTE%' </div>
<div>
--AND SEGMENT_NAME LIKE 'OE_ORDER_LINES_ALL%' </div>
<div>
--AND partition_name LIKE 'USAGE_FCT_NEW%'</div>
<div>
AND OWNER <> 'SYSTEM' </div>
<div>
--AND ROUND(bytes/(1024*1024),2) > 1000)</div>
<div>
) </div>
<div>
GROUP BY owner </div>
<div>
ORDER BY MBytes DESC);</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>-------------------export query from 11g to 10g-------------------------</b></div>
<div>
<br /></div>
<div>
expdp system/system_password@orcl </div>
<div>
schemas=hr </div>
<div>
version= 10.2 </div>
<div>
dumpfile=hr_schema.dmp </div>
<div>
logfile=hr_schemas_exp.log</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>---------------import query at 10g from 11g--------------------------</b></div>
<div>
<br /></div>
<div>
impdp system/system@xe </div>
<div>
remap_schema=hr:scott </div>
<div>
dumpfile=hr_schema.dmp </div>
<div>
logfile=hr_schemas_imp.log --------simple query</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
impdp system/system_password@orcl </div>
<div>
remap_schema=hr:scott </div>
<div>
dumpfile=hr_schema.dmp </div>
<div>
sqlfile=hr_schemas.sql --------sqlfile</div>
<div>
logfile=hr_schemas_imp.log</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
you can use the parameter sqlfile=schema_sql.txt</div>
<div>
this parameter is used during import statements in this case you have the sqlfile and in this case there is no actual import</div>
<div>
you can check the sqlfile and come to know about the tablespace and users all</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
impdp system/system_password@orcl </div>
<div>
remap_schema=hr:scott </div>
<div>
REMAP_TABLESPACE=EXAMPLE:USERS ------tablespace</div>
<div>
dumpfile=hr_schema.dmp </div>
<div>
sqlfile=hr_schemas.sql </div>
<div>
logfile=hr_schemas_imp.log</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>-------------------------check for the objects------------------------</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
select OBJECT_TYPE,count(*)from dba_objects where owner='LGA1' group by OBJECT_TYPE;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>------------------------creating/changing path of DATA_PUMP_DIR---------------</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
drop directory DUMP_DIR ;</div>
<div>
<br /></div>
<div>
--Manually create folder dump</div>
<div>
create or replace directory DATA_PUMP_DIR as '<location>';</location></div>
<div>
GRANT read, write ON DIRECTORY DUMP_DIR TO system;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>------------------------to check path of data_pump_dir---------------</b></div>
<div>
<br /></div>
<div>
SELECT directory_path</div>
<div>
FROM dba_directories</div>
<div>
WHERE directory_name = 'DATA_PUMP_DIR';</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
emca -config dbcontrol db -repos recreate<br />
<br />
<br />
<pre style="font-family: Georgia,"Times New Roman",serif;">Your suggestions and queries are always warm welcomed. <span style="font-size: small;"> </span></pre>
</div>
<div>
<br /></div>
</div>
</div>
Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com0tag:blogger.com,1999:blog-3095073441666721593.post-35375714832879964442012-08-16T17:56:00.000+05:302012-09-21T09:57:04.319+05:30Useful commands RMAN<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
<span style="font-family: Georgia, serif;"><b>------------------------to take backup as copy/image or backupset---------------------</b></span></div>
<div>
<span style="font-family: Georgia, serif;"><br /></span></div>
<div>
<span style="font-family: Georgia, serif;">CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY;</span></div>
<div>
<span style="font-family: Georgia, serif;">CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO backupset;</span></div>
<div>
<span style="font-family: Georgia, serif;"><br /></span></div>
<div>
<span style="font-family: Georgia, serif;"><b>--------------------------------check for all archives--------------------------------------</b></span></div>
<div>
<span style="font-family: Georgia, serif;"><br /></span></div>
<div>
<span style="font-family: Georgia, serif;">crosscheck archivelog all;</span></div>
<div>
<span style="font-family: Georgia, serif;"><br /></span></div>
<div>
<span style="font-family: Georgia, serif;"><b>-----------------------------------skip inaccessible-----------------------------------------</b></span></div>
<div>
<span style="font-family: Georgia, serif;"><br /></span></div>
<div>
<span style="font-family: Georgia, serif;">backup database plus archivelog skip inaccessible ;</span></div>
<div>
<span style="font-family: Georgia, serif;"><br /></span></div>
<div>
<span style="font-family: Georgia, serif;"><br /></span></div>
<div>
<span style="font-family: Georgia, serif;"><b>---------------------------------delete all archives-----------------------------------------</b></span></div>
<div>
<span style="font-family: Georgia, serif;"><br /></span></div>
<div>
<span style="font-family: Georgia, serif;">delete archivelog all</span></div>
<div>
<span style="font-family: Georgia, serif;"><br /></span></div>
<div>
<span style="font-family: Georgia, serif;"><br /></span></div>
<div>
<span style="font-family: Georgia, serif;"><b>-----------------delete archives after backup & skip inaccessible-----------------------</b></span></div>
<div>
<span style="font-family: Georgia, serif;"><br /></span></div>
<div>
<span style="font-family: Georgia, serif;"><br /></span></div>
<div>
<span style="font-family: Georgia, serif;">RMAN> backup database plus archivelog skip inaccessible delete all input;</span><br />
<br />
<br />
<br />
<br />
<b><span style="font-family: Georgia, serif;">------------- Creating Duplicate SB database in networking----------------</span></b><br />
<span style="font-family: Georgia, serif;"><br /></span>
<span style="font-family: Georgia, serif;">DUPLICATE TARGET DATABASE<br /> FOR STANDBY<br /> FROM ACTIVE DATABASE<br /> SPFILE<br /> SET DB_NAME='ORCL'<br /> SET DB_UNIQUE_NAME='ORCL'<br /> SET DB_RECOVERY_FILE_DEST='E:\app\navneet\flash_recovery_area'<br /> SET CONTROL_FILES='E:\APP\NAVNEET\ORADATA\ORCL\CONTROL01.CTL', 'E:\APP\NAVNEET\FLASH_RECOVERY_AREA\ORCL\CONTROL02.CTL'<br /> SET DB_FILE_NAME_CONVERT='E:\app\navneet\oradata\strdb\', 'E:\app\navneet\oradata\orcl\' <br /> SET LOG_FILE_NAME_CONVERT='E:\app\navneet\oradata\strdb\', 'E:\app\navneet\oradata\orcl\';<br /></span><br />
<br />
<br /></div>
</div>
Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com0tag:blogger.com,1999:blog-3095073441666721593.post-71033548139895153462012-08-16T17:54:00.001+05:302012-08-16T17:54:24.016+05:30Oracle Data Guard with TAF<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div align="center" class="MsoNormal" style="text-align: center;">
<b style="mso-bidi-font-weight: normal;"><u><span style="font-family: "Georgia","serif"; font-size: 16.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">This is for my personal refference </span></u></b></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<br /></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<br /></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<br /></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<b style="mso-bidi-font-weight: normal;"><u><span style="font-family: "Georgia","serif"; font-size: 16.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Server1(Primary DB- orcl)</span></u></b></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif";">1) Install
Oracle 11g on the server1 </span></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif";">2) Enable Archive
logs </span></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif";">3) Enable
Flashback logs</span></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif";">4) Setup RMAN
with target Database</span></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif";">5) Enable Force
Logging</span></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif";">6) Create Stand
By Logs</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-family: Georgia; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Georgia;"><span style="mso-list: Ignore;">1)<span style="font: 7.0pt "Times New Roman";"> </span></span></span></b><b style="mso-bidi-font-weight: normal;"><u><span style="font-family: "Georgia","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Install
Oracle 11g on server1.</span></u></b></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif";">Run the Oracle
setup and get the whole s/w with database install on server1 successful with
the DB name as ORCL.<span style="mso-spacerun: yes;"> </span>And alter the force
logging to yes.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif";">Sql> alter
system set force_logging =true;</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif";">It can be verified
by</span></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif";">Sql> select
force_logging from v$database;</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-family: Georgia; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Georgia;"><span style="mso-list: Ignore;">2)<span style="font: 7.0pt "Times New Roman";"> </span></span></span></b><b style="mso-bidi-font-weight: normal;"><u><span style="font-family: "Georgia","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Enable
Archive Logs</span></u></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">To
set archive log, always login through SYSDBA</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Now,
let us check the current log mode either in "Archivelog" or
"Noarchivelog":</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">C:\Documents
and Settings\navneet>sqlplus</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SQL*Plus:
Release 11.2.0.1.0 Production on Tue Mar 27 11:19:53 2012</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Copyright
(c) 1982, 2010, Oracle. All rights reserved.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Enter
user-name: /as sysdba</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Connected
to:</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Oracle
Database 11g Enterprise Edition Release 11.2.0.1.0 - Production</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">With
the Partitioning, OLAP, Data Mining and Real Application Testing options</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SQL>
archive log list</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Database
log mode <b>No Archive Mode</b></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Automatic
archival <b>Disabled</b></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Archive
destination USE_DB_RECOVERY_FILE_DEST</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Oldest
online log sequence 2296</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Current
log sequence 2299</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">OR</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SQL>
select log_mode from v$database;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">LOG_MODE</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">------------</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">NOARCHIVELOG</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">We
have checked that our Database is in "NOARCHIVE LOG". Below query
will set the location where to save the archive logs.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SQL>
ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=E:\ARCHIVE_LOG' SCOPE=SPFILE;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">System
altered.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SQL>
SHUTDOWN IMMEDIATE</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Database
closed.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Database
dismounted.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ORACLE
instance shut down.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SQL>
STARTUP MOUNT</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ORACLE
instance started.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Total
System Global Area 535662592 bytes</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Fixed
Size 1375792 bytes</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Variable
Size 385876432 bytes</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Database
Buffers 142606336 bytes</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Redo
Buffers 5804032 bytes</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Database
mounted.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">The
below query will make database into archivelog.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SQL>
ALTER DATABASE ARCHIVELOG;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Database
altered.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SQL>
ALTER DATABASE OPEN;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Database
altered.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SQL>
SELECT LOG_MODE FROM V$DATABASE;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">LOG_MODE</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">------------</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ARCHIVELOG</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">OR</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SQL>
ARCHIVE LOG LIST</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Database
log mode <b>Archive Mode</b></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Automatic
archival <b>Enabled</b></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Archive
destination <b>E:\ARCHIVE_LOG</b></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Oldest
online log sequence 2296</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Next
log sequence to archive 2299</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Current
log sequence 2299</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 12.0pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SQL> alter system
switch logfile; <br />
<br style="mso-special-character: line-break;" />
<br style="mso-special-character: line-break;" />
</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Now
database is in Archivelog mode, We have verified by checking archivelogs in
directory.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">E:\>dir</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Volume
in drive E has no label.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Volume
Serial Number is AA1B-C0B9</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Directory
of E:\</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">12/09/2011
09:15 AM app</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">03/27/2012
11:43 AM 13,952,512 ARCHIVE_LOG2ARC0000002299_0769427405.0001</span></b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">03/27/2012
11:46 AM 1,536 ARCHIVE_LOG2ARC0000002300_0769427405.0001</span></b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">03/28/2012
05:39 AM 50,630,144 ARCHIVE_LOG2ARC0000002301_0769427405.0001</span></b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">03/29/2012
05:38 AM 40,771,072 ARCHIVE_LOG2ARC0000002302_0769427405.0001</span></b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">03/29/2012
06:30 PM 40,671,232 ARCHIVE_LOG2ARC0000002303_0769427405.0001</span></b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">02/17/2009
11:33 AM 23,516,968 SkypeSetupFull.exe</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">6
File(s) 169,543,464 bytes</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">1
Dir(s) 38,746,923,008 bytes free</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 13.0pt; line-height: 115%; mso-bidi-font-family: Georgia; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Georgia;"><span style="mso-list: Ignore;">3)<span style="font: 7.0pt "Times New Roman";"> </span></span></span></b><b style="mso-bidi-font-weight: normal;"><u><span style="font-family: "Georgia","serif"; font-size: 13.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Enabling
Flashback Logs</span></u></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Before enable the
flashback we need to take our database in archive log mode. After
enabling the archive logs now we need to set 3 paramaters for flashback are</span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="mso-spacerun: yes;"> </span>1 db_recovery_file_dest </span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">2
db_recovery_file_dest_size</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">3
db_flashback_retention_target </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">>>This parameter
"<b>db_recovery_file_dest</b>" is used to set the destination where
we<span style="mso-spacerun: yes;"> </span>want to store </span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">the location of flashback
logs. The location of flashback logs may or maybe be same as the
location of archive logs, here i gave different location from archive
logs. </span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">>>The parmeter
"<b>db_recovery_file_dest_size</b>" is used to define the size that
can be used by </span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">flashback
directory/folder provided with above parameter. This size can be calculated on
the basis of transactions happened in our database and if archive logs,
only when the destination of archive logs </span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">& flashback logs are
same.</span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">>>The parameter
"<b>db_flashback_retention_target</b> " is used to provide time limit
upto which flashback logs should be in the memory of database, So that
database can be flashed up back with in time limit. Time is provided in
minutes, so we set retention time 1440 which is about a day.</span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<b><u><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> >>Set
flashback database parameters</span></u></b><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">alter system set
db_recovery_file_dest='E:\app\navneet\FRA' scope=spfile; </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">alter system set
db_recovery_file_dest_size=20G scope=spfile;</span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">alter system set
db_flashback_retention_target=1440 ; </span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> <b>>> Turn
flashback on for the database </b></span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">shutdown immediate; </span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">startup mount;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">alter database flashback
on;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">alter database open;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">>>Now check if
flashback is enabled </span></b><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">select flashback_on from
v$database; </span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> FLASHBACK_ON</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">------------------</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">YES</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> Now Flashback is
ENABLED. </span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<b><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">>></span></b><b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">To disable
flashback </span></b><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">alter system set
db_recovery_file_dest=" scope= both sid='*';</span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<u><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Some related queries are
as follow </span></u><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">>> To check the
flashback logs </span></b><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">select * from
v$flashback_database_log;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">>>To check the
estimated flashback size</span></b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SELECT
ROUND(ESTIMATED_FLASHBACK_SIZE/1024/1024/1024) FROM
V$FLASHBACK_DATABASE_LOG; </span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">>>To create a
guaranteed restore point</span></b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">create restore point
RESTORE_POINT guarantee flashback database;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">select NAME, SCN, TIME
from V$RESTORE_POINT;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">>>To flashback the
database to specific time</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">flashback database to
timestamp to_timestamp('dd/mm/yy HH24:MI:SS', 'DD/MM/YYYY</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">HH24:MI:SS');</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">>>To drop a restore
point</span></b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">select NAME, SCN, TIME from
V$RESTORE_POINT; </span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> drop restore point
RESTORE_POINT;</span><span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">The
V$RECOVERY_FILE_DEST and V$FLASH_RECOVERY_AREA_USAGE views can help </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">to
find out the current location, disk quota, space in use, space reclaimable by
deleting files,</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 9.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">total
number of files, the percentage of the total disk quota used by different types
of files.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoListParagraph" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-add-space: auto; mso-list: l0 level1 lfo1; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; text-indent: -.25in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; mso-bidi-font-family: Georgia; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Georgia;"><span style="mso-list: Ignore;">4)<span style="font: 7.0pt "Times New Roman";">
</span></span></span></b><b style="mso-bidi-font-weight: normal;"><u><span style="font-family: "Georgia","serif"; font-size: 13.0pt; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Setting
up RMAN</span></u></b><b style="mso-bidi-font-weight: normal;"><u><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"></span></u></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 2;">
<b><span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">Create Recovery
Catalog</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">CONNECT sys/password@w2k1
AS SYSDBA</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">-- Create tablepsace to
hold repository</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">CREATE TABLESPACE
"RMAN" </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">DATAFILE 'C:\ORACLE\ORADATA\W2K1\RMAN01.DBF'
SIZE 6208K REUSE</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">AUTOEXTEND ON NEXT 64K
MAXSIZE 32767M</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">EXTENT MANAGEMENT LOCAL</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">SEGMENT SPACE MANAGEMENT
AUTO;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">-- Create rman schema
owner</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">CREATE USER rman
IDENTIFIED BY rman</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">TEMPORARY TABLESPACE temp
</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">DEFAULT TABLESPACE rman </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">QUOTA UNLIMITED ON rman;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 5.0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">GRANT connect, resource,
recovery_catalog_owner TO rman;</span></div>
<div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Create
the recovery catalog.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">C:>rman
catalog=rman/rman@w2k1</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">Recovery Manager: Release
9.2.0.1.0 - Production</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">Copyright (c) 1995, 2002,
Oracle Corporation.<span style="mso-spacerun: yes;"> </span>All rights reserved.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">connected to recovery
catalog database</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">recovery catalog is not
installed</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">RMAN> create catalog
tablespace "RMAN";</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">recovery catalog created</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">RMAN> exit</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">Recovery Manager
complete.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 5.0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 5.0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 2;">
<b><span style="font-family: "Georgia","serif"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 18.0pt; mso-fareast-font-family: "Times New Roman";">Register Database</span></b></div>
<div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Georgia","serif"; font-size: 12.0pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Each
database to be backed up by RMAN must be registered with the catalog.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">C:>rman
catalog=rman/rman@w2k1 target=sys/password@w2k2</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">Recovery Manager: Release
9.2.0.1.0 - Production</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">Copyright (c) 1995, 2002,
Oracle Corporation.<span style="mso-spacerun: yes;"> </span>All rights reserved.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">connected to target
database: W2K2 (DBID=1371963417)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">connected to recovery
catalog database</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">RMAN> register
database;</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">database registered in
recovery catalog</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">starting full resync of
recovery catalog</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">full resync complete</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 13.0pt; line-height: 115%; mso-bidi-font-family: Georgia; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Georgia;"><span style="mso-list: Ignore;">5)<span style="font: 7.0pt "Times New Roman";"> </span></span></span></b><b style="mso-bidi-font-weight: normal;"><u><span style="font-family: "Georgia","serif"; font-size: 13.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Enable
force logging</span></u></b></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Check whether Force logging is
YES or NO.</span></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">SQL> select force_logging
from v$database;</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">FOR</span></b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">---</span></b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">NO</span></b></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">The above<span style="mso-spacerun: yes;"> </span>o/p shows the force logging is not enabled so
Enable it by followed syntax.</span></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">SQL> alter database force
logging;</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Database altered.</span></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Check again if force logging is
enabled.</span></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">SQL> select force_logging
from v$database;</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">FOR</span></b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">---</span></b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">YES</span></b></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">The above o/p shows that force
logging is enabled now.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 16.0pt; line-height: 115%; mso-bidi-font-family: Georgia; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Georgia;"><span style="mso-list: Ignore;">6)<span style="font: 7.0pt "Times New Roman";"> </span></span></span></b><b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 16.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"><span style="mso-spacerun: yes;"> </span>Create Standby Logs </span></b></div>
<div class="MsoNormal">
Standby redo logs are required to enable real time apply of
redo data onto the standby. This standby redo logs are populated with redo
information as fast as the primary redo logs, rather than waiting for the redo
log to be archived and shipped to the standby. This results in
faster switchover and failover times because the standby redo log files have
been applied already to the standby database by the time the failover or
switchover begins.</div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%;">Ensure
log file sizes are identical on the primary and standby databases.</span></b><span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%;"> </span>The
size of the current standby redo log files must exactly match the size of the
current primary database online redo log files. For example, if the primary
database uses two online redo log groups whose log files are 200K, then the
standby redo log groups should also have log file sizes of 200K.</div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"> D<a href="http://www.blogger.com/blogger.g?blogID=3095073441666721593" name="sthref298"></a><a href="http://www.blogger.com/blogger.g?blogID=3095073441666721593" name="sthref299"></a><a href="http://www.blogger.com/blogger.g?blogID=3095073441666721593" name="sthref300"></a><a href="http://www.blogger.com/blogger.g?blogID=3095073441666721593" name="sthref301"></a>etermine the appropriate number of standby redo log file
groups. </b>Logs should be equal in number. If Primary has 3 redo logs then we
should made 3 or more Standby redo logs. Oracle recommends that you create a
standby redo log on the primary database so that the primary database can
switch over quickly to the standby role without the need for additional DBA
intervention.</div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">Syntax to create
Standby Log</b></div>
<div class="MsoNormal">
alter database add standby logfile group 1 ‘%ORACLE_BASE%\ORADATA\%ORACLE_SID%\REDO01.LOG’<span style="mso-spacerun: yes;"> </span>size 50m;</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%;">Alter system set dg_broker_start=TRUE scopth = both;</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<b style="mso-bidi-font-weight: normal;"><u><span style="font-family: "Georgia","serif"; font-size: 17.0pt; line-height: 115%; mso-bidi-font-size: 10.0pt;">Go to server 2(To create Standby DB -
strdb)</span></u></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%;">Install the Oracle software only without database. <span style="mso-spacerun: yes;"> </span>Then <b style="mso-bidi-font-weight: normal;">create
an instance</b> (STRDB) by firing the command on command prompt. The following
commands you can see is how i tried.</span></div>
<div class="MsoNormal">
C:\Users\Administrator>ORADIM -NEW -SID STRDB</div>
<div class="MsoNormal">
Instance created.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Now <b style="mso-bidi-font-weight: normal;">creating password
file</b> in %Oracle_home% \db_home. </div>
<div class="MsoNormal">
C:\Users\Administrator>ORAPWD
FILE="C:\app\Administrator\product\11.2.0\dbhome_1</div>
<div class="MsoNormal">
\database\PWDSTRDB.ora" PASSWORD=system</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">Create folder for
Flash Area Recovery</b></div>
<div class="MsoNormal">
%Oracle_base%\FRA\strdb</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">Create folder for
Flash Area Recovery</b></div>
<div class="MsoNormal">
%Oracle_base%\ORADATA\strdb</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">Create pfilestrdb.ora</b>
tp startup database in nomount stage, place anywhere in the Hard drive and add
two lines in that file.</div>
<div class="MsoNormal">
*.db_name='ORCL'</div>
<div class="MsoNormal">
*.db_unique_name='STRDB'</div>
<div class="MsoNormal">
Save & exit.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Now <b style="mso-bidi-font-weight: normal;">create listener
& tns entry</b> so that database instance can be able to talk.</div>
<div class="MsoNormal">
Go to listner.ora, edit it by copy & pasting the same
entry as mentioned below.</div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">OLD ENTERY OF
LISTNER.ORA</b></div>
<div class="MsoNormal">
# listener.ora Network Configuration File:
C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora</div>
<div class="MsoNormal">
# Generated by Oracle configuration tools.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
SID_LIST_LISTENER =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(SID_LIST =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(SID_DESC =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(SID_NAME =
CLRExtProc)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ORACLE_HOME =
C:\app\Administrator\product\11.2.0\dbhome_1)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(PROGRAM =
extproc)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ENVS =
"EXTPROC_DLLS=ONLY:C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
LISTENER =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(DESCRIPTION_LIST =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS =
(PROTOCOL = IPC)(KEY = EXTPROC1521))</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS =
(PROTOCOL = TCP)(HOST = eagle394.server4you.de)(PORT = 1521))</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
ADR_BASE_LISTENER = C:\app\Administrator</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">NEW ENTRY OF
LISTNER.ORA</b></div>
<div class="MsoNormal">
# listener.ora Network Configuration File:
C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora</div>
<div class="MsoNormal">
# Generated by Oracle configuration tools.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
SID_LIST_LISTENER =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(SID_LIST =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(SID_DESC =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(SID_NAME =
CLRExtProc)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ORACLE_HOME =
C:\app\Administrator\product\11.2.0\dbhome_1)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(PROGRAM =
extproc)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ENVS =
"EXTPROC_DLLS=ONLY:C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(SID_DESC =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(SID_NAME = STRDB)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(ORACLE_HOME =
C:\app\Administrator\product\11.2.0\dbhome_1)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(ENVS =
"EXTPROC_DLLS=ONLY:C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
LISTENER =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(DESCRIPTION_LIST =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS =
(PROTOCOL = IPC)(KEY = EXTPROC1521))</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS =
(PROTOCOL = TCP)(HOST = eagle394.server4you.de)(PORT = 1521))</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
ADR_BASE_LISTENER = C:\app\Administrator</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">Now for TNS ENTRY</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">OLD TNS ENTRY</b></div>
<div class="MsoNormal">
# tnsnames.ora Network Configuration File:
C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora</div>
<div class="MsoNormal">
# Generated by Oracle configuration tools.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
ORACLR_CONNECTION_DATA =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS_LIST =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS =
(PROTOCOL = IPC)(KEY = EXTPROC1521))</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(CONNECT_DATA =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(SID =
CLRExtProc)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(PRESENTATION =
RO)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">NEW TNS ENTRY</b></div>
<div class="MsoNormal">
# tnsnames.ora Network Configuration File:
C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora</div>
<div class="MsoNormal">
# Generated by Oracle configuration tools.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">STRDB =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(ADDRESS_LIST =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(ADDRESS = (PROTOCOL = TCP)(HOST =
69.64.58.18)(PORT = 1521))</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(CONNECT_DATA =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(SERVICE_NAME = STRDB)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
ORACLR_CONNECTION_DATA =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS_LIST =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS =
(PROTOCOL = IPC)(KEY = EXTPROC1521))</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(CONNECT_DATA =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(SID =
CLRExtProc)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(PRESENTATION =
RO)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Now to make the <b style="mso-bidi-font-weight: normal;">network
connectivity of both the DBs. </b>Just add the servers 1’s tns entry to
server2’s tns entry & vice versa.</div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">Server1’s TNS
ENTRY<span style="mso-spacerun: yes;"> </span>after adding the server2’s tns
entry</b></div>
<div class="MsoNormal">
# tnsnames.ora Network Configuration File:
c:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora</div>
<div class="MsoNormal">
# Generated by Oracle configuration tools.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">STRDB =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(ADDRESS_LIST =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(ADDRESS = (PROTOCOL = TCP)(HOST =
69.64.58.18)(PORT = 1521))</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(CONNECT_DATA =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(SERVICE_NAME = STRDB)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
ORACLR_CONNECTION_DATA =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS_LIST =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS =
(PROTOCOL = IPC)(KEY = EXTPROC1521))</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(CONNECT_DATA =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(SID =
CLRExtProc)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(PRESENTATION =
RO)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
ORCL =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS =
(PROTOCOL = TCP)(HOST = pro1848.server4you.de)(PORT = 1521))</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(CONNECT_DATA =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(SERVER =
DEDICATED)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(SERVICE_NAME =
orcl)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">Server2’s TNS
ENTRY<span style="mso-spacerun: yes;"> </span>after adding the server1’s tns
entry</b></div>
<div class="MsoNormal">
# tnsnames.ora Network Configuration File:
C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora</div>
<div class="MsoNormal">
# Generated by Oracle configuration tools.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
STRDB =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS_LIST =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS =
(PROTOCOL = TCP)(HOST = 69.64.58.18)(PORT = 1521))</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(CONNECT_DATA =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(SERVICE_NAME =
STRDB)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">ORCL =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(ADDRESS = (PROTOCOL = TCP)(HOST =
pro1848.server4you.de)(PORT = 1521))</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(CONNECT_DATA =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(SERVER = DEDICATED)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(SERVICE_NAME = orcl)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
ORACLR_CONNECTION_DATA =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS_LIST =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(ADDRESS =
(PROTOCOL = IPC)(KEY = EXTPROC1521))</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(CONNECT_DATA =</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(SID =
CLRExtProc)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>(PRESENTATION =
RO)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;"> </span>)</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">Restart the LSNRCTL</b>
by firing the command on command prompt on both servers. </div>
<div class="MsoNormal">
cmd> LSNRCTL STOP</div>
<div class="MsoNormal">
cmd> LSNRCTL START</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Now on server 2 make the DB in nomount stage</div>
<div class="MsoNormal">
C:\Users\Administrator>sqlplus sys/system@strdb as sysdba</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jul 6
09:55:33 2012</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Copyright (c) 1982, 2010, Oracle.<span style="mso-spacerun: yes;"> </span>All rights reserved.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Connected to:</div>
<div class="MsoNormal">
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 -
64bit Production</div>
<div class="MsoNormal">
With the Partitioning, OLAP, Data Mining and Real
Application Testing options</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
SQL> startup nomount pfile='C:\app\pfile.ora';</div>
<div class="MsoNormal">
ORACLE instance started.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Total System Global Area 1.3696E+10 bytes</div>
<div class="MsoNormal">
Fixed Size<span style="mso-spacerun: yes;">
</span>2188768 bytes</div>
<div class="MsoNormal">
Variable Size<span style="mso-spacerun: yes;">
</span>6878661152 bytes</div>
<div class="MsoNormal">
Database Buffers<span style="mso-spacerun: yes;">
</span>6777995264 bytes</div>
<div class="MsoNormal">
Redo Buffers<span style="mso-spacerun: yes;">
</span>37044224 bytes</div>
<div class="MsoNormal">
SQL></div>
<div class="MsoNormal">
<br /></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<b style="mso-bidi-font-weight: normal;"><span style="font-size: 14.0pt; line-height: 115%;">Go to server 1</span></b></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Connect
to Rman with orcl database to make the StandBy database with the script
provided below.</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">C:\Users\Administrator>rman
target sys/system@orcl</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Recovery
Manager: Release 11.2.0.1.0 - Production on Fri Jul 6 12:13:36 2012</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Copyright
(c) 1982, 2009, Oracle and/or its affiliates.<span style="mso-spacerun: yes;">
</span>All rights reserved.</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">connected
to target database: ORCL (DBID=1314151480)</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">RMAN>
conn auxiliary sys/system@strdb</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">RMAN>
DUPLICATE TARGET DATABASE</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">2><span style="mso-spacerun: yes;"> </span>FOR STANDBY</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">3><span style="mso-spacerun: yes;"> </span>FROM ACTIVE DATABASE</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">4><span style="mso-spacerun: yes;"> </span>SPFILE</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">5><span style="mso-spacerun: yes;"> </span>SET DB_NAME='ORCL'</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">6><span style="mso-spacerun: yes;"> </span>SET DB_UNIQUE_NAME='STRDB'</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">7><span style="mso-spacerun: yes;"> </span>SET
DB_RECOVERY_FILE_DEST='C:\app\Administrator\FRA'</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">8><span style="mso-spacerun: yes;"> </span>SET
CONTROL_FILES='C:\app\Administrator\ORADATA\STRDB\CONTROL01.CTL',<span style="mso-spacerun: yes;">
</span>'C:\app\Administrator\FRA\STRDB\CONTROL02.CTL'</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">9><span style="mso-spacerun: yes;"> </span>SET DB_FILE_NAME_CONVERT='C:\app\Administrator\oradata\orcl\',
'C:\app\Administrator\ORADATA\STRDB\'</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">10><span style="mso-spacerun: yes;"> </span>SET
LOG_FILE_NAME_CONVERT='C:\app\Administrator\oradata\orcl\',
'C:\app\Administrator\ORADATA\STRDB\';</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span><b style="mso-bidi-font-weight: normal;">Script in simple form is</b> <b style="mso-bidi-font-weight: normal;">used
in RMAN</b> <br />
</span><span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">DUPLICATE
TARGET DATABASE</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>FOR STANDBY</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>FROM ACTIVE DATABASE</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>SPFILE</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>SET DB_NAME='ORCL'</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>SET DB_UNIQUE_NAME='STRDB'</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>SET
DB_RECOVERY_FILE_DEST='C:\app\Administrator\FRA'</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>SET
CONTROL_FILES='C:\app\Administrator\ORADATA\STRDB\CONTROL01.CTL',<span style="mso-spacerun: yes;">
</span>'C:\app\Administrator\FRA\STRDB\CONTROL02.CTL'</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>SET DB_FILE_NAME_CONVERT='C:\app\Administrator\oradata\orcl\',
'C:\app\Administrator\ORADATA\STRDB\' </span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>SET
LOG_FILE_NAME_CONVERT='C:\app\Administrator\oradata\orcl\',
'C:\app\Administrator\ORADATA\STRDB\';</span></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Note- All the locations
provided in the script are according to the database located on the Test
Servers.</span></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="font-size: 14.0pt; line-height: 115%;">Go to Server2 - strdb</span></b></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">This
will create exact database at server 2 (STRDB) with its all redo logs and
Standby logs, multiplexed control file with archive logs and flashback
database. After finishing the script under RMAN, the database will be in mount
stage. Database will be in the Physical standby position. It can be checked by
the query</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Sql>
select name, db_unique_name, <b style="mso-bidi-font-weight: normal;">database_role</b>,
open_mode from v$database;</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Output
would be </span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">NAME<span style="mso-spacerun: yes;"> </span>DB_UNIQUE_NAME<span style="mso-spacerun: yes;"> </span>DATABASE_ROLE<span style="mso-spacerun: yes;"> </span>OPEN_MODE</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">---------
------------------------------ ---------------- --------------------</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">ORCL<span style="mso-spacerun: yes;"> </span><b style="mso-bidi-font-weight: normal;">STRDB</b><span style="mso-spacerun: yes;"> </span><b style="mso-bidi-font-weight: normal;">PHYSICAL STANDBY MOUNTED</b></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%;">Check the parameter whether <b style="mso-bidi-font-weight: normal;">dg_broker_start </b>is true or not, if not then make it true by the
followed query.</span></div>
<div class="MsoNormal">
<span style="font-family: "Georgia","serif"; font-size: 10.0pt; line-height: 115%;">Sql>Alter system set dg_broker_start=TRUE scopth = both;</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="font-size: 14.0pt; line-height: 115%;">Go to server 1 - orcl</span></b></div>
<div class="MsoNormal">
<span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 14.0pt;">Now setting up Dataguard Manager(dgmgrl) to make failover
automatic.</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">C:\Users\Administrator>set
oracle_sid=orcl</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">C:\Users\Administrator>dgmgrl/</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">DGMGRL
for 64-bit Windows: Version 11.2.0.1.0 - 64bit Production</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Copyright
(c) 2000, 2009, Oracle. All rights reserved.</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Welcome
to DGMGRL, type "help" for information.</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Connected.</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">The
following command is used to create the configuration known as DG with primary
database. Only primary database would be integrated in this configuration.
StandBy database will be added in next step. </span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">DGMGRL>
CREATE CONFIGURATION dg AS</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>>PRIMARY DATABASE IS orcl</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>>CONNECT IDENTIFIER IS orcl;</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Configuration
“dg” has been configured with primary database “orcl”</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Now
to add standby database in the same configuration and same primary database.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">DGMGRL>
ADD DATABASE strdb</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>>AS CONNECT IDENTIFIER IS strdb</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>>MAINTAINED AS physical;</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Database
“strdb” added</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">DGMGRL>
show configuration</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Configuration
- dg</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>Protection Mode: MaxPerformance</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>Databases:</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>orcl<span style="mso-spacerun: yes;"> </span>- Primary database</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>strdb -<span style="mso-spacerun: yes;"> </span>Physical standby database</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Fast-Start Failover: <b style="mso-bidi-font-weight: normal;">DISABLE</b></span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Configuration Status:</span></div>
<div class="MsoNormal" style="line-height: normal;">
<b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-size: 14.0pt;">DISABLE</span></b></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Now the configuration is Disabled as above, to make it enable run the
below command</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">DGMGRL>enable configuration</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Enabled.</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">DGMGRL> show configuration</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Configuration - dg</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>Protection Mode: MaxPerformance</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>Databases:</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>orcl - Primary database</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>strdb - Physical standby
database</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Fast-Start Failover: <b style="mso-bidi-font-weight: normal;">DISABLE</b></span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Configuration Status:</span></div>
<div class="MsoNormal" style="line-height: normal;">
<b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-size: 14.0pt;">SUCCESS</span></b></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Now the configuration is success after enabling. If it is not
configured well then it will show error instead of success. And Fast-Start
Failover is Disable which is okay for now. We can check that archive logs from
Primary (orcl) database are shipping to the standby (strdb) database by going
physically on their appropriate place with same sequence number. In this
scenario archive log destinations are</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Primary DB- C:\app\Administrator\archivelogs</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Standby DB- C:\app\Administrator\archivelogs</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Next step is to make Failover automatic known as <b style="mso-bidi-font-weight: normal;">FastStart Failover</b> , for that we need to set the parameters as
below:</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">><b style="mso-bidi-font-weight: normal;">LogXptMode</b> should be
SYNC for both the database</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Dgmgrl> edit database orcl set property ‘LogXptMode’ <span style="mso-spacerun: yes;"> </span>='SYNC’;</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Dgmgrl> edit database strdb set property ‘LogXptMode’<span style="mso-spacerun: yes;"> </span>='SYNC’;</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>>change the <b style="mso-bidi-font-weight: normal;">protection</b> <b style="mso-bidi-font-weight: normal;">mode</b> to MaxAvailability</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Dgmgrl> edit configuration set protection mode as maxavailability</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">> <b style="mso-bidi-font-weight: normal;">Standbyfile</b> <b style="mso-bidi-font-weight: normal;">management</b> should be Auto</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Dgmgrl> edit database orcl set property StandbyFileManagement<span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>=
'AUTO';</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">> <b style="mso-bidi-font-weight: normal;">FastStartFailoverTarget</b><span style="mso-spacerun: yes;"> </span>should be Standby database so that it got
connect o SBDB</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Dgmgrl> edit database orcl set property FastStartFailoverTarget<span style="mso-spacerun: yes;"> </span>= ‘strdb’;</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Dgmgrl> edit database strdb set property FastStartFailoverTarget<span style="mso-spacerun: yes;"> </span>= ‘orcl’;</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">>Now enabling the <b style="mso-bidi-font-weight: normal;">FastStart_Failover</b></span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Dgmgrl> enable FastStart_failover;</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">enabled</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Now check the status of configuration and notice that Protection mode
has been changed and Fast start failover has been Enabled. </span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">DGMGRL> show configuration</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Configuration - dg</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>Protection Mode: <b style="mso-bidi-font-weight: normal;">MaxAvailability</b></span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>Databases:</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>orcl - Primary database</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>strdb - (*) Physical standby
database</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Fast-Start Failover: <b style="mso-bidi-font-weight: normal;">ENABLED</b></span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Configuration Status:</span></div>
<div class="MsoNormal" style="line-height: normal;">
<b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-size: 14.0pt;">SUCCESS </span></b></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">We can check by firing the command on sqlplus of Primary Database, here
output shows that Standby database is synchronized with primary database, and
if primary(orcl) fails then target database id STRDB which will become Primary.</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">SQL> select name, db_unique_name, database_role,
fs_failover_current_target, fs_failover_status </span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">from v$database;</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">NAME<span style="mso-spacerun: yes;"> </span>DB_UNIQUE_NAME<span style="mso-spacerun: yes;"> </span>DATABASE_ROLE<span style="mso-spacerun: yes;"> </span>FS_FAILOVER_CURRENT_TARGET<span style="mso-spacerun: yes;"> </span>FS_FAILOVER_STATUS </span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">--------- ------------------------------ ----------------
------------------------------ ----------------------</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">ORCL<span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>ORCL<span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>PRIMARY<span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><b style="mso-bidi-font-weight: normal;">STRDB</b><span style="mso-spacerun: yes;"> </span><b style="mso-bidi-font-weight: normal;">SYNCHRONIZED</b></span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<b style="mso-bidi-font-weight: normal;"><u><span style="font-size: 15.0pt; mso-bidi-font-size: 14.0pt;">Setting up Observer
</span></u></b><span style="font-size: 15.0pt; mso-bidi-font-size: 14.0pt;">which
can on another machine</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Take the third machine for setting the observer and install only oracle
software instead of Oracle software+database. <span style="mso-spacerun: yes;"> </span>Copy the tns entery of strdb & orcl
database & paste it on the third Machine’s tns file so that third machine
would be able to contact both the servers. </span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">STRDB =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(ADDRESS_LIST =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(ADDRESS = (PROTOCOL = TCP)(HOST =
69.64.58.18)(PORT = 1521))</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(CONNECT_DATA =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(SERVICE_NAME = STRDB)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;">ORCL =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(ADDRESS = (PROTOCOL = TCP)(HOST =
pro1848.server4you.de)(PORT = 1521))</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(CONNECT_DATA =</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(SERVER = DEDICATED)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>(SERVICE_NAME = orcl)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="mso-spacerun: yes;"> </span>)</b></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Now we need to connect dataguard manager tostart the observer on this
machine which will observe the primary database. Whenever Primary database goes
down due to any reason then it will automatically switch STRDB to primary &
make it in use with clients with in 30 seconds</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">C:\Users\Administrator>set
oracle_sid=orcl(primary)</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">C:\Users\Administrator>dgmgrl/</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">DGMGRL
for 64-bit Windows: Version 11.2.0.1.0 - 64bit Production</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Copyright
(c) 2000, 2009, Oracle. All rights reserved.</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Welcome
to DGMGRL, type "help" for information.</span></div>
<div class="MsoNormal">
<span style="line-height: 115%; mso-bidi-font-size: 14.0pt;">Connected.</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">DGMGRL> start observer</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Observer started</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Now this window needs to be open till observer is running, if by chance
this window has been closed then observer will get close itself and automatic
switchover can never be performed.</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<b style="mso-bidi-font-weight: normal;"><u><span style="font-size: 15.0pt; mso-bidi-font-size: 14.0pt;">Automatic Application
switchover</span></u></b></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">In my simple scenario, I have one Primary Database (orcl) and one
Physical Standby Database (strdb). On The challenge is now to get the connect
from the client side to the right (primary) database. That is called Connect
Time Failover and is achieved as follows:</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">First, we make sure that the client uses a tnsnames.ora with a connect
descriptor that uses a SERVICE_NAME instead of a SID</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">MYAPP =</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>(DESCRIPTION =</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>(ADDRESS_LIST =</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>(ADDRESS = (PROTOCOL = TCP)(HOST
= </span>69.64.58.18<span style="mso-bidi-font-size: 14.0pt;">)(PORT = 1521))</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>(ADDRESS = (PROTOCOL = TCP)(HOST
= </span>pro1848.server4you.de<span style="mso-bidi-font-size: 14.0pt;">)(PORT =
1521))</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>)</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>(CONNECT_DATA =</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>(SERVICE_NAME = myapp)</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>)</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>)</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Second, we take care that the service myapp is offered only at the
right database – only on the primary. Notice that the PMON background processes
of both databases must be able to communicate with the (local) listeners in
order to register the service myapp. If you don’t use the listener port 1521,
they can’t. You have to point to that listener port then with the initialization
parameter LOCAL_LISTENER.</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">We create and start now the service myapp manually on the primary:</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">begin</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>dbms_service.create_service('myapp','myapp');</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">end;</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">/</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">begin</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>DBMS_SERVICE.START_SERVICE('myapp');</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">end;</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">/</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Then we create a trigger, that ensures that this service is only
offered, if the database is in the primary role:</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">create trigger myapptrigg after startup on database</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">declare</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>v_role varchar(30);</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">begin</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>select database_role into v_role
from v$database;</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>if v_role = 'PRIMARY' then</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>DBMS_SERVICE.START_SERVICE('myapp');</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>else</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>DBMS_SERVICE.STOP_SERVICE('myapp');</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>end if;</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">end;</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">/</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">The event after startup is fired, if an instance changes from status
MOUNT to OPEN. If you use a logical standby, it is not fired, because the
logical standby remains in status OPEN. You may use the event after
db_role_change in this case. The creation of the trigger and of the service is
accompanied with redo protocol (the Data Dictionary has changed) and therefore
also present at strdb without any additional work to do there for the DBA. With
the present setup, we have already achieved Connect Time Failover: Clients can
use the same connect descriptor (myapp) to get to the right (primary) database
now, regardless of switchover or failover.</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">But sessions that are connected to orcl are disconnected if a
switchover or failover to strdb takes place. They have got to connect again
then. We can change that, so that a Runtime Failover is possible, under ideal
circumstances, that failover is even completely transparent to the client and proceeds
without error messages. To achieve that, you don’t have to touch the
tnsnames.ora on the client side. Instead, you do the following on the primary
database:</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">begin</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>dbms_service.modify_service</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>('myapp',</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>FAILOVER_METHOD => 'BASIC',</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>FAILOVER_TYPE => 'SELECT',</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>FAILOVER_RETRIES => 200,</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;"><span style="mso-spacerun: yes;"> </span>FAILOVER_DELAY => 1);</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">end;</span></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">/</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">Connections to the service myapp are now automatically failed over
together with the service to the new primary. Should they have done nothing
during the time of the failover/switchover, or even if they had run a select
statement, they will not receive any error but only notice a short
interruption.</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
<div class="MsoNormal" style="line-height: normal;">
<span style="mso-bidi-font-size: 14.0pt;">This is all done in configuration.</span></div>
<div class="MsoNormal" style="line-height: normal;">
<br /></div>
</div>
Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com0tag:blogger.com,1999:blog-3095073441666721593.post-6103558484741770762012-06-19T16:48:00.000+05:302012-06-19T16:55:09.565+05:30To install Oracle in english on non-english OS<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="font-family: Georgia,"Times New Roman",serif;">
I installed oracle on non-english OS(windows server 2008 R2) which was not feasible for me.</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
I got server in Germany and installed Oracle 11g. When i installed blindly then i noticed, Oracle was communicating in German language which i can't understand. After some research & discussion with my DBA friends, i found three ways to make oracle install in english on non-english machine. You can opt anyone of them as per your requirement.</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<b>#Modify the oraparam.ini file.</b></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
In all the unzipped oracle installation files directory, there is a folder called install which has the file oraparam.ini. It is this file which tells the setup.exe how to behave. There is this parameter ” NLS_ENABLED “, has a default value TRUE, which tells the setup.exe to take the OS language when invoked. So, if the OS is German, the setup.exe would show the details in German. Make it FALSE and setup.exe will not take the OS language, it will go for the default english.</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
NLS_ENABLED=TRUE #setup.exe will take the OS language for granted</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
NLS_ENABLED=FALSE #setup.exe will go for the default english</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<b>#Change the non-english OS language to English.</b></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
There is an alternate option that we can change OS language to English and oracle will automatically use english language. Steps to change the language:</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
Go to control panel --> Regional and language --> you will got four tab under this option</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
a) Formats --> select English where ever you find any option.</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
b) Location --> You can select your country but i choose US.</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
c) Keyboard & Language --> Change Keyboard --> general --> select US under Default Language and click on US under Installed Services.</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
d) Administrative --> change system locale.. --> select English</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
Reboot your system to take language into English. </div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
Now install oracle, it will automatically pick English language as default.</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<b>#Change the NLS_LANG.</b></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
After installing Oracle in non-english language use NLS_LANG.</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
NLS_LANG is an environment variable used to define language, territory and character set properties. You can use as follow.</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
Windows (in cmd window):</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
set NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
Unix/ Linux:</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
Here are some valid NLS_LANG settings:</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
-> French_France.WE8ISO8895P1</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
-> French_Switzerland.WE8ISO8895P1</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
-> Norwegian_Norway.NDK7DEC</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
-> Norwegian_Norway.WE8ISO8895P1</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
-> Japanese_Japan.JA16SJIS</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
-> Arabic_Egypt.AR8MSWIN1256</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
-> American_America.AR8MSWIN1256</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
-> American_America.WE8ISO8859P1</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
-> Latvian_Latvia.BLT8CP921 </div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
Note: Third option(Change the NLS_LANG.) is not permanent setting. It will work until command prompt is not closed. Rest both options are permanent.</div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<pre style="font-family: Georgia,"Times New Roman",serif;">Your suggestions and queries are always warm welcomed. <span style="font-size: x-small;"> </span></pre>
</div>Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com0tag:blogger.com,1999:blog-3095073441666721593.post-36325340335267082182012-05-17T18:23:00.001+05:302012-08-28T13:49:50.294+05:30Enable/Disable Flashback in Oracle 11g<div dir="ltr" style="text-align: left;" trbidi="on">
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">Before enable the flashback we need to take our database in archive log mode. To enable the archive log <a href="http://singhdba.blogspot.in/2012/03/enabling-archivelog-mode-in-oracle-11g.html" target="_blank">click here </a></span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> After enabling the archive logs now we need to set 3 paramaters for flashback are</span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> 1 db_recovery_file_dest </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">2 db_recovery_file_dest_size
</span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">3 db_flashback_retention_target
</span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">>>This parameter "<b>db_recovery_file_dest</b>" is used to set the destination where we want to store </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">the location of flashback logs. The location of flashback logs may or maybe be same as the location</span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> of archive logs, here i gave different location from archive logs. </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">>>The parmeter "</span><span style="font-size: small;"><b>db_recovery_file_dest_size</b>" is used to define the size that can be used by </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">flashback directory/folder provided with above parameter. This size can be calculated on the basis </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">of transactions happened in our database and if archive logs, only when the destination of archive logs </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">& flashback logs are same.</span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">>>The parameter "</span><span style="font-size: small;"><b>db_flashback_retention_target</b> " is used to provide time limit upto which </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">flashback logs should be in the memory of database, So that database can be flashed up back</span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> with in time limit. Time is provided in minutes, so we set retention time 1440 which is about a day.</span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><b><u><span style="font-size: small;"> >>Set flashback database parameters</span></u></b></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">alter system set db_recovery_file_dest='E:\app\navneet\FRA' scope=spfile;
alter system set db_recovery_file_dest_size=20G scope=spfile;</span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">alter system set db_flashback_retention_target=</span><span style="font-size: small;">1440 </span><span style="font-size: small;">; </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> <b>>> Turn flashback on for the database </b></span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">shutdown immediate; </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">startup mount;
alter database flashback on;
alter database open;
<b>>>Now check if flashback is enabled </b></span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">select flashback_on from v$database; </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> FLASHBACK_ON
------------------
YES
</span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> Now Flashback is ENABLED. </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><b>>><span style="font-size: small;">To disable flashback </span></b></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">alter system set db_recovery_file_dest=" scope= both sid='*';</span></pre>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<div style="font-family: Georgia,"Times New Roman",serif;">
<br /></div>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><u><span style="font-size: small;">Some related queries are as follow </span></u></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><b><span style="font-size: small;">>> To check the flashback logs </span></b></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">select * from v$flashback_database_log;
<b>>>To check the estimated flashback size</b>
SELECT ROUND(ESTIMATED_FLASHBACK_SIZE/1024/1024/1024) FROM V$FLASHBACK_DATABASE_LOG; </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><b>>>To create a guaranteed restore point</b>
create restore point RESTORE_POINT guarantee flashback database;
select NAME, SCN, TIME from V$RESTORE_POINT;
<b>>>To flashback the database to specific time
</b>flashback database to timestamp to_timestamp('dd/mm/yy HH24:MI:SS', 'DD/MM/YYYY
HH24:MI:SS');
<b>>>To drop a restore point</b>
select NAME, SCN, TIME from V$RESTORE_POINT; </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> drop restore point RESTORE_POINT;</span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;">The V$RECOVERY_FILE_DEST and V$FLASH_RECOVERY_AREA_USAGE views can help
to find out the current location, disk quota, space in use, space reclaimable by deleting files,</pre>
<pre style="font-family: Georgia,"Times New Roman",serif;">total number of files, the percentage of the total disk quota used by different types of files.</pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> </span></pre>
<pre style="font-family: Georgia,"Times New Roman",serif;">Your suggestions and queries are always warm welcomed. <span style="font-size: small;"> </span></pre>
</div>
Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com3tag:blogger.com,1999:blog-3095073441666721593.post-11752655865462538082012-04-28T04:00:00.000+05:302012-04-27T15:51:40.397+05:30ORA-00064: object is too large to allocate on this O/S (1,9080000)<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div>
<br />
<br />
Today i got an error <b>ORA-00064</b> in Oracle 10g Express Edition on Windows platform.<br />
<br />
When the Oracle starts then it read the Initialization file and allocates the memory of all parameters say for session , process and all . And if anyone don't have sufficient resource to allocate them then this issue persists.<br />
<br />
According to my environment one of my friend <b>increased </b>the <b>sessions </b>to <b>5000</b>, when Oracle is restarted, it throws error.<br />
<br />
Following steps are performed to resolve this issue.<br />
<br />
<br />
<br />
<br />
<br />
<br />
Microsoft Windows XP [Version 5.1.2600]<br />
(C) Copyright 1985-2001 Microsoft Corp.<br />
<br />
C:\Documents and Settings\navneet>sqlplus<br />
<br />
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Apr 27 13:15:32 2012<br />
<br />
Copyright (c) 1982, 2005, Oracle. All rights reserved.<br />
<br />
Enter user-name: /as sysdba<br />
Connected to an idle instance.<br />
<br />
SQL> startup<br />
<b>ORA-00064: object is too large to allocate on this O/S (1,9080000)</b><br />
<br />
SQL> create pfile='c:\pfile.ora' from spfile;<br />
File created.<br />
<br />
Then i edited the pfile.ora and reduced the session to 100 from 5000.<br />
<br />
<br />
SQL> startup pfile='c:\pfile.ora';<br />
ORACLE instance started.<br />
<br />
Total System Global Area 599785472 bytes<br />
Fixed Size 1288820 bytes<br />
Variable Size 180356492 bytes<br />
Database Buffers 415236096 bytes<br />
Redo Buffers 2904064 bytes<br />
Database mounted.<br />
<b>Database opened.</b><br />
<b><br /></b><br />
Now our pfile.ora is perfect, no need anymore edition. We are going to create spfile from this pfile.<br />
<br />
<br />
<br />
SQL> create spfile from pfile='c:\pfile.ora';<br />
File created.<br />
<br />
SQL> shutdown immediate<br />
Database closed.<br />
Database dismounted.<br />
ORACLE instance shut down.<br />
<br />
<br />
SQL> startup<br />
ORACLE instance started.<br />
<br />
Total System Global Area 599785472 bytes<br />
Fixed Size 1288820 bytes<br />
Variable Size 180356492 bytes<br />
Database Buffers 415236096 bytes<br />
Redo Buffers 2904064 bytes<br />
Database mounted.<br />
<b>Database opened.</b><br />
<b><br /></b><br />
<b><br /></b><br />
<b><br /></b><br />
Your suggestions and queries are always warm welcomed.<br />
<br /></div>
</div>Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com0Chandigarh, India30.7333148 76.779417930.678720799999997 76.7004539 30.7879088 76.8583819tag:blogger.com,1999:blog-3095073441666721593.post-44358883674223522962012-03-30T16:16:00.003+05:302012-03-31T13:09:48.737+05:30Checking operating system version: must be 5.0, 5.1, 5.2 or 6.0 . Actual 6.1 Failed<div><span>Today i got error while installing oracle on <b>Windows server 2008 R2</b></span></div><div style="font-weight: normal; "><span>When i clicked on "setup.exe" file, it throws an error as below:</span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span>Starting Oracle Universal Installer...</span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span>Checking installer requirements...</span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span>Checking operating system version: must be 5.0, 5.1, 5.2 or 6.0 . Actual 6.1</span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span> <b>Failed <<<<</b></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span>Exiting Oracle Universal Installer, log for this session can be found at C:\Prog</span></div><div style="font-weight: normal; "><span>ram Files\Oracle\Inventory\logs\installActions2012-03-30_09-25-48AM.log</span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span>Please press Enter to exit...</span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span>After too much research i came to know that I need to modify the "oraparam.ini" file which </span></div><div style="font-weight: normal; "><span>is placed with Oracle setup files.</span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span>I modify the Oraparam.ini file located here</span></div><div style="font-weight: normal; "><span>"database\install\oraparam.ini"</span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span>Just add those words which are bold as below in the oraparam.ini file.</span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span>[Certified Versions] </span></div><div style="font-weight: normal; "><span># You can customise error message shown for failure, provide value for </span></div><div style="font-weight: normal; "><span>CERTIFIED_VERSION_FAILURE_MESSAGE </span></div><div style="font-weight: normal; "><span>Windows = 5.0,5.1,5.2,6.0<b>,6.1 </b></span></div><div style="font-weight: normal; "><span><b><br /></b></span></div><div style="font-weight: normal; "><span><b><br /></b></span></div><div style="font-weight: normal; "><span><b><br /></b></span></div><div style="font-weight: normal; "><span><b>[Windows-6.1-required] </b></span></div><div style="font-weight: normal; "><span><b># Minimum display colours for OUI to run </b></span></div><div style="font-weight: normal; "><span><b>MIN_DISPLAY_COLORS = 256 </b></span></div><div style="font-weight: normal; "><span><b># Minimum CPU speed required for OUI </b></span></div><div style="font-weight: normal; "><span><b># CPU = 300 </b></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span>Save the oraparam.ini file & then run setup again. Now all goes fine & got the oracle installed.</span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span><br /></span></div><div style="font-weight: normal; "><span>Your suggestions and queries are always warm welcomed.</span></div>Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com2tag:blogger.com,1999:blog-3095073441666721593.post-10364001650061087972012-03-29T18:40:00.010+05:302012-06-20T13:20:31.867+05:30Enabling Archivelog Mode in Oracle 11g<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
To set archive log, always login through SYSDBA</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Now, lets check the current log mode either in "Archivelog" or "Noarchivelog":</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
C:\Documents and Settings\navneet>sqlplus</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 27 11:19:53 2012</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Copyright (c) 1982, 2010, Oracle. All rights reserved.</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Enter user-name: /as sysdba</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Connected to:</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
With the Partitioning, OLAP, Data Mining and Real Application Testing options</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
SQL> archive log list</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Database log mode <b>No Archive Mode</b></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Automatic archival <b>Disabled</b></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Archive destination USE_DB_RECOVERY_FILE_DEST</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Oldest online log sequence 2296</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Current log sequence 2299</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
OR</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
SQL> select log_mode from v$database;</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
LOG_MODE</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
------------</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
NOARCHIVELOG</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
We have checked that our Database is in "NOARCHIVE LOG". Below query will set the location where to save the archive logs.</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=E:\ARCHIVE_LOG' SCOPE=SPFILE;</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
System altered.</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
SQL> SHUTDOWN IMMEDIATE</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Database closed.</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Database dismounted.</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
ORACLE instance shut down.</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
SQL> STARTUP MOUNT</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
ORACLE instance started.</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Total System Global Area 535662592 bytes</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Fixed Size 1375792 bytes</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Variable Size 385876432 bytes</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Database Buffers 142606336 bytes</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Redo Buffers 5804032 bytes</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Database mounted.</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
The below query will make database into archivelog.</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
SQL> ALTER DATABASE ARCHIVELOG;</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Database altered.</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br />
<div>
SQL> ALTER DATABASE OPEN;</div>
<div>
<br /></div>
<div>
Database altered.</div>
<div>
<br /></div>
</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
SQL> SELECT LOG_MODE FROM V$DATABASE;</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
LOG_MODE</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
------------</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
ARCHIVELOG</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
OR</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
SQL> ARCHIVE LOG LIST</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Database log mode <b>Archive Mode</b></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Automatic archival <b>Enabled</b></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; line-height: normal;">
Archive destination <b>E:\ARCHIVE_LOG</b></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Oldest online log sequence 2296</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Next log sequence to archive 2299</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Current log sequence 2299</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
SQL> alter system switch logfile; <br />
<br />
<br />
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
Now database is in Archivelog mode, We have verified by checking archivelogs in directory.</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-weight: normal;">
<br />
<div style="font-weight: normal;">
E:\>dir</div>
<div style="font-weight: normal;">
Volume in drive E has no label.</div>
<div style="font-weight: normal;">
Volume Serial Number is AA1B-C0B9</div>
<div style="font-weight: normal;">
<br /></div>
<div style="font-weight: normal;">
Directory of E:\</div>
<div style="font-weight: normal;">
<br /></div>
<div style="font-weight: normal;">
12/09/2011 09:15 AM <span style="font-size: 100%;">app</span></div>
<div>
<b>03/27/2012 11:43 AM 13,952,512 ARCHIVE_LOG2ARC0000002299_0769427405.0001</b></div>
<div>
<b>03/27/2012 11:46 AM 1,536 ARCHIVE_LOG2ARC0000002300_0769427405.0001</b></div>
<div>
<b>03/28/2012 05:39 AM 50,630,144 ARCHIVE_LOG2ARC0000002301_0769427405.0001</b></div>
<div>
<b>03/29/2012 05:38 AM 40,771,072 ARCHIVE_LOG2ARC0000002302_0769427405.0001</b></div>
<div>
<b>03/29/2012 06:30 PM 40,671,232 ARCHIVE_LOG2ARC0000002303_0769427405.0001</b></div>
<div style="font-weight: normal;">
<span style="font-size: 100%;">02/17/2009 11:33 AM 23,516,968 SkypeSetupFull.exe</span></div>
<div style="font-weight: normal;">
6 File(s) 169,543,464 bytes</div>
<div style="font-weight: normal;">
1 Dir(s) 38,746,923,008 bytes free</div>
<div style="font-weight: normal;">
<br /></div>
<div style="font-weight: normal;">
<a href="http://singhdba.blogspot.in/2012/05/enable-flashback-database-in-oracle.html" rel="nofollow" target="_blank">Click here to Enable/Disable Flashback on Oracle Database</a></div>
<div style="font-weight: normal;">
<br /></div>
<div style="font-weight: normal;">
<br /></div>
<div style="font-weight: normal;">
Your suggestions and queries are always warm welcomed. </div>
</div>
</div>Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com0tag:blogger.com,1999:blog-3095073441666721593.post-50290070212390165502012-03-09T16:35:00.005+05:302012-06-07T12:26:12.236+05:30Error ORA-28056: Writing audit records to Windows Event Log failed<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: 100%;">I got a PC which ran out from disk space & Oracle was not working. The error was ORA-28056.</span><br />
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
I need to delete all the event log & then reconnect it again. Here you can see what happened & it get resolved.</div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">
<br /></div>
<div>
<div>
C:\Documents and Settings\navneet>sqlplus</div>
<div>
<br /></div>
<div>
SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 7 15:44:02 2012</div>
<div>
<br /></div>
<div>
Copyright (c) 1982, 2010, Oracle. All rights reserved.</div>
<div>
<br /></div>
<div>
Enter user-name: /as sysdba</div>
<div>
Connected to an idle instance.</div>
<div>
<br /></div>
<div>
SQL> startup</div>
<div>
<b>ORA-28056: Writing audit records to Windows Event Log failed</b></div>
<div>
<b>OSD-157797404: Message 157797404 not found; product=RDBMS; facility=SOSD</b></div>
<div>
<b><br /></b></div>
<div>
<b>O/S-Error: (OS 1502) The event log file is full.</b></div>
</div>
<div>
<b><br /></b></div>
<div>
<div>
SQL> exit</div>
<div>
Disconnected</div>
<div>
<br /></div>
<div>
<br /><b>Solution of the Problem</b> : This was because the Event Viewer log is full and could not log anymore events.<br />The solution is to clear the event log .To solve this issue follow any of the following steps.<br /><br />1) When a log is full, it stops recording new events. Clearing the log is one way to free the log and start recording new events. To do so<br />
Go to Control Panel --> Administrative Tools --> Event Viewer --> Clear All Events. <br /><br />
<br />2) We can also free a log and start recording new events by overwriting old events. To overwrite events,<br />
Go to Control Panel --> Administrative Tools --> Event Viewer --> on the left side Application/System/Security (as available) Right click --> Properties --> click Overwrite events as needed . <br />
This ensures that all new events are written to the log, even when the log is full. <br />
<br />
<br />3) We can also start logging new events by increasing the maximum log size. To increase the log size,<br />
Go to Control Panel --> Administrative Tools --> Event Viewer --> on the left side Application/System/Security (as available) Right click --> Properties --> Increase the Maximum log size by typing a bigger value.<br /><br /></div>
<div>
<div>
<br /></div>
<div>
<br /></div>
<div>
After that open the CMD, </div>
<div>
write "sqlplus /nolog" and press enter. </div>
<div>
Now, write "connect as sysdba", enter the user name, for example, "sys" and the password. </div>
<div>
After connect, write "startup".</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
C:\Documents and Settings\navneet>sqlplus</div>
</div>
<div>
<div>
SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 7 15:52:12 2012</div>
<div>
Copyright (c) 1982, 2010, Oracle. All rights reserved.</div>
<div>
<br /></div>
<div>
Enter user-name: /as sysdba</div>
<div>
<br /></div>
<div>
Connected to:</div>
<div>
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production</div>
<div>
With the Partitioning, OLAP, Data Mining and Real Application Testing options</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
SQL> select status from v$instance;</div>
<div>
<br /></div>
<div>
STATUS</div>
<div>
------------</div>
<div>
STARTED</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
SQL> alter database mount;</div>
<div>
<br /></div>
<div>
Database altered.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
SQL> select status from v$instance;</div>
<div>
<br /></div>
<div>
STATUS</div>
<div>
------------</div>
<div>
MOUNTED</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
SQL> alter database open;</div>
<div>
<br /></div>
<div>
Database altered.</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<div>
SQL> select status from v$instance;</div>
<div>
<br /></div>
<div>
STATUS</div>
<div>
------------</div>
<div>
OPEN</div>
<br class="Apple-interchange-newline" /></div>
<div>
<br /></div>
<div>
Njoy!!!!!</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Your suggestions and queries are always warm welcomed. </div>
<div>
<br /></div>
<div>
<b><br /></b></div>
<div>
<b><br /></b></div>
</div>Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com0tag:blogger.com,1999:blog-3095073441666721593.post-35393722104018261482012-02-29T16:35:00.001+05:302012-03-31T13:11:32.631+05:30Oracle XE 10g compatibility issue window 2008<div dir="ltr" style="text-align: left; font-family: arial;" trbidi="on"><div>Today I was installing Oracle XE 10g on windows 2008. </div><div>The installation was successful without any error or any warning. But after clicking on FINISH, the apex page was not found. </div><div><br /></div><div>I checked the services of oracle & seen that all services are <b>STOP</b>.</div><div>I started all the services of oracle. </div><div>For servies, Goto <b>Windows+R</b>> Type "<b>services.msc</b>"> right click on service name & click <b>START</b>.</div><div><br /></div>Even then i was not able to see apex webpage,<br /><div><div>then i tried to test it manually & enter into sqlplus. </div></div><div>After logging in " /as sysdba" i got an error<span class="Apple-tab-span" style="white-space: pre;"> </span></div><div><br /></div><div>Enter user-name: /as sysdba</div><div>Connected to an idle instance.</div><div><br /></div><div>SQL> startup</div><div>ORA-01078: failure in processing system parameters</div><div><b>ORA-01565: error in identifying file 'C:\oraclexe\app\oracle\product\10.2.0\serv</b></div><div><b>er\dbs/spfileXE.ora'</b></div><div>ORA-27041: unable to open file</div><div>OSD-04002: unable to open file</div><div>O/S-Error: (OS 2) The system cannot find the file specified.</div><div><br /></div><div><br /></div><div>I also noticed that BIN folder is empty & no CTRL file, no LOG file, no DBF's in oradata folder.</div><div>It did not created database too.</div><div>Then i re-install it after removing it completely, re-installation is successful again. Even after successful re-installing there is no files in BIN folder & again no CTRL file, no LOG file, no DBF's in oradata folder, Also database has not been created again.</div><div>After too much struggle i came to know that there is compatibility issue of Oracle XE with windows server 2008 and some of the rights issue too. </div><div><br /></div><div><div>This is the tip to make it work.</div><div>1. Go to the installer OracleXEUniv.exe</div><div>2. Right click --> Select Properties --> Compatibility --> click on Run this program in Compatibility Mode for: --> Windows 2003 Sp1</div><div>3. Run this OracleXEUniv.exe file as administrator.</div><div><br /></div><div>After running this OracleXEUniv.exe you will notice that setup is taking more time to install that means its creating database too.</div><div>Remember to double check that everything works fine. This solution works for me.</div></div><div><br /></div><div><br /></div><div><b>Extra Tips:</b></div><div>Here are some common issues which can make barrier to install XE.</div><div><div><br /></div><div>1) XE dump must be on local machine, not on network path.</div><div>2) XE must be installed by a local machine administrator, not a domain administrator.</div><div>3) XE requires several ports (1521, 8080) .</div><div>4) Firewalls and antivirus are known to crash the install.</div><div>5) Often point 3) will block the installation of the database. </div><div><br /></div><div>Note that XE does not use any form of HTTP listener - the database listener does the basic work and passes HTTP requests into the database. So no Apache or IIS requires with XE</div></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><span style="font-family: Georgia, serif; ">Your suggestions and queries are always warm welcomed.</span> </div></div>Navneet Singhhttp://www.blogger.com/profile/10701716036456268221noreply@blogger.com0