Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all 1640 articles
Browse latest View live

ADADMIN With Error "PLS-00201: identifier 'AD_JAR.GET_JRIPASSWORDS' must be declared"

$
0
0
While running ADOP / ADPATCH the below error occurs:

The ORACLE username specified below for Application Object Library
uniquely identifies your existing product group: APPLSYS

Enter the ORACLE password of Application Object Library [APPS] : *****

AutoPatch is verifying your username/password.
Connecting to APPS......Connected successfully.

Error: Unable to execute statement <
Begin
ad_jar.get_jripasswords(:l_storepass, :l_keypass);
End;
> len = 63

AutoPatch error:
ORA-06550: line 3, column 1:
PLS-00201: identifier 'AD_JAR.GET_JRIPASSWORDS' must be declared
ORA-06550: line 3, column 1:
PL/SQL: Statement ignored


AutoPatch error:

Unable to get passwords from Vault

Possible Reasons:

The AD_JAR object not available in apps schema.
 
SQL> desc AD_JAR
ERROR:
ORA-04043: object AD_JAR does not exist

Solution:

1. Please login as applmgr (Unix user that own application binaries )

2. Source the application environment file . (APPS.env)

3. cd $AD_TOP/patch/115/sql/

4. Login to database as apps database user and run below 2 SQL's

@ADJRIS.pls
@ADJRIB.pls

5. Run the below SQL to see whether objects are valid

select owner,object_type,status from dba_objects where object_name='AD_JAR';

6. If AD_JAR is available under apps schema re-run the failed patch





User "oracle" unable to start or stop listeners in RAC

$
0
0

Getting the error while try to stop the listener.
oracle$ srvctl stop listener
PRCR-1065 : Failed to stop resource ora.LISTENER.lsnr
CRS-0245:  User doesn't have enough privilege to perform the operation
CRS-0245:  User doesn't have enough privilege to perform the operation
PRCR-1065 : Failed to stop resource ora.LISTENER_IB.lsnr
CRS-0245:  User doesn't have enough privilege to perform the operation
CRS-0245:  User doesn't have enough privilege to perform the operation

Solution:

Before:

# crsctl status resource ora.LISTENER.lsnr -p | grep ACL=
ACL=owner:root:rwx,pgrp:root:r-x,other::r--

# crsctl status resource ora.LISTENER_IB.lsnr -p | grep ACL=
ACL=owner:root:rwx,pgrp:root:r-x,other::r--


"Fix":

# crsctl setperm resource ora.LISTENER.lsnr -o oracle
# crsctl setperm resource ora.LISTENER.lsnr -g oinstall
# crsctl setperm resource ora.LISTENER_IB.lsnr -g oinstall
# crsctl setperm resource ora.LISTENER_IB.lsnr -o oracle


After:

# crsctl status resource ora.LISTENER.lsnr -p | grep ACL=
ACL=owner:oracle:rwx,pgrp:oinstall:r-x,other::r--

# crsctl status resource ora.LISTENER_IB.lsnr -p | grep ACL=
ACL=owner:oracle:rwx,pgrp:oinstall:r-x,other::r--

Start the listener now,

oracle$ srvctl start listener
oracle$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): etc9cn02,etc9cn01
Listener LISTENER_IB is enabled
Listener LISTENER_IB is running on node(s): etc9cn02,etc9cn01

oracle$ srvctl stop listener

oracle$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is not running
Listener LISTENER_IB is enabled
Listener LISTENER_IB is not running

oracle$ srvctl start listener

Getting “Xlib: PuTTY X11 proxy: wrong authentication protocol attempted”? I have the answer :)

$
0
0
When you run into the error “Xlib: PuTTY X11 proxy: wrong authentication protocol attempted”.  What to do?

ssh oracle@localhost
sample $ echo $DISPLAY
localhost:10.0
sample$ su - oracle
sample's Password:
oracle $ xterm
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted

xterm Xt error: Can't open display: localhost:10.0

Action Plan:

You need to temporarily transfer the authorization to the other account. First, get the key from your account:

sample $ xauth list
aspc2o1/unix:10 MIT-MAGIC-COOKIE-1 bc334c66cfec3c5c3d5b0efc4ee9d3ad

Next, sudo/su to the other account and add the authorization key.

sample $ su - oracle
oracle $ xauth add aspc2o1/unix:10 MIT-MAGIC-COOKIE-1 bc334c66cfec3c5c3d5b0efc4ee9d3ad

Next, sudo/su to the other account and add the authorization key.


oracle $ xterm

12.2 Install Fails With 'Fatal Error: TXK Install Service' And 'oracle.apps.fnd.txk.config.ProcessStateException: OUI process failed : Exit=254 See log for details'

$
0
0
Installing 12.2 fails on:


-------------details ------------<timestamp>.log -------------------
Executing command: /apps/source/startCD/Disk1/rapidwiz/jre/Linux_x64/1.6.0//bin/java/bin/java -cp /oracle/ZCLONE/db/tech_st/11.2.0.3/dbhome_1/temp/ZCLONE_biapps/DBInstallHome/fnd/../j11067593_fnd.zip:/oracle/ZCLONE/db/tech_st/11.2.0.3/dbhome_1/temp/ZCLONE_biapps/DBInstallHome/fnd/java/3rdparty/stdalone/xmlparserv2.zip -Doracle.apps.fnd.txk.env_home=/oracle/ZCLONE/db/tech_st/11.2.0.3/dbhome_1/temp/ZCLONE_biapps/ -Doracle.apps.fnd.txk.runtime.config=/oracle/ZCLONE/db/tech_st/11.2.0.3/dbhome_1/temp/ZCLONE_biapps/xmldocs/instDB.xml oracle.apps.fnd.txk.config.InstallService

Fatal Error: TXK Install Service

oracle.apps.fnd.txk.config.ProcessStateException: OUI process failed : Exit=254 See log for details. CMD= /apps/source/TechInstallMedia/database/database/runInstaller -waitForCompletion -ignoreSysPrereqs -force -silent -responseFile /oracle/ZCLONE/db/tech_st/11.2.0.3/dbhome_1/temp/ZCLONE_biapps/cfgHome/response/DB_HOME/txkDB11gR2_11203.rsp

  at oracle.apps.fnd.txk.config.OUIPatchActionNode.processState(OUIPatchActionNode.java:160)

  at oracle.apps.fnd.txk.config.PatchActionNode.processState(PatchActionNode.java:187)

  at oracle.apps.fnd.txk.config.PatchNode.processState(PatchNode.java:338)

  at oracle.apps.fnd.txk.config.PatchesNode.processState(PatchesNode.java:79)

  at oracle.apps.fnd.txk.config.InstallNode.processState(InstallNode.java:68)

  at oracle.apps.fnd.txk.config.TXKTopology.traverse(TXKTopology.java:594)

  at oracle.apps.fnd.txk.config.InstallService.doInvoke(InstallService.java:224)

  at oracle.apps.fnd.txk.config.InstallService.invoke(InstallService.java:237)

  at oracle.apps.fnd.txk.config.InstallService.main(InstallService.java:291)



Cannot install Oracle Database Home

  RW-50010: Error: - script has returned an error: 1
RW-50004: Error code received when running external process. Check log file for details.
Running Database Install Driver for ZCLONE instance

Possible Reasons:

There was still some files or inventory references left from a previous installation causing this install to fail.
 
This is confirmed in uploaded log filet   RDBMS $ORACLE_HOME/temp/$CONTEXT_NAME/logs/oracle.apps.fnd.txk.install0.log  which contains the errors: 

  CAUSE: The chosen installation conflicted with software already installed in the given Oracle home.
  ACTION: Install into a different Oracle home.

Solution:

The errors within the file txk.install0.log indicate that a previous install has not been completely removed before the new installation was started.

Ensure any previous install is completely deleted including any specific inventory references.
 


12.2 E-Business Suite Rapidwiz Install on Exadata Fails With Error 'Libmawt.so: LibXi.so.6: Cannot Open Shared Object File: No Such File Or Directory' and 'Could not find the main class: oracle.apps.ad.rapidwiz.RIWizard'

$
0
0
E-Business Suite 12.2.5 Applications DBA, Issues with the Function of AD Utilities

When attempting to run rapidwiz on an Exadata database machine to install Oracle E-Business Suite 12.2, the following error occurs:

ERROR


