24.3.17

Summary of differences between Java versions?

Java 8 (a.k.a 1.8)

Language changes:
  • lambda expressions (JSR 335, includes method handles)
  • continuation of Project Coin (small language improvements)
  • annotations on Java types
Library changes:

Java 7 (a.k.a 1.7)

Language changes:
Library changes:
Platform changes:

Java 6 (a.k.a 1.6)

Mostly incremental improvements to existing libraries, no new language features (except for the @Override snafu).

Java 5 (a.k.a 1.5)

Language Changes:
  • generics (that's the big one)
  • annotations
  • enum types
  • varargs, enhanced for loops (for-each)
Library changes:
  • concurrency utilities in java.util.concurrent

Java 1.4

Language changes:
Library changes:

Java 1.3

Mostly minor improvements, really.
Platform changes:
  • HotSpot JVM: improvement over the original JIT

Java 1.2

Language changes:
Library changes:
Platform changes
  • a real JIT, greatly improving speed

Java 1.1

Language changes:
  • inner classes
Library changes:
  • AWT event changes
  • JDBC, RMI
  • reflection

Java 1.0

Initial release, everything is new ;-)

11.3.17

How to create users in oracle Database ?

I have seen one Post on facebook in Oracle DB group that someone is asking, How to create user in oracle database. I know it's very silly question but it happens if you are new to Oracle. So I am only writing this post for those people how do not want to study the books. 

So here are the steps to create user in Oracle database. Theses steps will be same in 10g,11g and 12c. I will discuss two scenarios here :-

  1. create simple user 
  2. create user with attributes 

  1. Create simple user

Step1 :- You can connect to database with sysdba privileges. 

      e.g.  sql > conn / as sysdba 


Step2:- After connecting to sysdba, you need to use “CREATE USER” command to create new user. “ALTER USER”  is used to modify the properties of the users like password, profile etc. Please note that users name should be unique. You cannot create user wit the same name.

     e.g.  sql >  create user test identified by test;

Step 3:- With above command your database user created, But now you cannot connect to the database with this user, WHY? because you haven’t granted this user to connect to database and create the session. 
You need to grant your user as below:- 

e.g.  sql > grant create session to  test; 
       sql > grant connect to test; 

Now you can connect to the database by this user test. 
e.g. conn test/test@TNSNAME



  1. create user with attributes

creating user with attributes means you assign properties at the time of creation e.g. suppose we need to create a user and we need to specify its tablespace with quota and also want to assign a profile to this user. 

below is the example:-
sql> create user test identified by test default tablespace test temporary tablespace temp quota unlimited on test profile test;

This will create a user test with password test tablespace test and profile test. 

Keep Sharing :) 

What is JAVA ?

Java was originally developed by Sun Microsystems which and was initiated by James Gosling and released in 1995 as core component .
The latest version of the Java Standard Edition is Java SE 8. With the widespread popularity, multiple configurations were built to suit for various types of platforms. e.g.: J2EE for Enterprise Applications, J2ME for Mobile Applications.
There is new J2 versions were renamed as Java SE, Java EE, and Java ME respectively. As we know Java is guaranteed to be Write Once, Run Anywhere :).


So what is java? 

Java is a Technology :) Below are the features − 
  • Object Oriented − For Java and in JAVA everything is an Object. So ItJ can be easily extended because it is based on the Object model.
  • Platform Independent (WOW) − SO like many other programming languages like C and C++, when Java is compiled, it is not compiled into platform specific machine That's why its called Platform independent language, It is compiled into platform independent byte code. This code is distributed and interpreted by the Virtual Machine (JVM) .
  • Simple and Portable  − Actully Java is designed to be easy to learn to all that's the reason it's very famous among all. All you need to is to master the concepts of OOP Java.It's also very easily portable because it has no implementaion dependency. 
  • Secure Like anything −  Java is  secure and it's security feature  enables to develop a virus-free and temper free systems. 
  • Robust −  So Java Checks for the error on the compile time and also on runtime checking.

    Multithreaded − It means  with this feature of JAVA, You can write a code to perform multiple tasks at same time.  
  • High Performance − Java uses Just-In-Time compilers,So that automatically enables high performance.
  • Distributed − Java is mainly designed for the distributed environment of the internet.
  • Dynamic − Java more dynamic than C or C++.


    Keep Sharing :)

