Search This Blog

Showing posts with label Genral Topic. Show all posts
Showing posts with label Genral Topic. Show all posts

04 January 2015

Large Objects for Databases

I am developing an application. I got stuck with a situation how to save my pictures. I walked down to my manager, who is an OCP, and asked him what should I do with my images? Where should I save them for my application? He gave a nasty smile, and said, "Bhaskar, Just flow with the Blob!"
I love Oracle DB engine over others. Although, as a basic developer like me, even Access or Excel would work, but Oracle mesmerizes me.  For this application, I chose Oracle over other MS SQL Server. And now I'm even more enlightened with 2 new data types. BLOB and CLOB. Psst, these aren't restricted to just Oracle DB Engine.

Character Large Objects (CLOB)

CLOBs are the large limit character data type for DB. Their limit may vary for DB Engines, but it is said that they're having limit of about  2GB. CLOB is said to be a collection of character data. It is stored at a separate location and is often referenced in a table. Being a data of this much limit, operation may end up slow on performance. Different DBM systems have different mechanism to overcome the performance issue. But, I'm sure, not all the developers will be using this datatype during their career. Hope not me!

Binary Large Objects (BLOB)

BLOB is a collection of binary objects stored as a single entity. This can be used to save multimedia objects. One can save images or audio to the DB by using BLOB. Oracle says "A BLOB without specified length is defaulted to two gigabytes".
BLOB and CLOB have two more siblings in Oracle DB, NCLOB and BFILE

National Character Large Object (NCLOB)

Very Similar to CLOB, with just a difference that it stores UNICODE national character set data.

BFILE

The BFILE datatype stores unstructured binary data in operating-system files outside the database. A BFILE column or attribute stores a file locator that points to an external file containing the data. The amount of BFILE data that can be stored is limited by the operating system. BFILEs are read only; you cannot modify them. They support only random (not sequential) reads, and they do not participate in transactions. 
I'll be trying BLOB on my application. It will be fun to store images to DB rather than keeping them on File Share.
Let's hope that all goes well with it.

06 November 2013

RemoteApp Feature of Windows

Last week when I was travelling home for vacation, I met a person on Airport. He was from a reputed company (I would rather choose not to disclose his identity as I never took his permission). I was discussing about virtualization of applications. He told me that Windows itself has the capacity of doing so,

Enthusiastically I searched over internet for the possibility which I'm sharing here. Thought that this may be useful for people who like to explore.

To start with, I would like to present 2 major topics about RemoteApp:

What is RemoteApp

You can visualize the RemoteApp service similar to a CITRIX XenApp service. This service of Windows Server 2008 (or higher) gives the freedom to use an application installed on a server as a local installed application on client. One can connect to the server without actually logging in to the server (ofcourse with proper permission and configurations). For more details, you can visit Microsoft Portal.

Why use RemoteApp

RemoteApp has similar advantages as CITRIX (not all, but serves bare minimum). As a Smartplant Administrator, I see following advantages of using this features.

  • Managing applications at one server instead of each client. This will make life of administrators a lot easier.
  • Using multiple versions of same application without having headache of compatibility.
  • Management of environments would be a lot easier.
  • Upgrades will be easier and much quicker.
I would suggest to give it a shot. This may be useful for you. Let me know your experience as well.

Happy Smartplanting....

11 August 2013

Boost up Citrix performance

Citrix has been playing vital role for Smartplant. Most of the industry giants are using Citrix. But many people have different opinions for Citrix experiences. Recently I talked to a CITRIX expert. I understood few possible reasons why Citrix application may slow down compared to local installation. I'm breaking it in parts to make it more clearer.


Understanding why computer slows down

Following are few main reasons (according to experts) due to which a PC may slow down at the end of the day:
  • Less or no Page File available. Page File is the memory on disk which is used when the RAM is unable to handle processes.
  • The files may be fragmented. Your computer starts a new file at the end of address assigned to old file. So practically your old file never ends. This is called Fragmentation.
  • Computer disk drive may be failing. Your disk drive is wearing continuously.

Looking at slow Network performance reasons

  • Too many users on server.
  • Duplex and speed mismatch. It is like two cars trying to pass one another on a one way street while moving in opposite directions. 
  • Poor network design.
  • Inhouse loosely developed applications.

Improving CITRIX performance

  • Scale out by Adding Servers
  • Scale out by Adding Memory.
  • Scale up by moving to Windows X64.
  • Monitor Page File.
  • Monitor Disk Drive performance.
  • Plan Network.
Hope this will help you...

Happy Smartplanting





29 July 2013

Relation Between .pid file and SPPID drawing

Question - What is the best way to recreate a SPPID drawing?

Best Answer -  Rename the .pid file of the drawing, and open drawing from drawing manager!

Reason - ?????

Last time my friends asked the reason for existence of .pid file, I was completely answer less. I did a small investigation and found some information. Readers are welcome to share further information.