[oracle@<hostname.com> ] $ Exception in thread "main" java.lang.UnsatisfiedLinkError: software/startCD/Disk1/rapidwiz/jre/x64/1.6.0/lib/i386/libmawt.so: libXi.so.6: cannot open shared object file: No such file or directory
  at java.lang.ClassLoader$NativeLibrary.load(Native Method)
  at java.lang.ClassLoader.loadLibrary0(Unknown Source)
  at java.lang.ClassLoader.loadLibrary(Unknown Source)
  at java.lang.Runtime.load0(Unknown Source)
  at java.lang.System.load(Unknown Source)
  at java.lang.ClassLoader$NativeLibrary.load(Native Method)
  at java.lang.ClassLoader.loadLibrary0(Unknown Source)
  at java.lang.ClassLoader.loadLibrary(Unknown Source)
  at java.lang.Runtime.loadLibrary0(Unknown Source)
  at java.lang.System.loadLibrary(Unknown Source)
  at sun.security.action.LoadLibraryAction.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
  at sun.awt.DebugHelper.(Unknown Source)
  at java.awt.Component.(Unknown Source)
Could not find the main class: oracle.apps.ad.rapidwiz.RIWizard. Program will exit.

Possible Reasons:

Rapidwiz is expecting a 32-bit version of the JDK, and the error occurs because the only version available is 64-bit.

The issue is discussed in the following unpublished defect:

Bug 24386615 - STARTCD SHOULD BE UPDATED TO USE 64 BIT VERSION OF THE JDK/JRE .

Solution:


Copy a 64 bit version of the JDK from any 12c Oracle Home.

To resolve the issue test the following steps in a development instance and then migrate accordingly:

1. Backup the existing JDK located in startCD/Disk1/rapidwiz/jre/Linux_x64/

2. Copy a 64 bit version of the JDK to a zip file from any 12c Oracle Database or Grid Home located in $ORACLE_HOME/ via the following command:
   $ zip -ryT 1.6.0.zip jdk

3. Move the zip file 1.6.0.zip (via scp or other) into startCD/Disk1/rapidwiz/jre/Linux_x64

4. Unzip file 1.6.0.zip in directory startCD/Disk1/rapidwiz/jre/Linux_x64

5. Retest Rapidwiz and confirm the error is resolved.


Oracleasm Configure gets Error - Unable To Load Module Oracleasm

$
0
0
 Unable to load oracleasm kernel module:
/etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM Library Driver
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface [oracle]:
Default group to own the driver interface [dba]:
Start Oracle ASM library driver on boot (y/n) [y]:
Fix permissions of Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: [ OK ]
Loading module "oracleasm": Unable to load module "oracleasm"
[FAILED]


Possible Reason:

The oracleasm kernel module version does not exactly match the kernel version
For example:
kernel driver module (from rpm -qa command): oracleasm-2.6.18-8.0.0.4.1.el5-2.0.4-1.el5
kernel version (from uname -r): 2.6.18-8.el5 #1 SMP

Solution:

To implement the solution, please execute the following steps:
For "Unbreakable Linux Network" customers using the "compatible" (with RHEL) kernel: obtain the appropriate driver with command:


up2date -i oracleasm-`uname -r`

ORA-39125: Worker unexpected fatal error in KUPW$WORKER.GET_TABLE_DATA_OBJECTS while calling DBMS_METADATA.FETCH_XML_CLOB []

$
0
0
While taking EXPDP backup of the schema of 10.2.0.4.0 database got the following error

ORA-39125: Worker unexpected fatal error in KUPW$WORKER.GET_TABLE_DATA_OBJECTS while calling DBMS_METADATA.FETCH_XML_CLOB []