20.2.17

AD online patching in Oracle EBS R12.2

ADOP – Applications DBA Online Patching Tool 


Oracle introduced ADOP in Oracle E-Business R12.2 . This is a new patching mechanism (online patching) that allow the application of patches while your environment is up and running.You don't need to stop the application or put it on maintains mode as we use to do before. 

ADOP phases:

1) Prepare – This will prepare the instance for patch application.
2) Apply – This will apply patches .
3) Finalize – This will get ready the instance for cutover.
4) Cutover – This will make the patch edition the new run edition (fs1 to fs2).
5) Cleanup – This will drop obsolete objects and data from old editions.

Steps to apply patch on R12.2 using ADOP:

1) Download and unzip the patch

2) Read the readme carefully

3) run the environment as below in new cmd prompt.

$ source <run APPL_TOP path>/APPS<CONTEXT_NAME>.env

4) confirm the staus of adop by below command.

$ adop -status

5) start from first phase by Preparing the system for patching.

$ adop phase=prepare

6) NOw apply the patch to patch edition.

$ adop phase=apply patches=<patch number>,workers=<number_of_worker>
e.g adop phase=apply patches=1111,2222 workers=6

7) check for the logs and complete the rest of the phases as below:-

$ adop phase=finalize
$ adop phase=cutover
$ adop phase=cleanup

8) We have to Synchronize the file system, which copy the new run edition code and configuration to the patch file system.

$ adop phase=fs_clone


Note:- You can use in one go  "adop phase=prepare,apply,finalize,cutover,cleanup patches=<patch_number1>,<patch_number2>"

 Thanks ;)

10.2.17

ORA-04030: out of process memory when trying to allocate bytes (,)

 ORA-04030: out of process memory when trying to allocate  bytes (,)

In logs, We you see below error

>Instance terminated by CKPT, pid = 6172 with below errors in alert log . Other errors are found in log files are also listed below

1) ORA-04030: out of process memory when trying to allocate 4096 bytes (PLS non-lib hp,pdzdM80_Allocate_Block)
2) ORA-04030: out of process memory when trying to allocate 8148 bytes (kxs-heap-w,qesaQBInit:buffer)
3) ORA-04030: out of process memory when trying to allocate 16408 bytes (session heap,kxsFrame16kPage)
4) ORA-27300: OS system dependent operation:CreateThread failed with status: 8
5) ORA-27301: OS failure message: Not enough storage is available to process this command.
6) ORA-04030: out of process memory when trying to allocate  bytes (,)

Cause :- This may occurs if system is not having the enough memory to handle new jobs. In our case, system lacked the necessary resources to create another process. In Event logs, You can also see that system was unable to begin another thread.

Action :- Please check the virtual memory(Swap Memory) of the OS and set virtual memory to recommended memory or near to the value. You need outage to change this value as you have to  restart the DB server after changing this value.

20.1.17

How to reset the AdminServer Password in WebLogic 11g and 12c


In weblogic server which is very much in use now a days and promoted by oracle in every product. As a DBA its not easy that You forget your weblogic password. But Yes if you want to reset the password follow below easy five steps to reset the password :-


1. Stop the WebLogic server.

  You can stop weblogic sever by using "stopWebLogic.sh" or by killing the process. I recomnd to use "stopWebLogic.sh"

2.Delete directory data from mentioned location .

In Your DOMAIN_HOME, you can find the "data" folder at location servers->adminserver. You can delete or move to other name using mv or rm -rf.
Make sure Weblogic admin server is completly stoped.

3. run weblogic.security.utils.AdminAccount 

"weblogic.security.utils.AdminAccount" will reset the the password  for admin server . go to $DOMAIN_HOME->security
and run below command

$ java weblogic.security.utils.AdminAccount weblogic test .

By default username is weblogic and we setting password to test.

4. Update boot.properties

We have changed the password but we need to update boot.properties file becuase when adminserver will start it will read boot.properties file.
go to $DOMAIN_HOME -> servers ->AdminServer->security  and edit boot.properties with new username test and pssword test.shown below.

