Friday, December 6, 2019

ORA-17630: Mismatch in the remote file protocol version client 1 server 3



I was trying to setup an Oracle Data Guard environment (physical standby) from an Oracle database running version 11.2.0.4 to target oracle db version is 12.2.0.1 using rman duplicate .

Source db : 11.2.0.4
Target db : 12.2.0.1


RMAN> run {
 allocate channel pri1 type disk;
 allocate channel pri2 type disk;
 allocate channel prmy4 type disk;
 allocate auxiliary channel stby type disk;
 duplicate target database for standby from active database
  spfile
  parameter_value_convert 'paras','vipul'
    set db_unique_name='vipul'
    set control_files='/u01/app/oracle/oradata/vipul/control01.ctl'
    set fal_client='vipul'
    set fal_server='paras'
 set log_archive_max_processes='5'
2> 3> 4> 5> 6>     set standby_file_management='AUTO'
    set log_archive_config='dg_config=(paras,vipul)'
 set db_file_name_convert='/u01/app/oracle/oradata/paras/','/u01/app/oracle/oradata/vipul/'
    set log_file_name_convert='/u01/app/oracle/oradata/paras/','/u01/app/oracle/oradata/vipul/'
    set log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=vipul'
    set log_archive_dest_2='service=paras ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=paras';
  }
  7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20>
using target database control file instead of recovery catalog
allocated channel: pri1
channel pri1: SID=35 device type=DISK

allocated channel: pri2
channel pri2: SID=40 device type=DISK

allocated channel: prmy4
channel prmy4: SID=32 device type=DISK

allocated channel: stby
channel stby: SID=35 device type=DISK

Starting Duplicate Db at 03-DEC-19

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwparas' auxiliary format
 '/u01/app/oracle/product/12.2.0/db/dbs/orapwvipul'   targetfile
 '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileparas.ora' auxiliary format
 '/u01/app/oracle/product/12.2.0/db/dbs/spfilevipul.ora'   ;
   sql clone "alter system set spfile= ''/u01/app/oracle/product/12.2.0/db/dbs/spfilevipul.ora''";
}
executing Memory Script

Starting backup at 03-DEC-19
RMAN-03009: failure of backup command on pri1 channel at 12/03/2019 10:23:15
ORA-17629: Cannot connect to the remote database server
ORA-17630: Mismatch in the remote file protocol version client 1 server 3
continuing other job steps, job failed will not be re-run
released channel: pri1
released channel: pri2
released channel: prmy4
released channel: stby
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/03/2019 10:23:15
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on pri2 channel at 12/03/2019 10:23:15
ORA-17629: Cannot connect to the remote database server
ORA-17630: Mismatch in the remote file protocol version client 1 server 3

RMAN>

RMAN>



Solutions :
===============

We need to apply below patch on source 11.2.0.4 db 

p29913194_112040_Linux-x86-64 - Required patch
p18633374_11204190716_Linux-x86-64  - Main patch
p6880880_112000_Linux-x86-64  - required version of opatch 


After apply patch 18633374 to the ORACLE_HOME that was running the SOURCE database, able to proceed with building out the standby successfully using RMAN DUPLICATE with ACTIVE DATABASE


but we need to sysnc then upgrade db on target for open, i will share steps to upgarde in next post .


Always read README before apply any patch . 




Monday, December 2, 2019

Oracle Tablespace Utilization Script


Tablespace Utilization Script for Tablespace Space Used % more than 85 %
==========================================================================

Check the tablespace Utilization.
=========================================

set pages 500 lines 250
col tablespace_name format a30
col TABLESPACE_NAME heading "Tablespace|Name"
col Allocated_size heading "Allocated|Size(GB)" form 99999999.99
col Current_size heading "Current|Size(GB)" form 99999999.99
col Used_size heading "Used|Size(GB)" form 99999999.99
col Available_size heading "Available|Size(GB)" form 99999999.99
col Pct_used heading "%Used (vs)|(Allocated)" form 99999999.99

select a.tablespace_name
        ,a.alloc_size/1024/1024/1024 Allocated_size
        ,a.cur_size/1024/1024/1024 Current_Size
        ,(u.used+a.file_count*65536)/1024/1024/1024 Used_size
        ,(a.alloc_size-(u.used+a.file_count*65536))/1024/1024/1024 Available_size
        ,((u.used+a.file_count*65536)*100)/a.alloc_size Pct_used
from     dba_tablespaces t
        ,(select t1.tablespace_name
        ,nvl(sum(s.bytes),0) used
        from  dba_segments s
        ,dba_tablespaces t1
         where t1.tablespace_name=s.tablespace_name(+)
         group by t1.tablespace_name) u
        ,(select d.tablespace_name
        ,sum(greatest(d.bytes,nvl(d.maxbytes,0))) alloc_size
        ,sum(d.bytes) cur_size
        ,count(*) file_count
        from dba_data_files d
        group by d.tablespace_name) a
where t.tablespace_name=u.tablespace_name
and ((u.used+a.file_count*65536)*100)/a.alloc_size>85
and t.tablespace_name=a.tablespace_name
order by t.tablespace_name;


Check the details of the datafiles for a particular TableSpace 
=====================================================================


set pages 500 lines 250
col tablespace_name for a30
col CREATION_TIME for a15
col file_name for a70
select dd.tablespace_name TABLESPACE_NAME,dd.file_name,dd.bytes/1024/1024 Size_MB,dd.autoextensible,dd.maxbytes/1024/1024 MAXSIZE_MB,df.CREATION_TIME
from dba_data_files dd, v$datafile df where df.name=dd.file_name and tablespace_name=UPPER('&TABLESPACENAME') order by 1,2,6;



Get DDL for tablespace 
==============================

set pagesize 0
SET LONG 9999999
select dbms_metadata.get_ddl('TABLESPACE',upper('&TABLESPACE_NAME')) FROM DUAL;