Posts

Showing posts from 2011

Next set of Interview Q & A

1) How do you handle teams emotions.  2) How do you avoid leakages when there is lot me context switching.    3) Automation approach.    4) How do you manage when there is more work compared to your came width.  5) Conflict management.

Procedure to disable all user constraints on Oracle

BEGIN   FOR c IN   (SELECT c.owner, c.table_name, c.constraint_name    FROM user_constraints c, user_tables t    WHERE c.table_name = t.table_name    AND c.status = 'ENABLED'    ORDER BY c.constraint_type DESC)   LOOP     dbms_utility.exec_ddl_statement('alter table ' || c.owner || '.' || c.table_name || ' disable constraint ' || c.constraint_name);   END LOOP; END;
1) How do you decide the defect prone area ? 2) What do you do when you have resources with low competency ? 3) Example of risk and how to mitigate it ? 4) What do you do to increase teams productivity ? 5) What is effort estimation process in your company ?

EXP utility on 11gR2 will not work on empty tables with zero rows

1)Identify tables with 0 rows 2)Issue following command on those tables ALTER TABLE <<%empty_table%>> ALLOCATE EXTENT; 3) Now EXP utility will work

Identify empty tables in oracle

SELECT * FROM User_Tables s WHERE s.num_rows=0

To find PORT availability on unix systems

To find PORT availability on unix systems netstat -an | grep <<%PORTNUMBER%>>

Command to set 'NLS_LENGTH_SEMANTICS' after Installation & Creating 11gr2 db

update PROPS$ SET VALUE$='CHAR' where NAME='NLS_LENGTH_SEMANTICS';

Find A File Command

Find all perl (*.pl) files in current directory: > find . -name '*.pl'

Remove Control M characters from a file in UNIX

Open file in putty and execute the following command :%s,^VM,,g <------------ to remove ctrl m characters

To find Solaris version