[oracle@mums00100252 install]$ expdp TFWUSR1/TFWQAOS01PWD1 schemas=TFWUSR1 directory=DATAPUMP_DIR dumpfile=TFWUSR1.dmp logfile=TFWUSR1.log
Export: Release 10.2.0.4.0 - 64bit Production on Wednesday, 11 July, 2012 16:05:42 Copyright (c) 2003, 2007, Oracle.  All rights reserved.
Connected to: Oracle Database 10g Release 10.2.0.4.0 - 64bit Production
Starting TFWUSR1.SYS_EXPORT_SCHEMA_01:  TFWUSR1/******** schemas=TFWUSR1 directory=DATAPUMP_DIR dumpfile=TFWUSR1.dmp logfile=TFWUSR1.log
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
ORA-39125: Worker unexpected fatal error in KUPW$WORKER.GET_TABLE_DATA_OBJECTS while calling DBMS_METADATA.FETCH_XML_CLOB []
ORA-31642: the following SQL statement fails:
BEGIN DMSYS.DBMS_DM_MODEL_EXP.SCHEMA_CALLOUT(:1,0,1,'10.02.00.04.00'); END;
ORA-06512: at SYS.DBMS_SYS_ERROR, line 86
ORA-06512: at SYS.DBMS_METADATA, line 907
ORA-04063: package body DMSYS.DBMS_DM_IMP_INTERNAL has errors
ORA-06508: PL/SQL: could not find program unit being called: DMSYS.DBMS_DM_IMP_INTERNAL
ORA-06512: at SYS.DBMS_SYS_ERROR, line 95
ORA-06512: at SYS.KUPW$WORKER, line 6307
----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
0x740c0e80     15032  package body SYS.KUPW$WORKER
0x740c0e80      6372  package body SYS.KUPW$WORKER
0x740c0e80      9206  package body SYS.KUPW$WORKER
0x740c0e80      1936  package body SYS.KUPW$WORKER
0x740c0e80      6944  package body SYS.KUPW$WORKER
0x740c0e80      1314  package body SYS.KUPW$WORKER
0x742ab940         2  anonymous block


Job TFWUSR1.SYS_EXPORT_SCHEMA_01 stopped due to fatal error at 16:05:49


When I checked the status of components , I found the Oracle packages & Types found invalid,

17:59:47 SYS@TFWQAOS1 > col COMP_NAME format a40
17:59:53 SYS@TFWQAOS1 > col STATUS format a7
17:59:53 SYS@TFWQAOS1 > col COMP_ID format a8
17:59:53 SYS@TFWQAOS1 > col VERSION format a10
17:59:53 SYS@TFWQAOS1 > 
17:59:54 SYS@TFWQAOS1 > SELECT COMP_ID, COMP_NAME, VERSION, STATUS FROM DBA_REGISTRY;

COMP_ID  COMP_NAME                                VERSION    STATUS             
-------- ---------------------------------------- ---------- -------            
ODM      Oracle Data Mining                       10.2.0.4.0 VALID              
SDO      Spatial                                  10.2.0.4.0 VALID              
ORDIM    Oracle interMedia                        10.2.0.4.0 VALID              
AMD      OLAP Catalog                             10.2.0.4.0 INVALID            
EM       Oracle Enterprise Manager                10.2.0.4.0 VALID              
XDB      Oracle XML Database                      10.2.0.4.0 VALID              
CONTEXT  Oracle Text                              10.2.0.4.0 VALID              
EXF      Oracle Expression Filter                 10.2.0.4.0 INVALID            
RUL      Oracle Rules Manager                     10.2.0.4.0 INVALID            
OWM      Oracle Workspace Manager                 10.2.0.4.3 VALID              
CATALOG  Oracle Database Catalog Views            10.2.0.4.0 VALID              

COMP_ID  COMP_NAME                                VERSION    STATUS             
-------- ---------------------------------------- ---------- -------            
CATPROC  Oracle Database Packages and Types       10.2.0.4.0 INVALID            
JAVAVM   JServer JAVA Virtual Machine             10.2.0.4.0 VALID              
XML      Oracle XDK                               10.2.0.4.0 VALID              
CATJAVA  Oracle Database Java Packages            10.2.0.4.0 VALID              
APS      OLAP Analytic Workspace                  10.2.0.4.0 INVALID            
XOQ      Oracle OLAP API                          10.2.0.4.0 INVALID            

17 rows selected.



This was due to some issues at the time of upgradation from 10.2.0.1.0 to 10.2.0.4.0
This error mainly due to EXFSYS schema is not installed properly.
Problem Resolved after installing EXFSYS schema.
Follow the steps mentioned below to install EXFSYS schema,
 Solution:
Installing the EXFSYS schema: 
1. Login as SYSDBA 
2. @?/rdbms/admin/catexf.sql 

Apache server not started on the Ebs server

$
0
0
Permission denied error While starting the Apache server,

Cause:

cd $ORA_CONFIG_HOME/10.1.3/Apache/Apache/bin/

ls -rlta *apachect*

Solution:

Grant the access

chown root .apachectl

chmod 6750 .apachectl

Unable To Login After Clone

$
0
0
After performing a clone you attempt to login to Oracle Applications on the target instance. The following error is given:


"You have encountered an unexpected error. Please contact the System Administrator for assistance."

After setting profile option "FND: Diagnostics" to enabled one receives a hyperlink in the error message that provides a link to a more detailed error stack as follows:

Error:

oracle.apps.fnd.framework.OAException: Application: FND, Message Name: FND_GENERIC_MESSAGE. Tokens: MESSAGE =
oracle.apps.fnd.cache.CacheException;
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1969)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
at _oa__html._OA._jspService(_OA.java:88)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
at oracle.jsp.JspServlet.service(JspServlet.java:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
at _oa__html._OA._jspService(_OA.java:98)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
at oracle.jsp.JspServlet.internalService(JspServlet.java:18

Solution:


To implement the solution, please execute the following steps:

Run Concurrent manager job "Synchronize Workflow Local Tables" as sysadmin.

As one may be unable to login to applications to run the program, one may also try this approach to run the request manually


If one is NOT running the Oracle Applications Table Space Model run:

sql>

begin apps.wf_local_synch.BULKSYNCHRONIZATION(P_ORIG_SYSTEM=>'ALL',
P_PARALLEL_PROCESSES=>2,
P_LOGGING=>'LOGGING', P_RAISEERRORS=>TRUE,
P_TEMPTABLESPACE=>'APPLSYSX');
END;
/

If on IS running Oracle Applications Table Space Model run

sql>
begin apps.wf_local_synch.BULKSYNCHRONIZATION(P_ORIG_SYSTEM=>'ALL',
P_PARALLEL_PROCESSES=>2,
P_LOGGING=>'LOGGING', P_RAISEERRORS
P_LOGGING=>'LOGGING', P_RAISEERRORS=>TRUE,
P_TEMPTABLESPACE=>'APPS_TS_TX_DATA');
END;
 /



Kill the User session who get "Already Signed on" on Mwa server

$
0
0


Error:

User could not able to login in the mwa server and they are getting already signed error.

Reason:

The session is active in the MWA server.

Solution:

Kill the session using telnet prompt,

If our telnet port is "10200" then you need to login with "10201" then type the below command as follows,

SYSADMIN,Wms12345,_,KILL WMS

SYSADMIN --> Username,

Wms12345 ---> Password

WMS --> Username that need to kill





R12: Executing A Report Fails With REP-0004: Warning: Unable to open user preference file.

$
0
0
On an E-Business Suite Release 12.1.2 - when attempting to execute a Report the following error occurs:

REP-0004: Warning: Unable to open user preference file.

Reason:

In Release 11i the Environment Setting ORACLE_LOCALPREFERENCE has been used to store this setting in the ad80ux.env file, which has been sourced for the execution of an Concurrent Program.

In Release 12 you can find the Setting in the Contextfile, but is has been removed to be used in the Environment file.

Published Bug 11063588 - ORACLE_LOCALPREFERENCE REMOVED IN R12 has been created for this issue and a fix has been created but no Patch has been released yet.

SOLUTION

To implement the solution please execute the following steps:

Workaround :

1 - Backup file $AD_TOP/admin/template/iAS_1012_env.tmp

mv $AD_TOP/admin/template/iAS_1012_env.tmp $AD_TOP/admin/template/iAS_1012_env.tmp.org

2 - Edit  file $AD_TOP/admin/template/iAS_1012_env.tmp and add the following:

...
ORACLE_LOCALPREFERENCE=$ORACLE_HOME/tools/admin
export ORACLE_LOCALPREFERENCE
...

3 - Execute autoconfig

4 - Start the services and execute the failed Concurrent Request again and verify that the Workaround worked.

ORA-4031 in 10gR2, Excess "KGH: NO ACCESS" Memory Allocation

$
0
0
After several hours of database operation, ORA-4031 errors are reported.

An examination of the ORA-4031 trace file will show the Memory Allocation called "KGH: NO ACCESS" is consuming large amount of memory. For example the following shows over 500Mbytes  for this allocation.

 Allocation Name             Size  
_________________________   __________
"free memory            "  163766600
...
"KGH: NO ACCESS         "  560713888

Note that it is normal to periodically see "KGH: NO ACCESS" allocations up to about 64M.
This is memory that is in transition between SGA components when automatic memory management is resizing SGA components.  However, it is not normal to see persistent high allocations or a steady build up of this allocation type over time. The exception is when the database needs to make large changes i.e. when changing memory after a heavy load, or starting up using sub-optimal SGA settings, such as when an SPFILE is not being used.

The following query confirms that Memory Allocation "KGH: NO ACCESS" is large:

select * from v$sgastat where pool = 'shared pool' and (name in ('free memory', 'sql area', 'library cache', 'miscellaneous', 'row cache', 'KGH: NO ACCESS') );

The following query shows many GROW and SHRINK operations for "DEFAULT buffer cache" and "shared pool":

ALTER SESSION SET nls_date_format = 'DD/MM/YYYY HH:MI:SS';
SET PAGESIZE 900
SET LINESIZE 255
COL COMPONENT FORMAT A25
COL INITIAL_SIZE FORMAT A10
COL FINAL_SIZE FORMAT A10
SPOOL ASMM_RESIZE.TXT
select START_TIME, component, oper_type, oper_mode, initial_size/1024/1024 "INITIAL", FINAL_SIZE/1024/1024 "FINAL", END_TIME
from v$sga_resize_ops
where component in ('DEFAULT buffer cache', 'shared pool') and status = 'COMPLETE'
order by start_time, component;
SPOOL END


Cause:

Too frequent resizes of Shared Pool and Buffer Cache, leading to excess "KGH: NO ACCESS" memory allocation, that consumes SGA memory.

Several bugs have been logged for this problem, for different versions within 10gR2;
  • Fixed 10.2.0.2
    Unpublished Bug 4507532: SGA_TARGET DOESN'T WORK AS EXPECTED
    Bug 5045507 ASMM - FREQUENT RESIZING OF SHARED POOL & BUFFER CACHE
  • Fixed 10.2.0.4
    Unpublished Bug 6528336: APPSST 10G GSI: LARGE NUMBER OF SESSIONS WAITING ON CURSOR: PIN S WAIT ON X
  • Fixed 10.2.0.5
    Unpublished Bug 7189722: APPSST GSI 10G: VERY FREQUENT GROW/SHRINK SGA RESIZE OPERATION HAPPENING
If you are seeing this in version: 11.1.0.6 to 11.2.0.1, please see note:
Note 1127833.1 ORA-04031 in 11g & 11gR2, Excess "KGH: NO ACCESS" Memory Allocation




Solution 1: 

Disable ASMM and revert to setting the SGA Manually

Determine reasonable values for SGA Parameters DB_CACHE_SIZE, SHARED_POOL_SIZE, LARGE_POOL_SIZE, JAVA_POOL_SIZE and STREAMS_POOL_SIZE (as apprioriate).
For further assistance, please review MOS note:
Note 1008866.6 How to determine SGA Size (7.x, 8.0.x, 8i, 9i, 10g)

Disable ASMM:


SQL> alter system set SGA_TARGET=0 scope=spfile;
  
Set the SGA pool sizes manually, using the values you determined from Step 1 (above):

For example:

SQL> alter system set SHARED_POOL_SIZE=1G scope=spfile.
  
NOTE: Not all the parameters may need to be set, and will default to 0.

Shutdown and startup the database, so that ASMM is turned off, and the new manual SGA settings take affect.

APP-FND-01388: Cannot read value for profile option FND_MGR_STRTUP_THRES_TIME in routine &ROUTINE.

$
0
0
Issue: 

APP-FND-01388: Cannot read value for profile option FND_MGR_STRTUP_THRES_TIME in routine &ROUTINE.
Routine FDPCRQ encountered an ORACLE error. ORA-04031: unable to
allocate 32 bytes of shared memory ("shared pool".
Review your error messages for the cause of the error. (=<POINTER>)

Solution:

If the database parameter named _memory_broker_stat_interval has not been explicitely set to a value of 999 as per solution #3 of note 'Common Cause for ORA-4031 in 10gR2, Excess "KGH: NO ACCESS" Memory Allocation [Video]' (Doc ID 801787.1) then I would start with solution #3to see if that change alone is enough to avoid further ORA-04031 errors (especially if the failed allocation requests are for 32 bytes).

ALTER SYSTEM SET "_memory_broker_stat_interval"=999 SCOPE=SPFILE;


Then the instance would need to be restarted for the change to take effect.

FDUUID failed due to ORA-08004: sequence FND_CONCURRENT_PROCESSES_S.NEXTVAL exceeds MAXVALUE and cannot be instantiated. TheCall to establish_icm failed The Internal Concurrent Manager has encountered an error.

$
0
0
All the xml reports are getting errored out with the following error:


ORA-08004: sequence FND_CONCURRENT_PROCESSES_S.NEXTVAL exceeds MAXVALUE and cannot be instantiated.

TheCall to establish_icm failed

The Internal Concurrent Manager has encountered an error.


Cause:

SQL> select FND_CONCURRENT_PROCESSES_S.nextval from dual;
select FND_CONCURRENT_PROCESSES_S.nextval from dual
*
ERROR at line 1:
ORA-08004: sequence FND_CONCURRENT_PROCESSES_S.NEXTVAL exceeds MAXVALUE and
cannot be instantiated

The FND_CONCURRENT_PROCESSES_S Max value is reached. we need to increase this value

SQL> select * from dba_sequences
where sequence_name = ‘FND_CONCURRENT_PROCESSES_S’ 2 ;

SEQUENCE_OWNER SEQUENCE_NAME MIN_VALUE MAX_VALUE INCREMENT_BY C O CACHE_SIZE LAST_NUMBER
—————————— —————————— ———- ———- ———— – – ———- ———–
APPLSYS FND_CONCURRENT_PROCESSES_S 1 9999999 67778 N N 1000 10048596

Solution:

Increase max value;(shoud be greater Than previoue Max value)

SQL> ALTER SEQUENCE APPLSYS.FND_CONCURRENT_PROCESSES_S MAXVALUE 99999999;

Sequence altered.

Query to terminate the Bulk concurrent request in oracle apps

$
0
0
Query:

update fnd_concurrent_requests set status_code='X', phase_code='C' where concurrent_program_id='51385'
and phase_code='P' and status_code='Q'

Concurrent program ID --> This has to change the based the concurrent program 

RMAN RESTORE MONITORING SCRIPT

$
0
0




TTITLE LEFT '% Completed. Aggregate is the overall progress:'
SET LINE 132
SELECT opname, round(sofar/totalwork*100) "% Complete"
  FROM gv$session_longops
 WHERE opname LIKE 'RMAN%'
   AND totalwork != 0
   AND sofar <> totalwork
 ORDER BY 1;

TTITLE LEFT 'Channels waiting:'
COL client_info FORMAT A15 TRUNC
COL event FORMAT A20 TRUNC
COL state FORMAT A7
COL wait FORMAT 999.90 HEAD "Min waiting"
SELECT s.sid, p.spid, s.client_info, status, event, state, seconds_in_wait/60 wait
  FROM gv$process p, gv$session s
 WHERE p.addr = s.paddr
   AND client_info LIKE 'rman%';

TTITLE LEFT 'Files currently being written to:'
COL filename FORMAT a50
SELECT filename, bytes, io_count
  FROM v$backup_async_io
 WHERE status='IN PROGRESS'
/

TTITLE OFF
SET HEAD OFF
SELECT 'Throughput: '||
       ROUND(SUM(v.value/1024/1024),1) || ' Meg so far @ ' ||
       ROUND(SUM(v.value     /1024/1024)/NVL((SELECT MIN(elapsed_seconds)
            FROM v$session_longops
            WHERE opname          LIKE 'RMAN: aggregate input'
              AND sofar           != TOTALWORK
              AND elapsed_seconds IS NOT NULL
       ),SUM(v.value     /1024/1024)),2) || ' Meg/sec'
 FROM gv$sesstat v, v$statname n, gv$session s
WHERE v.statistic# = n.statistic#
  AND n.name       = 'physical write total bytes'
  AND v.sid        = s.sid
  AND v.inst_id    = s.inst_id
  AND s.program LIKE 'rman@%'
GROUP BY n.name
/
SET HEAD ON

CREATE A NEW USER WITH PRIVILAGES LIKE SAME DATABASE USERS

$
0
0


set pages 0 feed off veri off lines 500

accept oldname prompt "Enter user to model new user to: "
accept newname prompt "Enter new user name: "
-- accept psw     prompt "Enter new user's password: "

-- Create user...
select 'create user &&newname identified by values '''||password||''''||
-- select 'create user &&newname identified by &psw'||
       ' default tablespace '||default_tablespace||
       ' temporary tablespace '||temporary_tablespace||' profile '||
       profile||';'
from   sys.dba_users
where  username = upper('&&oldname');

-- Grant Roles...
select 'grant '||granted_role||' to &&newname'||
       decode(ADMIN_OPTION, 'YES', ' WITH ADMIN OPTION')||';'
from   sys.dba_role_privs
where  grantee = upper('&&oldname'); 

-- Grant System Privs...
select 'grant '||privilege||' to &&newname'||
       decode(ADMIN_OPTION, 'YES', ' WITH ADMIN OPTION')||';'
from   sys.dba_sys_privs
where  grantee = upper('&&oldname'); 

-- Grant Table Privs...
select 'grant '||privilege||' on '||owner||'.'||table_name||' to &&newname;'
from   sys.dba_tab_privs
where  grantee = upper('&&oldname'); 

-- Grant Column Privs...
select 'grant '||privilege||' on '||owner||'.'||table_name||
       '('||column_name||') to &&newname;'
from   sys.dba_col_privs
where  grantee = upper('&&oldname'); 

-- Tablespace Quotas...
select 'alter user '||username||' quota '||
       decode(max_bytes, -1, 'UNLIMITED', max_bytes)||
       ' on '||tablespace_name||';'
from   sys.dba_ts_quotas
where  username = upper('&&oldname');

-- Set Default Role...
set serveroutput on
declare
  defroles varchar2(4000);
begin
  for c1 in (select * from sys.dba_role_privs
              where grantee = upper('&&oldname')
                and default_role = 'YES'
  ) loop
      if length(defroles) > 0 then
         defroles := defroles||','||c1.granted_role;
      else
         defroles := defroles||c1.granted_role;
      end if;
  end loop;
  dbms_output.put_line('alter user &&newname default role '||defroles||';');
end;
/

LOOKUP DATABASE DETAILS FOR PID

$
0
0
rem -----------------------------------------------------------------------
rem Filename:   unixusr.sql
rem Purpose:    Lookup database details for a given Unix process id
rem Date:       06-Oct-1998
rem Author:     Frank Naude, Oracle FAQ
rem -----------------------------------------------------------------------

set serveroutput on size 50000
set echo off feed off veri off
accept 1 prompt 'Enter Unix process id: '

DECLARE
  v_sid number;
  s sys.v_$session%ROWTYPE;
  p sys.v_$process%ROWTYPE;
BEGIN
  begin
    select sid into v_sid
    from   sys.v_$process p, sys.v_$session s
    where  p.addr     = s.paddr
      and  (p.spid    = &&1
       or   s.process = '&&1');
  exception
    when no_data_found then
      dbms_output.put_line('Unable to find process id &&1!!!');
      return;
    when others then
      dbms_output.put_line(sqlerrm);
      return;
  end;

  select * into s from sys.v_$session where sid  = v_sid;
  select * into p from sys.v_$process where addr = s.paddr;

  dbms_output.put_line('=====================================================================');
  dbms_output.put_line('SID/Serial  : '|| s.sid||','||s.serial#);
  dbms_output.put_line('Foreground  : '|| 'PID: '||s.process||' - '||s.program);
  dbms_output.put_line('Shadow      : '|| 'PID: '||p.spid||' - '||p.program);
  dbms_output.put_line('Terminal    : '|| s.terminal || '/ ' || p.terminal);
  dbms_output.put_line('OS User     : '|| s.osuser||' on '||s.machine);
  dbms_output.put_line('Ora User    : '|| s.username);
  dbms_output.put_line('Status Flags: '|| s.status||''||s.server||''||s.type);
  dbms_output.put_line('Tran Active : '|| nvl(s.taddr, 'NONE'));
  dbms_output.put_line('Login Time  : '|| to_char(s.logon_time, 'Dy HH24:MI:SS'));
  dbms_output.put_line('Last Call   : '|| to_char(sysdate-(s.last_call_et/60/60/24), 'Dy HH24:MI:SS') || ' - ' || to_char(s.last_call_et/60, '990.0') || ' min');
  dbms_output.put_line('Lock/ Latch : '|| nvl(s.lockwait, 'NONE')||'/ '||nvl(p.latchwait, 'NONE'));
  dbms_output.put_line('Latch Spin  : '|| nvl(p.latchspin, 'NONE'));

  dbms_output.put_line('Current SQL statement:');
  for c1 in ( select * from sys.v_$sqltext
              where HASH_VALUE = s.sql_hash_value order by piece) loop
    dbms_output.put_line(chr(9)||c1.sql_text);
  end loop;

  dbms_output.put_line('Previous SQL statement:');
  for c1 in ( select * from sys.v_$sqltext
              where HASH_VALUE = s.prev_hash_value order by piece) loop
    dbms_output.put_line(chr(9)||c1.sql_text);
  end loop;

  dbms_output.put_line('Session Waits:');
  for c1 in ( select * from sys.v_$session_wait where sid = s.sid) loop
    dbms_output.put_line(chr(9)||c1.state||': '||c1.event);
  end loop;

--  dbms_output.put_line('Connect Info:');
--  for c1 in ( select * from sys.v_$session_connect_info where sid = s.sid) loop
--    dbms_output.put_line(chr(9)||': '||c1.network_service_banner);
--  end loop;

  dbms_output.put_line('Locks:');
  for c1 in ( select /*+ ordered */
          decode(l.type,
          -- Long locks
                      'TM', 'DML/DATA ENQ',   'TX', 'TRANSAC ENQ',
                      'UL', 'PLS USR LOCK',
          -- Short locks
                      'BL', 'BUF HASH TBL',  'CF', 'CONTROL FILE',
                      'CI', 'CROSS INST F',  'DF', 'DATA FILE   ',
                      'CU', 'CURSOR BIND ',
                      'DL', 'DIRECT LOAD ',  'DM', 'MOUNT/STRTUP',
                      'DR', 'RECO LOCK   ',  'DX', 'DISTRIB TRAN',
                      'FS', 'FILE SET    ',  'IN', 'INSTANCE NUM',
                      'FI', 'SGA OPN FILE',
                      'IR', 'INSTCE RECVR',  'IS', 'GET STATE   ',
                      'IV', 'LIBCACHE INV',  'KK', 'LOG SW KICK ',
                      'LS', 'LOG SWITCH  ',
                      'MM', 'MOUNT DEF   ',  'MR', 'MEDIA RECVRY',
                      'PF', 'PWFILE ENQ  ',  'PR', 'PROCESS STRT',
                      'RT', 'REDO THREAD ',  'SC', 'SCN ENQ     ',
                      'RW', 'ROW WAIT    ',
                      'SM', 'SMON LOCK   ',  'SN', 'SEQNO INSTCE',
                      'SQ', 'SEQNO ENQ   ',  'ST', 'SPACE TRANSC',
                      'SV', 'SEQNO VALUE ',  'TA', 'GENERIC ENQ ',
                      'TD', 'DLL ENQ     ',  'TE', 'EXTEND SEG  ',
                      'TS', 'TEMP SEGMENT',  'TT', 'TEMP TABLE  ',
                      'UN', 'USER NAME   ',  'WL', 'WRITE REDO  ',
                      'TYPE='||l.type) type,
       decode(l.lmode, 0, 'NONE', 1, 'NULL', 2, 'RS', 3, 'RX',
                       4, 'S',    5, 'RSX',  6, 'X',
                       to_char(l.lmode) ) lmode,
       decode(l.request, 0, 'NONE', 1, 'NULL', 2, 'RS', 3, 'RX',
                         4, 'S', 5, 'RSX', 6, 'X',
                         to_char(l.request) ) lrequest,
       decode(l.type, 'MR', o.name,
                      'TD', o.name,
                      'TM', o.name,
                      'RW', 'FILE#='||substr(l.id1,1,3)||
                            ' BLOCK#='||substr(l.id1,4,5)||' ROW='||l.id2,
                      'TX', 'RS+SLOT#'||l.id1||' WRP#'||l.id2,
                      'WL', 'REDO LOG FILE#='||l.id1,
                      'RT', 'THREAD='||l.id1,
                      'TS', decode(l.id2, 0, 'ENQUEUE', 'NEW BLOCK ALLOCATION'),
                      'ID1='||l.id1||' ID2='||l.id2) objname
       from  sys.v_$lock l, sys.obj$ o
       where sid   = s.sid
         and l.id1 = o.obj#(+) ) loop
    dbms_output.put_line(chr(9)||c1.type||' H: '||c1.lmode||' R: '||c1.lrequest||' - '||c1.objname);
  end loop;


  dbms_output.put_line('=====================================================================');

