Monday, December 7, 2009
VECTOR MQT problem
Wednesday, December 2, 2009
Failover Technology
A cluster is a group of servers networked together to share the work load. Failover is the process of transferring operation of a failed server to a backup server to ensure websites remain online even due to hardware failure or maintenance. Failover is used to host mission critical websites that require constant availability.
If a server fails, all sites are down, no mail works, incoming mails circulate in queue.
· A cluster system where one operates web and mail, the other databases. Both get mirrored constantly.
· If server A fails, his work is done by server B
· If server B fails, his work is done by server A
· As soon as both are working again, they get mirrored.
· No offline for website and no late mails.
Database Clustering
Database clustering is the way of achieving higher availability of database.
- Cluster: Cluster is a group of computers configured to work together to serve clients in a similar fashion.
- Nodes: Each server participating in a cluster is called as node.
- Max nodes in a cluster: In Windows Server 2003, the maximum number of nodes can be 4 (with at the most 16 SQL instances) whereas in case of Windows NT, maximum number of nodes can be 2 in a cluster.
- Heartbeats: The nodes in a cluster remain in constant communication through the exchange of periodic messages, called heartbeats.
- Same OS on Servers: A cluster cannot be made of nodes running Windows Server 2003 Enterprise Edition and Windows Server 2003 Datacenter Edition. The OS installed on all the nodes must be same.
Virtual IP (VIP): The client system communicates with the DB server using virtual IP. MSCS takes care of redirecting the client request to the active server and hence the client doesn’t have to worry about which server in a cluster is active.
Monday, November 23, 2009
Steps to Stop SQL Injections
SQL injections last year became the most common Web-based attack technique. Hackers are successful with these attacks largely due to poor coding practices. The following are six ways organizations can start to mitigate the risk from SQL injections.
Never Trust Input
Coders get themselves in trouble with injection attacks when they fail to validate user input.
Don’t use Dynamic Tables
Set parameters for SQL to thwart hackers from inserting their own SQL command into your code.
Encrypt Data
If attackers are successful in getting in and passwords are stored in clear text, they’ve hit the motherlode. Throw up a speedbump and encrypt.
Implement rules of least privilege
Hackers love it when coders set their web applications to access the database via the admin account.
Implement Code Review
Processes and tools need to be implemented that check the security of code before it goes live.
Hire a pen tester
What you don’t know CAN hurt you. Hire penetration testers to find out how vulnerable your sites really are.
Saturday, November 21, 2009
Reasons Your Team Hates You
You Don't Prioritize
If everything is important, the team can't focus on critical tasks.
Fix: Force yourself to rank each task, dividing them evenly between high medium, and low. Honor that list.
You Treat Them like Employees
If you know nothing about your team as people, they know it.
Fix: Take the time to learn some details. No faking this one.
You Don't Fight For Them
When you don't stand up for people, you lose their trust.
Fix: Get someone that raise they deserve. Get that cool new project approved. Let them know.
You Don't Model Balance
You say weekends are precious for families, then bombard them with email on Sunday afternoon.
Fix: Take a day off -- or learn how to do "delayed send" so your messages won't go out until Monday morning.
You Never Relax
Negative or stressful energy transfers to others.
Fix: Let them know you're human. Laugh, when appropriate.
You Micromanage
They have no room to make decisions on their own.
Fix: Pick a few low risk projects; commit to doing nothing unless being asked for help.
You're A Suck-up
This shows a lack of spine -- and could mean you expect the same from them.
Fix: Try kicking up, and kissing down.
You Treat Them like Mushrooms
In the dark, fed manure.
Fix: Share information within reason. You aren't 007.
You Don't Get Your Hands Dirty
You're great at assigning work. Doing work? Not so much.
Fix: Pick a smaller project and do it yourself.
You're Indecisive
Flip-flopping is not leadership.
Acknowledge you might make a mistake, but move ahead.
Monday, November 16, 2009
Hot Swapping,What is SWAP
Hot Swap
A hot swap is the replacement of a hard drive, CD-ROM drive, power supply, or other device with a similar device while the computer system using it remains in operation. The replacement can be because of a device failure or, for storage devices, to substitute other data.
Hot swapping and hot plugging are terms used to separately describe the functions of replacing system components without shutting down the system. Hot swapping describes changing components without significant interruption to the system, while hot plugging describes changing or adding components which interact with the operating system.[1] Both terms describe the ability to remove and replace components of a machine, usually a computer, while it is operating. For hot swapping once the appropriate software is installed on the computer, a user can plug and unplug the component without rebooting. A well-known example of this functionality is the Universal Serial Bus (USB) that allows users to add or remove peripheral components such as a mouse, keyboard, or printer.
Reasons for hot-swapping
Hot swapping is used whenever it is desirable to change the configuration or repair a working system without interrupting its operation. It may simply be for convenience, to avoid the delay and nuisance of shutting down and then restarting complex equipment, or because it is essential that the equipment be permanently available.
Hot swapping may be used to add or remove peripherals or components, to allow a device to synchronize data with a computer, and to replace faulty modules without interrupting equipment operation.
Equipment may be designed with redundancy so that in the event of the failure of a component, other parts of the system carry out its functions while the faulty component is removed and a replacement connected. For example, computer RAID disk arrays allow a faulty disk to be hot-swapped for a new one; the new one is configured to become part of the array automatically or by user command. A machine may have dual power supplies, each adequate to power the machine; a faulty one may be hot-swapped.
Hot Swap: A true hot swap is defined as one where the drive can be replaced while the rest of the system remains completely uninterrupted. This means the system carries on functioning, the bus keeps transferring data, and the hardware change is completely transparent.
Warn Swap: In a so-called "warm swap", the power remains on to the hardware and the operating system continues to function, but all activity must be stopped on the bus to which the device is connected. This is worse than a hot swap, obviously, but clearly better than a cold one.
Cold Swap: The system must be powered off before making the swap.
RAID technology
Redundant array of independent disk (RAID) is the technology of grouping several physical drives in a computer into an array that you can define as one or more logical drives. Each logical drive appears to the operating system as a single drive. This grouping technique greatly enhances logical-drive capacity and performance beyond the physical limitations of a single physical drive.
When you group multiple physical drives into a logical drive, the ServeRAID controller can transfer data in parallel from the multiple drives in the array. This parallel transfer yields data-transfer rates that are many times higher than with nonarrayed drives. This increased speed makes the system better able to meet the throughput (the amount of data processed in a given amount of time) or productivity needs of the multiple-user network environment.
The ability to respond to multiple data requests provides not only an increase in throughput, but also a decrease in response time. The combination of parallel transfers and simultaneous responses to multiple requests enables disk arrays to provide a high level of performance in network environments.
STRIPE-
The granularity at which data is stored on one drive of the array before subsequent data is stored on the next drive of the array is called the stripe-unit size .
You can set the stripe-unit size to 8 KB, 16 KB, 32 KB, or 64 KB. You can maximize the performance of your ServeRAID controller by setting the stripe-unit size to a value that is close to the size of the system I/O requests. For example, performance in transaction-based environments, which typically involve large blocks of data, might be optimal when the stripe-unit size is set to 32 KB or 64 KB. However, performance in file and print environments, which typically involve multiple small blocks of data, might be optimal when the stripe-unit size is set to 8 KB or 16 KB.
RAID level-5
RAID level-5 stripes data and parity across all drives in the array.
RAID level-5 offers both data protection and increased throughput. When you assign RAID level-5 to an array, the capacity of the array is reduced by the capacity of one drive (for data-parity storage). RAID level-5 gives you higher capacity than RAID level-1, but RAID level-1 offers better performance.
RAID level-5 requires a minimum of three drives and, depending upon the level of firmware and thestripe-unit size, supports a maximum of 8 or 16 drives.
The following illustration is an example of a RAID level-5 logical drive.
RAID level-5 example
Start with four physical drives.
Create an array using three of the physical drives, leaving the fourth as a hot-spare drive.
Then create a logical drive within that array.
The data is striped across the drives, creating blocks.
Notice that the storage of the data parity (denoted by *) also is striped, and it shifts from drive to drive.
A parity block (*) contains a representation of the data from the other blocks in the same stripe. For example, the parity block in the first stripe contains data representation of blocks 1 and 2.
If a physical drive fails in the array, the data from the failed physical drive is reconstructed onto the hot-spare drive.
Advantages and disadvantages
RAID level-5 offers the following advantages and disadvantages.
| Advantages | Disadvantages |
| · 100% data protection · Offers more physical drive storage capacity than RAID level-1 or level-1E | Lower performance than RAID level-1 and level-1E |
Sunday, November 8, 2009
GIS,Geographic Information System
The basic steps of the GIS implementation process are planning, requirements analysis, design, procurement and development, and operation and maintenance.
Strategic Vision, Scope and Organizational Impacts of GIS
To provide direction for the GIS and for all implementation and operations activities, it is necessary to establish a vision that defines the role GIS plays in the organization, its scope, and its relationship to business operations.
Assessment of Organizational Risk
Performing an assessment of organizational risk at the outset of a GIS project can increase the chances for success.
Coordinating GIS Participants and Users
Committees and team approaches are frequently employed for multi-participant GIS projects as a means for coordinating participants and guiding project development. The common model addresses participants’ GIS interests at three levels — policy, technical development and usage – and establishes a committee at each level, coordinated by the GIS manager.
Managing the GIS Committee and Team Environment
To make the GIS committee or team environment successful, several other aspects must also be managed.
Each committee must have a clear charter regarding the types of issues it will address, and must remained focused on these issues. There should be a clear plan regarding the matters to be addressed by each committee — as well as by the GIS manager — and regarding how information, recommendations, approvals and directives are to flow among the committees and staff. The appropriate committee composition follows the GIS project definition.
Organizational and professional interests should be appropriately represented according to the role of GIS in the organization. The most successful committee arrangements involve teams that are limited to a workable size – usually 6 to 8 people. When committees are very large, some success can be achieved by establishing subcommittees to address specific issues.
Communication and Providing Information
Communication is crucial to the success of a multi-participant GIS environment. It can be time consuming: communication requirements grow according to the number of participants, and differences in applications, professional backgrounds, priorities, organizational interests and personal agendas. All involved parties —future users, as well as committee members — must be kept in the communication network from the time they are first contacted through the entire project lifecycle.
In order to participate usefully in the GIS effort, participants need adequate information regarding GIS and the project goals. They must receive the right kind and amount of education and information at the right times. Different participants from different application areas and levels of the organization have different interests, backgrounds and needs related to understanding GIS. For example, the type of information required by the Mayor will differ greatly from that required by an assessment clerk. GIS education and orientation must be tailored to the specific audience. This often means conducting several events for different groups from various applications areas, professional backgrounds and levels in the organization. Furthermore, education will be an on-going need throughout the GIS project.(Somers, 1995)
Leadership and Support
In a large, multi-participant GIS project, two types of leadership are crucial to success: someone to manage the GIS implementation and operation and someone to provide support and influence at the policy level.
A large GIS effort must have a focal pint. The GIS manager coordinates the network of committees and participants. Among the many technical and managerial qualifications a GIS manager must possess, he or she must manage this complex environment. The ability to work with diverse individuals and groups, manage teams, educate, motivate and lead are critical to the success of the GIS.
Another key ingredient in an extensive GIS effort is a project champion who provides executive level support and influence.
The project champion’s support and efforts ensure continued political and financial support in the face of pressures that would erode the project’s resources and delay its implementation.
Management and Control of GIS
Basically, control and management of GIS may be centralized or decentralized. There are three basic areas in which the GIS management could be placed — in a line organization, in a support area, or at the executive level.
The appropriate organizational configuration and placement of GIS management and control within an organization depends on the role and scope of the GIS, the organization model used and the specific operational aspects of the organization.
Personnel issues
Regardless of the extent and impact of GIS within an organization, however, the basic personnel issues must at least be addressed. These issues include staff responsibilities, staff configuration, position requirements, position descriptions and pay scales, job classes and career paths, staffing and training.
Timing
Much of successful timing in GIS is an art. When developing implementation schedules, certain technical and organizational dependencies are inherent. Technically, certain components must be completed before dependent one can be developed. Organizationally, components must be prepared before technical changes can take place. There are many technical and organizational aspects whose timing must be coordinated. . Committees and large numbers of project participants often are the source of project delays. In a business environment, GIS timing must not only take into consideration cost/benefits and internal operations issues, but competitive ones as well.
Integrating GIS into an Organization’s Operations
Successful adoption and integration of GIS into an organizations operations depends on all of the above issues. Each issue must be considered by itself and in combination with the others. The primary factor in integrating GIS into an organization is to understand the role GIS will play in the organization. The scope, purpose and vision for GIS in the future of the organization will drive the development of organizational plans.
There are many other important issues affecting GIS adoption, including:
Educating users
Training
Involving users in the planning and design of the system
Transitions in operations
BBS
‘/Sybase/dump/bbs_sucess.dmp’
load database dump using following command
login using isql -Usa –P
load database vectest from ‘/Sybase/dump/bbs_sucess.dmp’
(2) To run BBS check following point
Do All The step require for vector BOD
Check data in following table
(i) BUY_TRAN
Previous day data should be there
(ii) BBO_BUY_TRAN
This table should be empty. Data will come in this table after Opening session.
(iii) INT_ORDER_MAP
In this table previous day data should be there.
(3)
If database transaction log is full then login with
isql –Usa –P
run following command
dump tran vectest with truncate_only
(4)
For BBS change no of user connection using following command
isql –Usa –P
(i)
sp_configure "connection"
This command will display current number of connection
Parameter Name Default Memory Used Config Value
Run Value Unit Type
------------------------------ ----------- ----------- ------------
------------ -------------------- ----------
cis idle connection timeout 0 0 0
0 seconds dynamic
max cis remote connections 0 526 0
0 number dynamic
number of remote connections 20 125 20
20 number static
number of user connections 25 45052 150
150 number dynamic
current no of user connection is -150
To change No of connection run following command
sp_configure "number of user connections",600
(5)
If it is fresh IPO then delete following table
DELETE FROM TRADE_TRAN
DELETE FROM BBS_PRICE
DELETE FROM BUY_TRAN
DELETE FROM BBO_BUY_TRAN
DELETE FROM INT_ORDER_MAP
Update
Scrip_mast table minallowprice and maxallowprice
Using follwing command
UPDATE SCRIP_DET SET MinAllowPrice=2400000,MaxAllowPrice=3600000 WHERE ScripId = 5558
update SCRIP_STAT_CURR set ClosePrice=3000000 where ScripId=5558
Ceiling Depth should be 10% of issued share.( Ex. 10000 for 100,000)
To check How many user login today
select * from INT_LOGIN where datediff(dd,LastLoginTime,getdate())=0
To check How many User login in last N minute
For e.g N =30
select * from INT_LOGIN where datediff(mi,LastLoginTime,getdate()) <=30
When any user is abnormal close window and next time try to login
Message will come “You are already logged in at another terminal”
Then run following query
Here Enter appropriate Broker code and Login Name
UPDATE INT_LOGIN SET LoginStatus = 'A' WHERE BrokerCd = 'BBS' AND LoginName='testing4';
Do Normal BOD
(6)
If in any case BBO Details is not display then run following query
(i) first delete record from BBO_BUY_TRAN
delete from BBO_BUY_TRAN
(ii) Then insert using following sql.
INSERT INTO BBO_BUY_TRAN
SELECT ScripId,XactType,Price,TotalQty,BrokerCd,TraderCd,'U'
FROM BUY_TRAN
Aftert 15th July 15, 2009 BBS testing database dump is
/Sybase/dump/bbs_final.dmp
if some problem occur in bbs_sucess.dmp then load this database dump
DELETE FROM TRADE_TRAN
DELETE FROM BBS_PRICE
DELETE FROM BUY_TRAN
DELETE FROM BBO_BUY_TRAN
DELETE FROM INT_ORDER_MAP
SELECT * FROM TRADE_TRAN
SELECT * FROM BBS_PRICE
SELECT * FROM BUY_TRAN
SELECT * FROM BBO_BUY_TRAN
SELECT * FROM INT_ORDER_MAP
SELECT * FROM BUY_TRAN WHERE ScripId = 5558
SELECT * FROM INT_LOGIN WHERE BrokerCd='SALTA' AND LoginName = 'krishnaa'
UPDATE INT_LOGIN SET LoginStatus = 'A' WHERE BrokerCd = 'SALTA' AND LoginName = 'krishnaa'
SELECT * FROM INT_LOGIN WHERE LoginName IN (SELECT LoginName FROM INT_REGISTRATION WHERE BrokerCd = 'BBS')
AND BrokerCd='BBS'
SELECT * FROM SCRIP_MAST WHERE ScripId = 5558
UPDATE SCRIP_MAST SET ScripStatus = 'S' WHERE ScripId <> 5558
SELECT * FROM SCRIP_DET WHERE ScripId = 5558
UPDATE SCRIP_DET SET MinAllowPrice=2400000,MaxAllowPrice=3600000 WHERE ScripId = 5558
UPDATE
SELECT * FROM BUY_TRAN WHERE ClientCd NOT IN (SELECT ClientCd FROM INT_LOGIN
WHERE BrokerCd='BBS' AND LoginName NOT IN (SELECT LoginName FROM INT_REGISTRATION WHERE
BrokerCd='BBS'))
SELECT * FROM INT_LOGIN WHERE LoginName LIKE 'atiq%'
SELECT * FROM INT_REGISTRATION WHERE LoginName = 'kajal'
SELECT * FROM INT_LOGIN WHERE BrokerCd = 'BBS' AND LoginName NOT IN (SELECT
LoginName FROM INT_REGISTRATION WHERE BrokerCd = 'BBS')
SELECT * FROM BUY_TRAN
SELECT * FROM BBS_BIDDER
UPDATE INT_LOGIN SET LoginStatus='A' WHERE BrokerCd='BBS' AND ClientCd LIKE '%BBS28'
UPDATE FINAL
UPDATE INT_LOGIN SET LoginStatus = 'A' WHERE BrokerCd = 'BBS' AND LoginName='check123'
SELECT * FROM SCRIP_STAT_CURR WHERE ScripId=5558
UPDATE SCRIP_STAT_CURR SET ClosePrice = 3000000 WHERE ScripId = 5558
UPDATE SCRIP_DET SET MinAllowPrice=2400000,MaxAllowPrice=3600000 WHERE ScripId = 5558
SELECT * FROM SCRIP_DET WHERE ScripId=5558
sp_configure "number of user connections",700
SELECT * FROM SCRIP_DET WHERE ScripId=5558
SELECT * FROM INT_LOGIN WHERE LoginName = 'korban2' AND BrokerCd='BBS'
UPDATE INT_LOGIN SET BrowPass = (SELECT BrowPass FROM INT_LOGIN WHERE LoginName = 'rassel2' AND BrokerCd='BBS')
WHERE LoginName = 'korban2' AND BrokerCd='BBS'
SELECT * FROM INT_LOGIN WHERE BrokerCd='SALTA' AND LoginName
SELECT * FROM INT_ORDER_MAP
SELECT * FROM BBO_BUY_TRAN
SELECT * FROM TRADE_TRAN
SELECT * FROM BBS_PRICE
SELECT * FROM BUY_TRAN WHERE Price = -2590000
VIEWS
CREATE VIEW BBS_BIDDER_TRADE AS
SELECT INT_REGISTRATION.LoginName,INT_REGISTRATION.ClientLName,
INT_REGISTRATION.Address1,INT_REGISTRATION.Address2,INT_REGISTRATION.Telephone,
TRADE_TRAN.BClientCd,INT_REGISTRATION.BoId,BROKINVLMT_TRAN.GrossLmt,
(BROKINVLMT_TRAN.GrossLmt/convert(INT,SYS_CONFIG_PARS.ParamValue) ) DepositeLmt,
BROKINVLMT_TRAN.CurrGrossLmt,
INT_REGISTRATION.BankAcctNo,INT_REGISTRATION.ClrBankCd,INT_REGISTRATION.ClrBankName,
SCRIP_MAST.ScripName,
TRADE_TRAN.Price,TRADE_TRAN.Qty,TRADE_TRAN.ScripId, TRADE_TRAN.DtTime,TRADE_TRAN.TradeId
,TRADE_TRAN.BXactId
FROM INT_REGISTRATION,TRADE_TRAN,INT_LOGIN,BROKINVLMT_TRAN,SCRIP_MAST,SYS_CONFIG_PARS
WHERE INT_REGISTRATION.LoginName = INT_LOGIN.LoginName AND
INT_LOGIN.ClientCd = TRADE_TRAN.BClientCd AND
INT_LOGIN.BrokerCd = TRADE_TRAN.BBrokerCd AND
INT_LOGIN.TraderCd = TRADE_TRAN.BTraderCd AND
BROKINVLMT_TRAN.BrokerCd = TRADE_TRAN.BBrokerCd AND
BROKINVLMT_TRAN.TraderCd = TRADE_TRAN.BTraderCd AND
BROKINVLMT_TRAN.ClientCd = TRADE_TRAN.BClientCd AND
TRADE_TRAN.ScripId = SCRIP_MAST.ScripId AND
SYS_CONFIG_PARS.ParamMnemonic = 'BBS_GROSS_MULT'
CREATE VIEW BBS_BIDDER AS
SELECT INT_REGISTRATION.LoginName,INT_REGISTRATION.ClientLName,
INT_REGISTRATION.Address1,INT_REGISTRATION.Address2,INT_REGISTRATION.Telephone,
BUY_TRAN.ClientCd,INT_REGISTRATION.BoId,BROKINVLMT_TRAN.GrossLmt,
(BROKINVLMT_TRAN.GrossLmt/convert(INT,SYS_CONFIG_PARS.ParamValue) ) DepositeLmt,
INT_REGISTRATION.BankAcctNo,INT_REGISTRATION.ClrBankCd,INT_REGISTRATION.ClrBankName,
SCRIP_MAST.ScripName,
BUY_TRAN.Price,BUY_TRAN.TotalQty,
BUY_TRAN.ScripId,BUY_TRAN.DtTime,BUY_TRAN.XactId
FROM INT_REGISTRATION,BUY_TRAN,INT_LOGIN,BROKINVLMT_TRAN,SCRIP_MAST,SYS_CONFIG_PARS
WHERE INT_REGISTRATION.LoginName = INT_LOGIN.LoginName AND
INT_LOGIN.ClientCd = BUY_TRAN.ClientCd AND
INT_LOGIN.BrokerCd = BUY_TRAN.BrokerCd AND
INT_LOGIN.TraderCd = BUY_TRAN.TraderCd AND
BROKINVLMT_TRAN.BrokerCd = BUY_TRAN.BrokerCd AND
BROKINVLMT_TRAN.TraderCd = BUY_TRAN.TraderCd AND
BROKINVLMT_TRAN.ClientCd = BUY_TRAN.ClientCd AND
BUY_TRAN.ScripId = SCRIP_MAST.ScripId AND
SYS_CONFIG_PARS.ParamMnemonic = 'BBS_GROSS_MULT'
SERVERS
/sybase/dump >display
======================================================================
No Server Name No of Copies
=====================================================================
1 ACserver 2
2 AMserver 0
3 AUserver 0
4 BCTserver 1
5 BCserver 1
6 BOserver 0
7 CPTserver 0
8 CPserver 0
9 CSserver 3
10 DOserver 0
11 DQserver 1
12 DRSserver 0
13 FIserver 0
14 FTserver 0
17 GQserver 2
16 HMserver 5
17 HSserver 1
18 IHserver 0
19 IXserver 1
20 LMserver 1
21 NDserver 0
22 OLserver 0
23 OMserver 0
24 OPserver 0
25 OSWserver 2
26 OSserver 4
27 PAserver 1
28 POSWserver 1
29 POSserver 1
30 PSserver 0
31 QMserver 0
32 QSserver 0
33 SLserver 0
34 SMSserver 0
35 SMserver 1
36 SPserver 0
37 TSserver 1
38 UMSserver 1
39 UMserver 1
=========================================================================
Total Number Of Servers Running Are : 30
---------------Some Query------------------------------------------------------------------------
->
select LoginName,BrokerCd,TraderCd,ClientCd,LoginStatus from INT_LOGIN where BrokerCd='BBS' order by LoginStatus
->
select ScripId,BrokerCd,TraderCd,ClientCd from BUY_TRAN order by ClientCd;
->
select LoginName,ClientCd from INT_LOGIN where ClientCd in (select ClientCd from ORDER_ADD_LOG);
->Clients who placed order
select LoginName,ClientCd from INT_LOGIN where ClientCd in (select ClientCd from BUY_TRAN)
->
UPDATE INT_LOGIN SET LoginStatus = 'A' WHERE BrokerCd = 'BBS' AND LoginName = 'SHAFIQB6'
?
UPDATE SCRIP_DET SET MinAllowPrice=2400000,MaxAllowPrice=3600000 WHERE ScripId = 5558
update SCRIP_STAT_CURR set ClosePrice=3000000 where ScripId=5558
? [Client –wise Total Bid qty]
select ClientCd,sum(TotalQty),sum(PendQty) from BUY_TRAN group by ClientCd order by 1
? [Clients who didn’t place order]
select LoginName,ClientCd from INT_LOGIN where ClientCd not in (select ClientCd from BUY_TRAN) and ClientCd not like'%BBS
%' order by 2
Exception
(26 rows affected)
1> update BUY_TRAN set TotalQty=10000,PendQty=10000 where ClientCd like '%BS11';
1> go
1> update BUY_TRAN set TotalQty=10000,PendQty=10000 where ClientCd like '%BS35';
1> update BUY_TRAN set TotalQty=10000,PendQty=10000 where ClientCd like '%BS84';
1> select ClientCd,sum(TotalQty),sum(PendQty) from BUY_TRAN group by ClientCd order by 1
2> go
Selecting The client who are not BBS and BrokerCd=BBS
select LoginName,ClientCd from INT_LOGIN where BrokerCd='BBS' and ClientCd not like ('%BBS%') order by 2
Selecting The client whose BrokerCd=BBS and TraderCd=BBS1
select BrokerCd,TraderCd,LoginName,ClientCd,UserStatus,LoginStatus from INT_LOGIN where BrokerCd='BBS' and TraderCd='BBS1' order by 3
If Tic
update SCRIP_MAST set TickPrice=2500 where ScripId=5559
UPDATE SCRIP_DET SET MinAllowPrice=2400000, MaxAllowPrice=3600000 WHERE ScripId = 5558
update SCRIP_STAT_CURR set ClosePrice=3000000 where ScripId=5558
Vector Related issue
Change Password scrip
Location of this scrip is
‘/ITS/release/bin/chpwd’
To change any trader password run following utility
chpwd “Brokercd” “Tradercd” Example:-
Suppose BrokerCd is –CSE2
And TraderCd is -002
Then to change this trader password run following command
chpwd CSE2 002
Now trader 002 password will be reset to 1111
To change mops or surveillance password to update “Password” field
of SYSUSER_MAST table according to User is
Example:-
To set User Id 6 password run following command
update SYSUSER_MAST set Password=’ZYXW’ where UserId=6
This will set UserId 6 password to 1111
(2) Match_q_tran problem
If there are large data in match_q_tran table first time then perform
Following steps
(i) Open one fresh crt window
(ii) Go to /ITS/release/exe path
(iii) Run additional copy of HM server using following command
(iv) ./HMserver –S91040 –N9 ok
(v) Do not close this window till Closing session
If Second time onwards this problem occur during trading session then perform following steps
(i) kill running existing HM by pressing Ctrl+c key
(ii) Again run HM server copy using following command from same window.
(iii) ./HMserver –S91040 –N9 ok
(3)
(1) SMstatus
If session is run means session is pass away and if u want to go reverse way
Say it is post closing session and if u want to run cp-trade session.
Then enter appropriate session id in session_curr table.
And run SMstatus utility from /ITS/release/exe/SMstatus
Then for menu select A to active all the session in memory.
And then select E to exit from menu.
(4) Close Price calculation Problem
If CP Trade Session come and Close price is not calculated then perform following Step
(1) Update Session CURR table to session id 5
update SESSION_CURR set SessionId=5
(2) Then Run SMstatus command and change all server status to ‘A’
(3) Then run Close Price Session using following command
./CPserver –S8001 –N1 ok
(4) The update SESSION_DLY session and set CP-trade time
(5) Then run CPT server using following command
./CPTserver –S9320 –N1 ok
(5) Table Lock Problem
To monitor table lock run following command
show locks
Example :-
name
type
class program_name spid
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------
------------------------------ ------------------------------ ------
INT_LOGIN
Shared intent lock
Non Cursor Lock QUERY 43
INT_CLIENT_MASTER
Shared intent lock
Non Cursor Lock QUERY 43
INT_LOGIN
Shared page lock
Non Cursor Lock QUERY 43
INT_LOGIN
Shared intent lock
Non Cursor Lock ctisql 44
INT_LOGIN
Shared page lock
Non Cursor Lock ctisql 44
INT_CLIENT_MASTER
Shared intent lock
Non Cursor Lock QUERY 166
Here Sybase process processes no 43,44,166 are generating lock on INT_LOGIN ,INT_CLIENT_MAST
Now to further investigate why locks are occur and which exact query or store procedure is generating lock login with super user
isql -Usa –P
run following query
select * from sysprocesses where spid in (43,44,166,167,183,187);
output of above query will be like this
spid kpid enginenum status suid
hostname program_name
hostprocess cmd
cpu physical_io memusage blocked dbid uid
gid
tran_name
time_blocked network_pktsz fid execlass
priority affinity id stmtnum
linenum origsuid block_xloid clientname
clienthostname clientapplname sys_id
ses_id loggedindatetime
ipaddr
nodeid
------ ----------- ----------- ------------ -----------
------------------------------ ------------------------------
------------------------------ ------------------------------
----------- ----------- ----------- ------- ------ -----------
-----------
----------------------------------------------------------------
------------ ------------- ------ ------------------------------
---------- ------------------------------ ----------- -----------
----------- ----------- ----------- ------------------------------
------------------------------ ------------------------------ ------
----------- --------------------------
---------------------------------------------------------------- ------
43 1153106073 0 lock sleep 5
chittra1 QUERY
24117 SELECT
122 0 5 167 8 1
0
NULL
238 512 0 EC2
HIGH ANYENGINE 2092612035 2
10 NULL 0
0
0 Jul 15 2009 9:30AM
192.168.101.100
NULL
44 1676410978 0 lock sleep 5
WinNT ctisql
12788 SELECT
0 0 13 167 8 1
0
NULL
153 512 0 EC2
HIGH ANYENGINE 0 1
1 NULL 0
0
0 Jul 15 2009 11:46AM
192.168.102.199
NULL
166 1153368224 0 lock sleep 5
chittra1 QUERY
24116 SELECT
132 0 5 167 8 1
0
NULL
218 512 0 EC2
HIGH ANYENGINE 2092612035 2
10 NULL 0
0
0 Jul 15 2009 9:30AM
192.168.101.100
NULL
167 1149108404 0 recv sleep 5
server-its NULL
AWAITING COMMAND
4 0 2 0 8 1
0
$chained_transaction
NULL 512 0 EC2
MEDIUM ANYENGINE 0 1
1 NULL 0
0
0 Jul 15 2009 9:23AM
203.76.107.52
NULL
183 1153302590 1 lock sleep 5
chittra1 QUERY
24119 SELECT
102 0 5 167 8 1
0
NULL
80 512 0 EC2
HIGH ANYENGINE 2092612035 2
10 NULL 0
0
0 Jul 15 2009 9:30AM
192.168.101.100
NULL
In this query
hostname – wil be the name of server which has fire query
program_name – will be the name of application server which has fire query.
Cmd – will be the command which is fire.
Set of recovery.
(1) Check which program_name and check which application server is generating lock
(2) Then try to kill and restart is using following command
(3) killbn ServerName
(4) Then check locks using show locks command. Even after this locks are not remove then run following command
(5) killb ServerName
(6) srv ServerName
(7) After above 2 option even if lock remain then kill that spid
(8) Login with isql –Usa –P
(9) Kill spid
(10) After killing server-its if in ITS internal server error is coming then restart web server.
(6) Syabse log
To check Sybase error log login with sybase user id and sybase password
Then go to ASE-15_0/install
Open vi SYBASE.log file
Go to last line using Shift+g command
IF in
(7) Scrip suspension and Revocation
(i) If from mops scrip suspension is not working then run RECUTIL Utility
(ii) If after running RECUTIL utility scrip is not suspended then update its’s status using following query.
update SCRIP_MAST set ScripStatus=’S’ where ScripId=”suspendedscripid”
To revoke any scrip if it is not coming in mops revocation list then
update SCRIP_MAST set ScripStatus=’A’ where ScripId=”suspendedscripid”
(8) To load Store procedure
run following command
LOAD UTcktbrkr.usp
Other option is
UTcktbrkr.usp d vectest
UTcktbrkr.usp a vectest
To compile C program
First go to appropriate directory
For example to compile GQ server go to GQ server directory
cd $GQ
Then make clean
make clobber
make
after successful make system will display message make successful.
Then run
make install
(9)Queue problem
show qs
IPC status from /dev/kmem as of Thu Jul 16 14:22:43 2009
T ID KEY MODE OWNER GROUP CBYTES QNUM LSPID LRPID
Message Queues:
q 2 0x000006a4 -Rrw-rw-rw- itsusr users 256 262144 22972 22970
q 3 0x00000708 --rw-rw-rw- itsusr users 251 262144 22970 22972
q 4 0x0000076c -Rrw-rw-rw- itsusr users 251 262144 23022 23012
Current Time ::
----------------------------
Jul 16 2009 02:22:43PM
If All Queues is getting full and all terminal r hang nothing is moving on then
Fist kill all server using following command
killbn server
Then Go to exe folder and start PMserver
./PMserver
(10)
For index calculation following scrip is used.
select * from INDEX_SCRIP_MAST where IndexId=2 and NewScripFlag='Y'
/* for cse-30 index */
SELECT (NoofShareDebent*ClosePrice)
FROM SCRIP_MAST SM,SCRIP_STAT_CURR SSC WHERE SM.ScripId IN
(SELECT ScripId FROM INDEX_SCRIP_MAST where IndexId=2 and NewScripFlag='Y')
AND SSC.ScripId IN (SELECT ScripId FROM INDEX_SCRIP_MAST where IndexId=2 and NewScripFlag='Y')
AND SM.ScripId = SSC.ScripId
/* for CSCX index */
SELECT (NoofShareDebent*ClosePrice)
FROM SCRIP_MAST SM,SCRIP_STAT_CURR SSC WHERE
SM.ScripId = SSC.ScripId
AND SM.EquityDebFlag='E'
AND SM.GroupCd IN ('A','B','G','N')
/* for all scrip index */
SELECT (NoofShareDebent*ClosePrice)
FROM SCRIP_MAST SM,SCRIP_STAT_CURR SSC WHERE
SM.ScripId = SSC.ScripId
AND SM.EquityDebFlag='E'
update this value in INDEX_HIST table in closeIndex column