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?
I used this schema to create Spring batch tables in MariaDB - https://github.com/spring-projects/spring-batch/blob/master/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-mysql.sql.
BATCH_JOB_EXECUTION_PARAMS table fails with below error
Error: (conn=10719030) This table type requires a primary key
SQLState: 42000
ErrorCode: 1173
Add PRIMARY KEY(JOB_EXECUTION_ID, KEY_NAME) to BATCH_JOB_EXECUTION_PARAMS if that combination is Unique.
BATCH_JOB_EXECUTION_SEQ also has no PK. The UNIQUE key could be promoted to be the PK. (Ditto for some other tables.) That particular table is rather weird -- it turns a 1-byte UNIQUE_KEY into an 8-byte id!?!
BATCH_JOB_EXECUTION_PARAMS is a pretty awful variant of the classic EAV schema.
MySQL and MariaDB are different products and it looks like they behave differently in regards to primary keys. You are using the MySQL DDL script against a MariaDB server which is not officially supported by Spring Batch.
So either adapt the script accordingly (by adding the primary keys manually) and be aware that Spring Batch would not necessarily work as expected since it does not support MariaDB officially, or open a feature request in the JIRA of the project to request support for MariaDB.
I'm trying to get flyway to work with a Spring Boot application and Oracle.
So far I have been successful in getting flyway working on several databases (postgreSQL, mysql, SQLServer) but on Oracle I keep getting in a chicken and egg problem.
If I run my app for the very first time, I get an error: Found non-empty schema "SPRING" without metadata table! Use baseline() or set baselineOnMigrate to true to initialize the metadata table.
I'm connecting with a user spring to a specific namespace configured on Oracle. and I'd like to have the schema_version table on the same namespace
So if I try to set flyway.baseline-on-migrate=true it does create the migration table, but then, it does not create any of the tables, as it says there's already a version 1 installed on the schema identified by << Flyway Baseline >>
How can I get away from this chicken and egg issue? Seems to happen only with oracle, all other dbs, it worked straight on the first time.
So far I'm running it, the app fails, I then delete entries from the schema_version table and run it again.
Ideas?
You may need to specify the schema in Spring Boot e.g.:
flyway:
schemas: SPRING
Let's say, you have the following setup in Oracle XE:
CREATE TABLESPACE SPRING DATAFILE 'spring.dbf' SIZE 40M ONLINE;
CREATE USER SPRING IDENTIFIED BY SPRING DEFAULT TABLESPACE SPRING TEMPORARY TABLESPACE TEMP;
GRANT CREATE SESSION, CREATE TABLE, CREATE SEQUENCE, UNLIMITED TABLESPACE TO SPRING;
You should now be able to populate the database using the following Boot properties:
spring:
datasource:
url: jdbc:oracle:thin:#localhost:1521:xe
username: SPRING
password: SPRING
flyway:
schemas: SPRING
We want to be able to pin all sql executions to a particular schema_version table in schema A. We need this so that we can run sqls as a sysdba and flyway always references A.schema_version to validate checksums and update result of SQL runs. We tried by adding the following settings:
flyway.schemas=A
flyway.table=schema_version
However we find that if we run info as user B then flyway is not able to show it can read A.schema_version. What are we missing?
Found out the solution. Schemas is case sensitive as specified in the flyway docs. We needed to reference flyway.schemas= where schema_name is in caps
Have to send email from oracle apex using APEX_MAIL.SEND() method.
I am using the code:
BEGIN
apex_mail.send(p_to => 'tanmoydawn#gmail.com'/*l_to_addr*/,
p_from => 'tanmoydawn#gmail.com'/*l_from_addr*/,
p_bcc => l_bcc_addr,
p_subj => l_mail_sub,
p_body => 'Service Request ' || :mail_body ||
'Note:- This is a system generated Email. Please DO NOT REPLY to it.');
apex_mail.push_queue;
EXCEPTION
when others then
INSERT INTO send_mail_error_test VALUES ('Send_mail',systimestamp,:service_request_id||'-err:'||seq_service_req_error_id.NEXTVAL);
COMMIT;
END;
*** all the variables contain correct values
Working with a database and that database has ACL(access control list) access
In apex administrative services, Configured instance settings for email as hostname, port , email provisioning enabled.
UTL_SMTP package is installed
From the same process, at the same point of control flow a code to send mail using utl_Smtp is working fine, though that apex_mail.send() is not working.
That apex_mail.send() is not giving any error or exception, but i am not recieving email from it.
Have one confusion, got some solutions like that, 'APEX_040200' should have been added to ACL. But the database I am using and implementing the code on it, say 'apex_user' is already added to ACL. Even now do I have to add 'APEX_040200' or 'APEX_050200' to ACL?
can anyone help me out and give me a fruitful solution? I am using apex 5.0.2.00.07.
As can be found in the apex_mail api documentation:
Before you can send email from an Application Builder application, you
must:
Log in to Oracle Application Express Administration Services and
configure the email settings on the Instance Settings page. See
"Configuring Email" in Oracle Application Express Administration Guide.
If you are running Oracle Application Express with Oracle Database 11g
release 1 (11.1), you must enable outbound mail. In Oracle Database
11g release 1 (11.1), the ability to interact with network services is
disabled by default. See "Enabling Network Services in Oracle Database
11g" in Oracle Application Express Application Builder User's Guide.
You specified instance settings are ok. Your "database has ALC access" doesn't mean anything. Do you mean you have a database which uses network ACLs? (11g or higher)
That same documentation links to "the Enabling Network Services in Oracle Database 11g or Later" documentation
This document does not leave you guessing:
By default, the ability to interact with network services is disabled
in Oracle Database 11g Release 1 or 2 or later. Therefore, if you are
running Oracle Application Express with Oracle Database 11g Release 1
or 2 or later, you must use the new DBMS_NETWORK_ACL_ADMIN package to
grant connect privileges to any host for the APEX_050000 database
user. Failing to grant these privileges results in issues with:...
If you have an older version of apex, eg 4.2, the user to grant to is another one, and can be found in the documentation. Alternatively, you can just find out
by for example querying the ALL_USERS view and find the APEX_###### users, pick the one with the highest version number:
select *
from all_users
where username like 'APEX%'
order by username;
in our case, it was a job, ORACLE_APEX_MAIL_QUEUE, which had status 'RUNNING' for 8 days. Apparently, it held some kind of lock on the queue or mailprocess
We killed the job and that was it.
(see dba_scheduler_jobs for the job & status)
I guess you should do as they say here, but with the proper APEX version, as you guessed... try various, with APEX_050000 (rather than APEX_050200 that would imply APEX 5.2 - not released yet):
DECLARE
ACL_PATH VARCHAR2(4000);
BEGIN
-- Look for the ACL currently assigned to '*' and give APEX_050000
-- the "connect" privilege if APEX_050000
-- does not have the privilege yet.
SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE (ACL_PATH,'APEX_050000','connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,'APEX_050000', TRUE, 'connect');
END IF;
EXCEPTION
-- When no ACL has been assigned to '*'.
WHEN NO_DATA_FOUND THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
'ACL that lets power users to connect to everywhere',
'APEX_050000', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/
COMMIT;
I had this same problem. Could send email using utl_smtp, but could not with apex_mail.send. Turned out I had an extra space in the smtp server url.
Email server for APEX is setup in the APEX Instance workspace. Check "Manage Instance' > 'Instance Settings' > 'Email' > 'SMTP Host Address'
Also try checking the Logs in 'Monitor Activity' in the Instance Workspace.