Saturday 11 April 2015

Start any program from Run Prompt



In this blog post we are going to see how to open any program or application from Windows Run Command Prompt.

By default you can open many programs for Windows command prompt eg. Notepad, WordPad, Microsoft Word, Outlook. But the problem with the default functionality is that you need to know the exact exe name to open the application i.e for opening PowerPoint you need to type POWERPNT but consider you need to open PowerPoint when you type PPT, it can’t be done by default.

Also there is another problem, for some programs you need to add the exe location to the PATH environment variable, if not added during the application installation. I by default prefer using application zip package instead of the installation file so every time I need to add the exe location to my path variable which increased its description too long.

 Now lets get to the point how can we access any programs, its simple follow the steps below.

1) Create a new folder in your windows locations. Here my folder is created at C:\users\kumar\Shortcuts make a note of this path.

2) Right Click My Computer (Right click) --> Properties --> Advanced system settings (Tab) --> Open the System Properties pop settings box.

3) Navigate to Advanced (tab) --> Click Environment Variables.

4) Select PATHEXT in System Variable section and click Edit and add ;.LNK in Variable Value section at the last as show in the image below.




5) Now select System Variable Path and click Edit and at the last add ;C:\users\kumar\Shortcuts (path where you created the new folder) at the last. Click OK and in Environment Variables tab and Click on Ok in System Properties. 

6) Now right click any .exe file and select Create Shortcut. Once the shortcut is created cut it from that location and paste in our new folder, and rename as your want it. This is the name that you will be calling from the Run prompt or CMD line prompt.

That's it now you will be able to open any application directly from the Run prompt with your custom names. You can even create shortcuts of folder and paste it here and open from Run prompt.

Please provide your comments below the blog.

Friday 10 April 2015

Various Oracle Database Objects

In this tutorial we are going to discuss about a couple of important database objects available in Oracle.

DATABASE:
                Database is a collection many related data which are treated as single unit. Its main purpose it to store, retrieve and manipulate the stored data when required. Oracle is a OORDBMS - Object Oriented Relational Database Management System.
               
SCHEMA / USER:
                Schema and User both are the same in terms of Oracle. All the database objects must belong to any one of the schema. An object between the schemas can communicate if they have process privileges.

TABLESPACE:
                Oracle database is divided into one or more logical storage units which are called as Tablespaces. Tablespaces are further divided into segments, segments are further divided into extends. (i.e X segments group to form a segments. X segments group to form a Tablespace. Where X is a number greater than 1)
               
TABLE:
                Table is the basic location where all the data in the application are being stored. Data are stored as rows and columns. Where each table should have a unique name in the schema. And each table should have unique column names. And each columns should have a valid data type.  The regular tables are also called as Heap Organized Tables.
Note: There is no guarantee that the records will be retrieved in the same order that it was inserted. Need to use ORDER BY clause for it.

CLUSTER:
                Cluster is a combination of more than one table which share the same data blocks, its created for scenario where more than 1 table is joined and queried. Also those tables will have a common column which is shared between them.
               
INDEX:
                Index is a method by which the data of the table can be retrieved fast. Its very similar to Index in a book. In Oracle Index is for a table or cluster. I can have one or more columns. It speeds up the data retrieval in a SQL statement. At the same time if more index are there in a table it will eventually slow the DML operations on the table as every time the index also needs to be rearranged.
               
INDEX ORGANIZED TABLES (IOT):
                IOT's are very similar to an Oracle table, but the main difference is that they all the records are saved in a sorted order. When the table is queried the records are retrieved in the sorted order.
               
VIEW:
                A view in simple terms can be said as a saved SQL query. Whenever a view is called the saved SQL query is ran and the results are fetched. If any WHERE clause is added to view it will be added to the result of the SQL query. A view can also be used as an alternative for complex queries. The view result is generally considered as a virtual table.
               
