You are on page 1of 13

Sybase DBA Interview Q&A Anything About SAP HANA,ASE,REP, IQ,ASA.


Question 1 What is the purpose of sybsystemdb? Answer 1 Sybsytemdb is basically used for distributed transaction management features, it is licensed feature. ~ Question 2 Suppose our tempdb is filling up (not completely Filled), you cant recycle the db server, and then what would be your steps? Answer 2 If tempdb is filling up, in that case you need to find out the culprit spid . Once you get the spid, escalate this spid to App support. After the confirmation you can kill this culprit spid /take the action as per request. ~ Question 3 Business Team (AD) is reporting the query slow performance, how will you investigate, pls consider all case. (Hint: memory, stats, indexes, reorg, locks etc) Answer 3 First I will look for blocking and if there is no blocking, I will check for errorlog for deadlock information, I will check for show plan weather Its is proper indexes or not, and if its not using proper indexes we can check for stats. Issue can be due to fragmentation also, so you can also check the fragmentation using derived_stats function. Consider checking data cache (if there are lot of cache misses in sysmon report). ~ Question 4 We have configured 7 dataserver engines for our PROD server(we have sufficient cpus), still we are facing the performance hit? Possible root cause? Answer 4 It can be due to spin lock contention; however it might be due to some other reason too. ~ Question 5 Suppose we are doing the ASE 15 upgrade by dump & load, and in 12.5 server having 2000 logins. Since syslogins having different table structure in both environments, we cant use bcp, how will we move these logins from 12.5 to 15.0? Answer5 You can create ASE15 syslogin structure table in ASE 12.5x environment, after perform the select into from master..syslogins to tempdb..tempdsyslogins , now do the bcp out . Now you will able to bcp in . ~
Sybase DBA Interview Questions- 2 -

Question 6 What is the difference between shutdown and shutdown with no_wait, besides the immediate shutdown difference? Answer 6 Shutdown with no wait never performs the checkpoint before server shutdown. ~ Question 7 Suppose In our one database huge trans are going on, we issued the shutdown with no_wait . Will it hit the server restart and how? Answer 7 Yes it will impact, database recovery may take long long time, Please avoid to do shutdown with no wait in production eenviorment. ~ Question 8 Is object level recovery possible in ASE? Answer 8 Using archive database feature we can do object level recovery. SBT can also perform object level recovery. ~ Question 9 How many maximum numbers of columns can create in a table? Answer 9 Maximum number of columns in a table is based on two parameters Fixed length or variable length column APL (all pages locked) or DOL (data only locked) tables If columns are fixed-length then maximum number would be 1024 irrespective of APL/DOL table. If columns are variable-length then maximum number would be 1024 for DOL table. If columns are variable-length then maximum number would be 254 for APL table. ~ Question 10 What is the maximum number of arguments can be passed in stored procedure? Answer 10 The maximum number of arguments for stored procedure is 2048. ~ Question 11 What is the maximum number of references allowed for a table? Answer 11 The maximum number of references allowed for a table is 200.
Sybase DBA Interview Questions- 3 -

~ Question 12 What is the maximum number of aggregate columns can be used in a compute class? Answer 12 127 ~ Question 13 What is the maximum number of columns can be used in group by clause? Answer 13 255 ~ Question 14 How many indexes can a table hold? Answer 14 A table can have maximum 250 indexes wherein 1 is clustered and remaining 249 are nonclustered indexes. ~ Question 15 How many devices are created during installation in ASE 15? Which system databases are stored on these devices? Answer 15 Three devices are created during installation: the sysprocsdev device, which stores the sybsystemprocs database, the systemdbdev device which stores the sybsystemdb, and the master device, which stores the master, model, and tempdb databases. Question 16 How many clustered index can be created in a table and why? Answer 16 Maximum number of clustered index can be created in a table is 1 because clustered index pages are tightly coupled with table pages and clustered index forces the table to store the data in a sorted way. So sorting can be defined only in one way. Hence, only 1 clustered index is possible in a table. ~ Question 17 What is the limit of nesting level of sub-queries in a TSQL query? Answer 17 16 level limit. ~
Sybase DBA Interview Questions- 4 -

Question 18 What is the maximum number of sub-queries can be defined on each side of a union? Answer 18 The maximum number of sub-queries on each side of a union is 16. ~ Question 19 How many columns can be referenced by a view? Answer 19 The number of columns referenced by a view cannot exceed 1024. ~ Question 20 How many total numbers of table can be used on all sides of a union query? Answer 20 The total number of tables that can appear on all sides of a union query is 256. ~ Question 21 How many columns can be specified in a single composite index? Answer 21 31 columns in a single composite index can be specified. All the columns in a composite index must be in same table. The maximum allowable size of the combined index values is 600 bytes. That is, the sum of the lengths of the columns that make up the composite index cannot exceed 600. ~ Question 22 How many page locks are required to escalate to table lock? Answer 22 200 page locks are required to escalate to table lock. ~ Question 23 How many row locks are required to escalate to table lock? Answer 23 200 rows locks are required to escalate to table lock. ~ Question 24 What is the difference between Database and DBMS (Database Management System)? Answer 24
Sybase DBA Interview Questions- 5 -

