Thinking Out Loud

November 2, 2017

Monitoring Standby – SQLPlus or DGMGRL

Filed under: Dataguard — mdinh @ 3:00 am

Here is an example using dgmgrl


DGMGRL> show database roverdb SendQEntries
PRIMARY_SEND_QUEUE
        STANDBY_NAME       STATUS     RESETLOGS_ID           THREAD              LOG_SEQ       TIME_GENERATED       TIME_COMPLETED    FIRST_CHANGE#     NEXT_CHANGE#       SIZE (KBs) 
           roverstby     ARCHIVED        936921167                1                13019  10/31/2017 10:47:04  10/31/2017 10:48:31     746413367424     746413483999          1819004 
           roverstby     ARCHIVED        936921167                1                13023  10/31/2017 10:51:40  10/31/2017 10:52:19     746413767648     746413883688          1809094 
           roverstby     ARCHIVED        936921167                1                13031  10/31/2017 10:57:02  10/31/2017 10:57:44     746414728981     746414851377          1924909 
           roverstby     ARCHIVED        936921167                1                13032  10/31/2017 10:57:44  10/31/2017 10:58:23     746414851377     746414967877          1815042 
           roverstby     ARCHIVED        936921167                1                13033  10/31/2017 10:58:23  10/31/2017 10:59:02     746414967877     746415089206          1798857 
           roverstby     ARCHIVED        936921167                1                13034  10/31/2017 10:59:02  10/31/2017 10:59:41     746415089206     746415217514          1818919 
                          CURRENT        936921167                1                13036  10/31/2017 11:29:41                          746415239037                               628 
                          CURRENT        936921167                2                12359  10/31/2017 11:29:05                          746415238854                               864 

DGMGRL> show database roverstby RecvQEntries
STANDBY_RECEIVE_QUEUE
              STATUS     RESETLOGS_ID           THREAD              LOG_SEQ       TIME_GENERATED       TIME_COMPLETED    FIRST_CHANGE#     NEXT_CHANGE#       SIZE (KBs) 
         NOT_APPLIED        936921167                1                13020  10/31/2017 10:48:31  10/31/2017 10:48:49     746413483999     746413509640           385949 
         NOT_APPLIED        936921167                1                13021  10/31/2017 10:48:49  10/31/2017 10:50:19     746413509640     746413636246          1885417 
         NOT_APPLIED        936921167                1                13022  10/31/2017 10:50:19  10/31/2017 10:51:40     746413636246     746413767648          1944637 
         NOT_APPLIED        936921167                1                13024  10/31/2017 10:52:19  10/31/2017 10:52:58     746413883688     746413999759          1819116 
         NOT_APPLIED        936921167                1                13025  10/31/2017 10:52:58  10/31/2017 10:53:40     746413999759     746414124264          1868420 
         NOT_APPLIED        936921167                1                13026  10/31/2017 10:53:40  10/31/2017 10:54:22     746414124264     746414244619          1890478 
         NOT_APPLIED        936921167                1                13027  10/31/2017 10:54:22  10/31/2017 10:55:02     746414244619     746414363387          1843514 
         NOT_APPLIED        936921167                1                13028  10/31/2017 10:55:02  10/31/2017 10:55:41     746414363387     746414484244          1818826 
         NOT_APPLIED        936921167                1                13029  10/31/2017 10:55:41  10/31/2017 10:56:20     746414484244     746414605367          1813344 
         NOT_APPLIED        936921167                1                13030  10/31/2017 10:56:20  10/31/2017 10:57:02     746414605367     746414728981          1904385 
         NOT_APPLIED        936921167                1                13035  10/31/2017 10:59:41  10/31/2017 11:29:41     746415217514     746415239037            79395 
   PARTIALLY_APPLIED        936921167                2                12352  10/31/2017 10:40:04  10/31/2017 10:47:07     746413130730     746413371576             1980 
         NOT_APPLIED        936921167                2                12353  10/31/2017 10:47:07  10/31/2017 10:50:22     746413371576     746413640990             1658 
         NOT_APPLIED        936921167                2                12354  10/31/2017 10:50:22  10/31/2017 10:53:01     746413640990     746414010894             1774 
         NOT_APPLIED        936921167                2                12355  10/31/2017 10:53:01  10/31/2017 10:55:04     746414010894     746414371654             1541 
         NOT_APPLIED        936921167                2                12356  10/31/2017 10:55:04  10/31/2017 10:57:04     746414371654     746414736501             1532 
         NOT_APPLIED        936921167                2                12357  10/31/2017 10:57:04  10/31/2017 10:59:04     746414736501     746415097318             1485 
         NOT_APPLIED        936921167                2                12358  10/31/2017 10:59:04  10/31/2017 11:29:05     746415097318     746415238854             6101 
