Sunday, August 7, 2022

How to recover standby database from a missing archive log gap

 02-08-2022

#how to recover standby database from a missing archive log gap


#Hossam Note

#if there is a Gap on DG there is 2 scenarios

#1- missing archivelogs on standby but it exist on prod this can be fixed by using rsync and catalog start with 

#2-missing archivelogs on standby but its NOT exist on prod this can be fixed by below 



https://techgoeasy.com/recovering-standby-database-fro/


#On the standby database check the current SCN

SQL>  col current_SCN for 99999999999999999999;

SQL> select current_scn from v$database;


          CURRENT_SCN

---------------------

      111050674405375



#On the primary database create the needed incremental backup from the above SCN

rman target /

RMAN> 

{

allocate channel c1 type disk;

BACKUP INCREMENTAL FROM SCN 111050674405375 DATABASE FORMAT '/tmp/inc_standby_%U';

}



#Cancel managed recovery at the standby database


SQL> alter database recover managed standby database cancel;


Database altered


#scp the backup files to standby server to /tmp folder.


scp -rp oraprod@


#Apply the Incremental Backup to the Standby Database


rman target /

RMAN>RECOVER DATABASE NOREDO;


#Put the standby database back to managed recovery mode.


qlplus "/ as sysdba"

SQL>recover managed standby database disconnect;

Media recovery complete.


#On the primary create new standby controlfile


alter database create standby controlfile as '/tmp/standby01.ctl';


#Copy the standby control file to the standby site. Shutdown the standby database and replace the standby control files and restart the standby database in the managed recovery mode using the below command


RMAN> SHUTDOWN IMMEDIATE ;

RMAN> STARTUP NOMOUNT;

RMAN> RESTORE STANDBY CONTROLFILE FROM '/tmp/standby01.ctl';



#Mount the standby


RMAN> ALTER DATABASE MOUNT;


#On STANDBY database, clear all standby redo log groups:




select GROUP# from v$logfile where TYPE='STANDBY' group by GROUP#;

    GROUP#

----------

        10

        11

        12

        13

ALTER DATABASE CLEAR LOGFILE GROUP 10;

ALTER DATABASE CLEAR LOGFILE GROUP 11;

ALTER DATABASE CLEAR LOGFILE GROUP 12;

ALTER DATABASE CLEAR LOGFILE GROUP 13;


#if dont clear restart standby db


#Now you can start the MRP


SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;


#if needed 

cd /oradata/proddata19/LOCALERP/archive/ 

rsync -avzhe ssh --progress oraprod@10.143.250.164:/oradata/proddata19/LOCALERP/archive/ .


rman> catalog start with '/oradata/proddata19/LOCALERP/archive';

Sunday, January 20, 2019

install react native problem using npm


install React Native 



fist install Node.js

https://nodejs.org/en/download/



2- install react native using npm

https://facebook.github.io/react-native/docs/getting-started



 problem :

H:\>npm install -g expo-cli
npm ERR! code SELF_SIGNED_CERT_IN_CHAIN
npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN
npm ERR! request to https://registry.npmjs.org/expo-cli failed, reason: self signed certificate in certificate chain

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\username\AppData\Roaming\npm-cache\_logs\2019-01-20T11_00_33_490Z-debug.log



fix :


H:\>npm config set prefix "D:\Program Files\nodejs\cash\AppData\Local\npm"

H:\>npm config set cache "D:\Program Files\nodejs\cash\AppData\Local\npm"

H:\>npm config set strict-ssl false

H:\>npm install -g expo-cli




Saturday, November 10, 2018

linux ubuntu slow internet fix

sudo nano /etc/gai.conf

#unhach this line

precedence ::ffff:0:0/96  100

                                                                                                                                                              

Wednesday, October 17, 2018

Oracle® Fusion Middleware System Requirements and Specifications Red Hat Linux 7




#Oracle® Fusion Middleware  System Requirements and Specifications

https://docs.oracle.com/en/middleware/lifecycle/12.2.1.3/sysrs/unix-operating-system-requirements.html#GUID-880D655D-F9FB-439B-8001-10AA78D0FC57

#1- Viewing the Number of Currently Open Files
/usr/sbin/lsof | wc -l

#2- Setting the Operating System Open File and Processes Limit

vi /etc/security/limits.conf

Add the following lines to the limits.conf file.
* soft  nofile  4096
* hard  nofile  65536
* soft  nproc   2047
* hard  nproc   16384


Reboot the host computer.

# 3- Minimum Requirements for the Linux Operating System

# Oracle Linux 7 (UL0+) and Red Hat Linux 7 (UL0+)

Oracle Linux 7 (UL0+) and Red Hat Linux 7 (UL0+)

binutils-2.23.52.0.1
compat-libcap1-1.10
compat-libstdc++-33-3.2.3.x86_64
compat-libstdc++-33-3.2.3.i686
gcc-4.8.2
gcc-c++-4.8.2
glibc-2.17.x86_64
glibc-2.17.i686
glibc-devel-2.17.x86_64
libaio-0.3.109.x86_64
libaio-devel-0.3.109.x86_64
libgcc-4.8.2.x86_64
libgcc-4.8.2.i686
libstdc++-4.8.2.x86_64
libstdc++-4.8.2.i686
libstdc++-devel-4.8.2.x86_64
ksh
make-3.82
sysstat-10.1.5
numactl-2.0.9 for x86_641
numactl-devel-2.0.9 for x86_642
motif-2.3.4-7 for x86_643
motif-devel-2.3.4-7 for x86_644
redhat-lsb-4.1-27.0.1.el7 for x86_64
redhat-lsb-core-4.1-27.0.1.el7 for x86_64

-- you cand add yum install ocfs2-tools -y   fot another oracle document