Database is the collection of database objects i.e. Tables, Views, and Procedures etc. DBMS consists of software that operates on database which provides storage, access, security, backup and other facilities. DBMS is responsible for storing data in tables and maintains relation among them. ~ Question 25 What is the basic architectural difference between Sybase, Oracle, UDB/DB2, MS SQL Server? Answer 25 There are two algorithms to design the databases. So all databases are based on these 2 algorithms and we can group databases accordingly. Algorithm Multiple Instances Single Database Multiple Instances Multiple Databases Databases Oracle, IBM UDB and DB2 on ZOS Sybase, MS SQL Server

~ Question 26 What are the system mandatory databases in Syabse? Answer 26 Sybase contains the 5 mandatory databases which are required to run ASE. Mandatory Databases: Master Database Master Database is the brain of ASE. It contains the system tables that stores the data used to run and manage ASE. Model Database Model is the template database used to create new database. Sybsystemprocs Database It stores all the system procedures which are required to perform operations on system tables. Sybsystemdb Database It contains data for the distributed transaction management feature. Tempdb Database It contains the temporary tables used to perform temporary operations, ~ Question 27 In addition to Question 3, what are others ASE defined system databases? Answer 27 In addition to above 5 system databases, ASE has 5 more system defined databases. Sybsyntax Database It contains the syntax help for SQL keywords. Dbccdb Database Installing dbccdb allows system administrators to check database consistency using parallel processing commands. Sybsecurity Database It contains auditing information Installing sybsecurity allows administrators to audit users. Sybdiag Database It is used for diagnostic purpose. pubs2 and pubs3 Database These are sample databases for a fictitious book distribution company, only for R&D purpose. We generally do not install these dbs in our application environment.
Sybase DBA Interview Questions- 6 -

<Application Databases> Application databases are user defined databases in production or development environments. ~ Question 28 What are system tables and their usage? Answer 28 System tables are an inbuilt table which gets created at the time of server build. System tables store the data about server and database. System tables are created and maintained by ASE only. No user can update the system tables. System tables are accessed by users using system procedures. E.g. sysdatabase system table stores details about the databases installed in a given server. Details of those databases can be accessed using system define system procedure sp_helpdb <database name>, etc. ~ Question 29 What is the total number of system tables exists in master database and other database? Answer 29 All databases, except master, have 29 system tables which stores the information corresponding to same database only. There are total 56 system tables exists in master database. As master database is the brain of the ASE server, it stores the information about each and every databases and configuration parameter, so it has some extra tables apart from common 29 tables. ~ Question 30 Why system table syslogs should not be altered manually? Answer 30 Do not attempt to modify syslogs with a delete, update, or insert command. An attempt to delete all rows from syslogs will put Adaptive Server into an infinite loop that eventually fills up the entire database. Because while manually updating the syslog table will insert a record in the same syslog table as a part of its logging function, so every time it will delete a row a new row would insert into the table and eventually sever will put onto an infinite loop.

~ Question 31 Can we create trigger on system tables? Answer 31 We cannot create triggers on system tables. If we try to create a trigger on a system table, Adaptive Server returns an error message and cancels the trigger.
Sybase DBA Interview Questions- 7 -

~ Question 32 Can aggregate functions be used on virtual tables such as syslocks and sysprocesses? Answer 32 Aggregate functions cannot be used on virtual tables such as syslocks and sysprocesses. ~ Question 33 What are important Sybase environment variables set while server build? Answer 33 In Linux environment $SYBASE It is a Sybase home directory called as Sybase installation directory. $SYBASE_ASE It is a Sybase ASE home called as Sybase ASE Home in $SYBASE. $SYBASE_OCS Sybase open client directory. $DSQUERY Sybase server name. ~ Question 34 What is the difference between environment variables $SYBASE and $SYBASE_ASE? Answer 34 $SYBASE is a root directory of Sybase wherein all Sybase products would get installed. Whereas ASE (Adaptive Server Engine) server is one of the product of Sybase, so it will installed at $SYBASE_ASE location (inside $SYBASE) ~ Question 35 Which file defines all the environment variable and what its location? Answer 35 In Unix environment, stores all environment variables which resides at $SYBASE directory. ~ Question 36 What is Run server file and how to mention configuration file name in run server file? Answer 36 Run server file, which gets created during ASE installation, contains the dataserver command to start Adaptive Server or the backup server command to start backup server. By default, the runserver file is in the current directory and is named RUN_servername. We specify the configuration file name with c option in the RUN server file. ~ Question 37 Define configuration and interface file?
Sybase DBA Interview Questions- 8 -