END;
/


DBUPGDIAG script to check integrity of database before 11g upgrade

$
0
0



col TODAY NEW_VALUE _DATE
col VERSION NEW_VALUE _VERSION
set termout off
select to_char(SYSDATE,’fmMonth DD, YYYY’) TODAY from DUAL;
select version from v$instance;
set termout on
set echo off
set feedback off
set head off
set verify off
Prompt
PROMPT Enter location for Spooled output:
Prompt
DEFINE log_path = &1
column timecol new_value timestamp
column spool_extension new_value suffix
SELECT to_char(sysdate,’dd-Mon-yyyy_hhmi’) timecol,’.log’ spool_extension FROM
sys.dual;
column output new_value dbname
SELECT value || ‘_’ output FROM v$parameter WHERE name = ‘db_name’;
spool &log_path/db_upg_diag_&&dbname&&timestamp&&suffix
set linesize 150
set pages 100
set trim on
set trims on
col Compatible for a35
col comp_id for a12
col comp_name for a40
col org_version for a11
col prv_version for a11
col owner for a12
col object_name for a40
col object_type for a40
col Wordsize for a25
col Metadata for a8
col ‘Initial DB Creation Info’ for a35
col ‘Total Invalid JAVA objects’ for a45
col ‘Role’ for a30
col ‘User Existence’ for a27
col “JAVAVM TESTING” for a15
Prompt
Prompt
set feedback off head off
select LPAD(‘*** Start of LogFile ***’,50) from dual;
select LPAD(‘Oracle Database Upgrade Diagnostic Utility’,44)||
LPAD(TO_CHAR(SYSDATE, ‘MM-DD-YYYY HH24:MI:SS’),26) from dual;
Prompt
Prompt ===============
Prompt Database Uptime
Prompt ===============
SELECT to_char(startup_time, ‘HH24:MI DD-MON-YY’) “Startup Time”
FROM v$instance;
Prompt
Prompt =================
Prompt Database Wordsize
Prompt =================
SELECT distinct(‘This is a ‘ || (length(addr)*4) || ‘-bit database’) “WordSize”
FROM v$process;
Prompt
Prompt ================
Prompt Software Verison
Prompt ================
SELECT * FROM v$version;
Prompt
Prompt =============
Prompt Compatibility
Prompt =============
SELECT ‘Compatibility is set as ‘||value Compatible
FROM v$parameter WHERE name =’compatible’;
Prompt
Prompt ================
Prompt Component Status
Prompt ================
Prompt
SET SERVEROUTPUT ON;
DECLARE
ORG_VERSION varchar2(12);
PRV_VERSION varchar2(12);
P_VERSION VARCHAR2(10);
BEGIN
SELECT version INTO p_version
FROM registry$ WHERE cid=’CATPROC’ ;
IF SUBSTR(p_version,1,5) = ‘9.2.0’ THEN
DBMS_OUTPUT.PUT_LINE(RPAD(‘Comp ID’, 8) ||RPAD(‘Component’,35)||
RPAD(‘Status’,10) ||RPAD(‘Version’, 15));
DBMS_OUTPUT.PUT_LINE(RPAD(‘ ‘,8,’-‘) ||RPAD(‘ ‘,35,’-‘)||
RPAD(‘ ‘,10,’-‘) ||RPAD(‘ ‘,15,’-‘));
FOR x in (SELECT SUBSTR(dr.comp_id,1,8) comp_id,
SUBSTR(dr.comp_name,1,35) comp_name,
dr.status Status,SUBSTR(dr.version,1,15) version
FROM dba_registry dr,registry$ r
WHERE dr.comp_id=r.cid and dr.comp_name=r.cname
ORDER BY 1)
LOOP
DBMS_OUTPUT.PUT_LINE(RPAD(SUBSTR(x.comp_id,1,8),8) ||
RPAD(SUBSTR(x.comp_name,1,35),35)||
RPAD(x.status,10) || RPAD(x.version, 15));
END LOOP;
ELSIF SUBSTR(p_version,1,5) != ‘9.2.0’ THEN
DBMS_OUTPUT.PUT_LINE(RPAD(‘Comp ID’, 8) ||RPAD(‘Component’,35)||
RPAD(‘Status’,10) ||RPAD(‘Version’, 15)||
RPAD(‘Org_Version’,15)||RPAD(‘Prv_Version’,15));
DBMS_OUTPUT.PUT_LINE(RPAD(‘ ‘,8,’-‘) ||RPAD(‘ ‘,35,’-‘)||
RPAD(‘ ‘,10,’-‘)||RPAD(‘ ‘,15,’-‘)||RPAD(‘ ‘,15,’-‘)||
RPAD(‘ ‘,15,’-‘));
FOR y in (SELECT SUBSTR(dr.comp_id,1,8) comp_id,
SUBSTR(dr.comp_name,1,35) comp_name, dr.status Status,
SUBSTR(dr.version,1,11) version,org_version,prv_version
FROM dba_registry dr,registry$ r
WHERE dr.comp_id=r.cid and dr.comp_name=r.cname
ORDER BY 1)
LOOP
DBMS_OUTPUT.PUT_LINE(RPAD(substr(y.comp_id,1,8), 8) ||
RPAD(substr(y.comp_name,1,35),35)||RPAD(y.status,10) ||
RPAD(y.version, 15)||RPAD(y.org_version,15)||RPAD(y.prv_version,15));
END LOOP;
END IF;
END;
/
SET SERVEROUTPUT OFF
Prompt
Prompt
Prompt ======================================================
Prompt List of Invalid Database Objects Owned by SYS / SYSTEM
Prompt ======================================================
Prompt
set head on
SELECT case count(object_name)
WHEN 0 THEN ‘There are no Invalid Objects’
ELSE ‘There are ‘||count(object_name)||’ Invalid objects’
END “Number of Invalid Objects”
FROM dba_objects
WHERE status=’INVALID’
AND owner in (‘SYS’,’SYSTEM’);
Prompt
DOC
################################################################
If there are no Invalid objects below will result in zero rows.
################################################################
#
Prompt
set feedback on
SELECT owner,object_name,object_type
FROM dba_objects
WHERE status=’INVALID’
AND owner in (‘SYS’,’SYSTEM’)
ORDER BY owner,object_type;
set feedback off
Prompt
Prompt ================================
Prompt List of Invalid Database Objects
Prompt ================================
Prompt
set head on
SELECT case count(object_name)
WHEN 0 THEN ‘There are no Invalid Objects’
ELSE ‘There are ‘||count(object_name)||’ Invalid objects’
END “Number of Invalid Objects”
FROM dba_objects
WHERE status=’INVALID’
AND owner not in (‘SYS’,’SYSTEM’);
Prompt
DOC
################################################################
If there are no Invalid objects below will result in zero rows.
################################################################
#
Prompt
set feedback on
SELECT owner,object_name,object_type
FROM dba_objects
WHERE status=’INVALID’
AND owner not in (‘SYS’,’SYSTEM’)
ORDER BY owner,object_type;
set feedback off
Prompt
Prompt ==============================================================
Prompt Identifying whether a database was created as 32-bit or 64-bit
Prompt ==============================================================
Prompt
DOC
###########################################################################
Result referencing the string ‘B023’ ==> Database was created as 32-bit
Result referencing the string ‘B047’ ==> Database was created as 64-bit
When String results in ‘B023’ and when upgrading database to 10.2.0.3.0
(64-bit) , For known issue refer below articles
Note 412271.1 ORA-600 [22635] and ORA-600 [KOKEIIX1] Reported While
Upgrading Or Patching Databases To 10.2.0.3
Note 579523.1 ORA-600 [22635], ORA-600 [KOKEIIX1], ORA-7445 [KOPESIZ] and
OCI-21500 [KOXSIHREAD1] Reported While Upgrading To 11.1.0.6
###########################################################################
#
Prompt
SELECT SUBSTR(metadata,109,4) “Metadata”,
CASE SUBSTR(metadata,109,4)
WHEN ‘B023’ THEN ‘Database was created as 32-bit’
WHEN ‘B047’ THEN ‘Database was created as 64-bit’
ELSE ‘Metadata not Matching’
END “Initial DB Creation Info”
FROM sys.kopm$;
Prompt
Prompt ===================================================
Prompt Number of Duplicate Objects Owned by SYS and SYSTEM
Prompt ===================================================
Prompt
Prompt Counting duplicate objects ….
Prompt
SELECT count(1)
FROM dba_objects
WHERE object_name||object_type in
(SELECT object_name||object_type
from dba_objects
where owner = ‘SYS’)
and owner = ‘SYSTEM’;
Prompt
Prompt =========================================
Prompt Duplicate Objects Owned by SYS and SYSTEM
Prompt =========================================
Prompt
Prompt Querying duplicate objects ….
Prompt
SELECT object_name, object_type
FROM dba_objects
WHERE object_name||object_type in
(SELECT object_name||object_type
FROM dba_objects
WHERE owner = ‘SYS’)
AND owner = ‘SYSTEM’;
Prompt
DOC
################################################################################
If any objects found please follow below article.
Note 1030426.6 How to Clean Up Duplicate Objects Owned by SYS and SYSTEM schema
Read the Exceptions carefully before taking actions.
################################################################################
#
Prompt
Prompt ================
Prompt JVM Verification
Prompt ================
Prompt
SET SERVEROUTPUT ON
DECLARE
V_CT NUMBER;
P_VERSION VARCHAR2(10);
BEGIN
— If so, get the version of the JAVAM component
EXECUTE IMMEDIATE ‘SELECT version FROM registry$ WHERE cid=”JAVAVM”
AND status 99’ INTO p_version;
SELECT count(*) INTO v_ct FROM dba_objects
WHERE object_type LIKE ‘%JAVA%’ AND owner=’SYS’;
IF SUBSTR(p_version,1,5) = ‘8.1.7’ THEN
IF v_ct>=6787 THEN
DBMS_OUTPUT.PUT_LINE(‘JAVAVM – Installed properly’);
ELSE
DBMS_OUTPUT.PUT_LINE(‘JAVAVM – Not Installed properly’);
END IF;
ELSIF SUBSTR(p_version,1,5) = ‘9.0.1’ THEN
IF v_ct>=8585 THEN
DBMS_OUTPUT.PUT_LINE(‘JAVAVM – Installed properly’);
ELSE
DBMS_OUTPUT.PUT_LINE(‘JAVAVM – Not Installed properly’);
END IF;
ELSIF SUBSTR(p_version,1,5) = ‘9.2.0’ THEN
IF v_ct>=8585 THEN
DBMS_OUTPUT.PUT_LINE(‘JAVAVM – Installed properly’);
ELSE
DBMS_OUTPUT.PUT_LINE(‘JAVAVM – Not Installed properly’);
END IF;
ELSIF SUBSTR(p_version,1,6) = ‘10.1.0’ THEN
IF v_ct>=13866 THEN
DBMS_OUTPUT.PUT_LINE(‘JAVAVM – Installed properly’);
ELSE
DBMS_OUTPUT.PUT_LINE(‘JAVAVM – Not Installed properly’);
END IF;
ELSIF SUBSTR(p_version,1,6) = ‘10.2.0’ THEN
IF v_ct>=14113 THEN
DBMS_OUTPUT.PUT_LINE(‘JAVAVM – Installed properly’);
ELSE
DBMS_OUTPUT.PUT_LINE(‘JAVAVM – Not Installed properly’);
END IF;
END IF;
EXCEPTION WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE(‘JAVAVM – NOT Installed. Below results can be ignored’);
END;
/
SET SERVEROUTPUT OFF
Prompt
Prompt ================================================
Prompt Checking Existence of Java-Based Users and Roles
Prompt ================================================
Prompt
DOC
################################################################################
There should not be any Java Based users for database version 9.0.1 and above.
If any users found, it is faulty JVM.
################################################################################
#
Prompt
SELECT CASE count(username)
WHEN 0 THEN ‘No Java Based Users’
ELSE ‘There are ‘||count(*)||’ JAVA based users’
END “User Existence”
FROM dba_users WHERE username LIKE ‘%AURORA%’ AND username LIKE ‘%OSE%’;
Prompt
DOC
###############################################################
Healthy JVM Should contain Six Roles.
If there are more or less than six role, JVM is inconsistent.
###############################################################
#
Prompt
SELECT CASE count(role)
WHEN 0 THEN ‘No JAVA related Roles’
ELSE ‘There are ‘||count(role)||’ JAVA related roles’
END “Role”
FROM dba_roles
WHERE role LIKE ‘%JAVA%’;
Prompt
Prompt Roles
Prompt
SELECT role FROM dba_roles WHERE role LIKE ‘%JAVA%’;
set head off
Prompt
Prompt =========================================
Prompt List of Invalid Java Objects owned by SYS
Prompt =========================================
SELECT CASE count(*)
WHEN 0 THEN ‘There are no SYS owned invalid JAVA objects’
ELSE ‘There are ‘||count(*)||’ SYS owned invalid JAVA objects’
END “Total Invalid JAVA objects”
FROM dba_objects
WHERE object_type LIKE ‘%JAVA%’
AND status=’INVALID’
AND owner=’SYS’;
Prompt
DOC
#################################################################
Check the status of the main JVM interface packages DBMS_JAVA
and INITJVMAUX and make sure it is VALID.
If there are no Invalid objects below will result in zero rows.
#################################################################
#
Prompt
set feedback on
SELECT owner,object_name,object_type
FROM dba_objects
WHERE object_type LIKE ‘%JAVA%’
AND status=’INVALID’
AND owner=’SYS’;
set feedback off
Prompt
Prompt INFO: Below query should succeed with ‘foo’ as result.
set heading on
select dbms_java.longname(‘foo’) “JAVAVM TESTING” from dual;
set heading off
Prompt
set feedback off head off
select LPAD(‘*** End of LogFile ***’,50) from dual;
set feedback on head on
Prompt
spool off
Prompt
set heading off
set heading off
set feedback off
select ‘Upload db_upg_diag_&&dbname&&timestamp&&suffix from “&log_path” directory’
from dual;
set heading on
set feedback on
Prompt

