Showing posts with label DATABASE. Show all posts
Showing posts with label DATABASE. Show all posts

Sunday 11 September 2016

Enterprise Manager 13c failed to start with the error The loading of OPSS java security policy provider failed due to exception


EM 13c failed to start with the below error.

Error :
<BEA-090892> <The loading of OPSS java security policy provider failed due to exception.


$OMS_HOME/bin/emctl start oms

webtier started successfully

but rest of services could  not start(admin server, jvmd  and bi-server ..) when I checked the admin server log files I found the below error

OPSS Unable to start Weblogic Server XML20108 Fatal Error JPS02592 Failed To Push Ldap Config Data To LibOvd


Issue:

 Sep 6, 2016 7:03:16 PM oracle.security.jps.internal.igf.ovd.OvdIGFServiceProvider pushLdapNamesTolibOvd SEVERE:JPS-02592
<Sep 6, 2016 7:03:16 PM SGT> <Error> <Security> <BEA-090892> <The loading of OPSS java security policy provider failed due to exception, see the exception stack trace or the server log file for

root cause. If still see no obvious cause, enable the debug flag -Djava.security.debug=jpspolicy to get more information. Error message: JPS-02592: Failed to push ldap config data to libOvd for

service instance "idstore.ldap" in JPS context "default", cause: org.xml.sax.SAXException: Error Parsing at line #1: 1.org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; <Line 1, Column

1>: XML-20108: (Fatal Error) Start of root element expected.>
<Sep 6, 2016 7:03:16 PM SGT> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: weblogic.security.SecurityInitializationException: The loading of OPSS java security policy

provider failed due to exception, see the exception stack trace or the server log file for root cause. If still see no obvious cause, enable the debug flag -Djava.security.debug=jpspolicy to get

more information. Error message: JPS-02592: Failed to push ldap config data to libOvd for service instance "idstore.ldap" in JPS context "default", cause: org.xml.sax.SAXException: Error Parsing at

line #1: 1.org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; <Line 1, Column 1>: XML-20108: (Fatal Error) Start of root element expected.
weblogic.security.SecurityInitializationException: The loading of OPSS java security policy provider failed due to exception, see the exception stack trace or the server log file for root cause. If

still see no obvious cause, enable the debug flag -Djava.security.debug=jpspolicy to get more information. Error message: JPS-02592: Failed to push ldap config data to libOvd for service instance

"idstore.ldap" in JPS context "default", cause: org.xml.sax.SAXException: Error Parsing at line #1: 1.
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; <Line 1, Column 1>: XML-20108: (Fatal Error) Start of root element expected.
        at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadOPSSPolicy(CommonSecurityServiceManagerDelegateImpl.java:1402)
        at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1022)
        at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:873)
        at weblogic.security.SecurityService.start(SecurityService.java:141)
        at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
        Truncated. see log file for complete stacktrace
Caused By: oracle.security.jps.JpsRuntimeException: JPS-02592: Failed to push ldap config data to libOvd for service instance "idstore.ldap" in JPS context "default", cause:

org.xml.sax.SAXException: Error Parsing at line #1: 1.
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; <Line 1, Column 1>: XML-20108: (Fatal Error) Start of root element expected.


Possible Reasons and Resolution:
================================

1.  Please verify whether your file system having disk space issues(check the file system where EM 13C is installed).
One of the causes of XML files corruption is seen when there is a filesystem

2.  If it is not relates to file system space issues, then it might be because of corrupted adapters.os_xml

3.  As additional symptom $DOMAIN_HOME/config/fmwconfig/ovd/default/server.os_xml was detected as zero (0) bytes.

Corruption of the adapters.os_xml or server.os_xml under this LibOVD location file may lead to Weblogic server startup failure.

Please navigate to the fmwconfig folder and check the adapters.os_xml or server.os_xml file or both
$DOMAIN_HOME/config/fmwconfig/ovd/default/adapters.os_xml

There are chances the any of those xml file could be corrupted due to which the Weblogic server fails to start.


