Friday, 12 June 2020

DemoIdentity.jks file not found

Dear DBA-Mates, Topic: demoidentity.jks does not exist for Nodemanager
Hope you all are doing Good in Covid-19. Stay safe, be safe!!!

This post is related to Node Manager Issue which throwing error while starting as DemoIdentity.jks is not found under below path.
.../wlserver_12.2.1/oracle_common/common/nodemanager/security/DemoIdentity.jks

When we start Node Manager, it will not start and will come out of nohup. So, we need to check the log file where we can see this alert.
Error/Action:

ora-data.blogspot.com$ ls -ltr .../wlserver_12.2.1/oracle_common/common/nodemanager/security/DemoIdentity.jks

ls: cannot access .../wlserver_12.2.1/oracle_common/common/nodemanager/security/DemoIdentity.jks: No such file or directory

As above we can see file is not found.

So, we can create it manually without any issue.

1. We need to set the wls env file as shown below:

ora-data.blogspot.com$ pwd
.../wlserver/server/bin
ora-data.blogspot.com$

ora-data.blogspot.com$ . setWLSEnv.sh

2. Once above env setted. Go to security directory where you want to create that DemoIdentity.jks file.

ora-data.blogspot.com$ cd .../wlserver_12.2.1/oracle_common/common/nodemanager/security

ora-data.blogspot.com$ java utils.CertGen -keyfilepass DemoIdentityPassPhrase -certfile democert -keyfile demokey -strength 1024 -noskid

Generating a certificate with common name vmohsautr068 and key strength 1024
issued by CA with certificate from /.../wlserver_12.2.1/wlserver/server/lib/CertGenCA.der file and key from /.../fmw/bea/wlserver_12.2.1/wlserver/server/lib/CertGenCAKey.der file

ora-data.blogspot.com$ ls -ltr
total 8
-rw-r-----. 1 ora-data ora-data   64 Jun 2 01:03 SerializedSystemIni.dat
-rw-r--r--. 1 ora-data ora-data  676 Jun 2 01:22 demokey.der
-rw-r--r--. 1 ora-data ora-data  993 Jun 2 01:22 demokey.pem
-rw-r--r--. 1 ora-data ora-data  800 Jun 2 01:22 democert.der
-rw-r--r--. 1 ora-data ora-data 1139 Jun 2 01:22 democert.pem

ora-data.blogspot.com$ java utils.ImportPrivateKey -keystore DemoIdentity.jks -storepass DemoIdentityKeyStorePassPhrase -keyfile demokey.pem -keyfilepass DemoIdentityPassPhrase -certfile democert.pem -alias demoidentity

No password was specified for the key entry
Key file password will be used
<Jun 2, 2020 1:23:07 AM EDT> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
<Jun 2, 2020 1:23:07 AM EDT> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG28 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>

Imported private key demokey.pem and certificate democert.pem
into a new keystore DemoIdentity.jks of type jks under alias demoidentity

ora-data.blogspot.com$ ls -ltr
total 10
-rw-r-----. 1 ora-data ora-data   64 Jun 2 01:03 SerializedSystemIni.dat
-rw-r--r--. 1 ora-data ora-data  676 Jun 2 01:22 demokey.der
-rw-r--r--. 1 ora-data ora-data  993 Jun 2 01:22 demokey.pem
-rw-r--r--. 1 ora-data ora-data  800 Jun 2 01:22 democert.der
-rw-r--r--. 1 ora-data ora-data 1139 Jun 2 01:22 democert.pem
-rw-r--r--. 1 ora-data ora-data 1577 Jun 2 01:24 DemoIdentity.jks
ora-data.blogspot.com$

Then start the Node Manager, it will work fine.
Some useful links:



Ref.: 1392455.1

Monday, 4 May 2020

How to get sql query output in xml format from putty session



Dear DBA-Mates, How to get sql query output in xml format.
Hope you all are doing well and Safe at Home!!!

We would like to share one of very important and useful query for How to get SQL Query output in xml/xls readable format.

This is very headache if you are running in Putty Session.

Even we also use this same format for such queries. So, we thought to share to you all and it will be easy for us also for references in future.

This type of request will be send by the developer or functional team which they may need for some analysis or monthly reports generation.

Whatever if they asked then as a DBA we need to provide them, even though angry inside Hahahah.