Advertisements

October 28, 2017

Use ORACLE_UNQNAME for DataGuard Environment

Filed under: 11g,Dataguard — mdinh @ 2:25 pm

If you are running only 1 database on the host, then it may not be useful.

However, if you run multiple databases, then it makes it easier to automate provided there are consistencies and/or conventions.

DB configuration

HOST01:(SYS@qa):PHYSICAL STANDBY> show parameter db%name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert                 string
db_name                              string      qa
db_unique_name                       string      qadr

OS configuration

$ env|grep ORACLE
ORACLE_BASE=/u01/app/oracle
ORACLE_SID=qa
ORACLE_UNQNAME=qadr
ORACLE_HOME=/u01/app/oracle/db/11g
$ ps -ef|grep pmon
  oracle  9896050        1   0 16:11:12      -  0:03 asm_pmon_+ASM
  oracle 10354862        1   0 20:06:31      -  0:02 ora_pmon_qa

Check DB status using srvctl

srvctl status database -d $ORACLE_UNQNAME -v
Database qadr is running with online services qarosvc
#!/bin/sh -e
. /opt/oracle/oracle_qa_env
dgmgrl -echo << END
connect /
show configuration
show database ${ORACLE_SID}
show database ${ORACLE_UNQNAME}
exit
END
exit
$ ./d.sh
DGMGRL for IBM/AIX RISC System/6000: Version 11.2.0.4.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect /
Connected.
DGMGRL> show configuration

Configuration - dgqa

  Protection Mode: MaxPerformance
  Databases:
    qa   - Primary database
    qadr - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> show database qa

Database - qa

  Enterprise Manager Name: qa_cluster
  Role:                    PRIMARY
  Intended State:          TRANSPORT-ON
  Instance(s):
    qa_1
    qa_2

Database Status:
SUCCESS

DGMGRL> show database qadr

Database - qadr

  Enterprise Manager Name: qa1
  Role:                    PHYSICAL STANDBY
  Intended State:          APPLY-ON
  Transport Lag:           0 seconds (computed 0 seconds ago)
  Apply Lag:               0 seconds (computed 1 second ago)
  Apply Rate:              937.00 KByte/s
  Real Time Query:         ON
  Instance(s):
    qa

Database Status:
SUCCESS

DGMGRL> exit

crsctl stat res -w “STATE = ONLINE”|egrep “db$|TYPE=ora.database.type”

NAME=ora.qadr.db
TYPE=ora.database.type
NAME=ora.qa2dr.db
TYPE=ora.database.type
NAME=ora.stageqadr.db
TYPE=ora.database.type
NAME=ora.testdr.db
TYPE=ora.database.type

dg_show.sh

#!/bin/sh -e
. /opt/oracle/oracle_qa_env
dgmgrl -echo << END
connect /
show configuration
show database ${ORACLE_SID}
show database ${ORACLE_UNQNAME}
exit
END
. /opt/oracle/oracle_qa2_env
dgmgrl -echo << END
connect /
show configuration
show database ${ORACLE_SID}
show database ${ORACLE_UNQNAME}
exit
END
. /opt/oracle/oracle_stageqa_env
dgmgrl -echo << END
connect /
show configuration
show database ${ORACLE_SID}
show database ${ORACLE_UNQNAME}
exit
END
. /opt/oracle/oracle_test_env
dgmgrl -echo << END
connect /
show configuration
show database ${ORACLE_SID}
show database ${ORACLE_UNQNAME}
exit
END
exit

Improved dg_show.sh using function.