4.  In case the file is corrupted, please perform the following steps:(caution)

   i) Take a backup of $DOMAIN_HOME/config/fmwconfig/ovd/default/adapters.os_xml
      or  server.os_xml
   ii) Delete corrupted adapters.os_xml or server.os_xml files under
        $DOMAIN_HOME/config/fmwconfig/ovd/default/adapters.os_xml

   iii)  Copy adapters.os_xml or server.os_xml from
         $MW_HOME/oracle_common/modules/oracle.ovd_11.1.1/templates/ to
         $DOMAIN_HOME/config/fmwconfig/ovd/default/. Or restore files from backup.

5.  Restart the server. It worked for me!!

Hope this post helps you to resolve this issue.



This worked for me perfectly, Hope it will work for you as well...

Saturday 14 June 2014

rman duplicate command for rman cloning(Robustness of ORACLE Technology)



ROBUSTNESS OF ORACLE TECHNOLOGIES : PART1
* Cloning Oracle Database  using backup based duplication
----------------------------------------------------------------------------
I was wondering about the cloning of oracle database using rman which directly converts the database name from ‘X’ to ‘Y’.
For example If I have a production database named PROD, I want to clone it to a new server for testing and the database name I want to keep as TEST.  
Is it possible using rman? If Yes, how can we do ?
The answer is yes and in fact it is the simplest way of doing cloning using rman duplicate command.
There are various ways to use rman duplicate command for database cloning depending on your requirement and availability.
Here are the ways:
Broad classification:
·         Backup based Duplication (only requires backup piece full with archivelog. Source database connection does require)
·         Active duplication (connection to source is required, no backups required )
  In my scenario I had only database rman full backup with archivelog(backup database plus archivelog) was there.
So I did the following steps to clone :
Environment:
Source DB
Target DB
PROD
TEST
DB_FILE_NAME_CONVERT=/u01/PROD/oradata
DB_FILE_NAME_CONVERT=
/u02/TEST/oradata
LOG_FILE_NAME_CONVERT=/u01/PROD/oradata
LOG_FILE_NAME_CONVERT=
/u01/TEST/oradata

I created a initialization parameter file initTEST.ora set the parameter according to TEST database server filesystem.


Added the following parameters in the initTEST.ora
DB_NAME= ‘TEST’
DB_FILE_NAME_CONVERT==’/u01/PROD/oradata’,’/u02/TEST/oradata’
LOG_FILE_NAME_CONVERT=’/u01/PROD/oradata’,’/u02/TEST/oradata’
I have created password file for TEST DATABASE
$cd $ORACLE_HOME/dbs
$orapwd file=orapwTEST password=system$

Copied the backup pieces from PROD to TEST Database location
‘/backup/PROD’
Now we are ready for Backup based duplication
I have started the TEST database with startup nomount.
Then I connected auxiliary database
$rman AUXILIARY /

Rman>duplicate database PROD dbid=123455 to TEST
      BACKUP LOCATION=‘/backup/PROD’
      NOFILENAMECHECK;

At the end it has started with database with name TEST

WOW!!!! It is awesome. It has reduced many steps unlike my previous way of doing rman restore manually.

If I would have used active duplication I would have to use the below rman command
$rman TARGET sys/password@source AUXILIARY /
 
Before running the above command I would have to configure listener and 
tnsnames.ora file for connecting to PROD database.
 
Then, for cloning here would be the command
 
RMAN>DUPLICATE TARGET DATABASE TO TEST
  SPFILE 
  NOFILENAMECHECK;
 
Please feel free to ask at viewssharings.blogspot.in@gmail.com

Wednesday 19 March 2014

Silent mode of Oracle Database Installation using manully created response file

######Silent Mode of Installation of database ignoring prereqs

#####Command ./runInstaller -silent -ignorePrereq  -showProgress -responseFile  /home/oracle/myresp.rsp

copy the below contents to myresp.rsp file and save then use the above command
---------------------------------- ---------------------------------------------
oracle.install.responseFileVersion=11.2.0
oracle.install.option=INSTALL_DB_AND_CONFIG
ORACLE_HOSTNAME=edc-chn-uat
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=ORCL
oracle.install.db.config.starterdb.SID=orcl
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=700
oracle.install.db.config.starterdb.installExampleSchemas=true
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=manoj123
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/u02/oracle/orcl/oradata
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/u01/app/oracle/flash_recovery_area
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
oracle.installer.autoupdates.option=SKIP_UPDATES

