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 😊