MATERIALIZED VIEW:
                Materialized view is very similar to the view, but the main difference is that it does not re-query the saved query every time instead once its queried those data are took and saved against the materialized view. The MV can be refreshed based on ADHOC or on timely basis. MV are mainly used to calculate and keep a pre-computed set of results to avoid query long running.
               
TRIGGER:
                Trigger is a stored PL/SQL object, which are used to perform an action when some other actions happen. i.e Make a log entry when a user logs into the database when users login. Make note of the changes of the values when certain table is updated or inserted or deleted.
               
DATABASE LINK:
                Database Links are used to provide a link between more two databases, using which the data from one database can be assessed in the other database.
               
DIRECTORY:
                Directory is a database pointer to file location in the server in which Oracle Database is running. Directories are mainly used to access any files in that specified location. The DBA needs to be make sure that Oracle user have complete access to that directory location.

PROCEDURE:
                Procedure is a stored PL/SQL object, which are used to perform a set of operations either i.e group of PL/SQL statements. The procedure needs to be called each time when it needs to be executed. It doesn't return any value after executing.
               
FUNCTION:
                Function is a stored PL/SQL object, which are used to perform a set of operations either i.e group of PL/SQL statements. The function needs to be called each time when it needs to be executed. It should return one value to the calling environment of any valid data types.

PACKAGE:
                Package is a collection of Procedures, functions. The main advantage of having Package is to group all the related procedures and function into one logical unit. Also when the first procedure, function in the package the whole package is loaded into the memory.

SEQUENCE:
                Sequence is a method provided by Oracle which is used to generate numbers.
               
SYNONYM:
                Synonym is an alternative name of an existing table or view. The main purpose of having a synonym is to hide the identity of the underlying database object.
               
ROLES:

                Role is a database object which has a group of privileges assigned to it, which can granted to another role or user.

Please provide your comments below the blog.

Saturday 4 April 2015

SQL in breif

In this tutorial we are going to see the need of SQL in a database and what it is capable of doing to the database.

Basically SQL stands for Structured Query Language. The main purpose of SQL is manage the data which is available in any Database. SQL are mainly classified as following

DDL – Data Definition Language
DML – Data Manipulation Language
DCL – Data Control Language
TCL – Transaction Control Language
DQL – Data Query Language

SQL is mainly used to perform CRUD (Create Read Update Delete) operations in the database objects. Now lets the see in brief each of the classifications

Note: We are going to discuss the important things, to see the detailed please refer Oracle documentation.

Data Definition Language:
          DDL statements allows you to mainly create, modify, and drop any database objects. Also allows to control the privileges of the objects between the schema/user.

CREATE – Used to create any database objects.
ALTER – Modify any existing database objects.
DROP – Remove objects from the database.
RENAME – Rename an existing object.
TRUNCATE –Remove all the data of the table.
PURGE – Permanently remove an object from the database.

Data Control Language:
               DCL statements make sure which the data are accessed between the schemas

GRANT – Allows a user to perform a specific task.
REVOKE – Removes the access provided to a user.

Data Manipulation Language:
          DML statements mainly helps us in creating, modifying, deleting the contents of an existing table.

INSERT – Insert new data into the table.
UPDATE – Update any existing data in the table.
DELETE – Delete the existing data in the table.
MERGE – Merge the data between two tables.

Note: All the transactions need to be committed so that the changes are saved in the database. If any DDL statements occurs

Transaction Control Language:
          TCL statements are used to control the data changed by DML statements. The changes can be either saved or discarded.


SAVEPOINT – Make a point for rolling back a transaction
SET TRANSACTION – Change transaction option like isolation level and what segment to use.
ROLLBACK – Rollback all the changes made during this transaction
COMMIT – Save all the changes made to the disk

Data Query Language:
            DQL allows mainly used to query existing data in the table, and display it to the user it’s SELECT statement. The select statement has the capability to only to display the data which is already available it can also modify the data before displaying it to the user.

SELECT - Used to select the data from the database object.

Please provide your comments below the blog.