It works absolutely fine provided that set database prerequisites before installing DB as per oracle suggestion.

All the options given in database software default template. You can also use them. Oracle given response files are present inside dbsoft/install/ directory

Tuesday 18 March 2014

Enterprise Manager Dbcontrol for a clustered environment(11gR2 RAC)

Here are the steps for configuring Enterprise Manager dbcontrol for 11gR2 clustered environment.

step-1 export DBUNIQNAME
you can get it from show parameter db_unique_name

$export ORACLE_UNQNAME=RACDB

SYSTEM
Check for DBUNIQUE name
=======
SELECT name, db_unique_name FROM v$database;

check the service status If dbcontrol is running on any cluster node
=================
Note: if dbcontrol repository is there for one node or dbcontrol is running on any cluster node you need to drop it.

$emctl status dbconsole  -- check for dbcontrol running on any node
$emca -deconfig dbcontrol db -repos drop  -- dropping dbcontrol running on single node
$emctl status agent  -- check the status of agent running on any node
$emca -repos drop -cluster


db user passwd unlock
=====================
alter user SYSMAN identified by SYSMAN account unlock;
alter user DBSNMP identified by DBSNMP account unlock;

Check for passwd file
======================
select * from V$PWFILE_USERS;

USERNAME                       SYSDB SYSOP SYSAS
—————————— —– —– —–
SYS                            TRUE  TRUE  FALSE

db user for ASM
==============
export GRID HOME AND SID FOR ASM

sqlplus sys/system as sysasm
create user asmsnmp identified by asmsnmp;
grant sysdba to asmsnmp;
grant sysasm to asmsnmp;
grant sysoper to asmsnmp;

SQL> select * from gv$pwfile_users;

   INST_ID USERNAME                       SYSDB SYSOP SYSAS
---------- ------------------------------ ----- ----- -----
         2 SYS                                           TRUE  TRUE  TRUE
         2 ASMSNMP                               TRUE  TRUE  TRUE
         1 SYS                                           TRUE  TRUE  TRUE
         1 ASMSNMP                               TRUE  TRUE  TRUE

SQL>  select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS                                     TRUE  TRUE  FALSE
ASMSNMP                         TRUE  FALSE FALSE

FIX:
======
alter user sys identified by SYSTEM;

passwd file for oracle_home/dbs for sysuser
=================
passwords for rdbms home
--------------
orapwd file=orapwRACDB1 password=SYSTEM entries=5 force=y ignorecase=y
orapwd file=orapwRACDB2 password=SYSTEM entries=5 force=y ignorecase=y

password for grid home
----------------------
inside grid_home/dbs
orapwd file=orapw+ASM password=SYSTEM entries=5 force=y ignorecase=y

before creating gridcontrol for cluster please check the followings
1) valid username/password.
2) Database should be up.
3) Scan listener should be up.
4) Database service should be registered with scan listener.
5) Password file should be  configured correctly.

Now configure emctl for cluster
--------------------------------
if you are creating for the first time
 $emca -config dbcontrol db -repos create -cluster

if you want to recreate the emcontrol again(drop and create)
  $emca -config dbcontrol db -repos recreate -cluster

This will ask you few questions like
DBNME
port number
clusternmae
ASMSNMP passwd
SYS Passwrd
DBSNMP passwd

keep these ready and give input.

100% it will be successfull.

Please feel free to ask @manojpalbabu@gmail.com





Sunday 9 March 2014

Troubleshooting Error 1017 received logging on to the standby (Error 1034 received logging on to the standby. PING[ARC2]: Heartbeat failed to connect to standby 'STBYKOL'. Error is 1034)

Hi Guys,

  Here is an Interesting case and  I was stuck with the problem since last 2 days and a half. In fact I was almost done with everything to resolve the mentioned problem but I could not able to solve almost.

Then I left it as I became exhausted, But I kept on thinking Where could be the problem, at last I got it.

Here was my case:
--------------------

  I have 2 node rac as primary and a standby was intended to create on single node.

   I changed parameter file, created passwords, tns entries accordingly. Then I did duplicate target and restored database as standby. After doing everything I saw, RAC node1 was able to send archive logs to dest_2 which is my standby but unfortunately node2 was unable to enter into standy database.

Here are

Problem Statement:
----------------------------

