I have a situation for which I would appreciate any valuable pointers. I have sql transactional replication configured as below. sql01sqla ---> publisher sql01sqlc --> subscriber sql01sqle ---> distributor. I am testing if I can recover my replication flow , in the event of losing the distribution host, I have put distribution database in full recovery model and am taking log backups every 15mins. After configuring transactional replication, and ensuring a table is in sync, i stopped the agents (log reader and distribution ) on the distribution host. inserted a few records on publication and ensure the log back job of the publisher db is disabled as well. Now restored distribution d...
ادامه مطلبAskTom has already discussed this. This could be achieved in following maer: BEGIN -- code containing INSERT operation EXCEPTION WHEN dup_val_on_index THEN Trace_SYS.Message(substr(sqlerrm, instr(sqlerrm, '(')+1, instr( sqlerrm, ')') - instr( sqlerrm,'(') -1 )); END; Let's block ads! بخوانید...
ادامه مطلبI have two tables 1.Product table having columns prod_code alert_limit prod_description 2.Daily_data table having columns prod_code used_today date stock_left How should i join these two tables to get recent records of each product on the basis of date ? I have tried SELECT p.*, d.* FROM product p JOIN daily_data d ON (p.product_code = d.prod_code) LEFT OUTER JOIN daily_data d2 ON (p.product_code = d.prod_code AND (d.date < d2.date OR d.date = d2.date AND d.prod_code < d2.prod_code)) WHERE d2.prod_code IS NULL; but the above is giving me one recent row of the last product added Let's block ads! بخوانید...
ادامه مطلبThe operating system retued error 38(Reached the end of the file.) to SQL Server during a read at offset 0000000000000000 in file 'C:Program FilesMicrosoft SQL ServerMSSQL12.MSSQLSERVERMSSQLDATAbanking_sys_log.LDF'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. (Microsoft SQL Server, Error: 823) Let's block ads! بخوانید...
ادامه مطلب
I have a table in
I have an SQL select, that gives two rows back. The SQL update gives the error message 1093 back;
I have a table of 500 million rows on SQLServer 2016. I calculate that each row should take up 12 bytes, total size should be in the order of 6GiB. However the actual size is over 10 GiB. After ruing dbcc showcontig ('[Table]') with tableresults I see the the MinimumRecordSize and MaximumRecordSize is 19 bytes and the AverageFreeBytes is 11.023 bytes. The table is defined as the following. CREATE TABLE [dbo].[Table]( [Key] [binary](7) NOT NULL, [Value] [binary](5) NOT NULL ) ON [PRIMARY] CREATE UNIQUE CLUSTERED INDEX [ClusteredIndex-Key] ON [dbo].[Table] ( [Key] ASC ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING ...
ادامه مطلبI have a cube, called metric_cube, with a measure of Metric and a dimension Week with the given output on SSAS from SQL Server 2014. Current Output: Week Metric ---- ------ 1 6 2 5 3 4 4 3 5 2 I want to get the cube to output the sum of the Metric for all combinations of a from Week and to Week, where the from Week <= the to Week. Desired Output: Week(F) Week(T) Metric ------- ------- ------ 1 1 6 1 2 11 1 3 15 1 4 18 1 5 20 2 2 5 2 3 9 2 4 12 2 5 14 3 3 4 3 4 7 3...
ادامه مطلبI installed always on setup on my laptop (testlab) with 3 VMs. One domain controller and 2 SQL instances(Plaed to have it as one primary and one secondary replica). Everything went well until I wanted to add the secondary replica to the Availability group. Please find screenshot attached. Yes I have already changed the port to 1433 in tcpip settings and have also added an exception for sqlserver in the windows firewall. Both of the servers are on the same cluster network. Not sure what else I am missing here Let's block ads! بخوانید...
ادامه مطلبI have six SQL Server 2014 servers. I am not using TDE, Transparent Data Encryption, on any server. I would like to be able to take an encrypted backup of a database on ANY server and restore that backup to ANY OTHER server. What actions do I need to take on each server with the service master key, master database key, and certificate? I would like to use the minimum number of keys, certificates, and backup files for these keys and certificates. What actions do I need to take if I add an additional SQL Server 2014 to the group? Thank you all. Server Fault and Stack Overflow have helped me many times in the past. Let's block ads! بخوانید...
ادامه مطلبSuppose I have two simple models, Sentences and Persons, where each Person is a reference to person mention in a Sentence. Let's say they have the following normalized schema: CREATE TABLE sentence (id INT, doc_id TEXT, text TEXT) CREATE TABLE person (id TEXT, sentence_id INT, name TEXT) Let's say that a significant fraction of all my queries filter persons on doc_id. When, if ever, should I denormalize my schema and replicate doc_id as a field in Person? CREATE TABLE sentence (id INT, doc_id TEXT, text TEXT) CREATE TABLE person (id TEXT, sentence_id INT, doc_id TEXT, name TEXT) If this case, would you recommend I use triggers or some other feature with postgres to ensure consistency? ...
ادامه مطلبWe have maintained one MySQL master server and two slave MySQL server. One of the MySQL slave server was down for more than a week. I tried to re-import all the database and restart the slave. But got the error 1594: MySql Version (Master): mysql Ver 14.14 Distrib 5.7.13 MySql Version (Slave): mysql Ver 14.14 Distrib 5.7.13 Replication method: GTID based Steps followed to re-import the DB and start the slave: mysql>stop slave; mysql>reset master; shell>mysql -u root -p < masterdbdump.sql mysql> start slave; Slave status after this: mysql> show slave statusG *************************** 1. row *************************** Slave_IO_State: Waiting for m...
ادامه مطلبI have a table which has 2 fields OS_ID and OZ_ID. I want to select combinations of OS_ID for different OZ_ID. What would be the query for that? Input OS_ID OZ_ID ---- ---- 1 1 2 1 3 2 4 2 5 2 6 2 7 3 8 3 9 3 Output combination row 1,3,7 1,3,8 1,3,9 1,4,7 1,4,8 1,4,9 1,5,7 1,5,8 1,5,9 1,6,7 1,6,8 1,6,9 2,4,7 2,4,8 ... Let's block ads! بخوانید...
ادامه مطلبI am getting an error: ORA-01691: unable to extend lob segment ABC.SYS_LOB0000167347C00131$$ by 1024 in tablespace XYZ But this is very strange to me because the tablespace has AUTOEXTEND on. What is the likely reason that this happens and how can I overcome it? Thanks. Let's block ads! بخوانید...
ادامه مطلب
In a simple
I'm having an issue deploying the latest build of a
What I have currently done. I have created an Oracle Virtual box and install XP SP3. Install Oracle 9.0.1 on XP SP3. Restore my database on Oracle 9.0.1. Test database using SQL Plus tool. These above things work file. On my local Machine, I have already install visual studio 2015 community. And I am trying to coect Oracle database and I got the below error. Can you please help me how to sort out this issue: On the XP machine, I have a tnsnames.ora file. below is the content of that file. # TNSNAMES.ORA Network Configuration File: C:oracleora90networkadmintnsnames.ora # Generated by Oracle configuration tools. EXTPROC_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS =...
ادامه مطلب