Search This Blog

Total Pageviews

Sunday, 2 June 2013

archive log status and error



set serveroutput on
DECLARE
CURSOR c is
select s.db_unique_name,
s.database_mode,
s.dest_id id, 
s.status stats,
s.recovery_mode,
s.protection_mode, 
s.standby_logfile_count,
s.standby_logfile_active,
s.archived_thread#, 
s.archived_seq#,
s.applied_thread#,
s.applied_seq#,
d.status, 
d.destination, 
d.archiver,
d.transmit_mode, 
d.affirm, 
d.async_blocks,
d.net_timeout, 
d.delay_mins, 
d.reopen_secs,
d.register,
d.binding, 
d.compression, 
d.error, 
to_char(d.FAIL_DATE,'dd-mm-yyyy hh24:mi:ss') FAIL_DATE
from v$archive_dest_status s, v$archive_dest d
where d.dest_id=s.dest_id
and s.db_unique_name != 'NONE'
and d.destination is not null;
BEGIN
dbms_output.put_line('-----------------------------------------------------');

FOR r IN c LOOP
DBMS_OUTPUT.PUT_LINE('Host Name          : ' || UTL_INADDR.GET_HOST_NAME);  
DBMS_OUTPUT.PUT_LINE('Ip Address         : ' || UTL_INADDR.GET_HOST_ADDRESS);  
dbms_output.put_line('Error date         : ' ||r.FAIL_DATE );
dbms_output.put_line('Dest ID            : ' ||r.id );
dbms_output.put_line('Status             : ' ||r.stats);
dbms_output.put_line('DB Name            : ' ||r.db_unique_name );
dbms_output.put_line('DB Mode            : ' ||r.database_mode);
dbms_output.put_line('Recovery Mode      : ' ||r.recovery_mode);
dbms_output.put_line('Protection Mode    : ' ||r.protection_mode);
dbms_output.put_line('SRL Count          : ' ||r.standby_logfile_count );
dbms_output.put_line('SRLActive          : ' ||r.standby_logfile_active);
dbms_output.put_line('Archived Thread#   : ' ||r.archived_thread# );
dbms_output.put_line('ArchivedSeq#       : ' ||r.archived_seq#);
dbms_output.put_line('Applied Thread#    : ' ||r.applied_thread# );
dbms_output.put_line('Destination        : ' ||r.destination);
dbms_output.put_line('Archiver           : ' ||r.archiver);
dbms_output.put_line('Transmit Mode      : ' ||r.transmit_mode);
dbms_output.put_line('Affirm             : ' ||r.affirm);
dbms_output.put_line('Asynchronous Blocks: ' ||r.async_blocks);
dbms_output.put_line('Net Timeout        : ' ||r.net_timeout);
dbms_output.put_line('Delay (Mins)       : ' ||r.delay_mins);
dbms_output.put_line('Reopen (Secs)      : ' ||r.reopen_secs);
dbms_output.put_line('Register           : ' ||r.register);
dbms_output.put_line('Binding            : ' ||r.binding);
dbms_output.put_line('Compression        : ' ||r.compression);
dbms_output.put_line('Error              : ' ||r.error);
dbms_output.put_line('----------------------------------------------------');
END LOOP;
END;
/




SQL> r
  1  DECLARE
  2  CURSOR c is
  3  select s.db_unique_name,
  4  s.database_mode,
  5  s.dest_id id,
  6  s.status stats,
  7  s.recovery_mode,
  8  s.protection_mode,
  9  s.standby_logfile_count,
 10  s.standby_logfile_active,
 11  s.archived_thread#,
 12  s.archived_seq#,
 13  s.applied_thread#,
 14  s.applied_seq#,
 15  d.status,
 16  d.destination,
 17  d.archiver,
 18  d.transmit_mode,
 19  d.affirm,
 20  d.async_blocks,
 21  d.net_timeout,
 22  d.delay_mins,
 23  d.reopen_secs,
 24  d.register,
 25  d.binding,
 26  d.compression,
 27  d.error,
 28  to_char(d.FAIL_DATE,'dd-mm-yyyy hh24:mi:ss') FAIL_DATE
 29  from v$archive_dest_status s, v$archive_dest d
 30  where d.dest_id=s.dest_id
 31  and s.db_unique_name !='NONE'
 32  and d.destination is not null;
 33  BEGIN
 34  dbms_output.put_line('-----------------------------------------------------');
 35
 36  FOR r IN c LOOP
 37  DBMS_OUTPUT.PUT_LINE('Host Name          : ' || UTL_INADDR.GET_HOST_NAME);
 38  DBMS_OUTPUT.PUT_LINE('Ip Address         : ' || UTL_INADDR.GET_HOST_ADDRESS);
 39  dbms_output.put_line('Error date         : ' ||r.FAIL_DATE );
 40  dbms_output.put_line('Dest ID            : ' ||r.id );
 41  dbms_output.put_line('Status             : ' ||r.stats);
 42  dbms_output.put_line('DB Name            : ' ||r.db_unique_name );
 43  dbms_output.put_line('DB Mode            : ' ||r.database_mode);
 44  dbms_output.put_line('Recovery Mode      : ' ||r.recovery_mode);
 45  dbms_output.put_line('Protection Mode    : ' ||r.protection_mode);
 46  dbms_output.put_line('SRL Count          : ' ||r.standby_logfile_count );
 47  dbms_output.put_line('SRLActive          : ' ||r.standby_logfile_active);
 48  dbms_output.put_line('Archived Thread#   : ' ||r.archived_thread# );
 49  dbms_output.put_line('ArchivedSeq#       : ' ||r.archived_seq#);
 50  dbms_output.put_line('Applied Thread#    : ' ||r.applied_thread# );
 51  dbms_output.put_line('Destination        : ' ||r.destination);
 52  dbms_output.put_line('Archiver           : ' ||r.archiver);
 53  dbms_output.put_line('Transmit Mode      : ' ||r.transmit_mode);
 54  dbms_output.put_line('Affirm             : ' ||r.affirm);
 55  dbms_output.put_line('Asynchronous Blocks: ' ||r.async_blocks);
 56  dbms_output.put_line('Net Timeout        : ' ||r.net_timeout);
 57  dbms_output.put_line('Delay (Mins)       : ' ||r.delay_mins);
 58  dbms_output.put_line('Reopen (Secs)      : ' ||r.reopen_secs);
 59  dbms_output.put_line('Register           : ' ||r.register);
 60  dbms_output.put_line('Binding            : ' ||r.binding);
 61  dbms_output.put_line('Compression        : ' ||r.compression);
 62  dbms_output.put_line('Error              : ' ||r.error);
 63  dbms_output.put_line('----------------------------------------------------');
 64  END LOOP;
 65* END;



-----------------------------------------------------
Host Name          : anuj.kumarsingh.co.uk
Ip Address         : 127.0.0.1
Error date         : 02-06-2013 06:49:58
Dest ID            : 2
Status             : ERROR
DB Name            : STANDBY
DB Mode            : UNKNOWN
Recovery Mode      : IDLE
Protection Mode    : MAXIMUM PERFORMANCE
SRL Count          : 0
SRLActive          : 0
Archived Thread#   : 0
ArchivedSeq#       : 0
Applied Thread#    : 0
Destination        : STDY
Archiver           : LGWR
Transmit Mode      : ASYNCHRONOUS
Affirm             : NO
Asynchronous Blocks: 16381
Net Timeout        : 180
Delay (Mins)       : 0
Reopen (Secs)      : 15
Register           : YES
Binding            : OPTIONAL
Compression        : DISABLE
Error              : ORA-12543: TNS:destination host unreachable
----------------------------------------------------




PROMPT *****************************************************************
PROMPT *  Archive Destinations
PROMPT *****************************************************************
set linesize 200 pagesize 200
COLUMN dest_id             HEADING "Dest|Id"                     FORMAT 99
COLUMN dest_name           HEADING "Dest Name"                   FORMAT a20
COLUMN db_unique_name      HEADING "UniqueName"                  FORMAT a15
COLUMN destination         HEADING "Destination"                 FORMAT a28
COLUMN archiver            HEADING "Arch|iver"                   FORMAT a4
COLUMN compression         HEADING "Compress"                    FORMAT a8
COLUMN transmit_mode       HEADING "Tranmit|Mode"                
COLUMN affirm              HEADING "AFFIRM"                      FORMAT a6

COLUMN reopen_secs         HEADING "Reopen|(sec)"                FORMAT 999999
COLUMN delay_mins          HEADING "Delay|(min)"                 FORMAT 99999
COLUMN max_connections     HEADING "Max|Conns"                   FORMAT 99999
COLUMN net_timeout         HEADING "Net|Time|Out"                FORMAT 9999
COLUMN alternate           HEADING "Alertnate"                   FORMAT a10
COLUMN dependency          HEADING "Dependency"                  FORMAT a10

COLUMN register            HEADING "Regi|ster"                   FORMAT a4
COLUMN log_sequence        HEADING "LogSeq"                      FORMAT 9999999

COLUMN async_blocks        HEADING "ASYNC|Blocks"                FORMAT 999999
COLUMN valid_now           HEADING "Valid|Now"                   FORMAT a7
COLUMN verify              HEADING "Verify"                      FORMAT a6

COLUMN fail_sequence       HEADING "FailSeq"                     FORMAT 9999999
COLUMN failure_count       HEADING "Fail|Count"                  FORMAT 99999
COLUMN max_failure         HEADING "Max|Fail"                    FORMAT 99999
COLUMN error               HEADING "Error"                       FORMAT a30

SELECT ad.dest_id
     , ad.dest_name
     , ad.db_unique_name
     , ad.destination
     , ad.status
     , ad.schedule
     , ad.target
     , ad.valid_type
     , ad.valid_role
     , ad.binding
     , ad.name_space
     , ad.compression
     , ad.archiver
     , ad.transmit_mode
     , ad.affirm
  FROM v$archive_dest ad
WHERE status <> 'INACTIVE'
;


Dest                                                                                                                                                               Arch Tranmit
  Id Dest Name            UniqueName      Destination                  STATUS    SCHEDULE TARGET           VALID_TYPE      VALID_ROLE   BINDING   NAME_SP Compress iver Mode         AFFIRM
---- -------------------- --------------- ---------------------------- --------- -------- ---------------- --------------- ------------ --------- ------- -------- ---- ------------ ------
   1 LOG_ARCHIVE_DEST_1   NONE            /u01/app/oracle/ArchiveLog   VALID     ACTIVE   PRIMARY          ALL_LOGFILES    ALL_ROLES    OPTIONAL  SYSTEM  DISABLE  ARCH SYNCHRONOUS  NO
   2 LOG_ARCHIVE_DEST_2   vihaan_stdy     stdy1                        DEFERRED  PENDING  STANDBY          ONLINE_LOGFILE  ALL_ROLES    OPTIONAL  SYSTEM  DISABLE  LGWR ASYNCHRONOUS NO




set lines 300 pagesize 300 numf 9999999999999
column destination format a25
column id 	format 999
column target 	format a7
column seq# 	format 999999999
column proc 	format a10
col transmit_mode for a20
select dest_id as id, status , target,archiver, destination, log_sequence as seq#, process ,register, transmit_mode, affirm,valid_type, valid_role, db_unique_name,applied_scn
from v$archive_dest 
where 1=1
and DB_UNIQUE_NAME!='NONE';





 select name,description from v$bgprocess where paddr<>'00' and description like 'Network%';
NAME  DESCRIPTION
----- ----------------------------------------------------------------
NSS2  Network Server SYNC

process that does the Redo Transport from Primary to Standby has changed from LNS to NSS (for synchronous Redo Transport):


SELECT ad.dest_id
     , ad.reopen_secs
     , ad.delay_mins
     , ad.max_connections
     , ad.net_timeout
     , ad.process
     , ad.register
     , ad.log_sequence
     , ad.alternate
     , ad.dependency
     , ad.async_blocks
     , ad.type
     , ad.valid_now
     , ad.verify
   --, ad.applied_scn
     , ad.fail_date
     , ad.fail_sequence
     , ad.failure_count
     , ad.max_failure
     , ad.error
  FROM v$archive_dest ad
WHERE status <> 'INACTIVE'
;

                             Net
Dest  Reopen  Delay    Max  Time            Regi                                  ASYNC         Valid                               Fail    Max
  Id   (sec)  (min)  Conns   Out PROCESS    ster   LogSeq Alertnate  Dependency  Blocks TYPE    Now     Verify FAIL_DATE  FailSeq  Count   Fail Error
---- ------- ------ ------ ----- ---------- ---- -------- ---------- ---------- ------- ------- ------- ------ --------- -------- ------ ------ ------------------------------
   1     300      0      1     0 ARCH       YES        40 NONE       NONE             0 PUBLIC  YES     NO                      0      0      0
   2     300      0      1    30 LGWR       YES         0 NONE       NONE         61440 PUBLIC  UNKNOWN NO                      0      0      
set linesize 200 pagesize 200 
col dest_id             heading "Dest|Id"                     format 9999
col destination         heading "Destination"                 format a15
col dest_status         heading "Dest|Status"                 format a8
col type                heading "Type"                        format a10
col database_mode       heading "Database Mode"               format a15
col recovery_mode       heading "Recovery Mode"               format a23
col protection_mode     heading "Protection Mode"             format a20
col gap_status          heading "GAP|Status"                  format a6
col applied             heading "A|p|p|l|i|e|d"               format a1   truncate
col archived            heading "A|r|c|h|e|v|e|d"             format a1   truncate
col deleted             heading "D|e|l|e|t|e|d"               format a1   truncate
col archlog_status      heading "S|t|a|t|u|s"                 format a1   truncate
col max_sequence#       heading "Max Sequence#"               format 999999
col max_next_time       heading "Max Next Time"               format a18
col max_first_time      heading "Max First Time"              format a18
SELECT l.dest_id
     , s.destination
     , s.status   dest_status
     , s.type
     , s.database_mode
     , s.recovery_mode
     , s.protection_mode
     , s.gap_status
     , l.applied
     , l.archived
     , l.deleted
     , l.status    archlog_status
     , l.thread#
     , max(l.sequence#) max_sequence#
     , TO_CHAR(max(l.next_time),'DD-MON-YY hh24:MI:SS')  max_next_time
     , TO_CHAR(max(l.first_time),'DD-MON-YY hh24:MI:SS') max_first_time
     , ROUND((SUM(l.block_size * l.blocks)/1024/1024/1024),2)  redo_size_GB
 FROM v$archived_log l
    , v$archive_dest_status s
WHERE l.dest_id = s.dest_id     
 GROUP BY l.dest_id
        , s.destination
        , s.status
        , s.type
        , s.database_mode
        , s.recovery_mode
        , s.protection_mode
        , s.gap_status
        , l.applied
        , l.archived
        , l.deleted
        , l.status
       , l.thread#
 ORDER BY l.applied desc
        , l.dest_id ;   



===

set line 500 
col  dest_name format a20
col destination format a15
col gap_status format a10
col db_unique_name format a15
col error format a25
col applied_scn for 999999999999999
SELECT AL.THREAD#,
       ADS.DEST_ID,
       ADS.DEST_NAME,
       (SELECT ADS.TYPE || ' ' || AD.TARGET      FROM V$ARCHIVE_DEST AD  WHERE AD.DEST_ID = ADS.DEST_ID) TARGET,
       ADS.DATABASE_MODE,
       ADS.STATUS,
       ADS.RECOVERY_MODE,
       ADS.DB_UNIQUE_NAME,
       ADS.DESTINATION,
       ADS.GAP_STATUS,
       (SELECT MAX(SEQUENCE#) FROM V$LOG NA WHERE NA.THREAD# = AL.THREAD#) CURRENT_SEQ#,
       MAX(SEQUENCE#) LAST_ARCHIVED,
       MAX(CASE  WHEN AL.APPLIED = 'YES' AND ADS.TYPE <> 'LOCAL' THEN         AL.SEQUENCE#
           END) APPLIED_SEQ#,
       (SELECT AD.APPLIED_SCN      FROM V$ARCHIVE_DEST AD  WHERE AD.DEST_ID = ADS.DEST_ID) APPLIED_SCN,
ADS.ERROR
  FROM (SELECT *    FROM V$ARCHIVED_LOG V
         WHERE V.RESETLOGS_CHANGE# = (SELECT D.RESETLOGS_CHANGE# FROM V$DATABASE D)) AL,
       V$ARCHIVE_DEST_STATUS ADS
 WHERE AL.DEST_ID(+) = ADS.DEST_ID
   AND ADS.STATUS != 'INACTIVE'
 GROUP BY AL.THREAD#,
          ADS.DEST_ID,
          ADS.DEST_NAME,
          ADS.STATUS,
          ADS.ERROR,
          ADS.TYPE,
          ADS.DATABASE_MODE,
          ADS.RECOVERY_MODE,
          ADS.DB_UNIQUE_NAME,
          ADS.DESTINATION,
          ADS.GAP_STATUS
 ORDER BY ADS.DEST_ID,AL.THREAD#;

 
                                                                                                                A
                                                                                                              A r D
                                                                                                              p c e S
                                                                                                              p h l t
                                                                                                              l e e a
                                                                                                              i v t t
 Dest                 Dest                                                                             GAP    e e e u
   Id Destination     Status   Type       Database Mode   Recovery Mode           Protection Mode      Status d d d s    THREAD# Max Sequence# Max Next Time      Max First Time     REDO_SIZE_GB
----- --------------- -------- ---------- --------------- ----------------------- -------------------- ------ - - - - ---------- ------------- ------------------ ------------------ ------------
    2 orajndr         VALID    PHYSICAL   MOUNTED-STANDBY MANAGED REAL TIME APPLY MAXIMUM PERFORMANCE  NO GAP Y Y N A          1        265642 10-JUL-17 09:02:50 10-JUL-17 09:01:08      3179.73
    1 +ORLOGS         VALID    LOCAL      OPEN            IDLE                    MAXIMUM PERFORMANCE         N Y N A          1        265643 10-JUL-17 09:10:48 10-JUL-17 09:02:50        44.22






set linesize 200 pagesize 200
col destination for a15
select /*+ parallel(8) */ ar.inst_id "inst_id",
       ar.dest_id "dest_id",
       ar.status "dest_status",
       ar.destination "destination",
         (select MAX (sequence#) highiest_seq   from v$archived_log val, v$database vdb
           where val.resetlogs_change# = vdb.resetlogs_change#
                 and thread# = ar.inst_id
                 and dest_id = ar.dest_id)
       - NVL (
            (select MAX (sequence#)   from v$archived_log val, v$database vdb
              where  val.resetlogs_change# = vdb.resetlogs_change#
                    and thread# = ar.inst_id
                    and dest_id = ar.dest_id
                    and standby_dest = 'YES'
                    and applied = 'YES'),  0)   "applied_gap",
         (SELECT MAX (sequence#) highiest_seq    from v$archived_log val, v$database vdb
           where     val.resetlogs_change# = vdb.resetlogs_change#
                     AND thread# = ar.inst_id)
       - NVL (
            (SELECT MAX (sequence#)  from v$archived_log val, v$database vdb
              where val.resetlogs_change# = vdb.resetlogs_change#
                    and thread# = ar.inst_id
                    and dest_id = ar.dest_id
                    and standby_dest = 'YES'), 0)     "received_gap",
       NVL (
          (SELECT MAX (sequence#)   from v$archived_log val, v$database vdb
            where     val.resetlogs_change# = vdb.resetlogs_change#
                  and thread# = ar.inst_id
                  and dest_id = ar.dest_id
                  and standby_dest = 'YES'), 0) "last_received_seq",
       NVL (
          (SELECT MAX (sequence#)  from v$archived_log val, v$database vdb
            where     val.resetlogs_change# = vdb.resetlogs_change#
                  and thread# = ar.inst_id
                  and dest_id = ar.dest_id
                  and standby_dest = 'YES'
                  and applied = 'YES'),  0)   "last_applied_seq"
  from (SELECT DISTINCT dest_id,
                        inst_id,
                        status,
                        target,
                        destination,
                        error
          from sys.gv_$archive_dest
         where target = 'STANDBY' and STATUS <> 'DEFERRED') ar;


----- ===============
PROMPT *****************************************************************
PROMPT *  D A T A G U A R D    L A G
PROMPT *****************************************************************
COLUMN name                HEADING "Name"                        FORMAT a23
COLUMN value               HEADING "Value"                       FORMAT a20
COLUMN unit                HEADING "Unit"                        FORMAT a30
COLUMN time_computed       HEADING "TimeComputed"                FORMAT a20
COLUMN datum_time          HEADING "datum_time"                  FORMAT a20
SELECT ds.name
     , ds.value
     , ds.unit
     , ds.time_computed
     , ds.datum_time
  FROM v$dataguard_stats ds ;
==

set linesize 300 pagesize 300
col VALUE for a150 wrap
col NAME for a30
select NAME,VALUE from V$SPPARAMETER where NAME like 'log_archive_dest%'
and VALUE is not null
and VALUE like '%db_unique_name%'
--and VALUE like 'LGWR%'
;


set linesize 300
col VALUE for a50
col NAME for a40
select name, value
from v$parameter
where name = 'log_archive_dest'
and value is not null
union all
select p.name, p.value
from v$parameter p where
name like 'log_archive_dest%'
and p.name not like '%state%'
and p.value is not null
and 'enable' = (
	select lower(p2.value)
	from v$parameter p2
	where p2.name =  substr(p.name,1,instr(p.name,'_',-1)) || 'state' || substr(p.name,instr(p.name,'_',-1))
)
union all
select p.name, p.value
from v$parameter p
where p.name like 'log_archive_dest_stat%'
and lower(p.value) = 'enable'
and (
	select p2.value
	from v$parameter p2
	where name = substr(p.name,1,16) || substr(p.name,instr(p.name,'_',-1))
) is not null
/



set linesize 300 pagesize 300
col VALUE for a150 wrap
col NAME for a30
select NAME,VALUE from V$SPPARAMETER where NAME like 'log_archive_dest%'
and VALUE is not null
and VALUE like '%db_unique_name%'
--and VALUE like 'LGWR%'
;





Set lines 150 pagesize  200
Col timest     format a14 heading TIMESTAMP
Col message    format a40 trunc
Col severity   format a15 trunc
Col facility   format a03
Select inst_id, to_char(timestamp, 'DD/MM HH24:MI:SS') timest, 
facility
    /*   decode(facility, 
              'Crash Recovery',           'CR',
              'Data Guard',               'DG',
              'Fetch Archive Log',        'FAL',
              'Log Apply Services',       'LAS',
              'Log Transport Services',   'LTS',
              'Network Services',         'NS',
              'Remote File Server',       'RFS',
              'Role Management Services', 'RMS',
                                          substr(facility,1,3)
             ) facility,
*/
        message, severity
,DEST_ID
from gv$dataguard_status
where 1=1
  and SEVERITY not in ('Informational','Control')
   and timestamp >= trunc(sysdate)
order by inst_id, timestamp
/


set linesize 300 pagesize 500
col DESTINATION for a40
col RECOVERY_MODE for a30
col DEST_NAME for a20
select DEST_ID,STATUS,DEST_NAME,RECOVERY_MODE,PROTECTION_MODE,DESTINATION,SYNCHRONIZATION_STATUS,SYNCHRONIZED ,ERROR from v$archive_dest_status
where 1=1
and STATUS='VALID'
;


set linesize 300
col ERROR for a80
select db_unique_name, status, error from v$archive_dest where db_unique_name != 'NONE' ;




  
  set linesize 200
  set pagesize 2000
  col name format a30
  col value format a20
  col unit format a30
  col time_computed forma a20
  col datum_time format a20
  select name, value, unit, time_computed, datum_time
  from   v$dataguard_stats
  ;

  
  alter session set nls_date_format='dd-mm-yyyy hh24:mi';
  
  SET LINESIZE 200  PAGESIZE 200
SET FEEDBACK OFF

COLUMN FACILITY FORMAT A20
COLUMN SEVERITY FORMAT A15
COLUMN MESSAGE FORMAT A80 WORD_WRAPPED
COLUMN TIMESTAMP FORMAT A20

SELECT FACILITY, SEVERITY, TIMESTAMP, MESSAGE 
FROM V$DATAGUARD_STATUS 
WHERE 1=1
-- and MESSAGE LIKE '%Media Recovery Log%'
and MESSAGE LIKE '%Media Recovery%'
--AND TIMESTAMP > SYSDATE - INTERVAL '10' MINUTE
ORDER BY TIMESTAMP DESC
;

Saturday, 13 April 2013

How To Install VMware Tools .. ?

Install VMWARE Tools

How To Install VMware Tools ..?

[root@localhost tmp]# tar zxf VMwareTools-8.4.0-240242.tar.gz

[root@localhost tmp]# ls -ltrd */

drwxrwxrwt 11 root root 4096 Jan 6 19:35 .

[root@localhost tmp]# ls -ltr
total 108492
drwxr-xr-x 7 root root 4096 Mar 10 2010 vmware-tools-distrib
drwx------ 2 root root 4096 Jan 6 19:26 ssh-EkwQiJ3516
drwx------ 2 root root 4096 Jan 6 19:26 keyring-9bhvw8
drwx------ 3 root root 4096 Jan 6 19:26 gconfd-root
drwx------ 2 root root 4096 Jan 6 19:27 virtual-root.HOOz6L
srwxr-xr-x 1 root root 0 Jan 6 19:27 mapping-root
drwx------ 2 root root 4096 Jan 6 19:27 orbit-root
-r--r--r-- 1 root root 110948671 Jan 6 19:31 VMwareTools-8.4.0-240242.tar.gz

[root@localhost tmp]# cd vmware-tools-distrib/

[root@localhost vmware-tools-distrib]# ls -ltr
total 552
drwxr-xr-x 17 root root 4096 Mar 10 2010 lib
drwxr-xr-x 2 root root 4096 Mar 10 2010 installer
drwxr-xr-x 3 root root 4096 Mar 10 2010 etc
drwxr-xr-x 2 root root 4096 Mar 10 2010 doc
drwxr-xr-x 2 root root 4096 Mar 10 2010 bin
-r--r--r-- 1 root root 538581 Mar 10 2010 FILES
lrwxrwxrwx 1 root root 31 Jan 6 19:35 vmware-install.pl -> ./bin/vmware-un
install-tools.pl
lrwxrwxrwx 1 root root 13 Jan 6 19:35 INSTALL -> ./doc/INSTALL

[root@localhost vmware-tools-distrib]# ./vmware-install.pl -d
Creating a new VMware Tools installer database using the tar4 format.

Installing VMware Tools.

In which directory do you want to install the binary files?
[/usr/bin]

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d]

What is the directory that contains the init scripts?
[/etc/rc.d/init.d]

In which directory do you want to install the daemon files?
[/usr/sbin]

In which directory do you want to install the library files?
[/usr/lib/vmware-tools]

The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]


In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]

The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes]

The installation of VMware Tools 8.4.0 build-240242 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes]

Initializing...


Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: [ OK ]
Virtual Printing daemon: [ OK ]
Unmounting HGFS shares: [ OK ]
Guest filesystem driver: [ OK ]


Found a compatible pre-built module for vmmemctl. Installing it...


Found a compatible pre-built module for vmhgfs. Installing it...


Found a compatible pre-built module for vmxnet. Installing it...


Found a compatible pre-built module for vmblock. Installing it...


[EXPERIMENTAL] The VMware FileSystem Sync Driver (vmsync) is a new feature that
creates backups of virtual machines. Please refer to the VMware Knowledge Base
for more details on this capability. Do you wish to enable this feature?
[no]

Found a compatible pre-built module for vmci. Installing it...


Found a compatible pre-built module for vsock. Installing it...


Found a compatible pre-built module for vmxnet3. Installing it...


Found a compatible pre-built module for pvscsi. Installing it...




Detected X.org version 7.1.


Host resolution detected as "1366 x 768".


Please choose one of the following display sizes that X will start with:

[1] "320x200"
[2] "320x240"
[3] "400x300"
[4] "512x384"
[5] "640x400"
[6] "640x480"
[7] "720x480"
[8] "800x480"
[9] "854x480"
[10] "720x576"
[11] "800x600"
[12] "1024x768"
[13]< "1280x720"
Please enter a number between 1 and 13:

[13]

_XSERVTransSocketOpenCOTSServer: Unable to open socket for inet6
_XSERVTransOpen: transport open failed for inet6/localhost.localdomain:1
_XSERVTransMakeAllCOTSServerListeners: failed to open listener for inet6

X Window System Version 7.1.1
Release Date: 12 May 2006
X Protocol Version 11, Revision 0, Release 7.1.1
Build Operating System: Linux 2.6.18-53.el5 i686 Red Hat, Inc.
Current Operating System: Linux localhost.localdomain 2.6.18-238.el5 #1 SMP Thu
Jan 13 16:24:47 EST 2011 i686
Build Date: 17 November 2010
Build ID: xorg-x11-server 1.1.1-48.76.el5_5.2
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/tmp/vmware-config0/XF86ConfigLog.3915", Time: Sun Jan 6 19:39:
58 2013
(++) Using config file: "/tmp/vmware-config0/XF86Config.3915"
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning: Multiple symbols for level 1/group 1 on key <I5F>
> Using XF86Sleep, ignoring XF86Standby
> Warning: Symbol map for key <I5F> redefined
> Using last definition for conflicting fields
Errors from xkbcomp are not fatal to the X server

X is running fine with the new config file.

FreeFontPath: FPE "unix/:7100" refcount is 2, should be 1; fixing.
Creating a new initrd boot image for the kernel.
Checking acpi hot plug [ OK ]
Starting VMware Tools services in the virtual machine:
Switching to guest configuration: [ OK ]
Paravirtual SCSI module: [ OK ]
Guest filesystem driver: [ OK ]
Mounting HGFS shares: [FAILED]
Guest memory manager: [ OK ]
Guest vmxnet fast network device: [ OK ]
VM communication interface: [ OK ]
VM communication interface socket family: [ OK ]
Blocking file system: [ OK ]
File system sync driver: [ OK ]
Guest operating system daemon: [ OK ]
Virtual Printing daemon: [ OK ]

The configuration of VMware Tools 8.4.0 build-240242 for Linux for this running
kernel completed successfully.

You must restart your X session before any mouse or graphics changes take
effect.

You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
command line or by invoking "/usr/bin/vmware-toolbox" from the command line
during an X server session.

To enable advanced X features (e.g., guest resolution fit, drag and drop, and
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session; and,
3. Restart your X session.

To use the vmxnet driver, restart networking using the following commands:
/etc/init.d/network stop
rmmod pcnet32
rmmod vmxnet
modprobe vmxnet
/etc/init.d/network start

Enjoy,

--the VMware team

Found VMware Tools CDROM mounted at /media/VMware Tools. Ejecting device <<<<<<<<<<<<<< final
/dev/hdc ...
[root@localhost vmware-tools-distrib]#

Monday, 21 January 2013

ORA-16047: DGID mismatch between destination setting and target database


ORA-16047: DGID mismatch between destination setting and target database
ORA-16047: DGID
ORA-16047 


select dest_id,status,error from v$archive_dest;

DEST_ID  STATUS       ERROR
------  ------------- -----------------------------------------------------------------
1       VALID
2       DISABLED      ORA-16047: DGID mismatch between destination setting and target database



>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>This parameter should be the same on primary and standby <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
SQL> show parameter log_archive_config

NAME                                        TYPE         VALUE
------------------------------------ -----------  ------------------------------
log_archive_config                      string       dg_config=(PRIMARY,STANDBY)


LOG_ARCHIVE_CONFIG='DG_CONFIG=(PRIMARY,STANDBY)' ---  using the DB_UNIQUE_NAME of both databases




Sunday, 25 November 2012

Oracle 11g single instance archivelog mode on ASM



Oracle 11g- Single instance  archivelog mode on ASM 



Oracle 11gR2 archivelog mode on ASM
Oracle 11gR2 archivelog mode

ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576      9216     5657              896            2380              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576      9216     8988                0            8988              0             N  FRA/


ASMCMD> cd FRA

ASMCMD> mkdir Archive

ASMCMD> ls -lt
Type       Redund  Striped  Time             Sys  Name
                                             Y    ONLINELOG/
                                             N    Archive/
                                             Y    AUTOBACKUP/
                                             N    redo03b.log => +FRA/ORCL/ONLINELOG/group_3.257.741266861
                                             N    redo02b.log => +FRA/ORCL/ONLINELOG/group_2.258.741267209
                                             N    redo01b.log => +FRA/ORCL/ONLINELOG/group_1.256.741266959

ASMCMD> pwd
+FRA/ORCL/Archive


[oracle@oel5u4-orcl ~] . oraenv
ORACLE_SID = [orcl] ?
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is /u01/app/oracle

sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Nov 24 19:43:11 2012

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


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


SQL> alter system set LOG_ARCHIVE_FORMAT ='Log%s_%t_%r.Arc' scope=spfile;
System altered.

SQL> alter system set log_archive_dest_1='location=+FRA/ORCL/Archive' SCOPE=SPFILE;
System altered.

SQL> alter system set log_archive_start=TRUE SCOPE=SPFILE;  --- no need in Oracle 11gr2
System altered.

SQL> alter system reset log_archive_start scope=spfile sid='*';
System altered.

SQL> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.

Total System Global Area  472887296 bytes
Fixed Size                  1337296 bytes
Variable Size             360712240 bytes
Database Buffers          104857600 bytes
Redo Buffers                5980160 bytes
Database mounted.

SQL> alter database archivelog;
Database altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +FRA/orcl/archive
Oldest online log sequence     32
Next log sequence to archive   34
Current log sequence           34

SQL> alter database open ;
Database altered.

SQL> alter system switch logfile;
System altered.

SQL> /
System altered.
SQL> /
System altered.


SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

[oracle@oel5u4-orcl ~] . oraenv
ORACLE_SID = [orcl] ? +ASM
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is /u01/app/oracle

[oracle@oel5u4-+ASM ~] asmcmd -p
ASMCMD [+] > cd FRA
ASMCMD [+FRA] > ls -lt
Type  Redund  Striped  Time             Sys  Name
                                        Y    ORCL/
ASMCMD [+FRA] > cd ORCL
ASMCMD [+FRA/ORCL] > cd Archive
ASMCMD [+FRA/ORCL/Archive] > ls -lt
Type        Redund  Striped  Time             Sys  Name
                                              N    log36_1_731227289.arc => +FRA/ORCL/ARCHIVELOG/2012_11_24/thread_1_seq_36.262.800222675
                                              N    log35_1_731227289.arc => +FRA/ORCL/ARCHIVELOG/2012_11_24/thread_1_seq_35.261.800222653
                                              N    log34_1_731227289.arc => +FRA/ORCL/ARCHIVELOG/2012_11_24/thread_1_seq_34.260.800222627
ASMCMD [+FRA/ORCL/Archive] >


Oracle 11g Duplicating Database without connecting to Target Database .....




Oracle 11g Duplicating Database without connecting to Target Database .....


Backup script 
take backup

# rman nocatalog target / <<-eof div="div">
   configure retention policy to recovery window of 3 days;
   configure backup optimization on;
   configure controlfile autobackup on;
   configure default device type to disk;
   configure device type disk parallelism 1 backup type to compressed backupset;
   configure datafile backup copies for device type disk to 1;
   configure maxsetsize to unlimited;
   configure snapshot controlfile name to '/u01/app/Backup/snapshot_controlfile';
   show all;
   run {
     allocate channel ch1 type Disk maxpiecesize = 1900M;
     backup full database noexclude
     include current controlfile
     format '/u01/app/Backup/datafile_%s_%p.bak'
     tag 'datafile_daily';
   }
   run {
     allocate channel ch1 type Disk maxpiecesize = 1900M;
     backup archivelog all
     delete all input
     format '/u01/app/Backup/archivelog_%s_%p.arch'
     tag 'archivelog_daily';
   }
   run {
      allocate channel ch1 type Disk maxpiecesize = 1900M;
      backup format '/u01/app/Backup/controlfile_%s.bak' current controlfile;
   }
   crosscheck backup;
   list backup of database;
   report unrecoverable;
   report schema;
   report need backup;
   report obsolete;
   delete noprompt expired backup of database;
   delete noprompt expired backup of controlfile;
   delete noprompt expired backup of archivelog all;
   delete noprompt obsolete recovery window of 3 days;
   quit
#EOF




Main Database                    : orcl
Auxiliary Database Server : dupli

for testing ...We are doing this on same server and on same +ASM group 

[oracle@oel5u4-dpuli dbs] cat initdpuli.ora
dpuli.__db_cache_size=58720256
dpuli.__java_pool_size=8388608
dpuli.__large_pool_size=4194304
dpuli.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
dpuli.__pga_aggregate_target=209715200
dpuli.__sga_target=264241152
dpuli.__shared_io_pool_size=0
dpuli.__shared_pool_size=180355072
dpuli.__streams_pool_size=4194304
*.audit_file_dest='/u01/app/oracle/admin/dpuli/adump'  #<<<< create this dir  
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='+DATA','+DATA'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain='us.oracle.com'
*.db_name='dpuli'
*.db_recovery_file_dest='+FRA'
*.db_recovery_file_dest_size=4259315712
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.log_archive_dest_1='location=+FRA/dpuli/Archive'  # <<<<---- archive="archive" create="create" dir="dir" div="div" fail="fail" for="for" in="in" it="it" log="log" other="other" this="this" will="will" wise="wise">
*.log_archive_format='Log%s_%t_%r.Arc'
*.memory_target=471859200
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'


[oracle@oel5u4-orcl dbs] pwd
/u01/app/oracle/product/11.2.0/dbhome_1/dbs


Create password file 

[oracle@oel5u4-orcl dbs] orapwd file=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwdpuli password=oracle
[oracle@oel5u4-orcl dbs] ls -ltr
total 9572
-rw-r--r-- 1 oracle oinstall    2851 May 15  2009 init.ora
drwx------ 2 oracle oinstall    4096 Oct  1  2010 peshm_DBUA0_0
-rw-rw---- 1 oracle oinstall    1544 Oct  1  2010 hc_DBUA0.dat
drwx------ 2 oracle dba         4096 Oct  1  2010 peshm_orcl_0
-rw-rw---- 1 oracle dba         1544 Oct  1  2010 hc_orcl.dat
-rw-r----- 1 oracle dba           24 Oct  1  2010 lkORCL
-rw-r----- 1 oracle oinstall      35 Oct  1  2010 initorcl.ora
-rw-r----- 1 oracle oinstall    1536 Oct  1  2010 orapworcl
-rw-r----- 1 oracle dba      9748480 Nov 24 18:57 snapcf_orcl.f
-rw-r----- 1 oracle oinstall    1536 Nov 24 22:02 orapwdpuli

cd /u01/app/oracle/admin
mkdir dpuli
mkdir dpdump adump pfile   --- <<<<<<<<<<<<<<<

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=dpuli


sqlplus sys/oracle as sysdba


[oracle@oel5u4-dpuli dbs] sqlplus sys/oracle as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Nov 24 22:05:02 2012

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

Connected to an idle instance.

startup nomount pfile=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initdpuli.ora



[oracle@oel5u4-dpuli dpuli] !sql
sqlplus sys/oracle as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Nov 24 22:20:02 2012

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

Connected to an idle instance.

SQL> def
DEFINE _DATE           = "24-NOV-12" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "dpuli" (CHAR)
DEFINE _USER           = "SYS" (CHAR)
DEFINE _PRIVILEGE      = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1102000100" (CHAR)
DEFINE _EDITOR         = "ed" (CHAR)
DEFINE _O_VERSION      = "" (CHAR)
DEFINE _O_RELEASE      = "" (CHAR)


SQL> startup nomount pfile=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initdpuli.ora

ORACLE instance started.

Total System Global Area  472887296 bytes
Fixed Size                  1337296 bytes
Variable Size             406849584 bytes
Database Buffers           58720256 bytes
Redo Buffers                5980160 bytes

[oracle@oel5u4-dpuli dpuli]  rman auxiliary /

Recovery Manager: Release 11.2.0.1.0 - Production on Sat Nov 24 22:27:36 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to auxiliary database: DPULI (not mounted)


duplicate database to 'dpuli' backup location '/u01/app/Backup';

RMAN> duplicate database to 'dpuli' backup location '/u01/app/Backup';


[oracle@oel5u4-orcl ~] export ORACLE_SID=dpuli
[oracle@oel5u4-dpuli ~] !sql
sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 25 07:52:32 2012

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

Connected to an idle instance.

SQL> startup nomount pfile=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initdpuli.ora

ORACLE instance started.

Total System Global Area  472887296 bytes
Fixed Size                  1337296 bytes
Variable Size             406849584 bytes
Database Buffers           58720256 bytes
Redo Buffers                5980160 bytes


SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

after nomount ....

[oracle@oel5u4-dpuli ~] ps -ef|grep -i smon
oracle    6666     1  0 07:32 ?        00:00:02 asm_smon_+ASM
oracle    7870     1  1 07:56 ?        00:00:02 ora_smon_dpuli
oracle    7988  7602 38 07:59 pts/4    00:00:00 grep -i smon


[oracle@oel5u4-dpuli ~] rman auxiliary /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Nov 25 08:00:16 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to auxiliary database: DPULI (not mounted)

RMAN> duplicate database to 'dpuli' backup location '/u01/app/Backup'; 

Starting Duplicate Db at 25-NOV-12

contents of Memory Script:
{
   sql clone "create spfile from memory";
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     472887296 bytes

Fixed Size                     1337296 bytes
Variable Size                411043888 bytes
Database Buffers              54525952 bytes
Redo Buffers                   5980160 bytes

contents of Memory Script:
{
   sql clone "alter system set  control_files =
  ''+DATA/dpuli/controlfile/current.274.800266185'', ''+DATA/dpuli/controlfile/current.273.800266189'' comment=
 ''Set by RMAN'' scope=spfile";
   sql clone "alter system set  db_name =
 ''ORCL'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''DPULI'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  '/u01/app/Backup/controlfile_16.bak';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  control_files =   ''+DATA/dpuli/controlfile/current.274.800266185'', ''+DATA/dpuli/controlfile/current.273.800266189'' 

comment= ''Set by RMAN'' scope=spfile

sql statement: alter system set  db_name =  ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''DPULI'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     472887296 bytes

Fixed Size                     1337296 bytes
Variable Size                411043888 bytes
Database Buffers              54525952 bytes
Redo Buffers                   5980160 bytes

Starting restore at 25-NOV-12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=12 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:36
output file name=+DATA/dpuli/controlfile/current.274.800266185
output file name=+DATA/dpuli/controlfile/current.273.800266189
Finished restore at 25-NOV-12

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=12 device type=DISK

contents of Memory Script:
{
   set until scn  1427605;
   set newname for clone datafile  1 to new;
   set newname for clone datafile  2 to new;
   set newname for clone datafile  3 to new;
   set newname for clone datafile  4 to new;
   set newname for clone datafile  5 to new;
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 25-NOV-12
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to +DATA
channel ORA_AUX_DISK_1: restoring datafile 00002 to +DATA
channel ORA_AUX_DISK_1: restoring datafile 00003 to +DATA
channel ORA_AUX_DISK_1: restoring datafile 00004 to +DATA
channel ORA_AUX_DISK_1: restoring datafile 00005 to +DATA
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/Backup/datafile_11_1.bak
channel ORA_AUX_DISK_1: piece handle=/u01/app/Backup/datafile_11_1.bak tag=DATAFILE_DAILY
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:25:08
Finished restore at 25-NOV-12

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=7 STAMP=800267909 file name=+DATA/dpuli/datafile/system.272.800266397
datafile 2 switched to datafile copy
input datafile copy RECID=8 STAMP=800267911 file name=+DATA/dpuli/datafile/sysaux.271.800266407
datafile 3 switched to datafile copy
input datafile copy RECID=9 STAMP=800267912 file name=+DATA/dpuli/datafile/undotbs1.269.800266419
datafile 4 switched to datafile copy
input datafile copy RECID=10 STAMP=800267913 file name=+DATA/dpuli/datafile/users.268.800266427
datafile 5 switched to datafile copy
input datafile copy RECID=11 STAMP=800267914 file name=+DATA/dpuli/datafile/example.270.800266415

contents of Memory Script:
{
   set until scn  1427605;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 25-NOV-12
using channel ORA_AUX_DISK_1

starting media recovery

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=41
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/Backup/archivelog_14_1.arch
channel ORA_AUX_DISK_1: piece handle=/u01/app/Backup/archivelog_14_1.arch tag=ARCHIVELOG_DAILY
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:26
archived log file name=+FRA/dpuli/archive/log41_1_731227289.arc thread=1 sequence=41
channel clone_default: deleting archived log(s)
archived log file name=+FRA/dpuli/archive/log41_1_731227289.arc RECID=1 STAMP=800268038
media recovery complete, elapsed time: 00:00:54
Finished recover at 25-NOV-12

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
   sql clone "alter system set  db_name =
 ''DPULI'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

database dismounted
Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     472887296 bytes

Fixed Size                     1337296 bytes
Variable Size                411043888 bytes
Database Buffers              54525952 bytes
Redo Buffers                   5980160 bytes

sql statement: alter system set  db_name =  ''DPULI'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     472887296 bytes

Fixed Size                     1337296 bytes
Variable Size                411043888 bytes
Database Buffers              54525952 bytes
Redo Buffers                   5980160 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DPULI" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP  1  SIZE 50 M ,
  GROUP  2  SIZE 50 M ,
  GROUP  3  SIZE 50 M
 DATAFILE
  '+DATA/dpuli/datafile/system.272.800266397'
 CHARACTER SET AL32UTF8


contents of Memory Script:
{
   set newname for clone tempfile  1 to new;
   switch clone tempfile all;
   catalog clone datafilecopy  "+DATA/dpuli/datafile/sysaux.271.800266407",
 "+DATA/dpuli/datafile/undotbs1.269.800266419",
 "+DATA/dpuli/datafile/users.268.800266427",
 "+DATA/dpuli/datafile/example.270.800266415";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to +DATA in control file

cataloged datafile copy
datafile copy file name=+DATA/dpuli/datafile/sysaux.271.800266407 RECID=1 STAMP=800268593
cataloged datafile copy
datafile copy file name=+DATA/dpuli/datafile/undotbs1.269.800266419 RECID=2 STAMP=800268594
cataloged datafile copy
datafile copy file name=+DATA/dpuli/datafile/users.268.800266427 RECID=3 STAMP=800268594
cataloged datafile copy
datafile copy file name=+DATA/dpuli/datafile/example.270.800266415 RECID=4 STAMP=800268595

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=800268593 file name=+DATA/dpuli/datafile/sysaux.271.800266407
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=800268594 file name=+DATA/dpuli/datafile/undotbs1.269.800266419
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=800268594 file name=+DATA/dpuli/datafile/users.268.800266427
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=800268595 file name=+DATA/dpuli/datafile/example.270.800266415

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 25-NOV-12

RMAN>



SQL> select OPEN_MODE from v$database ;

OPEN_MODE
--------------------
READ WRITE



select INSTANCE_NAME,DATABASE_STATUS,HOST_NAME,STATUS from v$instance

INSTANCE_NAME    DATABASE_STATUS   HOST_NAME                                                        STATUS
---------------- ----------------- ---------------------------------------------------------------- ------------
dpuli            ACTIVE            oel5u4                                                           OPEN



SQL> show parameter spfile ;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.0
                                                 /dbhome_1/dbs/spfiledpuli.ora

SQL> create pfile='/tmp/initdupli.txt' from spfile ;

File created.


Now New spfile <<<<<<<<<<<<<<<<<<<

SQL> !cat /tmp/initdupli.txt
*.__db_cache_size=56M
dpuli.__db_cache_size=54525952
*.__java_pool_size=8M
dpuli.__java_pool_size=8388608
*.__large_pool_size=4M
dpuli.__large_pool_size=4194304
*.__oracle_base='/u01/app/oracle'# ORACLE_BASE set from environment
*.__pga_aggregate_target=200M
dpuli.__pga_aggregate_target=209715200
*.__sga_target=252M
dpuli.__sga_target=264241152
*.__shared_io_pool_size=0
dpuli.__shared_io_pool_size=0
*.__shared_pool_size=172M
dpuli.__shared_pool_size=180355072
*.__streams_pool_size=4M
dpuli.__streams_pool_size=4194304
*._aggregation_optimization_settings=0
*._always_anti_join='CHOOSE'
*._always_semi_join='CHOOSE'
*._and_pruning_enabled=TRUE
*._b_tree_bitmap_plans=TRUE
*._bloom_filter_enabled=TRUE
*._bloom_folding_enabled=TRUE
*._bloom_pruning_enabled=TRUE
*._complex_view_merging=TRUE
*._compression_compatibility='11.2.0.0.0'
*._connect_by_use_union_all='TRUE'
*._convert_set_to_join=FALSE
*._cost_equality_semi_join=TRUE
*._cpu_to_io=0
*._dimension_skip_null=TRUE
*._eliminate_common_subexpr=TRUE
*._enable_type_dep_selectivity=TRUE
*._fast_full_scan_enabled=TRUE
*._first_k_rows_dynamic_proration=TRUE
*._gby_hash_aggregation_enabled=TRUE
*._generalized_pruning_enabled=TRUE
*._globalindex_pnum_filter_enabled=TRUE
*._gs_anti_semi_join_allowed=TRUE
*._improved_outerjoin_card=TRUE
*._improved_row_length_enabled=TRUE
*._index_join_enabled=TRUE
*._ksb_restart_policy_times='0','60','120','240'# internal update to set default
*._left_nested_loops_random=TRUE
*._local_communication_costing_enabled=TRUE
*._minimal_stats_aggregation=TRUE
*._mmv_query_rewrite_enabled=TRUE
*._new_initial_join_orders=TRUE
*._new_sort_cost_estimate=TRUE
*._nlj_batching_enabled=1
*._optim_adjust_for_part_skews=TRUE
*._optim_enhance_nnull_detection=TRUE
*._optim_new_default_join_sel=TRUE
*._optim_peek_user_binds=TRUE
*._optimizer_adaptive_cursor_sharing=TRUE
*._optimizer_better_inlist_costing='ALL'
*._optimizer_cbqt_no_size_restriction=TRUE
*._optimizer_coalesce_subqueries=TRUE
*._optimizer_complex_pred_selectivity=TRUE
*._optimizer_compute_index_stats=TRUE
*._optimizer_connect_by_combine_sw=TRUE
*._optimizer_connect_by_cost_based=TRUE
*._optimizer_connect_by_elim_dups=TRUE
*._optimizer_correct_sq_selectivity=TRUE
*._optimizer_cost_based_transformation='LINEAR'
*._optimizer_cost_hjsmj_multimatch=TRUE
*._optimizer_cost_model='CHOOSE'
*._optimizer_dim_subq_join_sel=TRUE
*._optimizer_distinct_agg_transform=TRUE
*._optimizer_distinct_elimination=TRUE
*._optimizer_distinct_placement=TRUE
*._optimizer_eliminate_filtering_join=TRUE
*._optimizer_enable_density_improvements=TRUE
*._optimizer_enable_extended_stats=TRUE
*._optimizer_enhanced_filter_push=TRUE
*._optimizer_extend_jppd_view_types=TRUE
*._optimizer_extended_cursor_sharing='UDO'
*._optimizer_extended_cursor_sharing_rel='SIMPLE'
*._optimizer_extended_stats_usage_control=224
*._optimizer_fast_access_pred_analysis=TRUE
*._optimizer_fast_pred_transitivity=TRUE
*._optimizer_filter_pred_pullup=TRUE
*._optimizer_fkr_index_cost_bias=10
*._optimizer_group_by_placement=TRUE
*._optimizer_improve_selectivity=TRUE
*._optimizer_join_elimination_enabled=TRUE
*._optimizer_join_factorization=TRUE
*._optimizer_join_order_control=3
*._optimizer_join_sel_sanity_check=TRUE
*._optimizer_max_permutations=2000
*._optimizer_mode_force=TRUE
*._optimizer_multi_level_push_pred=TRUE
*._optimizer_native_full_outer_join='FORCE'
*._optimizer_new_join_card_computation=TRUE
*._optimizer_null_aware_antijoin=TRUE
*._optimizer_or_expansion='DEPTH'
*._optimizer_order_by_elimination_enabled=TRUE
*._optimizer_outer_to_anti_enabled=TRUE
*._optimizer_push_down_distinct=0
*._optimizer_push_pred_cost_based=TRUE
*._optimizer_rownum_bind_default=10
*._optimizer_rownum_pred_based_fkr=TRUE
*._optimizer_skip_scan_enabled=TRUE
*._optimizer_sortmerge_join_inequality=TRUE
*._optimizer_squ_bottomup=TRUE
*._optimizer_star_tran_in_with_clause=TRUE
*._optimizer_system_stats_usage=TRUE
*._optimizer_table_expansion=TRUE
*._optimizer_transitivity_retain=TRUE
*._optimizer_try_st_before_jppd=TRUE
*._optimizer_undo_cost_change='11.2.0.1'
*._optimizer_unnest_corr_set_subq=TRUE
*._optimizer_unnest_disjunctive_subq=TRUE
*._optimizer_use_cbqt_star_transformation=TRUE
*._optimizer_use_feedback=TRUE
*._or_expand_nvl_predicate=TRUE
*._ordered_nested_loop=TRUE
*._parallel_broadcast_enabled=TRUE
*._partition_view_enabled=TRUE
*._pivot_implementation_method='CHOOSE'
*._pre_rewrite_push_pred=TRUE
*._pred_move_around=TRUE
*._push_join_predicate=TRUE
*._push_join_union_view=TRUE
*._push_join_union_view2=TRUE
*._px_minus_intersect=TRUE
*._px_pwg_enabled=TRUE
*._px_ual_serial_input=TRUE
*._query_rewrite_setopgrw_enable=TRUE
*._remove_aggr_subquery=TRUE
*._replace_virtual_columns=TRUE
*._right_outer_hash_enable=TRUE
*._selfjoin_mv_duplicates=TRUE
*._sql_model_unfold_forloops='RUN_TIME'
*._subquery_pruning_enabled=TRUE
*._subquery_pruning_mv_enabled=FALSE
*._table_scan_cost_plus_one=TRUE
*._union_rewrite_for_gs='YES_GSET_MVS'
*._unnest_subquery=TRUE
*._use_column_stats_for_function=TRUE
*.audit_file_dest='/u01/app/oracle/admin/dpuli/adump'
*.audit_trail='DB'
*.compatible='11.2.0.0.0'
*.control_files='+DATA/dpuli/controlfile/current.274.800266185','+DATA/dpuli/controlfile/current.273.800266189'#Restore Controlfile
*.core_dump_dest='/u01/app/oracle/diag/rdbms/dpuli/dpuli/cdump'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain='us.oracle.com'
*.db_name='DPULI'#Reset to original value by RMAN
*.db_recovery_file_dest='+FRA'
*.db_recovery_file_dest_size=4062M
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.log_archive_dest_1='location=+FRA/dpuli/Archive'
*.log_archive_format='Log%s_%t_%r.Arc'
*.log_buffer=5783552# log buffer update
*.memory_target=452M
*.open_cursors=300
*.optimizer_dynamic_sampling=2
*.optimizer_mode='ALL_ROWS'
*.plsql_warnings='DISABLE:ALL'# PL/SQL warnings at init.ora
*.processes=150
*.query_rewrite_enabled='TRUE'
*.remote_login_passwordfile='EXCLUSIVE'
*.result_cache_max_size=1184K
*.skip_unusable_indexes=TRUE
*.undo_tablespace='UNDOTBS1'





SQL> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup ;
ORACLE instance started.

Total System Global Area  472887296 bytes
Fixed Size                  1337296 bytes
Variable Size             411043888 bytes
Database Buffers           54525952 bytes
Redo Buffers                5980160 bytes


Database mounted.

create pfile='/tmp/initdupli1.txt' from spfile ;


SQL> archive log list ;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +FRA/dpuli/archive
Oldest online log sequence     1
Next log sequence to archive   1
Current log sequence           1

Oracle DBA

anuj blog Archive