database-administration

Quickest way to combine two identical structured tables without duplicate entries

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-17 05:20:06
问题 I have two tables with the exact same structure/columns. I need to combine them without duplicates based on the second column (title). First column is ID and these may have duplicates but should be ignored. Example of database structure id (primary key, auto increment), title (unique), description, link Ex. Table 1 1 Bob thisisbob bob.com 2 Tom thisistom tom.com 3 Chad thisischad chad.com Ex. Table 2 1 Chris thisischris chris.com 2 Chad thisischad chad.com 3 Dough thisisdough doug.com What I

Oracle Enterprise Manager job is Hung

本秂侑毒 提交于 2020-01-16 18:31:12
问题 I have a OEM job hung for few days and unfortunately logging is not enabled so i would like to know how to troubleshoot this issues ? or Better approach to create/handle OEM job ? DECLARE CHECK DATE; BEGIN CHECK := NULL; PROCESS_MAIL_TOTAL( CHECK => CHECK ); END; PROCESS_MAIL_TOTAL is the procedure used in PROCESS_MAIL_JOB OEM job. create or replace PROCEDURE PROCESS_MAIL_TOTAL ( CHECK IN DATE ) AS M_CHECK DATE; M_DATE_FORMAT VARCHAR2(20); BEGIN M_DATE_FORMAT := 'YYYY-MM-DD'; IF ( CHECK IS

How to recover a dropped database on MySQL

萝らか妹 提交于 2020-01-06 05:39:08
问题 I accidentaly dropped a database on MySQL yog ultimate. Also, I found that the IT guy uninstalled MySQL yog from the machine. Now am working on two machines which includes the one from which database was dropped and mysql was uninstalled. Is there a way to recover the dropped databases. 回答1: You said in a comment that you have a backup from a couple of hours prior to the data loss. If you also have binary logs, you can restore the backup, and then reapply changes from the binary logs. Here is

Optimize MySql 5.7 table without downtime

巧了我就是萌 提交于 2020-01-05 07:39:13
问题 I have a table in MySql 5.7 server. We store around 1M rows every day. After each row insertion, we do some processing on that row after that we delete that row. Table disk space is rapidly increasing because of this huge number of write operations. So I want to do OPTIMIZE the Table. So if I apply OPTIMIZE Table command on production table does it give any downtime. What is the best way to do OPTIMIZE table? MySql Server details Server version: 5.7 Engine: InnoDB Hosting: Google Cloud Sql

SQL server schema auditing?

两盒软妹~` 提交于 2019-12-30 03:31:07
问题 We have a SQL Server 2008 Enterprise database with two different schemas, a locked one that we maintain and an open one that we allow outside development teams to add to and modify for their own needs. Usually this works out OK for us but one particular team likes to really muck it up and it is impacting everyone else. So 2 questions: In hindsight I wish we had set up something robust from the outset but we did not, just the default install. It would be nice to be able to see what has been

ORA-01219: database not open: queries allowed on fixed tables/views only

点点圈 提交于 2019-12-29 08:35:09
问题 I Am using oracle 11g and SQL developer tool. When i tried to retrieve rows from db i am getting error message as :- ORA-01219: database not open: queries allowed on fixed tables/views only) I looked for sgadef.dbf file and it was missing in home directory.. Can someone help me to make it working. 回答1: First of all check the status of the instance you work with (this may need to connect under administrator account): select status from v$instance; Probably you will get STATUS ------------

Use of FLASHBACK in Oracle

随声附和 提交于 2019-12-28 07:06:07
问题 I have searched for the flashback command. Somewhere it is written we can rollback the truncate operation, and somewhere it is written we can't rollback. Can the FLASHBACK command in Oracle used to rollback the truncate table operation? 回答1: You need to have Flashback Data Archive enabled. Then the truncate could be reversed with a statement like this: insert into <truncated_table> select * from <truncated_table> as of timestamp <some time>; Thanks to @Jon Heller for adding this useful

Replication - Explicit value must be specified for identity column in table

爱⌒轻易说出口 提交于 2019-12-25 04:43:29
问题 I am using Merge Replication. The Identity range management is AUTOMATIC i HAVE A TRIGGER ON COMPANIES TABLE WHICH INSERTS ROWS IN SERIALNUMBERSCHEME TABLE which has documentID as identity column While synchronizing i am getting below error A row insert at 'SERVER\MUMBAI.PROD_SUB' could not be propagated to 'SERVER\NEWYORK.PROD'. This failure can be caused by a constraint violation. Explicit value must be specified for identity column in table 'SerialNumberScheme' either when IDENTITY_INSERT

Replication - Explicit value must be specified for identity column in table

我的梦境 提交于 2019-12-25 04:43:04
问题 I am using Merge Replication. The Identity range management is AUTOMATIC i HAVE A TRIGGER ON COMPANIES TABLE WHICH INSERTS ROWS IN SERIALNUMBERSCHEME TABLE which has documentID as identity column While synchronizing i am getting below error A row insert at 'SERVER\MUMBAI.PROD_SUB' could not be propagated to 'SERVER\NEWYORK.PROD'. This failure can be caused by a constraint violation. Explicit value must be specified for identity column in table 'SerialNumberScheme' either when IDENTITY_INSERT

Connecting to local Database from remote web server

旧时模样 提交于 2019-12-25 04:02:06
问题 I am trying to connect to my local Database from the webserver but i get Fatal error: Call to undefined function odbc_connect() in -/-/-/7001238/web/s/sage2.php on line 15" Any help on how to fix issue. Here is the code i used to connect. $odbc['dsn'] = "Sage50"; $odbc['user'] = "Peach"; $odbc['pass'] = "XXXX"; $mysql['host'] = "localhost"; $mysql['user'] = "root"; $mysql['pass'] = ""; $mysql['dbname'] = "sagetest"; $mysql['idfield'] = "id"; $debug=true; // Step 1: Connect to the source ODBC