Skip to main content

Posts

Showing posts from 2015

First Day with Neo4j Graph Database

Hi friends, 2015 is the year when I started working on noSQL databases, I have shared my few post earlier on same . Today my post is related to one more nosql database which came into my skill recently. This is a popular Graph Database Neo4j. Neo4j is a popular noSQL, open-source, graph database which is implemented in Java and accessible from software written in other languages using CQL. Neo4j Support ACID. What is Graph Database ? In computing, a graph database is a database that uses graph structures for semantic queries with nodes, edges and properties to represent and store data. Graph databases employ nodes, properties, and edges.

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  

mySQLdump easy way to take backup of database

MySQL is very handy database and tool to manage than sql server.  Today I will backup Mysql Database from command prompt. So 1st switch to bin folder c:\programfiles\mysql\mysql server 5.5\bin:\> Now give command mysqldump -u root -p theYoungDBA d:\data\dump\ theYoungDBA .sql ;;;here < theYoungDBA > is the database which backup we will took. <d:\data\dump\ theYoungDBA .sql> is the target path where backup dump will keep. Thanks https://www.facebook.com/pages/Sql-DBAcoin/523110684456757

Backup restore mongoDB Database

Hi friends,  Backup is always survival of any DBA either SQL or noSQL. My Last post was how to configure mongod process . Today i will backup and restore a mongodb database (also called namespace ) from command prompt. To take Backup execute command from \mongodb\bin\ directory Syntax Mongodump   --db <database name> eg. mongodump --db youngDBA List of associated backup files will generate we can varify from DUMP folder .. Now just for eg if I accidentally droped database from Robomongo (a mongoDB GUI tool) and i have to restore then execute command from mongodb\Bin\ mongorestore   <Source path> mongorestore  <E:\\mongodb\dump\user> This is very easy step like mySQL. Thanks https://www.facebook.com/pages/Sql-DBAcoin/523110684456757  

5 commands to handle Mongod Process

This year mongodb added into my skill set. Experts saying since last 10 years social media applications are most populars in the market which changes platforms, database and technology. This creates noSQL, hadoop and lots of new platforms for big data. Initially I want to say "MongoDB is a rapidly growing database in database market shares". This is a noSQL or what we are saying non-relational database . It become popular to develop rapid applications/ e-commerce sites/ online systems/ social media applications.  I am going to share my 1 st post on mongodb database. Now you will get more stuffs every week. Here is 5 most usefull mongodb configuration commands. All these are 1st day commands to start on mongodb database. Before starting to work on mongodb database, 1st we have to start command prompt with mongodb bin folder . How to start mongdb server. How to configure Data path. How to configure port. How to configure log. How to properly shut down mongodb serve

Top 10 NoSQL Database Design Funda

Design your Database schema in according to user requirement . Optimize your schema for most frequent use case. Combine objects into one documents if you will use them together, otherwise separate them. Duplicate the data because disk space is cheaper than computing time . Basically avoid joins however do while writing, not during reads. Don't insert mixed data-type values into one common fields, it can degrade performance. Do complex aggregation in schema. Do Capped Collection for fast writing on collection. Use Natural/default Order to read collection. Create index in Background . (offline). Avoid not in and not equal to operation . $ne and $nin .

sqlserver_start_time in dm_os_sys_info : sql server 2005

I was trying to get last server start time through DMV sys . dm_os_sys_info on all sql servers instance where groups was 2005+2008+2008r2+2012+2014. I got the result quickly excluded from one sql server 2005 instance it populated error.. Msg 207, Level 16, State 1, Line 1 Invalid column name 'sqlserver_start_time' . I think Microsoft was forgot to add this column in 2005. I managed it through. SELECT crdate FROM sysdatabases WHERE [name] = 'tempdb'. and xp_readerrorlog  Apart from this SYSDATETIME () was also not present in 2005 but now this is available …

Scalability, Horizontal and Vertical scalability

What is Scalability? Wikipedia say "Scalability is the ability of a system, network, or process to handle a growing amount of work in a capable manner or its ability to be enlarged to accommodate that growth." In Database point of View: Scalability is the ability or feature that should be able to support very large databases with very high request rates at very low latency. In General meaning "scalable database" is the ability of database which can add resources on any way to manage performance easily on growing database or requests. There are two types of Scalability vertical and horizontal. Vertical Scalability: 1.)     Increase capacity by adding more resources (memory or additional CPU ) to machine. 2.)     Usually it requires downtime. 3.)     It saves power consumption, less data-center cost and additional cost finance wise. Horizontal Scalability: 1.)     Horizontal Scalability is the ability to increase capacity by connecting mult