username=weblogic
password=test

5. Start the WebLogic domain.

go to $DOMAIN_HOME->bin and run startWebLogic.sh  to start the weblogic.

18.1.17

How to solve Oracle Intelligent Agent Executable encountered

How to solve Oracle Intelligent Agent Executable encountered


We have this error from Oracle 9i, and actually this is not a major issue, So you can avoid it. You may see this if you have changed hostname or IP of the database server.

Oracle Intelligent agent is a service, that is used to communicate between EM (enterprise manager ) and database.And if you are not using EM for databases than you can avoid it. While you have changed the IP or hostname, Oracle was up and running and agent tries shake hands between EM and Database but the communication channel was broken for that particular time. So you have this notification.

So for the solution, you can do one of the following :-

 1) If you are not using EM than You can disable the agent service from services.msc
                            Administrative Tasks>Services
2) Delete all files that end with q under below path and restart the agent on the line (found on internet) :-
                         $ORACLE_HOME/network/agent/ *q

 For me. I used solution 1 because we are not using EM for our databases.


 Keep troubleshooting and keep Sharing :)

16.1.17

Archiving Mode in Oracle Database 12c

How to change Archiving Mode in Oracle Database 12c ? 


This process is same for Oracle database  11g  and Oracle database 12C, . Means you can follow the below steps for 11g and 12C as well.

As we know to change the archiving mode in the 11g we use ALTER DATABASE statement. Same statement we use to change archive mode of your 12C database .

We also know that to do the same, we need to connect to the database with SYSDBA privileges.

Ok, let's change the archive mode. Please follow below steps:-

I have assumed that your DB is in NOARCHIVELOG mode. You can check the status of your database with below command. Please make sure you are connected with SYSDBA privileges.

SQL> conn sys@XXXXXX as sysdba
Enter password:XXXXXX
Connected.

Now you can run "archive log list;" to check your database. Below is output :-

SQL>  archive log list;
XXXXX            No Archive Mode
XXXXX          Disabled
XXXXX            USE_DB_RECOVERY_FILE_DEST
XXXXX     18001
XXXXX          18003

Database log mode showing that database is in No Archive Mode. :)

Please follow the below steps to put your 12C Database in archive log:-

1. Complete Shutdown your database instance. 


We cannot change mode of Database when it is up and running. So we need to stop the database 12c.

SQL> SHUTDOWN IMMEDIATE

The main point is you cannot change ARCHIVELOG to NOARCHIVELOG if any data files need media recovery. This is recomannded by Oracle.


2. Take Backup the database.


Although this step is recomended by Oracle, It is not nessesry. Taking backup before doing any changes to database is good practise. If you are new to Oracle
Please take backup of your database. Take cold backup of your DB i.e. copy everything to diffenet location. Easy but time taking process, again it depends on the size of your database.



3. Startup instance with mount option 

You need to startup the database again in mount mount. No need to open the database yet. BEcause we are going to change somoe parameters in the database.

SQL> STARTUP MOUNT


4. Change archiving mode

Now we can set the archiving mode for our 12C database. After that we need to open the database.

SQL> ALTER DATABASE ARCHIVELOG;

SQL> ALTER DATABASE OPEN;


5. Shut down the database. 

After changing the ARCHIVELOG in oracle database 12c you need to restart the database after taking the cold backup again.

SQL>SHUTDOWN IMMEDIATE


6. Back up the database

Take Cold backup of your oracle database 12c as control file information is also changed fro previous backup. Now you need to use this backup as your BASE backup.



7. Start the database 

After backup, just start the backup
SQL>STARTUP



Now your oracle database 12c is in ARCHIVELOG.

Keep ARCHIVING, Keep Posting :)

ORA-01722: invalid number

Causes for ORA-01722: invalid number?

ORA-01722 ("invalid number") error occurs when we try to convert a character string to a number & that cannot be converted into a valid number. As we know Valid numbers contain the digits '0' through '9'.There are many situations where this will occur with you.Like, Numeric column may be the object of an INSERT or an UPDATE statement. Or may be you have used numeric in part of where clause.Or if there is no numeric columns appear in the mentioned statement.

