w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to find who deleted a view from DB with SIMPLE recovery model
You can capture drop view events from the default trace, assuming they happened recently: DECLARE @path NVARCHAR(260); SELECT @path = REVERSE(SUBSTRING(REVERSE([path]), CHARINDEX(CHAR(92), REVERSE([path])), 260)) + N'log.trc' FROM sys.traces WHERE is_default = 1; SELECT LoginName, HostName, StartTime, ObjectName FROM sys.fn_trace_gettable(@path, DEFAULT) WHERE EventClass = 47 AND ObjectName = N'MyView'; (As an aside, this method doesn't have any dependencies on recovery model; however you should be aware that content in the default trace will roll out eventually, so you are unlikely to find out who dropped an object 6 months ago. How long it stays around depends on a lot of variables for each instance.)

Categories : SQL

How to do SQL Server database back up and recovery in MVC 4
you can use Microsoft.SqlServer.Management.Smo for back up and restore database Code Project example using .Net 2.0 .Hope this will match your requirement Also look the same type of question Restore SQL Database using C#

Categories : C#

Wait on the Database Engine recovery handle failed!! SQL Server 2012 installation
Ok, after 6 hours of struggle and 'googling' I could finally get this work. The problem was due to some account name conflict. Here are the steps I followed to set it right 1) Un-installed the SQLserver 3) Re-installed it back with following changes In the server configuration section, I changed the account name details to "NT AUTHORITY/LOCALSERVICE" (during the installation process) Please remember to set it as "NT AUTHORITY/NETWORKSERVICE" if LOCAL SERVICE is not allowed.

Categories : Sql Server

Namenode recovery, How does namenode recovery works?
There are 2 things to be considered here, 1- Recovery through SecondaryNameNode 2- Recovery through redundant NameNode In hadoop-1.x we have the concept on SecondaryNameNode which holds a copy of the NameNode metadata. If your NameNode goes down you can take the metadata copy stored with SecondaryNameNode and use it to resume your work, once your NameNode is up again. With hadoop-2.x(HA) you can have more than 1 NameNode. In case primary NameNode goes down, the redundant NameNode can take over so that your cluster doesn't stop working(either manual or automatic). In this implementation there is a pair of NameNodes in an active/standby configuration. In the event of the failure of the active namenode, the standby takes over its duties to continue servicing client requests. In order to

Categories : Hadoop

Replicated Sharding in mongodb
While it might be tempting to use tag aware sharding for this, it's actually not simple, nor is it very efficient. Here is why: 1) your range of keys which should exist on the "old" shard is changing every day. If your cut-off is five days ago, at midnight you will need to update the tags to reflect that it's a new day. 2) as soon as you add the day that was five days ago to the range that should be on the "old" shard the balancer process will need to migrate that data to the old shard. The problem is that this shard will have loads of old data so probably really huge indexes so it'll be much slower to write to it, and reading and removing data from day-5 from your "active" shard(s) may be interfering with the queries on "current" data. So, maybe it's not such a great option - altho

Categories : Mongodb

The model backing the 'SisContext' context has changed since the database was created. Consider using Code First Migrations to update the database
Have you tried following this link.... http://msdn.microsoft.com/en-us/data/jj591621 . I am using MVC3 and EF6.0.0.1 I had the same problem, but by Enabling Code First Migrations the error disappeared.

Categories : Asp Net Mvc

MVC 4 WebSecurity.GeneratePasswordResetToken does not work when table is replicated in sql
Try to see if it helps to add the extra columns in your table, to the EF definition which was auto-created in the C# program. The EF operations should then operate correctly behind the scenes. Here's how to add them: In the UserProfile class, in AccountModels.cs program, add the column(s) as follows: [Table("UserProfile")] public class UserProfile { [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int UserId { get; set; } public string UserName { get; set; } // Customization: Field(s) added public string AddedFieldName { get; set; } } I have successfully used this technique to add custom columns (such as registered users' names and other info) to the SimpleMembership system, and have in fact written a set of blog articles about it, whi

Categories : C#

WSO2 ESB 4.0.3 - Can we stop service log getting replicated in to wso2carbon.log
As you have tried, setting additivity false should prevent logs being directed to ancestors. See docs for service logging with WSO2 ESB. See also this blog post for information.

Categories : Wso2

Detecting new data in a replicated MongoDB slave
Instead of using a master/slave configuration you could instead use a replica set with a priority 0 secondary (so that it can never become primary). You can tail the oplog on that secondary looking for insert operations.

Categories : Database