5 Important mySQL Development scripts

During database review most useful object I used information_ schema and show tables. Now I feel ease to work on mysql, either from command line or most popular tool workbench.  Since 2014 mysql added into my skill set and till now 3-4 projects.  Last year I have posted   5-important-shortcut-and-tips-to-work on workbench and today I am sharing  5 more commands what I am using for development and review on mysql database projects. 1.        How to insert or populate data in one table from another table? 2.        How to update one table from another table? 3.        How to create and use temporary table? 4.        How to Check Table Property from command line? 5.        How to check all indexes from one table? How to insert or populate data in one table  from another table? insert into user2  SELECT * FROM setting.user; How to update one table from another table? UPDATE temp p, word pp SET pp.name= p.name, pp.describe = p.describe WHERE pp.id = p.id;

How to export performance metadata and statistics

Performance of query execution (stored Procedure or Ad-hoc query) is depends on Execution Plan and execution plans depend on Statistics-histogram . We already know Query Statistics is metadata of database engine which depend on data. Every insert-update-delete changes its stats. SQL server allowing us to export and copy to another server. So we can use it to sync the performance of server during quality or testing of procedures and queries. Step Connect to Production Server and right click on database. In the list just choose Generate Script. Now click on next and Choose Advance option button. Then select script statistics and then Next and Finish. This will generate Script just copy these script and run on Quality server/Testing Server Database.   Happy Reading...

Csharpcorner Annual Conference 2015

Hi friends, how are you? Hope you are doing well, as always I am cool. It was 2 nd time when I didn’t missed Csharpcorner Annual Conference . Rain could not stop my 3 months waiting, yeah… heavy rain in NCR on 4 th April . Organizer Mind Crackers and  sponsored   Infralogistics , Aspose , MCN Solution and Plural Sight , done well in this year. Microsoft were technical partner of this event. I reached on time with my colleague @ Country Inn Sahibabad, Ghaziabad, UP. The main highlights were the no of attendees it was about 1200 including MVPs, 20 most popular speakers and 28 different sessions on two different tracks (Grand Ball Room for Technology and Majestic for Platform). Sumit jolly started event as host and later Mahesh Chand sir keep the Keynotes in front of us who is the owner-director of CSharpcorner community. The entire community is debtor of him because his effort helping us. He explain what New Technology came in 2014. He addressed the community how he started fro

Join vs Correlated Sub-query

Not always but I observed simple join is much better than Correlated sub-query. So plz avoid to use it, if we have option than .... today i am sharing how a simple join is better than correlated sub query. . correlated sub-query in columns select   candidate_id,last_name,first_name,client_id, (select name from client_master where client_id=candidate_master.client_id) as cl_name  from candidate_master

How to Create Read-Only User in MySQL using workbench

Friends, Till now I haven’t got chance to vote in any election for PM or CM. This month everywhere talking about elections and here I am busy with my work connect-share-discover with database and applications..  Today I want to share How to Create Read-Only User in MySQL using workbench. First Go to Users and Privileges option from Workbench Managements Tab. Click on Add account and give account name and their respective password, after that apply. In Users and Privileges box there are 2 other tabs, Administrative Roles and schema privileges. Administrative Roles is Similar to Fixed Server roles of SQL Server. Schema privileges is schema level authorization process. Select Schema privileges and click on Add Entry. Then a Dialog box will come with schema available in server. Now select any schema which privilege we have to configure. After that give the appropriate rights which we have to give. As I have selected on select. Finally click on Apply.

Dont worry if SSMS not support attaching FILESTREAM enabled databases

SQL Server 2005 introduced the unstructured data types VARCHAR (MAX), NVARCHAR (MAX) and VARBINARY (MAX). And later on File stream features came with 2008. We are using SQL Server version 2012 and unfortunately I would like to say to Microsoft doesn’t given option to attach File-stream Enabled Database from SSMS. Mostly this requires when trying to migrate DB or system or doing some DR activity or maintenance activity. If you will try to attach from SSMS then it may give some errors like below … TITLE: Microsoft SQL Server Management Studio ------------------------------ An error occurred when attaching the database(s).  Click the hyperlink in the Message column for details. ------------------------------ BUTTONS: OK ------------------------------   But don’t worry just try below query to re-attach db.. USE [master] GO CREATE DATABASE <DBNAME> ON ( FILENAME = N'LOCATION\name.mdf' ), ( FILENAME = N'Location\name.ldf&#