Standby was receiving node1's log files but node2 was unable to send logfiles due to the below error

Error 1017 received logging on to the standby
------------------------------------------------------------
Check that the primary and standby are using a password file
and remote_login_passwordfile is set to SHARED or EXCLUSIVE,
and that the SYS password is same in the password files.

Steps for diagnosing
----------------------------
step-1
 when I checked  query on node 2

sql>select DEST_ID,DEST_NAME,STATUS,BINDING,ERROR from v$ARCHIVE_DEST where status<>'INACTIVE';

all log file location were valid

Sql> SELECT DESTINATION, STATUS, ERROR FROM V$ARCHIVE_DEST WHERE DEST_ID=2;

dest2 for archive log dest is valid

sql> select error_code,message from v$dataguard_status;

Error 1034 received logging on to the standby

PING[ARC2]: Heartbeat failed to connect to standby 'STBYDB'. Error is 1034.

Then I have done the below steps to resolve the problem

1.) alter system set  log_archive_dest_state_2=defer scope=both sid='*';

  (on primary RAC any node )

   Sql>recover managed standby database cancel;    (on standby side)

2) alter database set SEC_CASE_SENSITIVE_LOGON=FALSE scope=both sid='*';

 (on RAC side)

3) shutdown the standby database infact if possible primary also
then remove password files for all primary rac nodes and standby nodes and then created the password file on their respective server

orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=system entries=5 force=y ignorecase=Y

 Then start the primary db (rac nodes by srvctl start database -d primaryDB )

4) alter system set LOG_ARCHIVE_DEST_2='SERVICE=STBYKOL ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=STBYDB' scope=both sid='*';

 (on any primary rac node and standby db)

5) alter system set  log_archive_dest_state_2=enable scope=both sid='*'; (on any primary RAC node)

 6) recover standby database using current logfile disconnect; (on standby database)

After doing this I observed the alert log  and it worked

To check the database  syncing

on both side check the command

sql>select current_scn from v$database;

The value of primary and standby would be almost same


Hope It will help you guys

If any query don't forget to mail me at viewssharings.blogspot.in@gmail.com

 

Tuesday 21 January 2014

Demonstration of Co-related subquery


UNDERSTANDING CO-RELATED SUBQUERY
A correlated subquery is a subquery that uses values from the outer query, requiring the inner query to execute once for each outer query
Here is a TABLE: emp

EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO
7369
SMITH
CLERK
7902
12/17/1980
800

20
7788
SCOTT
ANALYST
7566
4/19/1987
3000

20
7839
KING
PRESIDENT

11/17/1981
5000

10
7844
TURNER
SALESMAN
7698
9/8/1981
1500
0
30
7902
FORD
ANALYST
7566
12/3/1981
3000

20

I want to find out nth highest salary of an employee from emp table
Now the query is :
select distinct sal from emp e where &no=(select count(distinct sal) from emp where e.sal<=sal) 

Demonstration
As we know co-related subquery uses the value from the outer query requiring the inner query to execute once for each outer query.
Here I am dividing the query into 3 sections
Section 1:
Outer query passess the value to inner query

Section 2:
Inner query uses the value passed from outer query for evaluation

Section 3:

Output of inner query is compared with the value passed in where clause


SECTION-1
Distinct keyword sorted the output
5000
3000
1500
800
-------------------
5000 --> passed
3000
1500
800




2nd execution
5000
3000 --> Passed
1500
800


Likewise we can compare for 3
---nth highest salary
SECTION-2(e.sal<=sal)
1st execution
5000<=5000 (true cnt=1)
5000<=3000(false cnt=1)
5000<=1500(flase cnt=1)
5000<=800(false   cnt=1)

 -----------------
1st execution
1st 5000 will be comared and
Output will be 1 as above



2nd execution
3000<=5000 (true cnt=1)
3000<=3000(true cnt=2)
3000<1500 (false cnt=2)
3000<800   (false cnt=2)
SECTION-3

&NO=1
Evaluation (1=1 true )
Hence 5000 is the highest sal


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

&NO=2 (second highest sal)

Evaluaton (2=1  false )
Hence 5000 not 2nd highest sal


Evaluation (2=2 which is true)
Hence 3000 will be the 2nd highest