Sie sind auf Seite 1von 5

-------------------------SYBASE INTERVIEW QUESTIONS -------------------------1. What databases are created in Sybase by default when installed?

- master, tempdb, model model --> template to provide attributes to various databases. Need an exampl e?? 2. What types of temp tables are created? - #abc, tempdb..abc - # tables life time is within the sp it is created or until session is open; when the session is closed all the # tables will be dropped. 3. When will tempdb..xxx tables be dropped? - When the sybase server is bounced. 4. What happens exactly when the sybase server is bounced? How are the tempdb.. tables dropped? - ??? The tempdb database is recreated from model database. 5. Have you used 'user defined datatypes'? What are they? - ??? sp_addtype tid, "char(6)", "not null" 6. What are the advantages of sp? - Fast -> why? a. Network traffic. b. Faster execution. Becuase it is alredy compiled/ c. Query plan can exist in procedure cache. 7. When will the query plan of a sp be created? - compile time or when executed first time. 8. What exactly happens when the sp is created? - ??? 9. Where is the sp stored when created? - syscomments --> what else are stored in syscomments? Performance Tuning: -------------------10. How will you start performance tuning? 11. How sybase will decide which index to use? - based on the statistics - stored in sysstatistics. 12. What are 'deffered update' and 'direct update'? - In a update statement when the table that is getting updated is joined, th en inorder not to join the updated data again and goes on in infinite join, Sybase deffers the update to table until all r ows are scanned. I think it stored the intermediary result in a work table. - Direct update is something which is updated realtime. 13. How to get query plan? How to get the query plan if I don't want to execute the query?

- SET SHOWPLAN ON - SET NOEXEC ON - SET FMTONLY ON 14. How error handling is done in stored procedure? - @@error variable not equal to zero when there is a error in the just execu ted SQL. 15. How will you pass the error message from stored procedure to the application program? - ??? may be db interface 16. What are different modes of transaction? - Chained mode and unchained mode. default is unchained. "set chained on" to set mode of transction. http://manuals.sybase.com/onlinebooks/group-as/asg1250e/sqlug/@Generic__Boo kTextView/53713;pt=52735/* 17. How does sybase internally manages a transaction? - @@trancount, transaction log 18. In a nested transaction, if you issue a rollback at the end all transactions are rolled back. How does sybase do this? - ??? 19. What are different locking schemes in Sybase? Allpages locking, which locks datapages and index pages Datapages locking, which locks only the data pages Datarows locking, which locks only the data rows http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc20021_12 51/html/locking/X25549.htm - ??? 20. How do you define what lock to be applied when defining a table? - CREATE TABLE abc (c1 int, c2 int) lock <datarows/datapages/allpages> create table table_name (column_name_list) [lock {datarows | datapages | allpages}] 21. What is the difference between Row level, Page level, Table level locks? Whi ch is preferred? - ??? 22. What is the default locking scheme is Sybase? Why Sybase decide to use this? - ??? page level -- Allpages locking is the default locking scheme 23. How update lock works? - ??? Sybase expects a row in page then creates a page lock till finds the a ctual row, then creates a exclusive lock. 24. Which lock should be used? Which is faster (or something like that he asked) ? - ??? For wide data range selection or update it is page level lock, else ro

w level locking. 24. What are different types of joins? - Simple join, self join, outer join 25. If monitoring tool is not installed how will you indentify the slow sql in a application? - what are the sys tables that can help us??? 26. How do you quickly provide a solution for a performance issue? - AQP? 27. How will you apply AQP to a query within a stored procedure? - ?? 28. What are the tools available in Sybase for performance tuning? - Force plan, index covering, ...? 29. What are indexs and types? Diff between clustered and non-clustered index? www.sybaseteam.com/showthread.php?tid=405 30. What are disadvantages of clustered index? - Table need to sorted if the table is inserted/amended/deleted often. 31. In Stored Procedure, what is the use of with recompile option? - Every time the sp is executed a new set of query plan is created. Used whe n data in the tables of sp change drastically/dynamically. 32. What is sp_recompile? When will you use this? - ??? Causes each stored procedure and trigger that uses the named table to be recompiled the next time it runs. sp_recompile objname 33. What are the advantages of views? - abstraction; not all data of the same table can be shown to the user. - He was asking one basic advantage you missed - what is that? http://sqlserverpedia.com/wiki/Views_-_Advantages_and_Disadvantages 34. What is with check option on views? - So that the column updated is visible for the view. 35. When a new column is added to the table and there is a view with that table say 'select * from table', when you execute the view will it include the new column? - No, because the 'select *' would internally get expanded to individual col umns and hence view will not know about the new column. 36. When a user manually update a column, say flag, in the table (there may be m any other columns), then it should be validated? How will you do this? - Trigger create trigger flag_trig on emp for update as begin

if exists (select 1 from deleted D, inserted I where D.flag != I.flag) BEGIN SQL Statements END 37. How does a update trigger work? - magic tables deleted and inserted. 38. What are different BCP types? What are the options available? - ??? Fast Bcp (removing triggers, indexes on table and then bcp) and slow bcp 39. What is a batch option in BCP? When -b option is not given and when you bcp in 4 million records what happens? - ??? Transaction log blows as bcp is logged operation. Long open transactio n also creates problem. 40. What happens exactly when a BCP with batch option is done? - ??? 41. What is the use of identity column? Can we give our own value? Do you know o f identity gaps? - ???sequential entry by sybase, yes we can give our own value. some rows de leted in between. 42. UNION and UNION ALL? What is the difference which is faster? - Union - gets distince Union all - duplicates. This is faster. 43. What is correlated sub query? What happens exactly in a correlated sub query ? 44. In isql utility what is o and i option? - o to output the query result to a file. - i to execute set of sqls stored in a file. 45. How can I ignore duplicates while loading data through BCP? - Create a index with ignore_dup_key option. 46. What is the difference between a 'User' and a 'Login' in Sybase? - ??? login is authentication to server. user is for database. 47. What are the system tables have you seen so far? - sysobjects, syscolumns, sysindex, syscomments,sysqueryplans,sysdevices 48. How do you know all the processes in a SYBASE? - sysprocesses -----UNIX -----1. What is AWK and why do we need it? 2. How to find a string in a file? - grep 3. What is SED? . /* Some action */

4. How do you know all the processes in a UNIX? - ps

Das könnte Ihnen auch gefallen