Adding Database in MariaDB on Swisscom Cloud - mariadb

Is it possible to CREATE DATABASE in MariaDB on the Swisscom Cloud? I know I can do this on Amazon RDS, but I'm not sure if this is possible on the Swisscom Cloud. If not: it would be an important feature to add.

Sorry this is not possible. You receive database space on a shared Galera Cluster (MariaDB) where you are granted all privileges in your own database.
Galera Cluster for MySQL is a true Multimaster Cluster based on
synchronous replication. Galera Cluster is an easy-to-use,
high-availability solution, which provides high system uptime, no data
loss and scalability for future growth.
> SHOW GRANTS FOR CURRENT_USER();
+----------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for 2RQGCnSeAmJTWYwX#% |
+----------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO '2RQGCnSeAmJTWYwX'#'%' IDENTIFIED BY PASSWORD '$HASH' WITH MAX_USER_CONNECTIONS 10 |
| GRANT ALL PRIVILEGES ON `CF_32FD02B6_9B18_473D_A4D8_C84E19EC6F2C`.* TO '2RQGCnSeAmJTWYwX'#'%' |
+----------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.01 sec)
Here the error (Access denied) when creating a new database
MariaDB [CF_32FD02B6_9B18_473D_A4D8_C84E19EC6F2C]> create database rokfor;
ERROR 1044 (42000): Access denied for user '2RQGCnSeAmJTWYwX'#'%' to database 'rokfor'
Please subscribe to our newsletter for new feature announcements.

rokfor - would it be possible for you to share a little bit more insights, why you need to create your own database? (behind the scenes on each service creation of a mariadb service, you get your an own database.)
Thanks a lot!

#rokfor:
We have some substantial improvements planned in roadmap for MariaDB in Q3/Q4.
The possibility of adding new Schema/DB is not of them ... but we have some other features in the pipeline that I believe will eliminate the whole need for such feature. Can you, please, share with us why would you need such feature to confirm our assumptions? TIA!
Stay up to date with Application Cloud News via newsletter or our news page:
https://developer.swisscom.com/news
Michal Maczka
Product Manager Swisscom Application Cloud

Related

Is it possible to setup MYSQL replication with binlog files generated from server A (which we are considering as Master) to server B