Installing Oracle 11g on RHEL 7



#Quick Installation Guide DB 11g Release 2 (11.2) for Linux x86-64 Red Hat Enterprise Linux 7

https://docs.oracle.com/cd/E11882_01/install.112/e24326/toc.htm#CIHFICFD



# following or later version of packages for Oracle Linux 7, and Red Hat Enterprise Linux 7 must be installed:

binutils-2.23.52.0.1-12.el7.x86_64
compat-libcap1-1.10-3.el7.x86_64
compat-libstdc++-33-3.2.3-71.el7.i686
compat-libstdc++-33-3.2.3-71.el7.x86_64
gcc-4.8.2-3.el7.x86_64
gcc-c++-4.8.2-3.el7.x86_64
glibc-2.17-36.el7.i686
glibc-2.17-36.el7.x86_64
glibc-devel-2.17-36.el7.i686
glibc-devel-2.17-36.el7.x86_64
ksh
libaio-0.3.109-9.el7.i686
libaio-0.3.109-9.el7.x86_64
libaio-devel-0.3.109-9.el7.i686
libaio-devel-0.3.109-9.el7.x86_64
libgcc-4.8.2-3.el7.i686
libgcc-4.8.2-3.el7.x86_64
libstdc++-4.8.2-3.el7.i686
libstdc++-4.8.2-3.el7.x86_64
libstdc++-devel-4.8.2-3.el7.i686
libstdc++-devel-4.8.2-3.el7.x86_64
libXi-1.7.2-1.el7.i686
libXi-1.7.2-1.el7.x86_64
libXtst-1.2.2-1.el7.i686
libXtst-1.2.2-1.el7.x86_64
make-3.82-19.el7.x86_64
sysstat-10.1.5-1.el7.x86_64

#Oracle ODBC Drivers

download from http://www.unixodbc.org

unixODBC-2.3.1-6.el7.x86_64 or later

unixODBC-2.3.1-6.el7.i686 or later

unixODBC-devel-2.3.1-6.el7.x86_64 or later

unixODBC-devel-2.3.1-6.el7.i686 or later

#create the oinstall and dba group

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba

#If the oracle user does not exist

/usr/sbin/useradd -g oinstall -G dba oracle

#Configuring Kernel Parameters and Resource Limits

 /etc/sysctl.conf
 /sbin/sysctl -p
 Enter the command /sbin/sysctl -a to confirm that the values are set correctly.

 #Check Resource Limits for the Oracle Software Installation Users

 limits.conf

mkdir -p /u01/app/
chown -R oracle:oinstall /u01/app/
chmod -R 775 /u01/app/

#Enterprise Manager
http://host.domain:1158/em/

Tuesday, July 31, 2018

List of Running Requests

List of Running Requests



set lines 130
set pages 200
col os form A7 head AppProc
col spid form a6 head SPID
col program form A50 trunc
set pages 38
col time form 99999.99 head Elapsed
col "Req Id" form 99999999
col "Parent" form a8
col "Prg Id" form 9999999
col serial# form 999999 head Serial#
col qname head "Manager" format a10 trunc
col sid format 9999 head SID
col user_name form A12 head User trunc
set recsep off




select
       q.concurrent_queue_name qname
      ,f.user_name
      ,a.request_id "Req Id"
      ,decode(a.parent_request_id,-1,NULL,a.parent_request_id) "Parent"
      ,a.concurrent_program_id "Prg Id"
      ,a.phase_code,a.status_code
--      ,b.os_process_id "OS"
--      ,vs.sid
--      ,vs.serial# "Serial#"
--      ,vp.spid
      ,a.oracle_process_id "spid"
      ,(nvl(a.actual_completion_date,sysdate)-a.actual_start_date)*1440 "Time"
      ,c.concurrent_program_name||' - '||
       c2.user_concurrent_program_name||' '||a.description "Program"
from APPLSYS.fnd_Concurrent_requests a
    ,APPLSYS.fnd_concurrent_processes b
    ,applsys.fnd_concurrent_queues q
    ,APPLSYS.fnd_concurrent_programs_tl c2
    ,APPLSYS.fnd_concurrent_programs c
    ,APPLSYS.fnd_user f
--    ,v$session vs
--    ,v$process vp
where
      a.controlling_manager = b.concurrent_process_id
  and a.concurrent_program_id = c.concurrent_program_id
  and a.program_application_id = c.application_id
  and c2.concurrent_program_id = c.concurrent_program_id
  and c2.application_id = c.application_id
  and a.phase_code in ('I','P','R','T')
  and a.requested_by = f.user_id
  and b.queue_application_id = q.application_id
  and b.concurrent_queue_id = q.concurrent_queue_id
  and c2.language = 'US'
--  and vs.process (+) = b.os_process_id
--  and vs.paddr = vp.addr (+)
order by 9 desc;

List of pending Jobs waiting for managers



List of pending Jobs waiting for managers


set lines 130
col USER_CONCURRENT_QUEUE_NAME format a39
SELECT b.USER_CONCURRENT_QUEUE_NAME , count(*)
FROM apps.FND_CONCURRENT_WORKER_REQUESTS a,apps.FND_CONCURRENT_QUEUES_VL b
WHERE (Phase_Code = 'P' ) and a.hold_flag != 'Y'
and a.Requested_Start_Date <= SYSDATE
AND ('' IS NULL OR ('' = 'B' AND PHASE_CODE = 'R' AND
STATUS_CODE IN ('I'))) and a.CONCURRENT_QUEUE_ID!=1003
and a.CONCURRENT_QUEUE_ID=b.CONCURRENT_QUEUE_ID 
group by b.USER_CONCURRENT_QUEUE_NAME ,status_code;

col program_description format a60
col user_concurrent_queue_name format a40