Answer 37 Configuration file: it stores the configuration information for the Sybase ASE server. By default configuration file name is like <servername>.cfg When server starts, ASE server allocates the resources as per configuration file. Interface file: Interface file stores the connection information between client and server. It resides in $SYBASE.If configuration file, does not exists; it creates the new one with default values. Question 38 What is configuration Parameters? Answer 38 Configuration parameters are setting which controls the behavior of ASE server. All configuration parameters gets stored in configuration file which resides at $SYBASE_ASE . After the ASE installation, ASE supplies default values for the parameter. With these default values, ASE server can start only. ~ Question 39 How to see the configuration value set up? Answer 39 To see configuration values, use system stored procedure sp_configure. By running this stored procedure without passing any arguments will provide all parameters values. sp_configure with parameter name provides the details for that given parameter only. sp_ configure [parameter_name | group_name ] ~ Question 40 How to change the configuration parameter? Answer 40 We can change the configuration parameter in 2 ways. using sp_configure system procedure. Manually modify the cfg file. ~ Question 41 What are different types of configuration parameters and how their values get reflected? Answer 41 ASE has two types of system parameters. Static parameter Static parameter changes reflected after the reboot of server. Dynamic parameter Dynamic parameter changes reflected immediately. ~
Sybase DBA Interview Questions- 9 -

Question 42 What is the role of configuration file while server startup? Answer 42 On server startup, ASE allocates the resources as per the configuration file. It also makes the backup of the existing configuration file with name <servername>.bak ~ Question 43 What is the good practice to change the configuration parameter? Answer 43 When you use sp_configure to change a parameter, the server: Saves a copy of old file with name <servername>.001, <servername>.002 Write a new cfg file <servername>.cfg ~ Question 44 Which table stores the value of configuration parameter? Answer 44 sysconfigures (In master database only) This table stores the value from startup time, or from the last modification of a parameter value. Columns: Value Startup value for the parameter Comment Name of the parameter Status Numeric value that represents the type of configuration parameter ~ Question 45 Which table stores the in use configuration parameters? Answer 45 syscurconfigs (In master database only) This table stores the configuration values in use. Columns: Value Current value for the parameter Status Numeric value that represents the type of configuration parameter defvalue Default value of the parameter syscurconfigs table stores the active dynamic configuration parameters and startup time of static parameters. ~ Question 46 What is the housekeeper? Answer 46 The housekeeper is a task that becomes active when no other tasks are active. It writes dirty pages to disk, reclaims lost space, flushes statistics to systabstats, and checks license usage.
Sybase DBA Interview Questions- 10 -

~ Question 47 Which components of Adaptive Server memory cannot be configured? Answer 47 The Adaptive Server executable, kernel structures an memory object pools cannot be configured. ~ Question 48 How can you verify that a server is running? Answer 48 You can verify a server is running i) by using the showserver command in Unix/Linux or in a Windows Command Prompt window by using the command net start. You can also go to Windows Services in the control panel. ii) By ps eaf | grep datas command in UNIX ~ Question 49 When you execute a stored procedure (starting with sp_), where does the server look for that procedure? Answer 49 The server first looks for the procedure in the current database. If it is not there, it then checks the sybsystemprocs database. If it is not there, it finally checks the master database. If the stored procedure cannot be found there, it returns an error. ~ Question 50 When you execute a stored procedure(does not starting with sp_), where does the server look for that procedure? Answer 50 Server only looks in current database. ~ Question 51 What is the difference between system tables found in every database and system tables found only in the master database? Answer 51 System tables found in every database store data about that database. System tables found only in the master database store data about the entire server( metadata, data about other databases, run time information , config information) Question 52
Sybase DBA Interview Questions- 11 -

What is the location of the ASE 15.0 configuration files (*.cfg) for windows and Unix platform? Answer 52: $SYBASE :Windows, $SYBASE/$SYBASE_ASE : Unix ~ Question 53 What is the difference between ASE Package Installer and srvbuild? Answer 53 Installer unloads the ASE software ( its create the directory structure). srvbuild creates an Actual Adaptive Server. ~ Question 54 What is the default name of the configuration file? Answer 54 By default, the configuration file is named <server_name>.cfg. ~ Question 55 Why ASE is Adaptive Server? Answer 55 We can configure the ASE for different environments by changing the configuration files, so its adaptive for any environment. ~ Question 56 What is the SySAM? Answer 56 SySAM stands for Sybase Software Asset Manager.

~ Question 57 Where is the RUNSERVER file located? Answer 57 In ASE 15.0 servers, the RUNSERVER file is located in the $SYBASE/ASE-15_0/install directory. ~ Question 58 What is the purpose of the interfaces/sql.ini file? Answer 58 The interfaces/sql.ini file is an address book that client and servers use to determine which address they should use when communicating with each other.
Sybase DBA Interview Questions- 12 -

~ Question 59 What command or procedure is used to display helpful information about configuration parameters? Answer 59 sp_helpconfig ~ Question 60 What two configuration parameters control memory allocation behavior? Answer 60 allocate max shared memory and dynamic allocation on demand.

To be continued

Sybase DBA Interview Questions- 13 -