Change Collation in Netezza Server - collation

I am trying to sort a list of records in Netezza, but their sort order seems different from SQL server.
In Netezza, I get AZ ahead of Aaaaa.
In SQL Server, I get Aaaaa ahead of AZ.
My SQL server collation is SQL_Latin1_General_CP1_CS_AS.
My Netezza collation is Latin9 Unicode.
Is there a way to change my Netezza collation to match my SQL server?

To set the session for LATIN1, enter:
set nz_encoding=LATIN1
Netezza docs
PostgreSQL

Related

How to disable cross partitioning in query in Golang Mongo API for Cosmos DB

I am using the official mongo Golang SDK (https://github.com/mongodb/mongo-go-driver) to connect to Cosmos DB. I am looking for a way to disable the cross partition query. The other SDKs supported by Cosmos DB have this option.
Thanks
Guru
The only way to work with the MongoDB API of Cosmos DB is with a MongoDB-specific SDK, just like the one you're using for Go. And MongoDB-specific SDKs know nothing about Cosmos DB - they are designed specifically to work with MongoDB. This is why there is no obvious settings for performing/not-performing cross-partition queries. Only the Cosmos DB native SDKs will know anything about Cosmos DB specifics.
To target a particular partition in your container, using a MongoDB-specific driver, you would need to specify your container's partition key in your query (though MongoDB calls such a key a shard key).
You haven't provided any sample data, but... assuming you had a collection of companies and divisions, and "company" was your shard key, you could have a query that looks something like this:
db.divisions.find( { division: 'marketing', company: 'ABC Corp' })
Since the shard key is specified, this avoids a cross-partition query.

Doubts to create connection string with DB2

I would like to know if anyone has a connection string model with the DB2 database?
The database is located on a Linux Centos 7 server.
I tried something like this:
db2 Database=SI;Hostname=VMCENTDB2;Protocol=TCPIP;Port=3700;Uid=db2inst1;Pwd=password;
But it didn't work and the following message returned:
DB21034E The command was processed as an SQL statement because it was
not a valid Command Line Processor command. During SQL processing it
returned: SQL1024N A database connection does not exist.
SQLSTATE=08003
Thanks in advance.
Your command is not valid for the db2 command, because it does not accept connection strings. Other tools do.
If you want to connect to a Db2-database, from the shell command line you have different options provided by different tools:
use the db2 command (requires previous catalog actions to be completed)
use the CLPplus command (accepts a connection string)
use an odbc iterface like isql
use the db2cli tool (more suitable for experts and also requires pre-configuration of db2dsdriver.cfg and/or db2cli.ini).
Different options are suitable for different purposes, and different skill sets etc.
You can use the Db2 command line processor = the db2command, via use of db2 connect to $DATABASENAME user $USER using $PASSWD (you provide your own values for the variables). This does not accept connection strings. But before that connect command can succeed from remote, you must catalog the node on which the database lives (using the db2 catalog tcpip node .... remote ... server ... command), and then catalog the database on that node using the db2 catalog database $DBNAME as $DBALIAS at node $NODENAME command. Refer to the online Db2 Knowledge centre for details of these commands. This is the oldest form of shell interface to Db2 from MS-Windows, Linux or Unix and is very script friendly for cmd.exe or bash or ksh etc. But many people do not like the catalog actions that are pre-requisites for remote working, although are easily scriptable.
Note that if you ssh to the centos server and get a shell, then you do not need to catalog local databases, you can use connect to them with the db2 command as long as your login shell dots in the correct db2profile file.
You cannot use a connection string for the Db2-CLP (command line processor), but you can use a connection string in the java-based CLPPlus tool and thereby avoid the need to catalog. CLPlus is useful for people who are familiar with Oracle SQLPlus syntax and does not need any catalog actions.
The CLPPlus command comes with the Db2-server, and with the Db2 runtime client and with the Db2 data server client, but it does not come with the tiny footprint Db2 clidriver. Refer to the documentation for usage details.

Spark job to work in two different HDFS environments

I have a requirement, I need to write a spark job to connect in Prod(Source-Hive)Server A
and get the data into Local(Temp hive server) do the transform and load it back into TargetProd(Server B)
In earlier cases, we have our Target DB as Oracle, so we use to give like below, which will overwrite the table
AAA.write.format("jdbc").option("url", "jdbc:oracle:thin:#//uuuuuuu:0000/gsahgjj.yyy.com").option("dbtable", "TeST.try_hty").option("user", "aaaaa").option("password", "dsfdss").option("Truncate","true").mode("Overwrite").save().
In terms of SPARK overwrite from Server A to B, what should be syntax we need to give.
when I try to establish the connection through jdbc from one hive(ServerA) to Server B. It is not working.. please help.
You can connect to hive by using jdbc if it’s a remote one. Please get your hive thrift server url and port details and connect via jdbc. It should work.

Apache Cassandra 3.10 : CQL query to check remote application connections in Cassandra DB

I want to know if there is a cqlsh query to check remote application connections in Cassandra DB, just like V$session in oracle, or processlists in mysql.
I don't think there is a cqlsh query to do that, but you can use cassandra java-diver to do a manual pooling. This link: http://docs.datastax.com/en/developer/java-driver/3.0/manual/pooling/#monitoring-and-tuning-the-pool, gives a simple example that will print the number of open connections, active requests, and maximum capacity for each host, every 5 seconds.

Amazon RDS SQL Server set timezone at database level

We recently moved the database to Amazon RDS SQL Server. We have some difficulties with the date times (timezone). By default RDS provides UTC date. Is there any way to overwrite / manipulate the local timezone at database level in SQL Server. Please help me on this.
Thanks in advance,
SqlLover
https://forums.aws.amazon.com/thread.jspa?messageID=161339
The time zone is currently not modifiable. There is indeed a Parameter value in rds-describe-db-parameters called "default_time_zone" but it's marked as not modifiable.

Resources