Sunday 8 March 2020

joxcsys: release mismatch 12.1.0.2.0 1.6 in database (classes.bin) vs 12.1.0.2.191015 1.6 in executable

joxcsys: release mismatch 12.1.0.2.0 1.6 in database (classes.bin) vs 12.1.0.2.191015 1.6 in executable

Observed multiple errors in one of the development database.



Solution :

[oracle@devoracledb ~]$ sqlplus / as sysdba


SQL*Plus: Release 12.1.0.2.0 Production on Sun Mar 8 11:18:02 2020

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SYS on 08-MAR-20 @ db_UAT2 > select dbms_java.get_jdk_version() from dual;

select dbms_java.get_jdk_version() from dual
                                        *
ERROR at line 1:
ORA-29548: Java system class reported: release of Java system classes in the
database (12.1.0.2.0 1.6) does not match that of the oracle executable
(12.1.0.2.191015 1.6)


SYS on 08-MAR-20 @ db_UAT2 > @?/javavm/install/update_javavm_db.sql
SYS on 08-MAR-20 @ db_UAT2 > SET FEEDBACK 1
SYS on 08-MAR-20 @ db_UAT2 > SET NUMWIDTH 10
SYS on 08-MAR-20 @ db_UAT2 > SET LINESIZE 80
SYS on 08-MAR-20 @ db_UAT2 > SET TRIMSPOOL ON
SYS on 08-MAR-20 @ db_UAT2 > SET TAB OFF
SYS on 08-MAR-20 @ db_UAT2 > SET PAGESIZE 100
SYS on 08-MAR-20 @ db_UAT2 >
SYS on 08-MAR-20 @ db_UAT2 > alter session set "_ORACLE_SCRIPT"=true;

Session altered.

SYS on 08-MAR-20 @ db_UAT2 >
SYS on 08-MAR-20 @ db_UAT2 > -- If Java is installed, do CJS.
SYS on 08-MAR-20 @ db_UAT2 >
SYS on 08-MAR-20 @ db_UAT2 > -- If CJS can deal with the SROs inconsistent with the new JDK,
SYS on 08-MAR-20 @ db_UAT2 > -- the drop_sros() call here can be removed.
SYS on 08-MAR-20 @ db_UAT2 > call initjvmaux.drop_sros();

Call completed.

SYS on 08-MAR-20 @ db_UAT2 >
SYS on 08-MAR-20 @ db_UAT2 > create or replace java system;
  2  /



Java created.

SYS on 08-MAR-20 @ db_UAT2 >
SYS on 08-MAR-20 @ db_UAT2 > update dependency$
  2    set p_timestamp=(select stime from obj$ where obj#=p_obj#)
  3    where (select stime from obj$ where obj#=p_obj#)!=p_timestamp and
  4          (select type# from obj$ where obj#=p_obj#)=29  and
  5          (select owner# from obj$ where obj#=p_obj#)=0;

0 rows updated.

SYS on 08-MAR-20 @ db_UAT2 >
SYS on 08-MAR-20 @ db_UAT2 > commit;

Commit complete.

SYS on 08-MAR-20 @ db_UAT2 >
SYS on 08-MAR-20 @ db_UAT2 > alter session set "_ORACLE_SCRIPT"=false;

Session altered.

SYS on 08-MAR-20 @ db_UAT2 >
SYS on 08-MAR-20 @ db_UAT2 > SYS on 08-MAR-20 @ db_UAT2 > SYS on 08-MAR-20 @ db_UAT2 >
SYS on 08-MAR-20 @ db_UAT2 >
SYS on 08-MAR-20 @ db_UAT2 > ---- VERIFIED 

SYS on 08-MAR-20 @ db_UAT2 > select dbms_java.get_jdk_version() from dual;

DBMS_JAVA.GET_JDK_VERSION()
-------------------------------------------------------------
1.6.0_211

1 row selected.

SYS on 08-MAR-20 @ db_UAT2 > 

Monday 17 February 2020

ORA-12012: error on auto execute of job ORA-12008: error in materialized view refresh path ORA-01722: invalid number

Errors in file /u01/app/oracle/diag/rdbms/db/db/trace/db_j000_31458.trc:
ORA-12012: error on auto execute of job 111816
ORA-12008: error in materialized view refresh path
ORA-01722: invalid number
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2821
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 3058
ORA-06512: at "SYS.DBMS_IREFRESH", line 687
ORA-06512: at "SYS.DBMS_REFRESH", line 195
ORA-06512: at line 1


Approach :

select job, schema_user, what from dba_jobs where job='111816';

  JOB SCHEMA_USER WHAT
111816 DB_PROD      dbms_refresh.refresh('"DB_PROD"."MV_CUST"');



Open the above mentioned materialized view "MV_CUST", in select query, one of the condition getting failed with "INVALID NUMBER". By digging down, found that, in one column having (its datatype VARCHAR) instead of number there was CHARACTER and this row getting compared with number. 







Monday 10 February 2020

Offline installation of SQL Server 2017 on Linux

Offline installation of SQL Server 2017 on Linux::


1) Meet the pre-requisites 

2) Download the rpm package for the SQL Server database engine. You can download the required rpm packages from the release note (https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-release-notes?view=sql-server-ver15) or from Microsoft Repositories.

3) Create a directory for SQLINSTALL & Copy the downloaded rpm to the Linux machine using WinSCP.

4) # systemctl status mssql-server






