The following errors occurred from 11.2.0.4 standby databases:
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
MOUNTED
SQL> select * from v$rman_backup_job_details;
select * from v$rman_backup_job_details
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 2
ORA-00904: "SYS"."DBMS_RCVMAN"."NUM2DISPLAYSIZE": invalid identifier
CAUSE
The problem is that DBMS_RCVMAN and other packages are not initialized when database in MOUNT mode, only in OPEN mode, hence the error when using SYS.DBMS_RCVMAN
dbms_rcvman package is not loaded in memory until database is open or RMAN client is ran explicitly.
SOLUTION
This error is expected because the standby instances are in MOUNT mode and the DBMS_RCVMAN does not get initialized.
Workaround: just make a call to rman before running the query in the Standby database. This will initialize the DBMS_RCVMAN package.
SQL> select * from v$rman_backup_job_details;
select * from v$rman_backup_job_details
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 2
ORA-00904: "SYS"."DBMS_RCVMAN"."NUM2DISPLAYSIZE": invalid identifier
SQL> exit
$ rman target /
RMAN> exit
$ sqlplus / as sysdba
SQL> select * from v$rman_backup_job_details;
...
..
.
b) Extract the Platform and Language Code, here we are only interested in platform “226P<—>Linux x86-64″withdefault English language:
$ grep -A200 "<select name=plat_lang" /home/testuser/output.tmp |
grep "^<option"|awk -F "[\">]" '{print $2 "<--->" $4}' |
|grep -v "<--->selected"
537P<--->Acme Packet 1100
529P<--->Acme Packet 3820
...
..
.
541P<--->Linux ARM 64-bit
214P<--->Linux Itanium
525P<--->Linux SPARC
46P<--->Linux x86
226P<--->Linux x86-64
912P<--->Microsoft Windows (32-bit)
208P<--->Microsoft Windows Itanium (64-bit)
539P<--->Microsoft Windows Phone
233P<--->Microsoft Windows x64 (64-bit)
...
..
.
117L<--->Traditional Chinese (ZHT)
116L<--->Turkish (TR)
37L<--->UK English (GB)
39L<--->Ukrainian (UK)
43L<--->Vietnamese (VN)
999L<--->Worldwide Spanish (ESW)
4) Get URLs of patch 6880880 for Linux X86-64 platform.
$wget --proxy-user=${PROXYUSER} --proxy-password=${PROXYPASSWD}
--no-check-certificate --load-cookies=$COOK
"https://updates.oracle.com/Orion/SimpleSearch/process_form?search_type
=patch&patch_number=6880880&plat_lang=226P" -O $HOME/output1.tmp -q
$ ls -ltr $HOME/output1.tmp
-rw-r----- 1 tetsuser users 4544310 Feb 26 15:44 /home/testuser/output1.tmp
$ grep "Download/process_form" output1.tmp | sed 's/ //g' | sed "s/.*href=\"//g" | sed "s/\".*//g"
https://updates.oracle.com/Orion/Download/process_form/p6880880_139000_Generic.zip?aru=21939900&file_id=98828928&patch_file=p6880880_139000_Generic.zip&
https://updates.oracle.com/Orion/Download/process_form/p6880880_112000_Linux-x86-64.zip?aru=21895918&file_id=64217272&patch_file=p6880880_112000_Linux-x86-64.zip&
https://updates.oracle.com/Orion/Download/process_form/p6880880_121010_Linux-x86-64.zip?aru=21886824&file_id=65461237&patch_file=p6880880_121010_Linux-x86-64.zip&
https://updates.oracle.com/Orion/Download/process_form/p6880880_122010_Linux-x86-64.zip?aru=21885985&file_id=96948775&patch_file=p6880880_122010_Linux-x86-64.zip&
https://updates.oracle.com/Orion/Download/process_form/p6880880_132000_Generic.zip?aru=17856597&file_id=72275045&patch_file=p6880880_132000_Generic.zip&
https://updates.oracle.com/Orion/Download/process_form/p6880880_111000_Linux-x86-64.zip?aru=19416466&file_id=26541776&patch_file=p6880880_111000_Linux-x86-64.zip&
https://updates.oracle.com/Orion/Download/process_form/p6880880_131000_Generic.zip?aru=16531511&file_id=62900088&patch_file=p6880880_131000_Generic.zip&
https://updates.oracle.com/Orion/Download/process_form/p6880880_101000_Linux-x86-64.zip?aru=13915384&file_id=42098007&patch_file=p6880880_101000_Linux-x86-64.zip&
https://updates.oracle.com/Orion/Download/process_form/p6880880_102000_Linux-x86-64.zip?aru=13116068&file_id=34545782&patch_file=p6880880_102000_Linux-x86-64.zip&
5) Download the patch by using URL from step 4):
curl:
$ curl -b $COOK -c $COOK --insecure --output p6880880_122010_Linux-x86-64.zip
-L "https://updates.oracle.com/Orion/Download/process_form/p6880880_122010_Linux-x86-64.zip?aru=21885985&file_id=96948775&patch_file=p6880880_122010_Linux-x86-64.zip&"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 90.8M 100 90.8M 0 0 5008k 0 0:00:18 0:00:18 --:--:-- 20.7M
$ unzip -t p6880880_122010_Linux-x86-64.zip
Archive: p6880880_122010_Linux-x86-64.zip
testing: OPatch/ OK
testing: OPatch/operr.bat OK
testing: OPatch/opatch_env.sh OK
...
..
.
No errors detected in compressed data of p6880880_122010_Linux-x86-64.zip.