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