I currently have SQL DB and Log files going to the same drive. I would like to move the Log files to their own drive. Is there an easy way to achieve this and will it require downtime/reboot of the server?
vendredi 27 mars 2015
What will be the Better database design for following table?
I am designing database schema for bulk mail system.
campaign table is used to store the campaign details.
Table Campaign
-------------------------------------------------------------------------------
id | subject | message | status | sent | opened | bounced |senttime | User_id
-------------------------------------------------------------------------------
campaign_log table will used to store the every recipents status like he opens mail or mail bounces for this email or sent etc.
Table Campaign_log
--------------------------------
id | campaign_id | email |status
---------------------------------
My questions is
- should I make the columns in table campaign for storing the count of sent,opened and bounced mails
- Should I make the another table for storing the statistical data like sent,opend and bounced mail ? can it improve a performance.
- I like to explain the second question to describe my doubt (may be it silly stupid idea) I am explaining my doubt with above example. In campaign table id,subject message fields are filled by the user while sent, opened and bounced columns are fills after sending the campaign. Is there more unused column at the inserting or updating affects the performance I mean to say when inserting the campaign, the sent opened and bounced are just like unused we are not filiing them
- I read about OLTP AND OLAP databases. But I am confuse about my application nature. because there is because my database is going to store the thousands of row in tables such as mailing list also there is more updates operation will be performs and it's also have the reporting, analysis system.
and when updatingthe count for each column sent opened and bounced other columns are unused.
I am sorry I think it's very silly but I am beginnig to database design and have the doubt and I want to clear it.
Can I setup database triggers to run on a defined secondary set of servers only?
This might sound a bit off, but here's what I have been thinking for a while now:
Use Case
You want to build an activity log for each user action on your application using database (postgreSQL) triggers on every relevant table, outputting to an activity_log table. The triggers should do the trick, but how do we eliminate the burden of every user action triggering an action on the production servers, delaying the whole application?
Purposed Architecture
What I have in mind is a complex structure where one or more secondary postgres nodes would take the entire activity_log trigger activity. The triggers would be disabled on all primary nodes (the ones the application reads and writes to) and enabled on some/all secondary nodes (let's call them "workers"). Data would be written to a primary server (no trigger runs) and replication would forward it to all other nodes. When a "worker" node get's the data, the triggers process it and update the activity_log. activity_log table should be replicated across ALL servers which means that a "worker" node should be able to read, write and send selected data upstream.
Is there anything even close to this? Is this even possible to achieve without having to rewrite a replication model from scratch?
Change MySQL master to a slave
I have a MySQL master/slave configuration
-------- --------
| master | -> | slave1 |
-------- --------
I want to kill my current master, transform slave1 to be the new master and have another slave pointing to slave1
-------- ------------ --------
| master | | new master | -> | slave2 |
-------- ------------ --------
KILLED
What is the best way to do this without database downtime? I am using MariaDB 10.0.17
How to create a communication link failure in MySQL
For testing purposes I would like my MySQL server to generate a communication link failure (com.mysql.jdbc.exceptions.jdbc4.CommunicationsException). How can I tweak MySQL that this error is easily created?
mysql - order by first condition in where clause
I have a table consists of the following fields
id, name
with the following values
1, ciro
2, test ciro
3, ciprox
4, other
5, other
i would like to get all the values that begin with "ci" or contain "ci" but show me the results before they start with ci and then the rest.
the query
select * FROM table WHERE name like '%ci' || name like '%ci%' order by name
I returns
1, ciro
2, test ciro
3, ciprox
I want
1, ciro
3, ciprox
2, test ciro
therefore before the rows in which name begins with "ci" and then those that contain
is there a way without using two queries to obtains the result?
Permissions for executing subscription in SSRS
I'd like to execute an SSRS subscription after some ETL work run by a SSIS package that takes a varying amount of time completes. I'm considering using this method, which basically consists of SSIS calling the same stored procedure that the SQL Server Agent jobs for subscriptions call to execute a subscription.
However, I'm not sure what the best way of managing permissions to execute the subscription would be. For example, I'm reluctant to add users to the RsExecRole
because it's discouraged by Microsoft in some documents, and I'm reluctant to grant object-level permissions to execute the ReportServer.ado.AddEvent
procedure because they'll likely get overlooked in any migrations. (Edit: I suppose we could work around this by having something execute the Agent job instead of calling the stored proc.)
I'm also hoping to avoid issues with the the code that executes the subscription breaking when one of the GUIDs changes.
How do SSRS professionals manage permissions for this type of request? Alternatively, is there a simpler method that bypasses these issues?