Following are the brief observations of investigation:


  • .pid files works on database connection. Change plant from Drawing Manager and try to open the file directly, it won't work.
  • .pid files are sufficient to work on the drawing. Copy them on local desktop. Open the drawing from .pid file, and work on them. Only difference is that when you launch the corresponding drawing from Drawing Manager, the drawing will be recreated.
  • .pid files have basic information about drawing and its template. Create a custom template with few xml labels, use it in drawing, open .pid file in notepad and you can view the xml script.
  • .pid file also works as a log file. Try this - on each operation, like placing object, editing attributes, deleting objects, check the latest .pid file. You can view information about each operation.
  • Rename a .pid file, open that drawing using DM, recreate drawing, do some operation, and then compare both the .pid files.
  • Try to edit any single character on original .pid file and save it. The drawing won't respond on open event.  You'll have to rename or delete that .pid file.
Summary of the observation. .pid file is one which has
  1. Encrypted information about the plant.
  2. Encrypted or plain information about Drawing and Template.
  3. Stores log for each operation.
  4. On drawing open event Database matches information on .pid file, if everything looks fine, it opens the drawing. If doesn't match, recreates the drawing. If anything is wrong, doesn't respond!
Till next post...

Happy Smartplanting...

12 July 2013

Free stuck seat in SPLM

  When I was working as SPPID designer, I had a favourite place where I always wanted to sit. But unfortunately the computer wasn't used for SPPID drafting, because license used to stuck for each SPPID drawing open event, even after exit.

Normally the tools, on launch talks to the SPLM server on a TCP port. The server checks for free seats and as per availability it assigns license to the client on a particular TCP port and blocks the seat. For some reason, may be on system crash, or bad network response of a particular system, when the license is set free by the system, it doesn't acknowledges the SPLM server. As result SPLM considers the seat to be busy and doesn't release the port. Therefore on scavenging for new seat, it shows the seat as non recoverable.

Recently I was searching for an option to recover the seat, and got a wonderful solution. It worked for me. But isn't approved by any authorized personnel. So I would suggest that you perform the steps on your own risk.

The following activity should be the last option, when other options suggested by Intergraph doesn't work.
By following steps, I released stuck seat:

  • Go to the license server.
  • Open command prompt with Administrator privilege.
  • Type 'netstat -p TCP -o'. Netstat displays protocol statistics and network connections, -p displays connections for protocols which will be TCP for our case, and -o will display owning Process ID or PID.
  • In Foreign Address column, find your client computer which will be followed by ':Port No'.
  • Check corresponding PID.
  • Goto Task Manager-> Processes Tab.
  • Select View->Select Columns...
  • Check PID and press OK.
  • Search for the related PID. It should be a svchost.exe process. 
  • Select Process and press End Task.
  • Scavenge SPLM. Seat should be free.
If this work for you, please let me and others know.

Important: Please read this message.

Happy Smartplanting...

28 June 2013

Error: Out of Stack Space!

Ever got the error message 'Out of Stack Space' while running any application? If yes you're welcome to read the reason. If not, you're not an exception! You may get this error.

Many users experience this error while launching or running applicaions. There is a way to avoid this error while working with SP3D drawings. But sometimes (that too in exception) it fails. According to Microsoft, following are the possible reasons for this error in VB applications:

  • The code has too many active Function, Sub or Property procedure calls.
  • Local variable is having less space allocated than required.
  • Too many fixed length strings in the code is also a possible reason for this error.
  • Too many nested DoEvents function call.
  • Code has triggered an event cascade.
To get more details on the reasons, visit MSDN link.
Right now this error is reported with SPPID 2009 SP5. You can share if you experience with any other application or version.

Happy Smartplanting...

24 June 2013

How to Boost IIS performance




IIS, the web server, is a part for SPF site setup. While many stuffs work for SPF with IIS as a web server, it is important to know about the facts that how the performance of IIS can be pumped up. The better IIS performs, better SPF performs.


  • Object Cache TTL
    • For a dynamic site (in case of website), it is recommended that object shouldn't be cached. In case of SPF, where most important function of Plant Lifecycle, the integration occurs, it should be recommended that the cache is set to minimum possible. By default it is set to 15 minutes. It depends on the criticality of the project, or integration frequency how fast the cache should be refreshed.
  • Enable HTTP to Keep Alive
    • Improves client connection experience. Allows Integration authentication, recommended to keep it enabled.
  • HTTP Compression
    • An important feature recommended by IIS gurus. There is a built in feature to perform this task.
  • Connection Timeout
    • This depends totally on projects requirement, sometimes on a particular action. May be helpful while troubleshooting.
  • Optimize Memory Usage
    • IIS utilizes a lot of physical memory. More the memory alotted, better will be the IIS performance.
Hope you find this of some use. Till next post

Happy Smartplanting...

18 February 2013

Too Many Defs


Hi,

Before I wrote my last post, I came across few def words (ClassDef, InterfaceDef, RelDef, PropertyDef etc.). SPF schema definitions have very clear architecture of Object Oriented Modelling. It makes sense, as the more I learn, the more I get clearer picture. Let’s talk about some classic data modelling terms here.


Classes
Orthodox definition for class is a group of objects. The objects in classes have similar properties or attributes, common behaviour or operations, common relationships to other objects and common semantics. For instance, the posts in* my blog can be a class, and this particular post can be considered as objects. Smartplant being a class, SPF will become an object.

