Howto determine the Oracle client version number using VBA? - oracle

Does anyone know how to get the currently used Oracle client version number using VBA?
(And the info "32bit" or "64bit" Client.)
If so, could you please post example code?
Thanks much in advance.
1) the connection to Oracle is OK
2) connection via ADO and the MS Driver
3) the connection object properties are showing a lot of information abaout the driver, the connection and the database. But no info about the oracle client:
Asynchable Abort: FALSE
Asynchable Commit: FALSE
Pass By Ref Accessors: TRUE
Catalog Location: 2
Catalog Term: Datenbankverknüpfung
Catalog Usage: 1
Column Definition: 1
NULL Concatenation Behavior: 2
Connection Statu:s 1
Data Source Name: BASE
Read-Only Data Source: FALSE
DBMS Name: Oracle
DBMS Version: 09.02.0000 Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
Data Source Object Threading Model: 1
GROUP BY Support: 4
Heterogeneous Table Support: 1
Identifier Case Sensitivity: 1
Maximum Index Size: 0
Maximum Open Chapters: 0
Maximum Row Size: 0
Maximum Row Size Includes BLOB: TRUE
Maximum Tables in SELECT: 0
Multiple Parameter Sets: TRUE
Multiple Results: 0
Multiple Storage Objects: FALSE
Multi-Table Update: FALSE
NULL Collation Order: 2
OLE Object Support: 1
ORDER BY Columns in Select List: FALSE
Output Parameter Availability: 2
Persistent ID Type: 4
Prepare Abort Behavior: 2
Prepare Commit Behavior: 2
Procedure Term: PL/SQL - Gespeicherte Prozedur
Provider Friendly Name: Microsoft OLE DB Provider für Oracle
Provider Name: MSDAORA.DLL
OLE DB Version: 2
Provider Version: 02.81.1132.0
Quoted Identifier Sensitivity: 4
Rowset Conversions on Command: TRUE
Schema Term: Besitzer
Schema Usage: 15
SQL Support: 267
Structured Storage: 1
Subquery Support: 31
Transaction DDL: 2
Isolation Levels: 1052672
Isolation Retention: 0
Table Term: Tabelle
User Name: REPORT
Table Statistics Support: 3
Open Rowset Support: 8
Password: b_rep
User ID: report
Data Source: BASE
Window Handle:
Locale Identifier: 1031
OLE DB Services: -7
Prompt: 4
Extended Properties:
Autocommit Isolation Levels: 4096

I don't know if it is possible in VBA but in VB.NET you can do it like this:
Dim con As System.Data.OleDb.OleDbConnection
Dim architecture As String
architecture = System.Reflection.AssemblyName.GetAssemblyName(con.GetType.Assembly.Location).ProcessorArchitecture.ToString
Console.WriteLine("Architecture: " & architecture)
Console.WriteLine("Assembly: " & con.GetType.Assembly.FullName)

Related

Saltstack user.present does not set uid while creating the user

My goal is to have a user with a given uid. I try to have a simple user created with the very basic state:
Add Student:
user.present:
- name: Student
- uid: 333123123123
- allow_uid_change: True
333123123123 is just some dummy value. I'd like something more meanigful later, but this is what I use for testing.
This creates the user perfectly fine, but with generated uid:
ID: Add Student
Function: user.present
Name: Student
Result: True
Comment: New user Student created
Started: 19:47:33.543457
Duration: 203.157 ms
Changes:
----------
account_disabled:
False
account_locked:
False
active:
True
comment:
description:
disallow_change_password:
False
expiration_date:
2106-02-07 07:28:15
expired:
True
failed_logon_attempts:
0
fullname:
Student
gid:
groups:
home:
homedrive:
last_logon:
Never
logonscript:
name:
Student
passwd:
None
password_changed:
2022-02-21 19:47:33
password_never_expires:
False
profile:
None
successful_logon_attempts:
0
uid:
S-1-5-21-3207633127-2685365797-3805984769-1043
Summary
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
Total run time: 203.157 ms
Now, if I try running state.apply again, I get the following message:
ID: Add Student
Function: user.present
Name: Student
Result: False
Comment: Encountered error checking for needed changes. Additional info follows:
- Changing uid (S-1-5-21-3207633127-2685365797-3805984769-1043 -> 333123123123) not permitted, set allow_uid_change to True to force this change. Note that this will not change file ownership.
Started: 19:47:45.503643
Duration: 7000.025 ms
Changes:
Summary
------------
Succeeded: 0
Failed: 1
------------
Total states run: 1
Total run time: 7.000 s
So it IS being considered, checked and verified - but not working while creating the user. The syntax seems to be confirmed. Why is it not getting applied upon creating the user?
It is possible to change a user's SID, but it requires unsupported registry hacking. Creating a new user with a specific SID would be even harder. Salt won't do that.
If you need to know the SID of a Windows user, you have to create it first and then query it. If you need it in a following state in the same run, then you can use slots.