#!/bin/sh -e
check_dg()
{
  dgmgrl -echo << END
  connect /
  show configuration
  show database ${ORACLE_SID}
  show database ${ORACLE_UNQNAME}
  exit
  END
}
. /opt/oracle/oracle_qa_env
check_dg
. /opt/oracle/oracle_qa2_env
check_dg
. /opt/oracle/oracle_stageqa_env
check_dg
. /opt/oracle/oracle_test_env
check_dg
exit

October 27, 2017

KUP-04095: preprocessor command qopiprep.bat

Filed under: 12c — mdinh @ 12:46 pm

WARNING: Please open SR to confirm this is applicable to your environment as there are too many errors which look similar.

Applying Patch 26635880 – Database Proactive Bundle Patch 12.1.0.2.171017

# $GRID_HOME/OPatch/opatchauto apply $PATCHDIR/26635880

Starting database service on home /u01/oracle/db12c
Database service successfully started on home /u01/oracle/db12c

Preparing home /u01/oracle/db12c after database service restarted
No step execution required.........
Prepared home /u01/oracle/db12c successfully after database service restarted

Trying to apply SQL patch on home /u01/oracle/db12c
"/bin/sh -c 'ORACLE_HOME=/u01/oracle/db12c ORACLE_SID=db01
/u01/oracle/db12c/OPatch/datapatch'" command failed with errors. 
Please refer to logs for more details. SQL changes, if any, can be applied by manually retrying the same command.

SQL patch applied successfully on home /u01/oracle/db12c

Verifying patches applied on home /u01/oracle/gi12c
Patch verification completed with warning on home /u01/oracle/gi12c

Verifying patches applied on home /u01/oracle/db12c
Patch verification completed with warning on home /u01/oracle/db12c

OPatchAuto successful.

--------------------------------Summary--------------------------------
Output omitted for brevity.

This is the only results – no other errors.
SQL> select dbms_sqlpatch.verify_queryable_inventory from dual;

VERIFY_QUERYABLE_INVENTORY
--------------------------------------------------------------------------------
ORA-20001: Latest xml inventory is not loaded into table

SQL> select * from OPATCH_XML_INV;

ERROR:
ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-29400: data cartridge error
KUP-04095: preprocessor command /u01/oracle/db12c/QOpatch/qopiprep.bat
encountered error "Argument(s) Error... Cannot use file
"/u01/oracle/db12c/QOpatch/xml_file.xml" to generate XML output.
Specify path/filename and make sure filename doesn't"



no rows selected