Interface
Interface talks about roles. What I can do? What am I destined to do? What is my designated work? Interface, in terms of SPF, defines the role of an object. Let’s say, role of SPF is to integrate data among tools and manage documents. Interface is important to define the designated responsibility.

Property
Property talks about the figure. It describes an object with all of its description. Each property has a value for each object instance. For example, SPF has site name, plant name, PBS, version, etc. These attributes may be defining different aspects of an instance. To have a selective set of property, we should have a rigid (well defined to be specific) role of object in Instance.

Property Scope

Property should be scoped. While coding a program, if a variable has scope (or data type) string, and the Database has value DBNull, it would be inappropriate to return the value to variable. It will always cast an error. For example, if you tell some girl’s age as 250, either the girl will commit suicide or will kill you. You should say 250 months (better be specific in SPF, not in real life ;-) ).


This was just an introduction for succeeding posts. This will be helpful in future...

Happy Smartplanting...

* Added as per comment made in a Linkedin Discussion. Thanks to 'Mariusz Lubkowski'.

03 February 2013

Smartplant Data Model

Hi Again,

In the last post, I discussed a little about data modeling and tried to co-relate it to Smartplant. But after reading it several times, I myself found it disgusting. It never cleared any point. Here, I'm trying to make it more clear.


Smartplant Schema
As we all know, Smartplant tools talk to each other via adapters. Of course, SPF acts as an interpreter. But for SPF to understand the tools, it itself needs a medium. To interpret the data of each tool, there are several schemas that are stored in xml files. There several dlls that parse these xml files for SPF. The tool adapter interfaces with schema component to read the Smartplant schema.

Smartplant Schema Rules
Smartplant Suite deals with heterogeneous data.  In order to control the data transfer in disciplined way, following rules are applied.
  • ·         Smartplant Schema consists of all schema data, and describes everything that goes to SPF.
  • ·         The Server contains a copy of Smartplant Schema, which actually is an xml file.
  • ·         Clients contain the selective extracts of Smartplant Schema, known as Component Schema.
  • ·         The changes to be done are first done in Smartplant Schema and then propagated to Component Schema.

Overview of Smartplant schema Data Model
The Smartplant Data Model consists of three main components. These are represented using UML (will discuss about it some time).

Component
Representation
Defined by
Classes
Represents real world objects
ClassDefs
Interfaces
Used to tightly bind roles
InterfaceDefs
Relationships
Represents the association between two objects
RelDefs

Hope this was more clear for understanding modeling.

Happy Smartplanting...

23 December 2012

The need to Model


Hi,

Modeling data in SPF is a common topic. It comes up with the word modeling and mapping. To perform mapping exactly, we should have a clear overview on modeling. I've gone through books (or guides) which gives examples of model of car. But why do we need model has been real quest for me so far.

Why we model?

Different tools of smartplant have different approach to data, as they were developed independently. Yet data needs to be shared among them as we do not want to deal the same data again for different tool. So to make the tools understand that SPPID and SP3D (for instance) are pointing to same valve, we need to model data.

How model?

In terms of Integration, model of valve is not a valve, but it represents different properties of valves. There can be hundreds of attributes of a valve. Each smartplant tool deals with particular set of attributes, but they appear to define the same valve in different way. So to make them understand that they are dealing the same entity, SPF understands the valve as a model. It takes the properties of valve from all tools, and integrates them to represent a single valve.
Based on this model, SPF schema is prepared. This is then used for mapping stuff. This is the base of smartplant integration.

27 November 2012

Memory powered virtually

While installing SPF on an Application server, the recommended virtual memory is said to be at least 1 GB. Why is this virtual memory needed when the server has 8GB of RAM?


Virtual Memory can be considered as backup memory. It is the space reserved on physical hard disk to behave as RAM in case of emergency. All computers are said to be multitasking. But actually a computer does only one task at a time. But the process is actually so fast that it appears to be working at multiple tasks at a time.

There are situations when the 8GB RAM is not enough to handle all the processes at a time. At this situation, your computer can say "Back off. Let me finish pending first or unload some previous work". This may lead you to either wait pending process to complete or ending up some processes.

But actually, the RAM selects few of its some less important process, transfers it to the VIRTUAL MEMORY on your hard disk, performs the important task, completes them, backs up the process from virtual memory and works on it.

RAM has very high speed of performance. Accessing (transferring data to and from) virtual memory decreases the speed a lot (some claims degrading of speed a 100 times).

Size of virtual memory can be increased manually. Following are the steps to increase on Windows 7 (Administrator rights are required to perform this action. Do it on your own risk).

  • Right click on my computer and goto Properties, or goto control panel, select System and Security, select System.
  • Select Advanced System Settings.
  • Select Advanced tab, select Settings button in Performance.
  • Select Advanced tab and select Change... button under Virtual Memory.
  • Select Custom Size radio button and fill up the size boxes as you wish.
  • Press OK.

In short, you can say that virtual memory behaves as risk management backup for RAM.

Happy Smartplanting….