How do I transfer data from one oracle database to another oracle database with airflow

i'm trying to transfer data from one oracle_db1.table1 to another oracle_db2.table1. I've already installed the backport-provider: https://pypi.org/project/apache-airflow-backport-providers-oracle/.
Import works fine now. But trying first tasks i get this error. I think it's something about the connection:
Here the error log
[2020-08-18 12:30:15,485] {logging_mixin.py:112} INFO -
[2020-08-18 12:30:15,485] {base_hook.py:84}
INFO - Using connection to: id: DB1234.
Host: 192.168.50.123:1521/testserver, Port: 1521, Schema: blup, Login: blup, Password: xxXXX, extra: None
[2020-08-18 12:30:15,485] {logging_mixin.py:112} INFO -
[2020-08-18 12:30:15,485] {connection.py:342} ERROR - Expecting value: line 1 column 1 (char 0).
And here is my example DAG Task:
T3 = OracleToOracleOperator(
task_id="insert_data_to_db",
oracle_destination_conn_id= "BCDEFG",
destination_table= "BCDEFG.TEST_BENUTZER3",
oracle_source_conn_id= "DESTINATION_DB",
source_sql= """
SELECT * FROM DESTINATION_DB.BENUTZER
""",
source_sql_params=None,
rows_chunk=5000
)
Thanx in advance
problem with the connection. There were inputs in "extra". I deleted them. then it works

How to insert UUID in Tarantool using go-tarantool?