SQL> host ls -l /u01/oracle/db12c/QOpatch/*
-rw-r--r--    1 oracle   dba          128227 Oct 24 16:24 /u01/oracle/db12c/QOpatch/qopatch_log.log
-r-xr-xr--    1 oracle   dba            1372 Apr 07 2013  /u01/oracle/db12c/QOpatch/qopiprep.bat
-rw-r--r--    1 oracle   dba            2349 Oct 24 16:24 /u01/oracle/db12c/QOpatch/stout.txt
-rw-r--r--    1 oracle   dba         2066473 Oct 24 16:24 /u01/oracle/db12c/QOpatch/xml_file.xml

SQL>

Oracle support provided solution as shown below:
Patch 20244108: QOPIPREP.BAT MODIFIES XML INVENTORY WHILE READING IT
Last Updated 03-Apr-2015 04:11 (2+ years ago)

What’s really FUBAR – patch is from 2+ years ago, so why wouldn’t it be included in BP?

October 24, 2017

DB 12.2 NF for Goldengate

Filed under: 12.2,GoldenGate — mdinh @ 12:30 pm

Logical Replication

Error Handling Improvements for Oracle GoldenGate Integrated Replicat
Database views can manage and display details about Oracle GoldenGate conflict resolution methods, 
DBA_APPLY_REPERROR_HANDLERS 
DBA_APPLY_HANDLECOLLISIONS
DBA_APPLY_DML_CONF_HANDLERS
DBA_APPLY_DML_CONF_COLUMNS

A new capture parameter, ANNOTATE_DDL_SIZE, 
is available for Oracle GoldenGate integrated capture to specify the size of the buffer that describes the DDL more fully.

October 23, 2017

Finding EM Configuration

Filed under: Cloud Control — mdinh @ 3:45 am

DIRECTORY STRUCTURE AND LOCATIONS OF IMPORTANT TRACE AND LOG FILES OF ENTERPRISE MANAGER CLOUD CONTROL 13C

MW_HOME=/u01/middleware
OMS_HOME=$MW_HOME/13.2.0
EM_INST_HOME=$OMS_HOME/gc_inst

ps -ef|grep agent_inst|tail -2
ps -ef|grep gc_inst|tail -2

OMS_HOME/install/setupinfo.txt
OMS_HOME/install/portlist.ini

 

October 17, 2017

DB Starts with SQLPlus not SRVCTL

Filed under: 11g,oracle — mdinh @ 1:25 am

Reason why DB was able to be started using SQL*Plus and not srvctl because DB was configured incorrectly with srvctl.

$ srvctl start database -d DB01
PRCR-1079 : Failed to start resource ora.db01.db
CRS-5017: The resource action "ora.db01.db start" encountered the following error:
ORA-01078: failure in processing system parameters. 
For details refer to "(:CLSN00107:)" in "/u01/app/oracle/product/11.2.0/grid_2/log/host01/agent/ohasd/oraagent_oracle//oraagent_log".

CRS-2674: Start of 'ora.db01.db' on 'host01' failed

--- Spfile pointing to non-existing pfile.
$ srvctl config database -d DB01
Database unique name: DB01
Database name:
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_2
Oracle user: oracle
Spfile: /oracle/product/11.2.0/dbhome_2/dbs/initDB01.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Database instance: DB01
Disk Groups: DATA,FRA
Services:

SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/db01/spfiledb01.ora

cat: /oracle/product/11.2.0/dbhome_2/dbs/initDB01.ora: No such file or directory

$ srvctl modify database -d DB01 -p +DATA/db01/spfiledb01.ora
$ srvctl config database -d DB01
Database unique name: DB01
Database name:
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_2
Oracle user: oracle
Spfile: +DATA/db01/spfiledb01.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Database instance: DB01
Disk Groups: DATA,FRA
Services:

October 10, 2017

Cloning Goldengate Integrated Capture and DB

Filed under: 12c,GoldenGate — mdinh @ 10:10 pm

Using DBMS_STREAMS_ADM To Cleanup GoldenGate

Let’s say you want to clone DB and Goldengate implementation from PROD to DEV, then you need to drop the capture that was registered with PROD database.

This is what happens when dependencies are introduced / created.

select capture_name from dba_capture;
exec DBMS_CAPTURE_ADM.DROP_CAPTURE ('&capture');

October 9, 2017

No Guarantees with opatch -report or CheckConflict

Filed under: 11g,oracle — mdinh @ 8:13 pm

I have performed the following checks.

# $GRID_HOME/OPatch/opatch auto /media/swrepo/JUL2017PSU/26030799 -report -ocmrf /tmp/ocm.rsp
$ $GRID_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/swrepo/JUL2017PSU/26030799

Actual patching failed.

# $GRID_HOME/OPatch/opatch auto /media/swrepo/JUL2017PSU/26030799 -ocmrf /tmp/ocm.rsp
Executing /u01/app/oracle/product/11.2.0/grid/perl/bin/perl 
/u01/app/oracle/product/11.2.0/grid/OPatch/crs/patch11203.pl 
-patchdir /media/swrepo/JUL2017PSU -patchn 26030799 
-ocmrf /tmp/ocm.rsp -paramfile /u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params

This is the main log file: /u01/app/oracle/product/11.2.0/grid/cfgtoollogs/opatchauto2017-10-09_10-35-34.log

This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/oracle/product/11.2.0/grid/cfgtoollogs/opatchauto2017-10-09_10-35-34.report.log

2017-10-09 10:35:34: Starting Oracle Restart Patch Setup
Using configuration parameter file: /u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params

Stopping RAC /u01/app/oracle/product/11.2.0/dbhome_1 ...
Stopped RAC /u01/app/oracle/product/11.2.0/dbhome_1 successfully

patch /media/swrepo/JUL2017PSU/26030799/25869727  apply successful for home  /u01/app/oracle/product/11.2.0/dbhome_1
patch /media/swrepo/JUL2017PSU/26030799/25920335/custom/server/25920335  apply successful for home  /u01/app/oracle/product/11.2.0/dbhome_1

Stopping CRS...

Stopped CRS successfully

Error : The opatch Applicable check failed.  The patch /media/swrepo/JUL2017PSU/26030799/25920335 is not applicable to /u01/app/oracle/product/11.2.0/grid
Error:Patch Applicable check failed for /u01/app/oracle/product/11.2.0/grid

Starting CRS...

ERROR: Prereq checkApplicable failed. Refer log file for more details.


opatch auto failed.
#

Really useful info – ERROR: Prereq checkApplicable failed. Refer log file for more details.

I digress.

After some digging – search for ZOP-46 from /u01/app/oracle/product/11.2.0/grid/cfgtoollogs/opatch

$ grep -n "ZOP-46" opatch2017-10-09*.log
opatch2017-10-09_10-41-58AM_1.log:13:
[Oct 9, 2017 10:42:00 AM]    ZOP-46: 
The patch(es) are not applicable on the Oracle Home because some patch actions are not applicable. 
All required components, however, are installed.


$ head -25 opatch2017-10-09_10-41-58AM_1.log
[Oct 9, 2017 10:41:59 AM]    PREREQ session

[Oct 9, 2017 10:41:59 AM]    
OPatch invoked as follows: 'prereq CheckApplicable 
-ph /media/swrepo/JUL2017PSU/26030799/25920335 
-oh /u01/app/oracle/product/11.2.0/grid 
-invPtrLoc /u01/app/oracle/product/11.2.0/grid/oraInst.loc '

[Oct 9, 2017 10:41:59 AM]    OUI-67077:
                             Oracle Home       : /u01/app/oracle/product/11.2.0/grid
                             Central Inventory : /u01/app/oracle/oraInventory
                                from           : /u01/app/oracle/product/11.2.0/grid/oraInst.loc
                             OPatch version    : 11.2.0.3.6
                             OUI version       : 11.2.0.4.0
                             OUI location      : /u01/app/oracle/product/11.2.0/grid/oui
                             Log file location : /u01/app/oracle/product/11.2.0/grid/cfgtoollogs/opatch/opatch2017-10-09_10-41-58AM_1.log
[Oct 9, 2017 10:41:59 AM]    Patch history file: /u01/app/oracle/product/11.2.0/grid/cfgtoollogs/opatch/opatch_history.txt
[Oct 9, 2017 10:41:59 AM]    Invoking prereq "checkapplicable"

[Oct 9, 2017 10:42:00 AM]    
ZOP-46: The patch(es) are not applicable on the Oracle Home because some patch actions are not applicable. 
All required components, however, are installed.

[Oct 9, 2017 10:42:00 AM]    Patch 25920335:
                             Copy Action: Source File "/media/swrepo/JUL2017PSU/26030799/25920335/files/bin/appvipcfg.pl" does not exists or is not readable
                             'oracle.crs, 11.2.0.4.0': Cannot copy file from 'appvipcfg.pl' to '/u01/app/oracle/product/11.2.0/grid/bin/appvipcfg.pl'
                             Copy Action: Source File "/media/swrepo/JUL2017PSU/26030799/25920335/files/bin/oclumon.bin" does not exists or is not readable
                             'oracle.crs, 11.2.0.4.0': Cannot copy file from 'oclumon.bin' to '/u01/app/oracle/product/11.2.0/grid/bin/oclumon.bin'
                             Copy Action: Source File "/media/swrepo/JUL2017PSU/26030799/25920335/files/bin/ologgerd" does not exists or is not readable
                             'oracle.crs, 11.2.0.4.0': Cannot copy file from 'ologgerd' to '/u01/app/oracle/product/11.2.0/grid/bin/ologgerd'
                             Copy Action: Source File "/media/swrepo/JUL2017PSU/26030799/25920335/files/bin/osysmond.bin" does not exists or is not readable
                             'oracle.crs, 11.2.0.4.0': Cannot copy file from 'osysmond.bin' to '/u01/app/oracle/product/11.2.0/grid/bin/osysmond.bin'
                             Copy Action: Source File "/media/swrepo/JUL2017PSU/26030799/25920335/files/crs/demo/coldfailover/act_db.pl" does not exists or is not readable
                             'oracle.crs, 11.2.0.4.0': Cannot copy file from 'act_db.pl' to '/u01/app/oracle/product/11.2.0/grid/crs/demo/coldfailover/act_db.pl'
                             Copy Action: Source File "/media/swrepo/JUL2017PSU/26030799/25920335/files/crs/demo/coldfailover/act_listener.pl" does not exists or is not readable
$ ls -l /media/swrepo/JUL2017PSU/26030799/25920335/files/bin/appvipcfg.pl
-rwxr-x--- 1 root root 9051 Jun 27 07:40 /media/swrepo/JUL2017PSU/26030799/25920335/files/bin/appvipcfg.pl

Please don’t ask me why.

Solution.

# cd /media/
# chmod -R 777 swrepo/
# chown -R oracle:dba patches/

opatch report “ERROR: Prereq checkApplicable failed.” when Applying Grid Infrastructure patch (Doc ID 1417268.1)

	A. Expected behaviour if GRID_HOME has not been unlocked
 	B. Bug 13575478
 	C. The patch is stored in a shared NFS location and there is a permission issue accessing the patch
 	D. The patch is not unzipped as grid user, often it is unzipped as root user
 	E. The patch is unzipped inside GRID_HOME

In summary, trust but verify!

Upgrade 12.2 Journey – Fixing MEMORY_TARGET

Filed under: Upgrade 12.2 Journey — mdinh @ 10:08 am

As it turns out, root cause for MEMORY_TARGET is due to configuration.

Setting SQL> alter system set memory_target=0 scope=spfile; was the initial work around, the better solution is to fix root cause.

From alert_+ASM.log

2017-10-09T11:50:19.746027+02:00
WARNING: You are trying to use the MEMORY_TARGET feature. 
This feature requires the /dev/shm file system to be mounted for at least 1073741824 bytes. 
/dev/shm is either not mounted or is mounted with available space less than this size. 
Please fix this so that MEMORY_TARGET can work as expected. 
Current available is 915083264 and used is 0 bytes. 
Ensure that the mount point is /dev/shm for this directory.

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

[oracle@db-asm-1 ~]$ df /dev/shm/
Filesystem     1K-blocks  Used Available Use% Mounted on
tmpfs             893636     0    893636   0% /dev/shm
[oracle@db-asm-1 ~]$

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

[oracle@db-asm-1 dinh]$ sqlplus / as sysasm

SQL*Plus: Release 12.2.0.1.0 Production on Mon Oct 9 11:48:44 2017

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show parameter target

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
memory_max_target                    big integer 0
memory_target                        big integer 0
pga_aggregate_target                 big integer 10M
sga_target                           big integer 0
SQL> show parameter size

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_cache_size                        big integer 24M
large_pool_size                      big integer 12M
max_dump_file_size                   string      unlimited
parallel_execution_message_size      integer     16384
sga_max_size                         big integer 216M
shared_pool_reserved_size            big integer 8808038
shared_pool_size                     big integer 168M
sort_area_size                       integer     65536
unified_audit_sga_queue_size         integer     1048576
workarea_size_policy                 string      AUTO

SQL> alter system set memory_max_target=1G scope=spfile;

System altered.

SQL> shu immediate;
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup;
ORA-00845: MEMORY_TARGET not supported on this system
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@db-asm-1 dinh]$

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

[root@db-asm-1 ~]# df -h /dev/shm/
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           873M     0  873M   0% /dev/shm
[root@db-asm-1 ~]# mount -o remount,size=2G /dev/shm
[root@db-asm-1 ~]# df -h /dev/shm/
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           2.0G     0  2.0G   0% /dev/shm
[root@db-asm-1 ~]# vi /etc/fstab
[root@db-asm-1 ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Mon Apr 24 10:50:55 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=b33f8d74-4869-460a-9835-abcbf5e7fc19 /                       ext4    defaults        1 1
UUID=f6263370-a504-46e9-bb85-26e2400eafae swap                    swap    defaults        0 0
/root/swapfile                            swap                    swap    defaults        0 0
tmpfs                   /dev/shm          tmpfs defaults,size=2G        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/vgora/lvora /u01 ext4 defaults 1 2
[root@db-asm-1 ~]# mount -a
[root@db-asm-1 ~]#

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

[oracle@db-asm-1 dinh]$ sqlplus / as sysasm

SQL*Plus: Release 12.2.0.1.0 Production on Mon Oct 9 11:54:43 2017

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

Connected to an idle instance.

SQL> startup;
ASM instance started

Total System Global Area 1073741824 bytes
Fixed Size                  8628936 bytes
Variable Size            1039947064 bytes
ASM Cache                  25165824 bytes
ASM diskgroups mounted
SQL> show parameter target

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
memory_max_target                    big integer 1G
memory_target                        big integer 0
pga_aggregate_target                 big integer 10M
sga_target                           big integer 0
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@db-asm-1 dinh]$

Upgrade 12.2 Journey – Troubleshooting FAILED GRID Upgrade from 11.2.0.4 to 12.2.0.1

Filed under: Upgrade 12.2 Journey — mdinh @ 1:41 am

First, I am very thankful to all the bloggers out there.
It would have been nearly impossible to find resolution on one’s own.

ASM not starting with ORA-00845 – how to fix ASM parameter file

One issue after GI upgrade

Solution


[oracle@db-asm-1 ~]$ . oraenv <<< +ASM 
ORACLE_SID = [+ASM] ? The Oracle base remains unchanged with value /u01/app/oracle 

[oracle@db-asm-1 ~]$ sqlplus / as sysasm 
SQL*Plus: Release 12.2.0.1.0 Production on Mon Oct 9 01:47:54 2017 
Copyright (c) 1982, 2016, Oracle. All rights reserved. 
Connected to an idle instance. 

SQL> startup;
ORA-00845: MEMORY_TARGET not supported on this system
SQL> exit
Disconnected
[oracle@db-asm-1 ~]$

--- Find spfile.
[oracle@db-asm-1 ~]$ crsctl stat res ora.asm -p | egrep "ASM_DISKSTRING|SPFILE"
ASM_DISKSTRING=/dev/oracle/*
SPFILE=+CRS/asm/asmparameterfile/registry.253.956854045

--- Create pfile to start +ASM with MEMORY_TARGET=0.
[oracle@db-asm-1 ~]$ cat /tmp/initASM.ora
SPFILE=+CRS/asm/asmparameterfile/registry.253.956854045
MEMORY_TARGET=0
_asm_compatibility='11.2.0.4.0'

--- Mount CRS DG in restricted mode to modify 'compatible.asm'='11.2.0.4.0'.
[oracle@db-asm-1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 12.2.0.1.0 Production on Mon Oct 9 02:47:09 2017

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

Connected to an idle instance.

SQL> startup pfile=/tmp/initASM.ora
ASM instance started

Total System Global Area  226492416 bytes
Fixed Size                  8619064 bytes
Variable Size             192707528 bytes
ASM Cache                  25165824 bytes
ORA-15032: not all alterations performed
ORA-59303: The attribute compatible.asm (11.2.0.0.0) of the diskgroup being
mounted should be 11.2.0.2.0 or higher.

SQL> alter diskgroup CRS mount restricted;

Diskgroup altered.

SQL> alter diskgroup CRS set attribute 'compatible.asm'='11.2.0.4.0';

Diskgroup altered.

SQL> alter diskgroup CRS dismount;
alter diskgroup CRS dismount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15027: active use of diskgroup "CRS" precludes its dismount

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

[oracle@db-asm-1 ~]$ asmcmd lsdg
State       Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
RESTRICTED  EXTERN  N         512             512   4096  4194304     10236    10148                0           10148              0             N  CRS/
MOUNTED     EXTERN  N         512             512   4096  4194304     20472    18612                0           18612              0             N  DATA/
MOUNTED     EXTERN  N         512             512   4096  4194304     30708    30264                0           30264              0             N  FRA/

--- Restart +ASM since DG was not able to dismount.
[oracle@db-asm-1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 12.2.0.1.0 Production on Mon Oct 9 02:43:59 2017

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +CRS/asm/asmparameterfile/regi
                                                 stry.253.956854045
SQL> shut abort;
ASM instance shutdown

SQL> startup pfile=/tmp/initASM.ora
ASM instance started

Total System Global Area  226492416 bytes
Fixed Size                  8619064 bytes
Variable Size             192707528 bytes
ASM Cache                  25165824 bytes
ASM diskgroups mounted
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

[oracle@db-asm-1 ~]$ asmcmd lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304     10236    10148                0           10148              0             N  CRS/
MOUNTED  EXTERN  N         512             512   4096  4194304     20472    18612                0           18612              0             N  DATA/
MOUNTED  EXTERN  N         512             512   4096  4194304     30708    30264                0           30264              0             N  FRA/

--- Set memory_target=0 for spfile and restart ASM.
[oracle@db-asm-1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 12.2.0.1.0 Production on Mon Oct 9 02:47:09 2017

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> alter system set memory_target=0 scope=spfile;

System altered.

SQL> shu abort;
ASM instance shutdown
SQL> startup;
ASM instance started

Total System Global Area  226492416 bytes
Fixed Size                  8619064 bytes
Variable Size             192707528 bytes
ASM Cache                  25165824 bytes
ASM diskgroups mounted
SQL> show parameter target

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
memory_max_target                    big integer 0
memory_target                        big integer 0
pga_aggregate_target                 big integer 10M
sga_target                           big integer 0
SQL> show parameter disk

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups                       string      DATA, FRA, CRS
asm_diskstring                       string      /dev/oracle/*
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

[oracle@db-asm-1 ~]$ asmcmd lsattr -G CRS -l
Name                     Value
access_control.enabled   FALSE
access_control.umask     066
au_size                  4194304
cell.smart_scan_capable  FALSE
compatible.asm           11.2.0.4.0
compatible.rdbms         10.1.0.0.0
content.type             data
disk_repair_time         3.6h
idp.boundary             auto
idp.type                 dynamic
sector_size              512
[oracle@db-asm-1 ~]$

[oracle@db-asm-1 ~]$ . oraenv <<< orclcdb
ORACLE_SID = [+ASM] ?
The Oracle base remains unchanged with value /u01/app/oracle

[oracle@db-asm-1 ~]$ srvctl status database -d orclcdb
Database is running.
[oracle@db-asm-1 ~]$

[oracle@db-asm-1 ~]$ . oraenv <<< +ASM
ORACLE_SID = [+ASM] ? The Oracle base remains unchanged with value /u01/app/oracle
[oracle@db-asm-1 ~]$ echo $ORACLE_HOME
/u01/app/12.2.0.1/grid
[oracle@db-asm-1 ~]$ export GRID_HOME=$ORACLE_HOME
[oracle@db-asm-1 ~]$ $GRID_HOME/OPatch/opatch lspatches
There are no Interim patches installed in this Oracle Home "/u01/app/12.2.0.1/grid".

OPatch succeeded.

[oracle@db-asm-1 ~]$ $GRID_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.6
Copyright (c) 2017, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/12.2.0.1/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/12.2.0.1/grid/oraInst.loc
OPatch version    : 12.2.0.1.6
OUI version       : 12.2.0.1.4
Log file location : /u01/app/12.2.0.1/grid/cfgtoollogs/opatch/opatch2017-10-09_03-36-17AM_1.log

Lsinventory Output file location : /u01/app/12.2.0.1/grid/cfgtoollogs/opatch/lsinv/lsinventory2017-10-09_03-36-17AM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: db-asm-1.internal.lab
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Grid Infrastructure 12c                                       12.2.0.1.0
There are 1 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.


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

OPatch succeeded.
[oracle@db-asm-1 ~]$

[oracle@db-asm-1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS.dg
               ONLINE  ONLINE       db-asm-1                 STABLE
ora.DATA.dg
               ONLINE  ONLINE       db-asm-1                 STABLE
ora.FRA.dg
               ONLINE  ONLINE       db-asm-1                 STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       db-asm-1                 STABLE
ora.asm
               ONLINE  ONLINE       db-asm-1                 STABLE
ora.ons
               OFFLINE OFFLINE      db-asm-1                 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       db-asm-1                 STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       db-asm-1                 STABLE
ora.orclcdb.db
      1        ONLINE  ONLINE       db-asm-1                 Open,HOME=/u01/app/o
                                                             racle/11.2.0.4/db1,S
                                                             TABLE
--------------------------------------------------------------------------------
[oracle@db-asm-1 ~]$

Q.E.D.

« Previous PageNext Page »

Create a free website or blog at WordPress.com.