Examples : - 













How to fix it


You need to check expression which caused the problem for you.For the solution, Always keep in mind that this may be caused by the simple typo with query or in the program logic. In many cases, we found that this occurs due to bad data.

I will update this post again. I have copied this from other blog and after doing the practical, I will update with the solution. I am working on this blog.


Keep sharing :)

What is a Nagios ?

Nagios is open source  monitoring engine and very powerful tool that provides you with instant awareness of your organization’s mission-critical IT infrastructure.
In Other words, Nagios will help you to know about your infrastructure in a very detail way. It  allows you to detect and repair problems and mitigate future issues before they affect end-users and customers. For an example, If you are dealing with the hundreds of servers. And you want ease in life so this is perfect solution for you. It will help you know about your n/w failure or your H/w failure and many more.

Benefits of Nagios:-- 


Plan for infrastructure upgrades before outdated systems cause failures

Respond to issues at the first sign of a problem

Automatically fix problems when they are detected

Coordinate technical team responses

Ensure your organization’s SLAs are being met

Ensure IT infrastructure outages have a minimal effect on your organization’s bottom line

Monitor your entire infrastructure and business processes


How it Works:--


1) Monitoring : IT staff configure Nagios to monitor critical IT infrastructure components, including system metrics, network protocols, applications, services, servers, and network infrastructure.

2) Response : IT staff can acknowledge alerts and begin resolving outages and investigating security alerts immediately. Alerts can be escalated to different groups if alerts are not acknowledged in a timely manner.

3) Maintenance : Scheduled downtime prevents alerts during scheduled maintenance and upgrade windows.

4) Alerting : Nagios sends alerts when critical infrastructure components fail and recover, providing administrators with notice of important events. Alerts can be delivered via email, SMS, or custom script.

5) Reporting : Reports provide a historical record of outages, events, notifications, and alert response for later review. Availability reports help ensure your SLAs are being met.

6)Planning : Trending and capacity planning graphs and reports allow you to identify necessary infrastructure upgrades before failures occur.


Keep Sharing :)

13.1.17

DBA_SCHEDULER_JOB_RUN_DETAILS and PURGE_LOG

How to purge DBA_SCHEDULER_JOB_RUN_DETAILS?


Manually deleting from DBA_SCHEDULER_JOB_RUN_DETAILS is not recommended by oracle.DBA_SCHEDULER_JOB_RUN_DETAILS is a view that is using two master tables (scheduler$_job_run_details and scheduler$_event_log) and display the information about jobs history.

As there is one procedure named PURGE_LOG and Oracle have Scheduler for this procedure. It will purges all rows in the job log that are older than 30 days.This is the default behavior of this procedure. You can change this to any number of days you want by setting the attribute "SET_SCHEDULER_ATTRIBUTE". e.g.

exec DBMS_SCHEDULER.SET_SCHEDULER_ATTRIBUTE('log_history','15');

It will purge all logs older than 15days and it will maintain the history of 15days.

But If you want manually purge these logs, you can use below solution:-

exec DBMS_SCHEDULER.PURGE_LOG(log_history => 15, which_log => 'JOB_LOG');

It will purge all entries from the jog log that are older than fifteen days.

Keep posting :)

12.1.17

How to Change the Date and Time in Linux



It's very simple to change the time of liunx machines. Some times you need to change the time of your oracle database server that is running on Linux.

Just follow the below steps:-
1) type command "date"
 it will show you the current date and time.
2) now type below command:-
    date --set=" Thu Jan 12 15:04:32 HKT 2017 "

It will give you error some times but if you check the date again you will find the value that is changed by you.

11.1.17

How to find the date when a role was created?

The view DBA_ROLES doesn’t have the created date column to display when the role was created, but the information is stored in sys.user$ the underlying table. So using the following query one can find the date the role was created.

You need to SYSDBA role to get the information.
SQL> select name, to_char(ctime, ‘DD-MON-YYYY HH24:MI:SS’) from sys.user$ where name = ‘RESOURCE’;
NAME TO_CHAR(CTIME,’DD-MON-YYYYHH24:MI:SS’)
——– —————————————–
RESOURCE 11-JAN-2017 00:42:50