Tarantool now has a built-in type UUID.
How to insert a record and pass this field using https://github.com/tarantool/go-tarantool?
For now I have this:
Tuple field 1 type does not match one required by operation: expected uuid (0x17)
when trying to insert UUID as a string
"github.com/satori/go.uuid"
...
var (
Tarantool *tarantool.Connection
)
...
Tarantool.Insert("log", []interface{}{
uuid.NewV4().String(),
...
Index:
index:
0: &0
unique: true
parts:
- type: uuid
is_nullable: false
fieldno: 1
id: 0
space_id: 513
type: HASH
name: primary
primary: *0
it is a fresh feature that is not supported in official go driver. You may track implementation progress and open discussions here

How to find the fault column from an oracle error ORA-12704

I support a product that uses an oracle database. One of our queries is creating an error "ORA-12704: character set mismatch error".
I asked their dba to look at the oracle logs and he tells me he cannot identify the column and that the only thing he can find in the oracle logs is this:
Trace file /opt/oracle/oradata/PRESC/diag/rdbms/presc_s_v1/PRESC/trace/PRESC_ora_123128.trc
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning and Real Application Testing options
ORACLE_HOME = /opt/oracle/product/12.1.0/dbhome_1
System name: Linux
Node name: ******
Release: 3.10.0-514.2.2.el7.x86_64
Version: #1 SMP Tue Dec 6 23:06:41 UTC 2016
Machine: x86_64
Instance name: PRESC
Redo thread mounted by this instance: 1
Oracle process number: 64
Unix process pid: 123128, image: oracle#******
*** 2019-05-15 13:54:23.960
*** SESSION ID:(83.13298) 2019-05-15 13:54:23.960
*** CLIENT ID:() 2019-05-15 13:54:23.960
*** SERVICE NAME:(SYS$USERS) 2019-05-15 13:54:23.960
*** MODULE NAME:(mtxagent#****** (TNS V1-V3)) 2019-05-15 13:54:23.960
*** CLIENT DRIVER:() 2019-05-15 13:54:23.960
*** ACTION NAME:() 2019-05-15 13:54:23.960
ORA-12704(1): dty=1 typ=0 flg=00000000 xfl=000A0000 bfl=128 bfc=64 csfm=2 csid=2000
ORA-12704(2): dty=1 typ=3 flg=00030300 xfl=00000100 bfl=0 bfc=0 csfm=1 csid=31 styp=0
This is the error we get in our product logs:
24/04/2019 15:59:12 Vision64Database ERR [46975217760576] SQL Error: ORA-12704: character set mismatch
24/04/2019 15:59:12 Vision64Database ERR [46975217760576] Query: SELECT a.ApplicationName, a.ApplicationVersion, COUNT (a.ApplicationName) FROM Applications a INNER JOIN SoftwareInventory s ON ((s.Version IS NULL) AND (a.ApplicationVersion = '') AND (a.ApplicationName = Name)) GROUP BY a.ApplicationName, a.ApplicationVersion UNION SELECT /*+ dynamic_sampling(11) */ a.ApplicationName, a.ApplicationVersion, COUNT (a.ApplicationName) FROM Applications a INNER JOIN SoftwareInventory s ON ((s.Version IS NOT NULL) AND (a.ApplicationVersion = s.Version) AND (a.ApplicationName = CONCAT (CONCAT (Name, ' '), Version))) GROUP BY a.ApplicationName, a.ApplicationVersion
Offending SQL Query suitably formatted (does not add information !):
SELECT a.ApplicationName
, a.ApplicationVersion
, COUNT (a.ApplicationName)
FROM Applications a
INNER JOIN SoftwareInventory s
ON ((s.Version IS NULL)
AND (a.ApplicationVersion = '')
AND (a.ApplicationName = Name))
GROUP BY a.ApplicationName
, a.ApplicationVersion
UNION
SELECT /*+ dynamic_sampling(11) */
a.ApplicationName
, a.ApplicationVersion
, COUNT (a.ApplicationName)
FROM Applications a
INNER JOIN SoftwareInventory s
ON ((s.Version IS NOT NULL)
AND (a.ApplicationVersion = s.Version)
AND (a.ApplicationName = CONCAT (CONCAT (Name, ' '), Version)))
GROUP BY a.ApplicationName
, a.ApplicationVersion
;
I will most likely find the faulty column name by hand but it's going to be a hastle, and I'd like to find a way to get it from the oracle logs for the next times it happens with any query.
Any hint someone?

Eclispe Milo handle missing Sever Nonce in ActivateSessionRequest

I use Eclipse Milo (0.2.3) in my prject for OPC UA communication. The OPC UA participants are a client (written using Eclipse Milo) and a server, which is running on a remote machine, and is not implemented using Milo).
I can connect the client to the server normally and if the remote server is shut down, I am able to reconnect the client automatically, as soon as the server is accessible again.
However, after updating the server software, the client can't reconnect any more and it floods the server with the following messages:
Create Session Request
The server is able to create a session
Activate Session Request
The server sends an Activate Session Response, in which the ServerNonce is missing and the service result is "bad"
This causes the client to send a new Create Session Request. This all happens multiple times within a second, which makes it impossible for the server to execute any other tasks then trying to create this session.
Are there any settings in Milo to specify the reconnection delay? Or is there any setting for sepcifying what should happen when receiving an empty ServerNonce?
The server's responses are as follows:
If the session can be activated:
OpcUa Binary Protocol
Message Type: MSG
Chunk Type: F
Message Size: 96
SecureChannelId: 1599759116
Security Token Id: 1
Security Sequence Number: 53
Security RequestId: 3
OpcUa Service : Encodeable Object
TypeId : ExpandedNodeId
NodeId EncodingMask: Four byte encoded Numeric (0x01)
NodeId Namespace Index: 0
NodeId Identifier Numeric: ActivateSessionResponse (470)
ActivateSessionResponse
ResponseHeader: ResponseHeader
Timestamp: Nov 16, 2018 14:05:47.974000000
RequestHandle: 1
ServiceResult: 0x00000000 [Good]
ServiceDiagnostics: DiagnosticInfo
EncodingMask: 0x00
.... ...0 = has symbolic id: False
.... ..0. = has namespace: False
.... .0.. = has localizedtext: False
.... 0... = has locale: False
...0 .... = has additional info: False
..0. .... = has inner statuscode: False
.0.. .... = has inner diagnostic info: False
StringTable: Array of String
ArraySize: 0
AdditionalHeader: ExtensionObject
TypeId: ExpandedNodeId
EncodingMask: 0x00
ServerNonce: ab...
Results: Array of StatusCode
ArraySize: 0
DiagnosticInfos: Array of DiagnosticInfo
ArraySize: 0
If the session can't be activated (after updating the server's software):
OpcUa Binary Protocol
Message Type: MSG
Chunk Type: F
Message Size: 64
SecureChannelId: 1599759041
Security Token Id: 1
Security Sequence Number: 61
Security RequestId: 11
OpcUa Service : Encodeable Object
TypeId : ExpandedNodeId
ActivateSessionResponse
ResponseHeader: ResponseHeader
Timestamp: Nov 16, 2018 12:49:08.235000000
RequestHandle: 222
ServiceResult: 0x80000000 [Bad]
ServiceDiagnostics: DiagnosticInfo
EncodingMask: 0x00
.... ...0 = has symbolic id: False
.... ..0. = has namespace: False
.... .0.. = has localizedtext: False
.... 0... = has locale: False
...0 .... = has additional info: False
..0. .... = has inner statuscode: False
.0.. .... = has inner diagnostic info: False
StringTable: Array of String
ArraySize: 0
AdditionalHeader: ExtensionObject
TypeId: ExpandedNodeId
EncodingMask: 0x00
ServerNonce: <MISSING>[OpcUa Null ByteString]
Results: Array of StatusCode
ArraySize: 0
DiagnosticInfos: Array of DiagnosticInfo
ArraySize: 0
Thank you in advance for your help.
This corner case you described where there's no delay between a failed re-activation and the subsequent re-creation is addressed on the dev/0.3 branch in this commit.
I might be able to back port it to 0.2.x next week if I have some spare time.
I don't think there are any workarounds you can use.

Resources