1) cat /etc/*release 2) uname -a

To Verify ML versions

Following commands will give the ML versions in AIX 1) instfix -i | grep ML 2) oslevel -r

Find command in UNIX

Find text in the current folder and redirect output to OP1.txt find . -name "*" -exec grep "FIND THIS TEXT" {} \;>> OP1.txt Find text in the current folder and print the output on screen grep "FIND THIS TEXT" `find .` |cut -d":" -f1 | grep -v properties | sort -u find the text and print the file name along with the path on screen find xxxxxPATH_TO_SEARCHxxxxxx -type f -exec grep -l 'FIND THIS TEXT' {} \;

Update a column of a table with random values

Query to update a column of a table with random values within a range of 1 to 21 UPDATE <%table_name%> SET <%column_name%> = trunc(dbms_random.value(2,21))

Monitor Memory Status (available memory)

copy the following into a .sh file and execute the same from putty #!/usr/bin/ksh #memory calculator um=`svmon -G | head -2|tail -1| awk {'print $3'}` um=`expr $um / 256` tm=`lsattr -El sys0 -a realmem | awk {'print $2'}` tm=`expr $tm / 1000` fm=`expr $tm - $um` echo "\n\n-----------------------"; echo "System : (`hostname`)"; echo "-----------------------\n\n"; echo "\n\n-----------------------"; echo " Users Login information \n"; for ENTRY in `finger | cut -d " " -f1 | grep -v Login | uniq` do echo "`finger -l $ENTRY | head -1 | cut -d \" \" -f14` ---> `finger -l $ENTRY | awk '{ print $2 }' | tail -2 | head -1`"; #finger -l $ENTRY | awk '{ print $2 }' | tail -2 | head -1; done echo "-----------------------\n"; echo "\n----------------------"; echo "Memory Information\n\n"; echo "total memory = $tm MB" echo "free memory = $fm

Search for a string in schema

declare cursor c1 is select column_name , table_name from user_tab_columns where data_type = 'VARCHAR2' ; -- and table_name = 'TABLE_NAME' ; vSQL varchar2 ( 32676 ) := null ; vParam varchar2 ( 100 ) := 'STING_YOU_WANT_TO_SEARCH' ; vcnt number ; begin for x in c1 loop begin vSQL := 'select count(*) from ' ||x.table_name|| ' where ' ||x.column_name|| ' like ' ||chr( 39 )|| '%' ||vparam|| '%' ||chr( 39 ); execute immediate vSQL into vcnt; if vcnt > 0 then dbms_output.put_line( 'Found in ' ||x.table_name|| ' ' ||x.column_name); end if ; exception when others then dbms_output.put_line( 'Problem in ' ||vSQL); end ; end loop ; end ;

Command to set 'NLS_LENGTH_SEMANTICS' after Installation & Creating 11gr2 db.......

1) update PROPS$ SET VALUE$='CHAR' where NAME='NLS_LENGTH_SEMANTICS'; 2) ALTER SYSTEM SET NLS_LENGTH_SEMANTICS=CHAR; 3) ALTER SESSION SET NLS_LENGTH_SEMANTICS=CHAR;

Unable to export tables with 0 rows in Oracle 11g

Scenario: I have used this command in 11g where I was not able to use "exp" utility for exporting tables with no rows. Issue: I was not able to export tables with '0' rows, objects were not created while taking .dmp file. Resolution: Execute below query on tables from where you want to export "select'alter table '||table_name || ' allocate extent;'from user_tables"
Scenario: I have used this command in 11g where I was not able to use "exp" utility for exporting tables with no rows. Issue: I was not able to export tables with '0' rows, objects were not created while taking .dmp file. Resolution: Execute below query on tables from where you want to export select'alter table '||table_name || ' allocate extent;'from user_tables

Check the Hard disk space availability on AIX

Issue following lsvg command >lsvg rootvg vg01 Once you get response from server Issue following command and check "FREE PPs:" 212 (108544 megabytes) > lsvg vg01

How to find Host name and IP Address in unix ?

Access /etc/hosts (file) to view mapping between host names and IP Address

Function to find specific value in any table any column

Steps to use the following function: Replace the string highlighted in bold/red , with the string you want to search. Note: the following function is tested & working fine in Oracle DB. declare cursor c1 is select column_name , table_name from user_tab_columns where data_type = 'VARCHAR2';-- and table_name = 'REV_DIM_ATTRIBUTES_B' ; vSQL varchar2(32676) := null; vParam varchar2(100) := '10.184.75.23' ; vcnt number; begin for x in c1 loop begin vSQL := 'select count(*) from '||x.table_name||' where '||x.column_name||' like '||chr(39)||'%'||vparam||'%'||chr(39); execute immediate vSQL into vcnt; if vcnt > 0 then dbms_output.put_line('Found in '||x.table_name||' '||x.column_name); end if; exception when others then dbms_output.put_line('Problem in '||vSQL);

List all the files from directory and sub directories

Execute the command in root directory dir /s/p/w/b /S Displays files in specified directory and all subdirectories. /P Pauses after each screenful of information. /W Uses wide list format. /B Uses bare format (no heading information or summary).

Recursively delete files not folder structure

del /s/q *.doc - Delete only .doc files and not folder structure del /s/q *.* - Delete all files and not folder structure /S Delete specified files from all subdirectories. /Q Quiet mode, do not ask if ok to delete on global wildcard.

Oracle to Excel via Sqlplus

Try this on scott schema SET TERMOUT OFF SET FEEDBACK OFF SPOOL current_employees.xls SELECT ename||' '||ename AS "Employee Name", sal, hiredate, NVL(TO_CHAR(comm),'No Commission') AS "Commission", job FROM emp; OR Select * from emp; SPOOL OFF EXIT;

Installation may fail due to ULIMIT settings on LINUX

ULIMIT settings need to be verified before any installation on LINUX Default settings would be 1024 for bot ulimit -Hn & ulimit -Sn

Check whether UNIX OS is 32 or 64 bit

Following are the options to check OS 32 or 64 bit 1) # getconf LONG_BIT 2) # uname -a 3) # cat /proc/cpuinfo

Check if any executable file is 32 or 64 bit on any of UNIX flavours

Following is command to know whether the executable file is 32 or 64 bit $ file #filename# Note: Remove # on both sides when you execute command eg: $ file libcpptrippledes.so

How will environment affect the testing schedule

Simple scenario where I have experienced testing schedule affected by environment change. I was working on a datawarehouse product, where a Multidimensional (MDD) cube building is possible, which was successful while executing on 2003 Windows server but the same was failing when tried to build the same over 2008 Windows server, later identified as an environment issue with 2008 windows server. Which requires fix from the Microsoft, thereby the testing schedule got affected.

Interview Q & A

How will you allocate resources in the following scenario: 1) You have 5 resources, 2 are well experienced (5+ years exp), 2 are experienced ( 3 + years) and 1 fresher. 2) 2 machines to conducted testing

Software Testing Life Cycle

The software testing life cycle (STLC) identifies all testing activities and their relationship with other activities in the software development life cycle (SDLC). Software testing should begin with the start of the software development life cycle. The main activities of any software testing life cycle (various phases involved in testing) are: 1. Requirements analysis 2. Test planning, including test strategy 3. Test development and review 4. Test environment setup and maintenance (including test data preparation) 5. Test execution (static and dynamic) 6. Test reporting 7. Test result analysis (see "Software bug life cycle" on this website for details) 8. Defect retesting 9. Test automation 10. Test maintenance 11. Regression testing 12. Test closure # QA activities that have an influence on the software testing life cycle: Software configuration management (change control) # All QA defect prevention activities Software testing activities and

How a Good Bug Hunter Prioritizes his Bug Hunting Activities in Software Testing

Let us firstly understand as to what is a bug hunter? A bug hunter is an experienced & enthusiastic exploratory tester. Good bug hunters usually do the following: 1) Do initial exploratory testing of a suspect area, to develop ideas for more detailed attacks that can be performed by less experienced testers. 2) Explore an area that is allegedly low risk - can he quickly find bugs that would lead to reassessment of the risk? 3) Troubleshoot key areas that seem prone to irreproducible bugs. 4) Find critical bugs that will convince the project manager to slip a (premature) release date. How to prioritize the bug hunting activities? Generally the mission of a good bug hunter is finding bugs that are important (as opposed to insignificant) and finding them quickly. If so, what does this mean in terms of the tests that are run? You can use following suggestions to prioritize bug hunting in your software testing effort. 1) Test things that are changed before things that are the same. Fixe

What is the difference between Views and Materialized Views in Oracle?

Materialized views are disk based and update periodically base upon the query definition. Views are virtual only and run the query definition each time they are accessed.

Can we update a view ?

A View created by a single table, can be updated and the updates made on a view will be reflected on the the base table. An updatable view lets you insert, update, and delete rows in the view and propagate the changes to the target master table. In order to be updatable, a view cannot contain any of the following constructs: SET or DISTINCT operators, an aggregate or analytic function, a GROUP BY, ORDER BY, CONNECT BY, or START WITH clause, a subquery (or collection expression) in a SELECT list or finally (with some exceptions) a JOIN . Views that are not updatable can be modified using an INSTEAD OF trigger.

How to verify the Correcteness of the ETL process

Why are we doing ETL process: Customers are increasingly focusing on the collection and organization of data for strategic decision-making. The ability to review historical trends and monitor near real-time operational data has become a key competitive advantage. General goals of testing an ETL application: * Data completeness: Ensures that all expected data is loaded. * Data transformation: Ensures that all data is transformed correctly according to business rules and/or design specifications. * Data quality: Ensures that the ETL application correctly rejects, substitutes default values, corrects or ignores and reports invalid data. * Performance and scalability: Ensures that data loads and queries perform within expected time frames and that the technical architecture is scalable. * Integration testing: Ensures that the ETL process functions well with other upstream and downstream processes. * User-acceptance testing: Ensures the solution meets users' current expec

Client / Server Applications

What is: The client–server characteristic describes the relationship of cooperating programs in an application. The server component provides a function or service to one or many clients, which initiate requests for such services. Advantages: * In most cases, a client–server architecture enables the roles and responsibilities of a computing system to be distributed among several independent computers that are known to each other only through a network. This creates an additional advantage to this architecture: greater ease of maintenance. For example, it is possible to replace, repair, upgrade, or even relocate a server while its clients remain both unaware and unaffected by that change. * All data is stored on the servers, which generally have far greater security controls than most clients. Servers can better control access and resources, to guarantee that only those clients with the appropriate permissions may access and change data. * Since data storage is centralized, update