Data Guard Switchover Unix shell script

$
0
0



Steps to Run this Script:
$ cd /var/opt/oracle/dataguard
$ ./pre_switchover_check.sh
$ ./make_me_standby.sh
On the machine where the Standby Database is running we need to run the following script:
$ cd /var/opt/oracle/dataguard
$ ./make_me_primary.sh
After the switchover is completed, we need to run the following script on the machine where the former Primary (now new Standby) database is running:
$ cd /var/opt/oracle/dataguard
$ ./start_recovery.sh


pre_switchover_check.sh

!/bin/ksh

if [ "$1" = "" ]
then
echo ""
echo "##################################################################"
echo "# PLEASE ENTER ORACLE_SID AS THE FIRST COMMAND LINE ARGUMENT     #"
echo "#      SCRIPT USAGE : pre_switchover_check.sh        #"
echo "##################################################################"
echo ""
exit
fi

ORACLE_SID=`echo $1 |tr '[A-Z]''[a-z]'`; export ORACLE_SID;

ls -l /var/opt/oracle/cronjobs/set$ORACLE_SID > /dev/null
if [ $? != 0 ]
then
echo ""
echo "##################################################################"
echo "#           ENVIRONMENT SETTING SET FILE NOT FOUND...!!!         #"
echo "#           /var/opt/oracle/cronjobs/set$ORACLE_SID              #"
echo "##################################################################"
echo ""
exit
fi