And the worst things those queries will be running 2 to 3 hrs and rows may be 2 to 3 lakhs, so can imagine it.

$sqlplus / as sysdba
SQL> SET LINESIZE 10000
SQL> SET VERIFY OFF
SQL> SET FEEDBACK OFF
SQL> SET PAGESIZE 999

SQL> SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF
SQL> SPOOL <Output_Filename>.xls
SQL> set time on   ## To Capture query start and end time
SQL> @<Filename>.sql
SQL> spool off;

Optional:
SQL>SET MARKUP HTML OFF ENTMAP OFF SPOOL OFF PREFORMAT ON

SQL>SET LINESIZE 2000 VERIFY ON FEEDBACK ON

OR
SQL> set feed off markup html on spool on
SQL> SET PAGESIZE 50000
SQL> SPOOL <output_filename>.xls
SQL> <your_query like select * from dual;>
SQL> SPOOL OFF;

OR
SQL> set pagesize 50000
SQL> set heading on
SQL> set echo off
SQL> set colsep ','
SQL> set heading on
SQL> SET LINESIZE 999 VERIFY OFF FEEDBACK OFF
SQL> SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF
SQL> spool workflow.xls
SQL> <Your query>
SQL> Spool off;

OR
Save Query output as HTML file from SQLPLUS

As alternative you may use below block of code from the sqlplus only to save the output as HTML file.

SQL> set linesize 4000
SQL> set verify off
SQL> set feedback off
SQL> set pagesize 9999
SQL> set markup html on entmap on spool on preformat off
SQL> spool /tmp/query_output.html
SQL> --Your query--
SQL> set markup html off
SQL> spool off;

Hope this ma useful and helpful for everyone here.

Some more useful link:
Regards,

Saturday, 18 April 2020

ORACLE CLOUD CERTIFICATION (OCI) FREE 100% (at zero cost)


Hi DBA-Mates, OCI Certification 100% Free till 15thMay2020
Hope you all are doing Great!!!

We are back with very excited / good news like (OCI Certification Free) in between bad news like CORONO.

Exited news is that OCI Training (at high level of concepts and training videos) and Exam Certification is FREE (100%).

I don’t know why some people hide these good things and they promote other non-sense or paid things over social platform.
So, please make use of it. Please don't miss this golden opportunity.

As per my advice and experiences, please don't delay in booking your free seats.

Also, don't think that once you study then attend the exam. 1st priority is book the exam and then study because boss it is free hhhhh.

You can read my blog later on first go and book/schedule your exam.

Here is link where you can get exam's details and choose which one you want to attend.

Submit very carefully and complete the process, hardly will it take 10-15 min. 
I have used Firefox which is easy for some accepting terms and condition which is not visible in chrome.
Here, you can get all the details like:

