Skip to main content

Posts

Two way to execute javaScript in mongod

Hi friends, We can automate things of mongdb using javascript procedures . Mongodb allows to execute javaScript through two ways . This post will demonstrate how to automate mongodb administration work. First of all write mongodb queries or procedure, which we have to performe and then save into .js file and then consider any process out of below 2. 1.) We can execute from command shell, without login mongo shell. So we can schedule script of administering tasks that will run automatically like below : c:\>mongo localhost:27017/test admin.js This operation executes the admin.js script in a mongo shell that connects to the test database on the mongod instance accessible via the localhost interface on port 27017. 2.) We can execute a .js file from within the mongo shell, using the load() function, as in the following: load("admin.js") Thanks for reading

3 ways to recompile stored procedures

Requirement for Recompilation :  When we create and execute a procedure it will compiled and create execution plan for the present state of the database . If we do changes into database structure, we should recompiling a procedure updates and optimizes the procedure’s query plan for those changes. This can improve the procedure’s processing performance. Another reason to stress a procedure to recompile is to retro-act the "parameter sniffing". When SQL Server executes procedures, any parameter values that are used by the procedure when it compiles are connected as part of generating the query plan. SQL Server also do automatic recompiling of procedure whenever Server is restarted. 3 ways to recompile manually : 1.) Directly writing in procedure. 2.) During execution of procedure. 3.) Ad-hoc manner from query prompt. Directly writing in procedure. Create PROCEDURE [dbo] . [upTitle_Select] @TitleID int = NULL, @Title varchar ( 5 ) = NUL

SQL71562: external references are not supported when creating a package from this platform

Last week I got this error from one of developer who was trying to deploy his project from Testing server to SQL Azure QA server. He was using “Deploy Database to SQL Azure” option from SSMS Tool-Task option. After connecting to SQL Azure portal when operation started to deployment below errors occurs. Validation of the schema model for data package failed. Error SQL71562: Error validating element xx.xxx.xx:function .dbo.xxx has an unresolved refrence to object xx.dbo.xxxx external refrences are not supported when creating a package from this platform . Reason: The reason of the this error was; some functions of project was dependent on master database and only single database was being deploy to SQL Azure. DACFx must block Export when object definitions (views, procedures, etc.) contain external references, as Azure SQL Database does not allow cross-database external references So, this error was coming. Solution : I suggested him to create those function to locally

The database could not be exclusively locked to perform the operation

When database goes big it will difficult to do any administrative task and think if you have to change the name of database ; then it will be major task. I got below error while changing database name on my test database , users were loged in and i was trying to change the name , database server quickly pop-up error . I tried 2-3 times error was same like below : I followed below step to resolv e this issue :- ALTER DATABASE school SET SINGLE_USER WITH ROLLBACK IMMEDIATE ; GO EXEC sp_renamedb N'school' , N'SQLSchool' ; message - The database name 'SQLSchool' has been set . ALTER DATABASE SQLSchool SET MULTI_USER WITH ROLLBACK IMMEDIATE ;

Daffodil Software Celebrated 16th Foundation Day

16 September 2015, Galaxy Hotel Gurgaon Rocked with Daffodil Software Ltd foundation Day celebration. Today Organization became 16th years old . Last 3 years went superb for organization, they achieved 3 awards, Fast 50 India, Fast 500 Asia and Emerging India. Organization is growing every day with all aspects. Daffodil Software Ltd Established by Mr. Yogesh Agrawal in year 1999. Daffodil is the f irst organization in India where Java used for Product development and in New Generation cutting edge technology MongoDB, Drupal widely being used. These are few things which make different about Daffodil. Currently Daffodil is the leading organization in their field.

Asia's First SQL Confrence

I remembered that when I was registered first time on SQLSERVERGEEKS and attended a session at Microsoft Gurgaon in 2012,  I have seen technology and professional life were discussed without any expectation by 3 persons including teaching,  joking and talking. I got impressed because they were different from others. I decided to continue to attend next session also. Thereafter, I faced some downfalls in my life; friends left me but I continue with the community. Sometime later Community started knowing me which gave me strength helped me to come out from trouble. Now SQLSERVERGEEK is the part of my daily life. SQLSERVERGEEEG was founded by. Mr. Amit Bansal who is the Regional Director of Microsoft, Mr. Sarbpreet S Anand (MVP) who is the President, Manohar Punna (MVP) is the Vice President and Ahmad Osama (MVP) is the Chief Technical Editor. I am constantly getting a lines from thease individual in my professional lifetime.  Do you know Friends, 2015 is the Best time for SSG

mongoDB error : aborting after fassert() failure

What to do when facing errors on mongoDB “aborting after fassert() failure” I like errors, in mongoDB this is the first error I faced and luckily many times. This error i faced during restoring name-space on local and restarting db system. I am still searching the exact root cause of this issue but i am able to resolve the current problem through below steps. Remove all relevant namespace files from data-file route path.. Now repair mongo instance using mongod process. mongod --repair ////////// execute command from bin folder path  Then start server using mongd process, if started server successfully then .. mongod  ////////// execute command from bin folder path Restore last backups as normal process. Now check database by connecting mongo shell. Thanks for reading,  Please comment your experience if you faced and also share knowledge if you have better steps to resolve... https://www.facebook.com/pages/Sql-DBAcoin/523110684456757