Simplest ehcache replicated cache not working
Ok I figured it out, the code above sort of worked but didn't wait long enough for the caches to sync before printing out what was in the cache. I added a while loop around the cache check and after a few iterations through the loop it each test program started showing cache elements from the other program. Here's the test program with the loop: public static void main(String[] args) throws InterruptedException { CacheManager manager = CacheManager.newInstance("bin/ehcache.xml"); Cache cache = manager.getCache("tprc"); Element element = new Element("name2", "erik"); cache.put(element); while (true) { for (int i = 1; i <= 2; i++) { String key = "name" + Integer.toString(i); Element got = cache.get(key); if (got != null) {

Categories : Caching

UTF-8 encoding issue special characters like 'É' not replicated properly
First thing is that you need to make sure that your source file is actually stored as UTF-8 - see @Ankur's answer for a good explanation. Then, you also need to provide an encoding when calling getBytes() on String to retrieve the byte array: byte sByte[] = Cdata.getBytes("UTF-8"); If you call String.getBytes() with no encoding, the platform`s default encoding is used, which can be (almost) anything. See also java.lang.String.getBytes(): Encodes this String into a sequence of bytes using the platform's default charset With that, the following SSCCE properly prints the expected output for me (note: took identifiers from question, not adjusted to coding conventions): import java.io.UnsupportedEncodingException; public class Encoding { public static void main(String[] args) th

Categories : Java

shiro + ehcache + replication: login and logout not being replicated
Frankly, I'd try to get away from peer-to-peer replication altogether...as it has potential for race conditions and concurrent exceptions, which could explain your missing entries at random. I'd move towards a much more robust distributed caching solution using Bigmemory Max which is free for up to 4 clients + 4GB of memory storage (http://terracotta.org/products/bigmemorymax) EDIT - FYI, BigMemory Max is still ehcache...it's just a "distributed ehcache" with extra "off-heap" memory capability...

Categories : Java

How is re-population of replicated caches handled after system restarts
I will try to present here possible solution from Infinispan point of view. In your use case I would suggest to use cluster of Infinispan standalone nodes (client-server access, for example via HotRod) with configured underlying cache store. https://docs.jboss.org/author/display/ISPN/Infinispan+Server & https://docs.jboss.org/author/display/ISPN/Using+Hot+Rod+Server Now more specifically to your questions: What I need to know is how this cache will be repopulated when the individual nodes or the entire application restarts. That's why I suggest you to use let's say "independent" cluster with remote client-server access. Your caching layer does not depend directly on your application. When application restarts, crash, redeploying... you still have cached data in Infinispan clus

Categories : Java

HDFS Error while copying the file : Could only be replicated to 0 nodes, instead of 1
Some times the data node may be starting up slowly and this may cause the above issue.. keep some wait time after the start of dfs and mapred demons. bin/hadoop namenode -format bin/start-dfs.sh wait for some 5 min(data node will be up in the time) bin/start-mapred.sh

Categories : Hadoop

Mysql - Does INSERT IGNORE that fails gets replicated to slave?
The INSERT IGNORE query does not fail - it does not insert the records which do not colide, and returns successfully. This means that the new inserted records should be replicated. a successful execution of “replace into” or “insert ignore” on the master maps to a normal insertion on the slave This means that only the rows that are inserted on the master will be replicated, and the ones ignored by the master won't be replicated on the slave, even if the slave doesn't have them. Some information on the topic @ tokutek

Categories : Mysql

Need help in finding the location of the replicated file on my hdfs cluster
first of all, files in HDFS are not stored as a whole. Rather they are chopped into blocks and these blocks are stored in a replicated manner across the cluster. So your question should be how to find the location of the second replica of a block and not the file. You can point your web browser to namenode_machine:50070, the HDFS webUI. Click on Browse the filesystem and move to the file in question. Once you click on this file a new page will be opened. Scroll down to : Total number of blocks: 1 -4906713039323389639: 127.0.0.1:50010 This shows you all the block of this file and the machine where they are placed. HTH

Categories : Hadoop

How do you model Database-to-Database integration/mapping in UML?
I'd rather use a database-specific modeling tool for that kind of task. Something like the mysql workbench. Which software is exactly the best for your case is of course vendor specific.

Categories : Database

Define Database Constraints in both Model and Database
I don't think you need all those empty values and they may be messing things up. You should only need: Comment.php class Comment extends AppModel { public $belongsTo = array( 'Post' ); } and class Post extends AppModel { public $hasMany = array( 'Comment' ); } Also, let us know the error as currently we have nothing to go on...

Categories : Cakephp

wso2 keystore management - do keystores added to one carbon node get replicated to other nodes?
AFAIK in a clustered deployment replication of Keystores is not supported in WSO2 products. Only the files under repository/deployment/server are synchronized. The keystores are not in that directory. So as a work-arround you can add the keystores to that directory and point to them in the relevant config files. Also note that if the setup if a worker manager setup , only manager will be able to commit, so the modifications should be done in the managers node.

Categories : Wso2

Git repository recovery
if you did not use some special repo management software, you can just copy the files over. check that the file ownerships are set to the user you use. if the new server is reachable via another domain or you changed the username or the location of the git repo on the server you may need to update the remote(s) in .git/config.

Categories : GIT

Git revert screwup - recovery?
On how to avoid this in the future: set push.default to upstream and only ever run git push without further arguments, unless you explicitly want to push to a different branch (which I personally never did). Do not push to other branches. Check out master, merge refactor, push. You might also want to think about the parent order in merges. Your workflow causes a total mess there. On fixing your problem: You guessed right: You are merging your revert commit in, so that is what git does. Here’s how to prevent that: Create a new branch master-fix-revert of master and check it out: git checkout -b master-fix-revert master Revert you revert: git revert **SHA-of-revert-commit** check out your refactor branch and merge your master-fix-revert: git checkout refactor git merge master-fix-

Categories : GIT

How to recovery Ubuntu 12.04 just from the .iso file, without CD-ROM
if you have installed GRUB 2, Grub2/ISOBoot may helps. it permits the user to boot and install Ubuntu directly from an ISO on the hard drive

Categories : Ubuntu

Recovery after accidental `git am` and `git am --abort`
Sorry, if they were unstaged then they were just ordinary files whose contents are outside of git's view. Unless your filesystem has some form of continuous data protection setup (git annex?) setup in it, I think you are out of luck. Possibly it's time to alias am to something else.

Categories : GIT

Linux file deleted recovery
You can use lsof to recover deleted files (sometimes)... > lsof | grep testing.txt less 4607 juliet 4r REG 254,4 21 8880214 /home/juliet/testing.txt (deleted) Be sure to read the original article for full details before attempting this, unless you're a Maveric like me. > ls -l /proc/4607/fd/4 lr-x------ 1 juliet juliet 64 Apr 7 03:19 /proc/4607/fd/4 -> /home/juliet/testing.txt (deleted) > cp /proc/4607/fd/4 testing.txt.bk http://www.linuxplanet.com/linuxplanet/tips/6767/1 Enjoy

Categories : Linux

is there any account recovery gem for ruby on rails that uses SMS?
Not that I am directly aware of, but https://www.ruby-toolbox.com/search?utf8=%E2%9C%93&q=sms gives some gems for SMS interaction. That is one of the first places I look, as well as searching on github.com directly. RubyForge is another good source of information for finding gems. https://rubyforge.org/search/?type_of_search=soft&words=sms&Search=Search

Categories : Ruby

Is it possible to create model of a table from a given table of database in django model
I don't think you can tell inspectdb to generate code only for a certain table. You can just use inspectdb for all tables, and then only use the code generated for the table you want. The modelname usually is the CamelCased version of your underscored_table_name.

Categories : Django

Django South error recovery: no such index
It turn out that SQLite doesn't create an index for one-to-one field in the first place, but South assumes it does. I suspect database type is the culprit for many other errors I encountered when using South. Solution is simple though. I go into the migration file and remove index part in both forward and backward functions. That's it.

Categories : Django

Script to automate recovery of MySQL password
Here is a start: service mysql stop vi /etc/my.cnf # In the server section add skip-grant-tables service mysql start mysql use mysql; insert into user (Host, User, Password) values ('localhost','root',''); update user set Select_priv='Y',Insert_priv='Y',Update_priv='Y',Delete_priv='Y',Create_Event_priv='Y', Trigger_priv='Y', Create_tablespace_priv='Y' where user='root'; quit; vi /etc/my.cnf # remove skip-grant-tables mysqladmin shutdown service mysql start mysqladmin -u root password XXXXXXXXXX You should recognise the code, it's pretty much what you asked. The missing bits are for you to separate the MySQL commands from the shell commands, or to wrap them as an invocation of mysql: mysql -D mysql ... Also, consider placing the password in a suitably protected file or passing it as

Categories : Shell

Recovery of the hash avatar on XMPP for facebook
Can you post the XMPP trace of what you send to the server after receiving that presence update? If your client doesn't recognise the hash, it should be querying the server for it. Is this happening? Is it possible that you're calculating the hash against the base64 encoded data rather than the raw data itself?

Categories : Facebook

Visual Studio password recovery without email
Protected Sub PasswordRecovery1_SendingMail(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MailMessageEventArgs) Handles PasswordRecovery1.SendingMail e.Cancel = True; PasswordRecovery1.SuccessText = e.Message.Body; Link: http://forums.asp.net/t/1138927.aspx/2/10

Categories : C#

Corrupt quicktime movie repair or recovery of some content
Depends what do you call 'corrupted video'. If there's no indexing, because of which usually most video players refuses to play the video, this can be done with mencoder or ffmpeg. For example this command fixed video indexing issue: mencoder -idx input.avi -ovc copy -oac copy -o output.avi There are plenty of video issues out there and you need to know how to handle each of them. I'm sure you'll find plenty of topic on web for recovering videos with these tools. So all you need is ffmpeg or mencoder wrappers if you want to write tools with python

Categories : Python

SolrCloud hash range set to null after recovery from index corruption
I ended up fixing it by uploading a new clusterstate.json to Zookeeper, using the Zookeeper CLI tool, with the correct hash ranges set (they were easily deducible since they were sorted by shard name).

Categories : Solr

Along with my hosted Windows service's installer, is it possible to set the recovery options when errors occur?
You can set recovery options using sc.exe from the command line. This answer has a good example of how to do this using C#: Install Windows Service with Recovery action to Restart

Categories : C#

Guide to implementing spring security password recovery with dynamic URL sent to email
The problem doesn't really have much to do with Spring Security. Provided you know the structure of the user database and the password encoder used, it's really just implementing a workflow involving data access, web controllers and sending an email. The link should contain a random token string (use SecureRandom and a base64 encoder, for example) and it should be stored in a database with the userId and a timestamp (for validating the window within which the link is valid). The controller would simply extract the token from the incoming request, load the data from the database using the token. It would check the timestamp and then forward the user to a password entry form. Depending on requirements, you might also want them to answer some other security questions too. You'd then validate

Categories : Java

Ubuntu 12.04.2 server auto enter root shell in recovery mode
After further study, I thought I had figured it out. Two changes are needed: (1) update the grub.cfg to customize recovery mode - open /boot/grub/grub.cfg - revise the menuentry "linux ...... ro recovery nomodest ...... " to "linux ...... ro single ...... " (2) There is known issue of GRUB in the 12.04 64bits, where the change of timeout is not converged into final grub.cfg (/etc/grub). You have to revise "set timout=-1" to "set timeout=0" in the auto generated grub.cfg or do below, §/etc/grub.d/00_header –In the make_timeout() function: replace the if/else/if block with "set timeout=${2}“ before executing update-grub. Actually, you should do step (2) first and then step (1)

Categories : Linux

How can I model log in database?
For instance at first variant you can create 3 additional QueryManager for your Log model and use them (it will be similar to the 2 variant but without creating 3 additional models). They can be like create_objects, update_objects and delete_objects or more shorter (for example create_log). Here is example of manager class: from django.db.models import Manager class LogManager(Manager): def __init__(self, type): super(LogManager, self).__init__() # add check of type if you need self._type = type def get_queryset(self): return super(LogManager, self).get_queryset().filter(type=self._type) This code is only for demonstration (I didn't test it). And in your model class you should specify 3 additional managers like this: from django.db.models im

Categories : Python

Set database for model?
// Model class Client extends Eloquent { protected $connection = 'masterDb'; } // config/database.php 'masterDb' => array( 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'name', 'username' => 'user', 'password' => 'pass', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ), You can create as many named connections as you wish. Set one of them as default, each model can use any of these connections later.

Categories : Laravel

Database Model for authorization
Sounds like a good design except you might be reinventing the wheel. Java EE already provides both declarative and programmatic security facilities which is similar to what you're trying to implement.

Categories : Java

Database isn't generated from model
I would start looking at a few things, permissions being one. Make sure the delegating caller can actually create on this database. Also validate that EF is access the database during debugging : base("name=DatabaseContext"). If you can access the database, IntelliTrace will give you the out put statements it is creating. Also, I would validate migrations is enabled. Using Nuget Package Manager Console run, Enable-Migrations.The full tutorial is Building an Initial Model & Database

Categories : C#

Recreate database when model changes
Set database initializer. If you want drop existing database when model changes, and recreate it, then use DropCreateDatabaseIfModelChanges initializer: Database.SetInitializer(new DropCreateDatabaseIfModelChanges<YourContext>()); If you want to seed database with some data, then create your own initializer and override seed method: public class YourInitializer : DropCreateDatabaseIfModelChanges<YourContext> { protected override void Seed(YourContext context) { context.Foos.Add(new Foo()); // ... context.SaveChanges(); base.Seed(context); } } And use this initializer: Database.SetInitializer(new YourInitializer());

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.