How to set the default schema in DBeaver? - database

I am having trouble with the DBeaver default schema. When I set the default schema and close DBeaver, on next startup Active catalog/schema is N/A. How to fix this?

<your db connection> => Edit connection => Connection settings => Initialization => Default schema

Related

Import DATA from an SQL server database with identities column

I would like to export all the data from a database to a new one with SQL Server Manager studio.
I used import and export assistant (taks -> export data) but after the import when I try to save new data
I have insertion error due to identity column error when I try to insert data:
com.microsoft.sqlserver.jdbc.SQLServerException: Unable to insert null value in column 'id'
Although I specified to keep identity insert before the export.
I would like to export data in a new database with all the Identities column constraints.
If you want to move all data completely from a database. Task->Export is one Option(since the issue which you face is not clear) you can try other option to take backup(.bak file) and restore it to the new database.
Thank you for your help, the problem wasn't clear.
I actually needed to export an azure database to a SQL server database.
I used another export process : microsoft.github.io/AzureTipsAndTricks/blog/tip140.html and now the exported local database is working

Cakephp 4 MySQL on hosted environment

I have created a Cake solution locally and have uploaded this on my hosting provider's environment. It runs MySQL. I have full access to the respective database but of course not the MySQL main database. If I understand the situation correctly, there are multiple databases in the same environment used by other clients on different domains that I would never see.
The provider has disabled the ability to manage user rights in PHPMyAdmin. Through an admin panel I was able to create a user that is granted INSERT, UPDATE, SELECT and DELETE rights. However, with the specified datasource parameters in appl_local.php, I get the message below when I try to add a new user to the database through the users/add page. For security reasons I have marked the name of the user with asterisks in the code below.
Could it be that I have to more specifically explain on which database we are trying to execute this?
Is there a way to tell the system to always specify the database when asking for a table? For example "SELECT * FROM database_name.users" instead of just "SELECT * FROM users"? I ask this because in the message below it does not specify which database was accessed when this error was raised, only the command, the user, the table and the source code file and line number.
Or is there some schema that needs to be specified when working in a shared environment?
2021-01-07 10:39:00 Error: [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user '******'#'localhost' for table 'users' in /home/multigra/domains/multi-grade.nl/public_html/content/vendor/cakephp/cakephp/src/Database/Statement/MysqlStatement.php on line 39
'default' => [
'host' => 'localhost',
/*
* CakePHP will use the default DB port based on the driver selected
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
* the following line and set the port accordingly
*/
'port' => '3306',
'username' => '******',
'password' => '******',
'database' => '******',
/**
* If not using the default 'public' schema with the PostgreSQL driver
* set it here.
*/
//'schema' => 'myapp',
/**
* You can use a DSN string to set the entire configuration
*/
'url' => env('DATABASE_URL', null),
],
This was an overight from my end. I had specified the location of information a little too much in order to learn about specifying databases when data is spread over different databases. Because the production environment connects to a different database, the requested table was not found at all. The error "SELECT command denied to user '******'#'localhost' for table 'users'" did not point me in that direction. I thought it was a permission issue. Instead, the table was not found in the database and that's why the SELECT statement failed.

Oracle 12C Database default Listener

I Have installed Oracle 12c r2 database software only on RHEL7 ( AWS EC2 instance). Then I created a database DB1 using DBCA. At the end of DBCA when it prompted for the listener I let it create the default 'LISTENER', Started the listener and the database and database registered automatically with the default 'LISTENER' as expected. Also verified my listener is started using lsnrctl.
Question: When I start netca, the option to reconfigure the existing listener is grayed out. When means netca is not able to recognize existing Listener.
How can I get a handle to default listener to either change the port, protocol or just to delete the listener. I tried netmgr and it can't see the listener as well.

how do i build a JDBC connection url from this XML connection data?

I'm connecting to an Oracle database with SQL Developer, the connection data was provided to me in XML form. I used the "Import Connection Descriptor" feature in SQL Developer and I can connect just fine. The XML looks like this:
<connections>
<connection>
<ConnectionType>JDBC</ConnectionType>
<DeployPassword>false</DeployPassword>
<user>user1</user>
<ConnectionName>ccddda</ConnectionName>
<URL>CCDDDA, CCDDD10A, CCDDD10A.ABCDEF.ABC</URL>
<RaptorConnectionType>Oracle</RaptorConnectionType>
<JdbcDriver>oracle.jdbc.driver.OracleDriver</JdbcDriver>
<PWD>
<![CDATA[01AB001AB001AB001AB001AB001AB01234]]>
</PWD>
<ORACLE_JDBC_TYPE>thin</ORACLE_JDBC_TYPE>
<PREVIOUS_NAME>ccddd2_11</PREVIOUS_NAME>
</connection>
</connections>
The problem is, I'm trying to create a database connection using the JPA perspective > Datasource Explorer in Eclipse.
My question is, how do I derive the JDBC values from the XML needed to establish the connection? The dialog is asking for the following:
Select a database manager: Oracle
JDBC driver: Oracle 10 - Oracle Thing Driver Default
SID: db /* selected by default */
Host: ?
Port Number: 1521 /* selected by default */
User name: ? /* I assume it's user1 */
Password: ?
Default Schema: ?
Catalog: User /* selected by default */
Any help is GREATLY appreciated!
Thanks, Rob
Look in these locations:
Oracle SQL developer connection properties
The TNSNAMES.ORA file

DB2 creating event monitor

I'd like to create event monitor on DB2 z/OS 9.2
i have spent a lot of time trying resolve this problem.
So i suggest this link: http://www.ibm.com/developerworks/data/library/techarticle/0303kolluru/0303kolluru.html
and trying to make this steps:
db2 => connect to dbname user username using password
db2 => update monitor switches using statement on
db2 => create event monitor rkmon for statements write to file '/tmp'
db2 => set event monitor rkmon state=1
but when I put command: create event monitor rkmon for statements write to file '/tmp'
Db2 throw me an error:
"DB2ADMIN" does not have the privilege to perform operation "CREATE EVENT MONITOR".. SQLCODE=-552, SQLSTATE=42502, DRIVER=3.58.81
so, then i try add some privilege to my db2admin user:
grant DBADM to db2admin
but get another error:
The name "DBADM" cannot be used because the specified identifier is reserved for system use.. SQLCODE=-707, SQLSTATE=42939, DRIVER=3.58.81
Now, I don't have any idea what shoould i do to resolve this problem.
Maybe, there is some othere way to logs sql queries sends to my db2 ?
(I develop some java apps using hibernate and db2, and sometimes quickest way to resolve some problem is see what sql queries is send to db).
Any ideas ?
Thanks
I think the "ON DATABASE" clause is mandatory in the GRANT statement. Try:
grant DBADM on database to user db2admin
GRANT (database authorities)
statement

Resources