5) Go ahead with rpm installation













6) Complete installation by executing below command & selected Evaluation pack & enter admin password.

# sudo /opt/mssql/bin/mssql-conf setup



7) Check the services :










8) Now you can connect to DB through the SSMS tool.





Sunday 2 February 2020

MySQL to Oracle Characterset Problem -- Solved




In our environment, one of the Oracle production DB fetches MySQL DB data for reporting purposes. Recently application team reported that they are getting data WITH SPACE in between. 



DOC REF    REFNO REMARKS
R C R A 1 0 1 2 0  R E C E I P T    
R C R A 1 0 1 2 0  D E P O S I T    




Solution:

1. Check Character set of MySQL database.


mysql> show variables like "character_set_database";
+------------------------+--------+
| Variable_name          | Value  |
+------------------------+--------+
| character_set_database | latin1 |
+------------------------+--------+
1 row in set (0.00 sec)


2. Insert below line in odbc.ini file



set LD_LIBRARY_PATH=/usr/lib64/lib
Description     = MySQL Production database
Trace       = ON
TraceFile   = /tmp/stderr
SERVER      = 10.xx.XX.XX
USER        = root
PASSWORD    = XXXX
PORT        = 3306
DATABASE    = MYSQLPROD
Driver=/home/oracle/oracleTOmysql/lib/libmyodbc8w.so
CHARSET = latin1


3. Fetch the data again from oracle DB. Now getting proper data from MySQL.

DOCREF   REFNOREMARKS
RCRA10120 RECEIPT    
RCRA10120 DEPOSIT





Hope this will help 😊

Thursday 23 January 2020

How to take MS SQL server DB backup on network mapped drive

How to take MS SQL server DB backup on network mapped drive::



EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO

EXEC sp_configure 'xp_cmdshell',1
GO
RECONFIGURE
GO



The syntax of this command is:
NULL
NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
        [/USER:[domainname\]username]
        [/USER:[dotted domain name\]username]
        [/USER:[username@dotted domain name]
        [/SMARTCARD]
        [/SAVECRED]
        [[/DELETE] | [/PERSISTENT:{YES | NO}]]
NULL
NET USE {devicename | *} [password | *] /HOME
NULL
NET USE [/PERSISTENT:{YES | NO}]
NULL
NULL




EXEC XP_CMDSHELL 'net use H: \\xx.xx.xx.xx\bkp\ /user:<domain>\<username> <password> '

EXEC XP_CMDSHELL 'Dir H:'


Now you can able to see H: drive in the backup window.



To Delete the Mapped Drive::

EXEC XP_CMDSHELL 'net use H: /delete'  

Wednesday 22 January 2020

I/O is frozen on database . No user action is required. However, if I/O is not resumed promptly, you could cancel the backup.

Error: 

I/O is frozen on database <database>. No user action is required. However, if I/O is not resumed promptly, you could cancel the backup.

I/O was resumed on database <database>. No user action is required.



DB Version: MS SQL Server 2016 SP2.

Scenario:

Every day we have observed the above error in one of our production database. When I retrieved the backup history of a database, the specific backups are created every 6 hours of interval of time. At that time all the application jobs got suspended for time being. This was a daily complaint we received from application team. 

First, it starts with an I/O freeze message on all databases at the same time.
I/O is frozen on database <database>. No user action is required. However, if I/O is not resumed promptly, you could cancel the backup.

Then, after 5 seconds I/O is resumed on all databases.I/O was resumed on database <database>. No user action is required.


This error was due to VEEAM backup. As our whole infra backup taken through VEEAM. This has been scheduled for every 6 hours and had removed the schedule during business hours.






MS SQL Server 2016, Log shipping stopped due to LSN chain break [TYPE=DISK: {'NUL'}]

In our production database have configured Log shipping. One day Log shipping stopped and found the below message in a log file.


Log was backed up. Database: model, creation date(time): 2003/04/08(09:13:36), first LSN: 42:3512:1, last LSN: 42:3632:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'NUL'}). This is an informational message only. No user action is required.


It was a strange phenomenon as "DISK: NUL found in error message. Since our whole infrastructure under VEEAM backup and after digging into it, I found that "VEEAM -Application-Aware Processing" feature, which creates transactionally consistent backups of MS SQL Server.

As soon as we disabled this feature and log shipping running smoothly.

Hope this will help :)

Error: 17836, Severity: 20, State: 17. Length specified in network packet payload did not match number of bytes read; the connection has been closed.

Logon Error: 17836, Severity: 20, State: 17. 

Message : 
Length specified in network packet payload did not match number of bytes read; the connection has been closed. Please contact the vendor of the client library. [CLIENT: xx.xx.xx.xx]


Since the SQL Server has Event ID 17836 logged. It is more like an authentication issue.

The error message depicts that there is some process trying to connect at SQL port but it is not a valid SQL related activity.

Here are few more causes based on my search on the internet:
1. Network team doing Port Scanning
2. Sometimes Antivirus programs do check the port.
3. MSSQL Server is under a DDoS


In our case, I have captured and analyze incoming traffic & bad packets with "Wireshark" tool and "netstat -na" output and from these logs found "GFI-Languard" tool which scan, detect, assess, windows patches & security update/vulnerabilities on the server. 

Hope this will help :)