. /var/opt/oracle/cronjobs/set$ORACLE_SID

DB=`echo $1 |tr '[a-z]''[A-Z]'`; export DB;

echo ""
echo "##################################################################"
echo "#            PERFORMING PRE-SWITCHOVER CHECKS FOR $DB            #"
echo "##################################################################"
echo ""

sqlplus  -s /nolog |&
print -p  "connect / as sysdba"
print -p  "set feedback off pause off pagesize 0 heading off verify off linesize 500 term off "
print -p  "set sqlprompt ''"
read  -p   JUNK
print -p  "SELECT DATABASE_ROLE DBROLE FROM V\$DATABASE;"
read  -p   DBROLE
print -p  "SELECT COUNT(FILE#) FILESTAT FROM V\$DATAFILE WHERE STATUS IN ('RECOVER', 'OFFLINE');"
read  -p   FILESTAT
print -p  "SELECT COUNT(FILE#) BKPSTAT FROM V\$BACKUP WHERE STATUS = 'ACTIVE';"
read  -p   BKPSTAT
print -p  "SELECT LOG_ARCHIVED-LOG_APPLIED LOGGAP
FROM (SELECT MAX(SEQUENCE#) LOG_ARCHIVED
FROM V\$ARCHIVED_LOG WHERE DEST_ID=1 AND ARCHIVED='YES'
AND RESETLOGS_CHANGE#=(SELECT MAX(RESETLOGS_CHANGE#)
FROM V\$ARCHIVED_LOG)),
(SELECT MAX(SEQUENCE#) LOG_APPLIED
FROM V\$ARCHIVED_LOG WHERE DEST_ID=2
AND APPLIED='YES'
AND RESETLOGS_CHANGE#=(SELECT MAX(RESETLOGS_CHANGE#) FROM V\$ARCHIVED_LOG)) ;"
read  -p   LOGGAP
print -p  "EXIT"

echo "CHECKING CURRENT DATABASE ROLE..."
if [ "$DBROLE" = "PHYSICAL STANDBY"  ]
then
echo ""
echo "##################################################################"
echo "# ERROR ! ! ! NOT  A PRIMARY DATABASE, PLEASE RUN IT ON PRIMARY  #"
echo "##################################################################"
echo ""
exit
else
echo ""
echo "   OK   "
echo ""
fi


echo "CHECKING LOG GAP BETWEEN PRIMARY & STANDBY..."
if [ $LOGGAP -ne 0 ]
then
echo ""
echo "######################################################################"
echo "# ERROR ! ! !  PRIMARY & STANDBY ARE NOT IN SYNC, LOG GAP = $LOGGAP  #"
echo "######################################################################"
echo ""
exit
else
echo ""
echo "   OK   "
echo ""
fi


echo "CHECKING FILES OFFLINE OR RECOVER STATUS..."
if [ $FILESTAT -ne 0 ]
then
echo ""
echo "##################################################################"
echo "#  ERROR ! ! !  ONE OR MORE FILE/S OFFLINE OR IN RECOVER STATUS  #"
echo "##################################################################"
echo ""
exit
else
echo ""
echo "   OK   "
echo ""
fi


echo "CHECKING FILES IN BACKUP MODE..."
if [ $BKPSTAT -ne 0 ]
then
echo ""
echo "##################################################################"
echo "#      ERROR ! ! !  ONE OR MORE FILE/S ARE IN BACKUP MODE        #"
echo "##################################################################"
echo ""
exit
else
echo ""
echo "   OK   "
echo ""
fi

echo ""
echo "##################################################################"
echo "# ALL PRE-SWITCHOVER CHECKS SUCCEEDED... PROCEED WITH SWITCHOVER #"
echo "##################################################################"
echo ""






make_me_standby.sh
 
#!/bin/ksh
 
if [ "$1" = "" ]
then
echo ""
echo "##################################################################"
echo "# PLEASE ENTER ORACLE_SID AS THE FIRST COMMAND LINE ARGUMENT     #"
echo "#        SCRIPT USAGE : make_me_standby.sh           #"
echo "##################################################################"
echo ""
exit
fi
 
ORACLE_SID=`echo $1 |tr '[A-Z]''[a-z]'`; export ORACLE_SID;
 
ls -l /var/opt/oracle/cronjobs/set$ORACLE_SID > /dev/null
if [ $? != 0 ]
then
echo ""
echo "##################################################################"
echo "#           ENVIRONMENT SETTING SET FILE NOT FOUND...!!!         #"
echo "#           /var/opt/oracle/cronjobs/set$ORACLE_SID              #"
echo "##################################################################"
echo ""
exit
fi
 
. /var/opt/oracle/cronjobs/set$ORACLE_SID
 
DB=`echo $1 |tr '[a-z]''[A-Z]'`; export DB;
 
sqlplus  -s /nolog |&
print -p  "connect / as sysdba"
print -p  "set feedback off pause off pagesize 0 heading off verify off linesize 500 term off"
print -p  "set sqlprompt ''"
read  -p   JUNK
print -p  "SELECT DATABASE_ROLE DBROLE FROM V\$DATABASE;"
read  -p   DBROLE
print -p  "SELECT COUNT(FILE#) FILESTAT FROM V\$DATAFILE WHERE STATUS IN ('RECOVER', 'OFFLINE');"
read  -p   FILESTAT
print -p  "SELECT COUNT(FILE#) BKPSTAT FROM V\$BACKUP WHERE STATUS = 'ACTIVE';"
read  -p   BKPSTAT
print -p  "SELECT LOG_ARCHIVED-LOG_APPLIED LOGGAP
FROM (SELECT MAX(SEQUENCE#) LOG_ARCHIVED
FROM V\$ARCHIVED_LOG WHERE DEST_ID=1 AND ARCHIVED='YES'
AND RESETLOGS_CHANGE#=(SELECT MAX(RESETLOGS_CHANGE#)
FROM V\$ARCHIVED_LOG)),
(SELECT MAX(SEQUENCE#) LOG_APPLIED
FROM V\$ARCHIVED_LOG WHERE DEST_ID=2
AND APPLIED='YES'
AND RESETLOGS_CHANGE#=(SELECT MAX(RESETLOGS_CHANGE#) FROM V\$ARCHIVED_LOG)) ;"
read  -p   LOGGAP
print -p  "EXIT"
 
if [ "$DBROLE" = "PHYSICAL STANDBY"  ]
then
echo ""
echo "##################################################################"
echo "# ERROR ! ! ! NOT  A PRIMARY DATABASE, PLEASE RUN IT ON PRIMARY  #"
echo "##################################################################"
echo ""
exit
fi
 
 
if [ $LOGGAP -ne 0 ]
then
echo ""
echo "######################################################################"
echo "# ERROR ! ! !  PRIMARY & STANDBY ARE NOT IN SYNC, LOG GAP = $LOGGAP  #"
echo "######################################################################"
echo ""
exit
fi
 
 
echo "CHECKING FILES OFFLINE OR RECOVER STATUS..."
if [ $FILESTAT -ne 0 ]
then
echo ""
echo "##################################################################"
echo "#  ERROR ! ! !  ONE OR MORE FILE/S OFFLINE OR IN RECOVER STATUS  #"
echo "##################################################################"
echo ""
exit
fi
 
 
if [ $BKPSTAT -ne 0 ]
then
echo ""
echo "##################################################################"
echo "#      ERROR ! ! !  ONE OR MORE FILE/S ARE IN BACKUP MODE        #"
echo "##################################################################"
echo ""
exit
fi
 
 
echo ""
echo "##################################################################"
echo "#              ALL PRE-SWITCHOVER CHECKS SUCCEEDED...            #"
echo "       SWITCHING $DB TO STANDBY ROLE, PLEASE CONFIRM ...          "
echo "##################################################################"
echo ""
echo ""
echo "Continue? - Please enter 'Y' to proceed & 'N' to exit"
read ans
if [ "$ans" = 'Y' -o "$ans" = 'y' ]
then
sqlplus -s  /nolog < /tmp/make_me_standby.log
connect / as sysdba;
startup force;
alter database commit to switchover to standby with session shutdown;
shutdown immediate;
startup nomount;
alter database mount standby database;
select database_role from v\$database;
EOF
cat /tmp/make_me_standby.log
$ORACLE_HOME/bin/lsnrctl stop PRIMARY_$DB
else
echo "Quitting ....."
exit
fi
 
echo ""
echo "####################################################################"
echo "# PLEASE CONFIRM THAT THE STATUS OF DATABASE IS NOW "STANDBY"      #"
echo "#                                                                  #"
echo "# On OLD STANDBY Host please run the following script:         #"
echo "# /var/opt/oracle/dataguard/make_me_primary.sh                #"
echo "####################################################################"
echo ""



make_me_primary.sh
 
#!/bin/ksh
 
if [ "$1" = "" ]
then
echo ""
echo "##################################################################"
echo "#  PLEASE ENTER ORACLE_SID AS THE FIRST COMMAND LINE ARGUMENT    #"
echo "#         SCRIPT USAGE : make_me_primary.sh          #"
echo "##################################################################"
echo ""
exit
fi
 
ORACLE_SID=`echo $1 |tr '[A-Z]''[a-z]'`; export ORACLE_SID;
 
ls -l /var/opt/oracle/cronjobs/set$ORACLE_SID > /dev/null
if [ $? != 0 ]
then
echo ""
echo "##################################################################"
echo "#           ENVIRONMENT SETTING SET FILE NOT FOUND...!!!         #"
echo "#           /var/opt/oracle/cronjobs/set$ORACLE_SID              #"
echo "##################################################################"
echo ""
exit
fi
 
. /var/opt/oracle/cronjobs/set$ORACLE_SID
 
 
DB=`echo $1 |tr '[a-z]''[A-Z]'`; export DB;
 
 
sqlplus  -s /nolog |&
print -p  "connect / as sysdba"
print -p  "set feedback off pause off pagesize 0 heading off verify off linesize 500 term off"
print -p  "set sqlprompt ''"
read  -p   JUNK
print -p  "SELECT DATABASE_ROLE DBROLE FROM V\$DATABASE;"
read  -p   DBROLE
print -p  "exit"
 
if [ "$DBROLE" = "PRIMARY"  ]
then
echo ""
echo "##################################################################"
echo "#   ERROR ! ! ! NOT STANDBY DATABASE, PLEASE RUN IT ON STANDBY   #"
echo "##################################################################"
echo ""
exit
fi
 
echo ""
echo "##################################################################"
echo "#         SWITCHING $DB TO PRIMARY ROLE, PLEASE CONFIRM ...      #"
echo "##################################################################"
echo ""
echo "Continue? - Please enter 'Y' to proceed & 'N' to exit"
read ans
if [ "$ans" = 'Y' -o "$ans" = 'y' ]
then
sqlplus -s /nolog < /tmp/make_me_primary.log
connect / as sysdba;
alter database commit to switchover to primary with session shutdown;
shutdown immediate;
startup mount;
alter system set log_archive_dest_state_2=enable scope=both;
alter database set standby database to maximize performance;
alter database open;
select database_role from v\$database;
EOF
cat /tmp/make_me_primary.log
$ORACLE_HOME/bin/lsnrctl start PRIMARY_$DB
else
echo "Quitting ....."
exit
fi
 
echo "####################################################################"
echo "# PLEASE CONFIRM THAT THE STATUS OF DATABASE IS NOW "PRIMARY"      #"
echo "#                                                                  #"
echo "# On NEW STANDBY Host please run the following script:             #"
echo "# /var/opt/oracle/dataguard/start_recovery.sh                 #"
echo "####################################################################"
 


start_recovery.sh
 
#!/bin/ksh
 
if [ "$1" = "" ]
then
echo ""
echo "##################################################################"
echo "#   PLEASE ENTER ORACLE_SID AS THE FIRST COMMAND LINE ARGUMENT   #"
echo "#      SCRIPT USAGE : start_recovery.sh              #"
echo "##################################################################"
echo ""
exit
fi
 
ORACLE_SID=`echo $1 |tr '[A-Z]''[a-z]'`; export ORACLE_SID;
 
ls -l /var/opt/oracle/cronjobs/set$ORACLE_SID > /dev/null
if [ $? != 0 ]
then
echo ""
echo "##################################################################"
echo "#           ENVIRONMENT SETTING SET FILE NOT FOUND...!!!         #"
echo "#           /var/opt/oracle/cronjobs/set$ORACLE_SID              #"
echo "##################################################################"
echo ""
exit
fi
 
. /var/opt/oracle/cronjobs/set$ORACLE_SID
 
DB=`echo $1 |tr '[a-z]''[A-Z]'`; export DB;
 
 
sqlplus  -s /nolog |&
print -p  "connect / as sysdba"
print -p  "set feedback off pause off pagesize 0 heading off verify off linesize 500 term off"
print -p  "set sqlprompt ''"
read  -p   JUNK
print -p  "SELECT DATABASE_ROLE DBROLE FROM V\$DATABASE;"
read  -p   DBROLE
print -p  "exit"
 
if [ "$DBROLE" = "PRIMARY"  ]
then
echo ""
echo "##################################################################"
echo "#   ERROR ! ! ! NOT STANDBY DATABASE, PLEASE RUN IT ON STANDBY   #"
echo "##################################################################"
echo ""
exit
fi
 
echo ""
echo "##################################################################"
echo "#     STARTING RECOVERY FOR $DB  STANDBY, PLEASE CONFIRM ...     #"
echo "##################################################################"
echo ""
echo "Continue? - Please enter 'Y' to proceed & 'N' to exit"
read ans
if [ "$ans" = 'Y' -o "$ans" = 'y' ]
then
sqlplus -s /nolog < /tmp/start_recovery.log
connect / as sysdba;
recover managed standby database disconnect;
alter system set log_archive_dest_state_2=defer scope=both;
EOF
cat /tmp/start_recovery.log
ps -ef | grep ora_mrp0_$ORACLE_SID |grep -v grep > /dev/null
if [ $? != 0 ]
then
echo ""
echo "##################################################################"
echo "#           RECOVERY PROCESS NOT RUNNING... PLEASE CHECK         #"
echo "##################################################################"
echo ""
exit
else
echo "##################################################################"
echo "#           MRP PROCESS SUCESSFULLY STARTED                      #"
echo "##################################################################"
echo ""
echo "####################################################################"
echo "#                SWITCHOVER COMPLETE                              #"
echo ""
echo "* Perform Database Post-Switchover Checklist!                      "
echo "####################################################################"
fi
else
echo "Quitting ....."
exit
fi
 

Viewing all 1640 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>