Training,
Exam Guide,
Practice for exam,
Certification (everyone's favorite)


Above link will direct to below link for OCI Architect Associate exam and certification.


Note: Last date is 15th May 2020.

So, you have to schedule or attend the exam before or on 15th May 2020.

Also, don't book at last date, so if anything happened like login issue or other internet issue then you may lose your chance?

Book it at your comfort date/days and be ready one day before with everything like username/password, internet etc.

You can attend this exam from your house/office also.
Hope this may useful and helpful.

For more updates you can join/follow us on Facebook: https://www.facebook.com/groups/471358400299093/

Because sometimes writing blog takes time, so we update on Facebook group.
Off course credit goes to Oracle...

Some more useful links:
Regards,

Thursday, 13 February 2020

How to change database DB name using NID utility

Hi DBA-Mates, Hope you all are doing Well!!!
We are back with how to change database DB name using NID utility.

Thank you all a lot for yours email as I was away for times because of some personal works.
It is very easy and simple but we are sure that very few people may have performed this activity, so it will be useful for those who has only read.

Note: If not sure about sys password, it can be set as either orapwd file or below command:

$sqlplus '/as sysdba'

SQL> alter user sys identified by sys;
User altered.

SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

SQL> startup mount;
ORACLE instance started.

Total System Global Area  456146944 bytes
Fixed Size                  1344840 bytes
Variable Size             356518584 bytes
Database Buffers           92274688 bytes
Redo Buffers                6008832 bytes
Database mounted.
SQL>

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
ORCL      MOUNTED

SQL>

Command:

[oracle@localhost bin]$ nid TARGET=sys/<sys password>@<Service/old_dbname> DBNAME=<DB New Name> SETNAME=YES

Query:

[oracle@localhost bin]$ nid TARGET=sys/sys@ORCL DBNAME=ORCLNEW SETNAME=YES

DBNEWID: Release 11.2.0.2.0 - Production on Sat Feb 1 22:41:13 2020

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to database ORCL (DBID=1229390655)

Connected to server version 11.2.0

Control Files in database:
    /home/oracle/app/oracle/oradata/orcl/control01.ctl
    /home/oracle/app/oracle/flash_recovery_area/orcl/control02.ctl

Change database name of database ORCL to ORCLNEW? (Y/[N]) => Y

Proceeding with operation
Changing database name from ORCL to ORCLNEW
    Control File /home/oracle/app/oracle/oradata/orcl/control01.ctl - modified
    Control File /home/oracle/app/oracle/flash_recovery_area/orcl/control02.ctl - modified
    Datafile /home/oracle/app/oracle/oradata/orcl/system01.db - wrote new name
    Datafile /home/oracle/app/oracle/oradata/orcl/sysaux01.db - wrote new name
    Datafile /home/oracle/app/oracle/oradata/orcl/undotbs01.db - wrote new name
    Datafile /home/oracle/app/oracle/oradata/orcl/users01.db - wrote new name
    Datafile /home/oracle/app/oracle/oradata/orcl/example01.db - wrote new name
    Datafile /home/oracle/app/oracle/oradata/orcl/APEX_1930613455248703.db - wrote new name
    Datafile /home/oracle/app/oracle/oradata/tbs1.db - wrote new name
    Datafile /home/oracle/app/oracle/oradata/tbs2.db - wrote new name
    Datafile /home/oracle/app/oracle/oradata/orcl/temp01.db - wrote new name
    Control File /home/oracle/app/oracle/oradata/orcl/control01.ctl - wrote new name
    Control File /home/oracle/app/oracle/flash_recovery_area/orcl/control02.ctl - wrote new name
    Instance shut down

Database name changed to ORCLNEW.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID - Completed succesfully.

[oracle@localhost bin]$

Change db name in pfile:

[oracle@localhost dbs]$ vi initorcl.ora

*.db_name='ORCLNEW'


SQL> startup mount
ORACLE instance started.

Total System Global Area  456146944 bytes
Fixed Size                  1344840 bytes
Variable Size             356518584 bytes
Database Buffers           92274688 bytes
Redo Buffers                6008832 bytes
Database mounted.

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery


SQL> alter database open;

Database altered.

SQL>

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
ORCLNEW   READ WRITE

Hope this may helpful and useful.
Regards,

Sunday, 5 January 2020

Happy New Year

Dear Friends, Happy New Year 2020 to All!!!
Today we would like to share some experiences which may useful for life time for everyone.

Just want to say Happy New Year with some words which may useful.

I don’t want to just celebrate New Year on 1st Jan and then same day all like earlier days.

So, here would like to share some real life time achievements which will be like golden year for next coming life.

If you want to be a success or real person in real life then we can try these below points which may help us to be a beautiful person.

And if you are a beautiful or true person from inside then success will come automatically.

So, promise you guys to yourself only that you will try to follow it and make some changes in yourself this year.

1. Take a steps which you want to do. 

Means do whatever you want if that does not impact anyone in bad ways.

BUT one advice before starting be careful and take a full proof plan and be mentally prepared for facing either failure or success.

2. Find out the best things and apply in yourself.

Example: Means note down only 4 to 5 points which can make a good person and follow them like be true, be kind etc…

3. Speak less but effective. People says that “jo jitna kam bolta hai , utna achha hota hai” .

4. Always do your best in present day, off course next day will be your best.

But see, all days can’t be best but almost days can be yours best.

5. Try to minimize you mistakes.

Friends, we are human and we do the mistakes that’s not a problem but we should learn from it and try to avoid from next time.

Note down your Only One weakness in One month and then work on that and come over that.

Again write next weakness and do the same, like this you can be a perfect person in Next year (1 yr).

You can’t imagine what you can achieved like this.

So, this is the thing which I though may useful you all here, and also I am sure I will also follow it from this Years. Because No body is perfect … We all are in same boat only the difference is some boat is deep water some boat at the sore.

So, Guys Wish you all a very very Happy New Year 2020 !!! Enjoy like king but with good heart…