We are migrating from the Magento community to Magento cloud for one of our projects and we need to access DB for our custom developed CRM.
But unfortunately magento cloud does not support DB replication and they have enabled binlogs and they are not supporting for creating replication user and server id setup, The binlog files can be synced to our CRM server periodically.
Now we want to know whether we can use the binlog files to replicate the database or is there any workaround for doing the same?
We have tried using tunnel setup but the query execution time is more while using tunnel setup which will affect our CRM performance badly.
Also we need to reconfirm whether there are any other possibilities we can try to access the Magento Cloud DB in our CRM without performance lag.
Thanks in advance for your suggestions.
Yes, it is possible, but it may be a little fiddly in the setup you are describing. You can replay the binlogs as relay logs. Have a look at this article for more details:
https://lefred.be/content/howto-make-mysql-point-in-time-recovery-faster/
Specifically, these parts are relevant (you'll need to edit them appropriately):
[root#mysql1 mysql]# for i in $(ls /tmp/binlogs/*.0*)
do
ext=$(echo $i | cut -d'.' -f2);
cp $i mysql1-relay-bin.$ext;
done
[root#mysql1 mysql]# ls ./mysql1-relay-bin.0* >mysql1-relay-bin.index

create cluster for existing mariadb database

I have an existing database for which i was looking to create a new clustered environment. I tried the following steps:
Create a new database instance (OS & DB Server).
Take a backup / snapshot from existing database server for all the databases.
Import the snapshot to the new server.
Configure the cluster - referred to various sites but all giving same solution. Example reference site - https://vexxhost.com/resources/tutorials/how-to-configure-a-galera-cluster-with-mariadb-on-ubuntu-12-04/
Ran the command (sudo galera_new_cluster) on the primary server. (Primary server - no issue starting up). But when we tried starting the secondary server - it actually crashed for some reason.
Unfortunately at this point, dont have the logs stored / backed up with me where it failed. But it seemed like it tried to sync in with the primary server - had some failure with that.
As for additional part of the actions performed above. Both the server with same username / password - created a passwordless ssh connection between both the machines. Also, the method of syncing is set to rsync.
Am i missing something or doing it wrong? Is there a better way available on it?

You have to be logged in and not anonymous to perform this request in cassandra even though I access it with cassandra userid

This is Cassandra 2.1.13 day2 for me.
I've been through 10 min. cassandra tutorial at http://www.planetcassandra.org/try-cassandra/ on my local machine.
% cqlsh -u cassandra -p cassandra
% // create demo keyspace
% // create users table
% //insert a couple of row in the users table
Now I have a problem as you see below.
cassandra#cqlsh:demo> list users;
Unauthorized: code=2100 [Unauthorized] message="You have to be logged in and not anonymous to perform this request"
I accessed to cassandra with username cassdanra, why this message came up?
Do I need to set up something else?
This message comes up if you also have in your cassandra.yaml config settings, authenticator: AllowAllAuthenticator. Even though you're logging in as user cassandra, when you have AllowAllAuthenticator it is effectively allowing all users and therefore does not check if you have logged in. To overcome this message, you should change the setting to authenticator: PasswordAuthenticator and then restart cassandra.

How to create a small and simple database using Oracle 11 g and SQL Developer?

How to create a small and simple database using Oracle 11 g and SQL Developer ?
I am seeing too many errors and I cannot find any way to make a simple database.
For example
create database company;
Caused the following error:
Error starting at line 1 in command:
create database company
Error at Command Line:1 Column:0
Error report:
SQL Error: ORA-01501: CREATE DATABASE failed
ORA-01100: database already mounted
01501. 00000 - "CREATE DATABASE failed"
*Cause: An error occurred during create database
*Action: See accompanying errors.
EDIT-
This is completely different from MySQL and MS-SQL that I am familiar with.
Not as intuitive as I was expecting.
First off, what Oracle calls a "database" is generally different than what most other database products call a "database". A "database" in MySQL or SQL Server is much closer to what Oracle calls a "schema" which is the set of objects owned by a particular user. In Oracle, you would generally only have one database per server (a large server might have a handful of databases on it) where each database has many different schemas. If you are using the express edition of Oracle, you are only allowed to have 1 database per server. If you are connected to Oracle via SQL Developer, that indicates that you already have the Oracle database created.
Assuming that you really want to create a schema, not a database (using Oracle terminology), you would create the user
CREATE USER company
IDENTIFIED BY <<password>>
DEFAULT TABLESPACE <<tablespace to use for objects by default>>
TEMPORARY TABLESPACE <<temporary tablespace to use>>
You would then assign the user whatever privileges you wanted
GRANT CREATE SESSION TO company;
GRANT CREATE TABLE TO company;
GRANT CREATE VIEW TO company;
...
Once that is done, you can connect to the (existing) database as COMPANY and create objects in the COMPANY schema.
Actually the answer from Justin above could not be more incorrect. SQL Server and MySQL are for smallish databases. Oracle is for large enterprise databases, thus the difference in it's structure. And it is common to have more than one Oracle database on a server provided that the server is robust enough to handle the load. If you received the error posted above then you obviously are trying to create a new Oracle database and if you are doing that then you probably already understand the structure of an Oracle database. The likely scenario is that you attempted to create a database using dbca, it initially failed, but the binaries were created. You then adjusted your initial parameters and re-tried creating the database using dbca. However, the utility sees the binaries and folder structure for the database that you are creating so it thinks that the database already exists but is not mounted. Dropping the database and removing the binaries and folders as well as any other cleanup of the initial attempt should be done first, then try again.
From your question description, I think you were to create a database schema, not a database instance. In Oracle terminology, a database instance is a set of files in the file system. It's more like data files in MySQL. Whereas database in MySQL is somewhat equivalent to Oracle's schema.
To create a schema in Oracle: https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_6014.htm
To create a database instance in Oracle (I personally prefer CDBA):
https://docs.oracle.com/cd/E11882_01/server.112/e25494/create.htm#ADMIN11068
Notice the Oracle Express edition does not support mounting more than one database instance at one time.

Can I solve this using oracle db listener?

Try to be more clear, I'm in lack of ideas in this problem, even it sounds like a classic.
My application is running on weblogic 10.3.3 application server, and for database I am using Oracle database 11g. My problem is that there is table in db, let's say "user.", there is column, let's say "columnA", in this table. This table is updating by some module of application.
What I want if when value of column is "abc.", then I have to show alert to console(IP). {IP can be retrieved from DB as it is configured in DB. this ip will be other linux system other than linux machine where oracle database is installed.} Updating is continuously done on my table from module of application. Please tell me from where should I start?, what should I read. I am not able to understand what should be approach. Any help is much appreciated.
Can u provide me any begginner.s link of oracle db listener?
You probably want to look at setting up a Trigger in the database
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/triggers.htm
An alternative to a trigger would be to log update queries against the table (to a log file) and have a process monitor the log, sending out alerts when something happens.

Resources