Tuesday, 24 February 2015

Dimension Table

What is Dimension Table?


Dimension table is one that describes the business entities of an enterprise, represented as hierarchical, categorical information such as time, departments, locations, and products. Dimension tables are sometimes called lookup or reference tables.

Location Dimension

In a relational data modeling, for normalization purposes, country lookup, state lookup, county lookup, and city lookups are not merged as a single table. In a dimensional data modeling (star schema), these tables would be merged as a single table called LOCATION DIMENSION for performance and slicing data requirements. This location dimension helps to compare the sales in one region with another region. We may see good sales profit in one region and loss in another region. If it is a loss, the reasons for that may be a new competitor in that area, or failure of our marketing strategy etc.

Example of Location Dimension:

Country Lookup

Country Code Country Name DateTimeStamp
USA United States Of America 1/1/2005 11:23:31 AM

State Lookup

State Code State Name DateTimeStamp
NY New York 1/1/2005 11:23:31 AM
FL Florida 1/1/2005 11:23:31 AM
CA California 1/1/2005 11:23:31 AM
NJ New Jersey 1/1/2005 11:23:31 AM

County Lookup

County Code County Name DateTimeStamp
NYSH Shelby 1/1/2005 11:23:31 AM
FLJE Jefferson 1/1/2005 11:23:31 AM
CAMO Montgomery 1/1/2005 11:23:31 AM
NJHU Hudson 1/1/2005 11:23:31 AM

City Lookup

City Code City Name DateTimeStamp
NYSHMA Manhattan 1/1/2005 11:23:31 AM
FLJEPC Panama City 1/1/2005 11:23:31 AM
CAMOSH San Hose 1/1/2005 11:23:31 AM
NJHUJC Jersey City 1/1/2005 11:23:31 AM

Location Dimension

Location
Dimension Id Country
Name State
Name County
Name City
Name DateTime
Stamp

1 USA New York Shelby Manhattan 1/1/2005 11:23:31 AM
2 USA Florida Jefferson Panama City 1/1/2005 11:23:31 AM
3 USA California Montgomery San Hose 1/1/2005 11:23:31 AM
4 USA New Jersey Hudson Jersey City 1/1/2005 11:23:31 AM

Product Dimension

          In a relational data model, for normalization purposes, product category lookup, product sub-category lookup, product lookup, and and product feature lookups are are not merged as a single table. In a dimensional data modeling(star schema), these tables would be merged as a single table called PRODUCT DIMENSION for performance and slicing data requirements.

Product Category Lookup

Product Category Code Product Category Name DateTimeStamp
1 Apparel 1/1/2005 11:23:31 AM
2 Shoe 1/1/2005 11:23:31 AM
Product Sub-Category Lookup

Product
Sub-Category Code Product
Sub-Category Name DateTime
Stamp
11 Shirt 1/1/2005 11:23:31 AM
12 Trouser 1/1/2005 11:23:31 AM
13 Casual 1/1/2005 11:23:31 AM
14 Formal 1/1/2005 11:23:31 AM
Product Lookup
Product Code Product Name DateTimeStamp
1001 Van Heusen 1/1/2005 11:23:31 AM
1002 Arrow 1/1/2005 11:23:31 AM
1003 Nike 1/1/2005 11:23:31 AM
1004 Adidas 1/1/2005 11:23:31 AM
Product Feature Lookup
Product Feature Code Product Feature Description DateTimeStamp
10001 Van-M 1/1/2005 11:23:31 AM
10002 Van-L 1/1/2005 11:23:31 AM
10003 Arr-XL 1/1/2005 11:23:31 AM
10004 Arr-XXL 1/1/2005 11:23:31 AM
10005 Nike-8 1/1/2005 11:23:31 AM
10006 Nike-9 1/1/2005 11:23:31 AM
10007 Adidas-10 1/1/2005 11:23:31 AM
10008 Adidas-11 1/1/2005 11:23:31 AM
Product Dimension
Product Dimension Id Product Category Name Product Sub-Category Name Product Name Product Feature Desc DateTime
Stamp
100001 Apparel Shirt Van Heusen Van-M 1/1/2005 11:23:31 AM
100002 Apparel Shirt Van Heusen Van-L 1/1/2005 11:23:31 AM
100003 Apparel Shirt Arrow Arr-XL 1/1/2005 11:23:31 AM
100004 Apparel Shirt Arrow Arr-XXL 1/1/2005 11:23:31 AM
100005 Shoe Casual Nike Nike-8 1/1/2005 11:23:31 AM
100006 Shoe Casual Nike Nike-9 1/1/2005 11:23:31 AM
100007 Shoe Casual Adidas Adidas-10 1/1/2005 11:23:31 AM
100008 Shoe Casual Adidas Adidas-11 1/1/2005 11:23:31 AM


Organization Dimension

In a relational data model, for normalization purposes, corporate office lookup, region lookup, branch lookup, and employee lookups are not merged as a single table. In a dimensional data modeling(star schema), these tables would be merged as a single table called ORGANIZATION DIMENSION for performance and slicing data.
This dimension helps us to find the products sold or serviced within the organization by the employees. In any industry, we can calculate the sales on region basis, branch basis and employee basis. Based on the performance, an organization can provide incentives to employees and subsidies to the branches to increase further sales.

Corporate Lookup
Corporate Code Corporate Name DateTimeStamp
CO American Bank 1/1/2005 11:23:31 AM
Region Lookup
Region Code Region Name DateTimeStamp
SE South East 1/1/2005 11:23:31 AM
MW Mid West 1/1/2005 11:23:31 AM
Branch Lookup
Branch Code Branch Name DateTimeStamp
FLTM Florida-Tampa 1/1/2005 11:23:31 AM
ILCH Illinois-Chicago 1/1/2005 11:23:31 AM
Employee Lookup
Employee Code Employee Name DateTimeStamp
E1 Paul Young 1/1/2005 11:23:31 AM
E2 Chris Davis 1/1/2005 11:23:31 AM
Organization Dimension
Organization Dimension Id Corporate Name Region Name Branch Name Employee Name DateTime
Stamp
1 American Bank South East Florida-Tampa Paul Young 1/1/2005 11:23:31 AM
2 American Bank Mid West Illinois-Chicago Chris Davis 1/1/2005 11:23:31 AM

Time Dimension
In a relational data model, for normalization purposes, year lookup, quarter lookup, month lookup, and week lookups are not merged as a single table. In a dimensional data modeling(star schema), these tables would be merged as a single table called TIME DIMENSION for performance and slicing data.

This dimensions helps to find the sales done on date, weekly, monthly and yearly basis. We can have a trend analysis by comparing this year sales with the previous year or this week sales with the previous week.

Year Lookup

Year Id Year Number DateTimeStamp
1 2004 1/1/2005 11:23:31 AM
2 2005 1/1/2005 11:23:31 AM

Quarter Lookup

Quarter Number Quarter Name DateTimeStamp
1 Q1 1/1/2005 11:23:31 AM
2 Q2 1/1/2005 11:23:31 AM
3 Q3 1/1/2005 11:23:31 AM
4 Q4 1/1/2005 11:23:31 AM

Month Lookup

Month Number Month Name DateTimeStamp
1 January 1/1/2005 11:23:31 AM
2 February 1/1/2005 11:23:31 AM
3 March 1/1/2005 11:23:31 AM
4 April 1/1/2005 11:23:31 AM
5 May 1/1/2005 11:23:31 AM
6 June 1/1/2005 11:23:31 AM
7 July 1/1/2005 11:23:31 AM
8 August 1/1/2005 11:23:31 AM
9 September 1/1/2005 11:23:31 AM
10 October 1/1/2005 11:23:31 AM
11 November 1/1/2005 11:23:31 AM
12 December 1/1/2005 11:23:31 AM

Week Lookup

Week Number Day of Week DateTimeStamp
1 Sunday 1/1/2005 11:23:31 AM
1 Monday 1/1/2005 11:23:31 AM
1 Tuesday 1/1/2005 11:23:31 AM
1 Wednesday 1/1/2005 11:23:31 AM
1 Thursday 1/1/2005 11:23:31 AM
1 Friday 1/1/2005 11:23:31 AM
1 Saturday 1/1/2005 11:23:31 AM
2 Sunday 1/1/2005 11:23:31 AM
2 Monday 1/1/2005 11:23:31 AM
2 Tuesday 1/1/2005 11:23:31 AM
2 Wednesday 1/1/2005 11:23:31 AM
2 Thursday 1/1/2005 11:23:31 AM
2 Friday 1/1/2005 11:23:31 AM
2 Saturday 1/1/2005 11:23:31 AM

Time Dimension

Time Dim Id Year No Day of Year Quarter No Month No Month Name Month Day No Week No Day of Week Cal Date DateTime
Stamp
1 2004 1 Q1 1 January 1 1 5 1/1/2004 1/1/2005 11:23:31 AM
2 2004 32 Q1 2 February 1 5 1 2/1/2004 1/1/2005 11:23:31 AM
3 2005 1 Q1 1 January 1 1 7 1/1/2005 1/1/2005 11:23:31 AM
4 2005 32 Q1 2 February 1 5 3 2/1/2005 1/1/2005 11:23:31 AM

Fact Table

What is Fact Table?


The centralized table in a star schema is called as FACT table. A fact table typically has two types of columns: those that contain facts and those that are foreign keys to dimension tables. The primary key of a fact table is usually a composite key that is made up of all of its foreign keys.

 "Sales Dollar" is a fact(measure) and it can be added across several dimensions. Fact tables store different types of measures like additive, non additive and semi additive measures.

Measure Types

• Additive - Measures that can be added across all dimensions.
• Non Additive - Measures that cannot be added across all dimensions.
• Semi Additive - Measures that can be added across few dimensions and not with others.
A fact table might contain either detail level facts or facts that have been aggregated (fact tables that contain aggregated facts are often instead called summary tables).
In the real world, it is possible to have a fact table that contains no measures or facts. These tables are called as Factless Fact tables.

Steps in designing Fact Table

 Identify a business process for analysis (like sales).
• Identify measures or facts (sales dollar).
• Identify dimensions for facts (product dimension, location dimension, time dimension,     organization dimension).
• List the columns that describe each dimension.(region name, branch name, region name).
• Determine the lowest level of summary in a fact table (sales dollar).
for a product in a year within a location sold or serviced by an employee

Monday, 2 February 2015

Windows Script to Schedule a Task

SCHTASKS /parameter [arguments]

Description:

Enables an administrator to create, delete, query, change, run and
end scheduled tasks on a local or remote system.

Parameter List:

/Create     Creates a new scheduled task.

/Delete     Deletes the scheduled task(s).

/Query     Displays all scheduled tasks.

/Change     Changes the properties of scheduled task.

/Run         Runs the scheduled task on demand.

/End         Stops the currently running scheduled task.

/ShowSid Shows the security identifier corresponding to a scheduled t
ask name.

/?             Displays this help message.

SCHTASKS /Create:

SCHTASKS /Create [/S system [/U username [/P [password]]]] [/RU username [/RP password]] /SC schedule [/MO modifier] [/D day] [/M months] [/I idletime] /TN taskname /TR taskrun [/ST starttime] [/RI interval] [ {/ET endtime | /DU duration} [/K] [/XML xmlfile] [/V1]] [/SD startdate] [/ED enddate] [/IT | /NP] [/Z] [/F]

Description:
Enables an administrator to create scheduled tasks on a local or remote system.

Parameter List:
/S     system     Specifies the remote system to connect to. If omitted the system parameter defaults to the local system.

/U     username Specifies the user context under which SchTasks.exe should execute.

/P [password]     Specifies the password for the given user context. Prompts for input if omitted.

/RU     username     Specifies the "run as" user account (user context) under which the task runs. For the system account, valid values are "", "NT AUTHORITY\SYSTEM" or "SYSTEM". For v2 tasks, "NT AUTHORITY\LOCALSERVICE" and "NT AUTHORITY\NETWORKSERVICE" are also available as well as the well known SIDs for all three.

/RP     [password]     Specifies the password for the "run as" user. To prompt for the password, the value must be either "*" or none. This password is ignored for the system account. Must be combined with either /RU or /XML switch.

/SC     schedule     Specifies the schedule frequency. Valid schedule types: MINUTE, HOURLY, DAILY, WEEKLY, MONTHLY, ONCE, ONSTART, ONLOGON, ONIDLE, ONEVENT.

/MO     modifier     Refines the schedule type to allow finer control over schedule recurrence. Valid values are listed in the "Modifiers" section below.

/D     days         Specifies the day of the week to run the task. Valid values: MON, TUE, WED, THU, FRI, SAT, SUN and for MONTHLY schedules 1 - 31 (days of the month). Wildcard "*" specifies all days.

/M     months         Specifies month(s) of the year. Defaults to the first day of the month. Valid values: JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC. Wildcard "*" specifies all months.

/I     idletime         Specifies the amount of idle time to wait before running a scheduled ONIDLE task.
Valid range: 1 - 999 minutes.

/TN     taskname         Specifies a name which uniquely identifies this scheduled task.

/TR         taskrun         Specifies the path and file name of the program to be run at the scheduled time. Example: C:\windows\system32\calc.exe

/ST     starttime             Specifies the start time to run the task. The time format is HH:mm (24 hour time) for example, 14:30 for 2:30 PM. Defaults to current time if /ST is not specified. This option is required with /SC ONCE.

/RI     interval             Specifies the repetition interval in minutes. This is not applicable for schedule types: MINUTE, HOURLY, ONSTART, ONLOGON, ONIDLE, ONEVENT.
Valid range: 1 - 599940 minutes. If either /ET or /DU is specified, then it defaults to 10 minutes.

/ET     endtime         Specifies the end time to run the task. The time format is HH:mm (24 hour time) for example, 14:50 for 2:50 PM. This is not applicable for schedule types: ONSTART, ONLOGON, ONIDLE, ONEVENT.

/DU     duration         Specifies the duration to run the task. The time format is HH:mm. This is not applicable with /ET and for schedule types: ONSTART, ONLOGON, ONIDLE, ONEVENT. For /V1 tasks, if /RI is specified, duration defaults to 1 hour.

/K                             Terminates the task at the endtime or duration time. This is not applicable for schedule types: ONSTART, ONLOGON, ONIDLE, ONEVENT. Either /ET or /DU must be specified.

/SD     startdate         Specifies the first date on which the task runs. The format is dd/mm/yyyy. Defaults to the current date. This is not applicable for schedule types: ONCE, ONSTART, ONLOGON, ONIDLE, ONEVENT.

/ED     enddate         Specifies the last date when the task should run. The format is dd/mm/yyyy. This is not applicable for schedule types: ONCE, ONSTART, ONLOGON, ONIDLE, ONEVENT.

/EC     ChannelName         Specifies the event channel for OnEvent triggers.

/IT                        Enables the task to run interactively only if the /RU user is currently logged on at the time the job runs. This task runs only if the user is logged in.

/NP                      No password is stored. The task runs non-interactively as the given user. Only local resources are available.

/Z                         Marks the task for deletion after its final run.

/XML     xmlfile     Creates a task from the task XML specified in a file. Can be combined with /RU and /RP switches, or with /RP alone, when task XML already contains the principal.

/V1                       Creates a task visible to pre-Vista platforms. Not compatible with /XML.

/F                         Forcefully creates the task and suppresses warnings if the specified task already exists.

/RL     level           Sets the Run Level for the job. Valid values are LIMITED and HIGHEST. The default is LIMITED.

/DELAY     delaytime     Specifies the wait time to delay the running of the task after the trigger is fired. The time format is mmmm:ss. This option is only valid for schedule types ONSTART, ONLOGON, ONEVENT.

/?                         Displays this help message.
Modifiers: Valid values for the /MO switch per schedule type:
MINUTE: 1 - 1439 minutes.
HOURLY: 1 - 23 hours.
DAILY: 1 - 365 days.
WEEKLY: weeks 1 - 52.
ONCE: No modifiers.
ONSTART: No modifiers.
ONLOGON: No modifiers.
ONIDLE: No modifiers.
MONTHLY: 1 - 12, or
FIRST, SECOND, THIRD, FOURTH, LAST, LASTDAY.

ONEVENT: XPath event query string.

Examples:
  • Creates a scheduled task "doc" on the remote machine "ABC" which runs notepad.exe every hour under user "runasuser".

    SCHTASKS /Create /S ABC /U user /P password /RU runasuser /RP runaspassword /SC HOURLY /TN doc /TR notepad
     
  • Creates a scheduled task "accountant" on the remote machine "ABC" to run calc.exe every five minutes from the specified start time to end time between the start date and end date.

    SCHTASKS /Create /S ABC /U domain\user /P password /SC MINUTE /MO 5 /TN accountant /TR calc.exe /ST 12:00 /ET 14:00 /SD 06/06/2006 /ED 06/06/2006 /RU runasuser /RP userpassword
     
  • Creates a scheduled task "gametime" to run freecell on the first Sunday of every month.

    SCHTASKS /Create /SC MONTHLY /MO first /D SUN /TN gametime /TR c:\windows\system32\freecell
     
  • Creates a scheduled task "report" on remote machine "ABC" to run notepad.exe every week.

    SCHTASKS /Create /S ABC /U user /P password /RU runasuser /RP runaspassword /SC WEEKLY /TN report /TR notepad.exe
     
  • Creates a scheduled task "logtracker" on remote machine "ABC" to run notepad.exe every five minutes starting from the specified start time with no end time. The /RP password will be prompted for.

    SCHTASKS /Create /S ABC /U domain\user /P password /SC MINUTE /MO 5 /TN logtracker /TR c:\windows\system32\notepad.exe /ST 18:30 /RU runasuser /RP
     
  • Creates a scheduled task "gaming" to run freecell.exe starting at 12:00 and automatically terminating at 14:00 hours every day

    SCHTASKS /Create /SC DAILY /TN gaming /TR c:\freecell /ST 12:00 /ET 14:00 /K
     
  • Creates a scheduled task "EventLog" to run wevtvwr.msc starting whenever event 101 is published in the System channel

    SCHTASKS /Create /TN EventLog /TR wevtvwr.msc /SC ONEVENT /EC System /MO *[System/EventID=101]
     
  • Spaces in file paths can be used by using two sets of quotes, one set for CMD.EXE and one for SchTasks.exe. The outer quotes for CMD need to be double quotes; the inner quotes can be single quotes or escaped double quotes:

    SCHTASKS /Create /tr "'c:\program files\internet explorer\iexplorer.exe' \"c:\log data\today.xml\"" ...

SCHTASKS /Delete:

SCHTASKS /Delete [/S system [/U username [/P [password]]]]
/TN taskname [/F]

Description:
Deletes one or more scheduled tasks.

Parameter List:
/S     system     Specifies the remote system to connect to. If omitted the system parameter defaults to the local system.

/U     username Specifies the user context under which SchTasks.exe should execute.

/P [password]     Specifies the password for the given user context. Prompts for input if omitted.

/TN     taskname     Specifies the name of the scheduled task to delete. Wildcard "*" may be used to delete all tasks.

/F                         Forcefully deletes the task and suppresses warnings if the specified task is currently running.

/?                         Displays this help message.

Examples
SCHTASKS /Delete /TN * /F
SCHTASKS /Delete /TN "Backup and Restore"
SCHTASKS /Delete /S system /U user /P password /TN "Start Restore"
SCHTASKS /Delete /S system /U user /P password /TN "Start Backup" /F

SCHTASKS /Query:

SCHTASKS /Query [/S system [/U username [/P [password]]]]
[/FO format | /XML [xml_type]] [/NH] [/V] [/TN taskname] [/?]

Description:
Enables an administrator to display the scheduled tasks on the local or remote system.

Parameter List:
/S     system     Specifies the remote system to connect to. If omitted the system parameter defaults to the local system.

/U     username Specifies the user context under which SchTasks.exe should execute.

/P [password]     Specifies the password for the given user context. Prompts for input if omitted.

/FO     format  Specifies the format for the output. Valid values: TABLE, LIST, CSV.

/NH                 Specifies that the column header should not be displayed in the output. This is valid only for TABLE format.

/V                     Displays verbose task output.

/TN     taskname        Specifies the task name for which to retrieve the information, else all of them.

/XML [xml_type]       Displays task definitions in XML format.

If xml_type is ONE then the output will be one valid XML file.

If xml_type is not present then the output will be the concatenation of all XML task definitions.

/?                     Displays this help message.

Examples
SCHTASKS /Query
SCHTASKS /Query /?
SCHTASKS /Query /S system /U user /P password
SCHTASKS /Query /FO LIST /V /S system /U user /P password
SCHTASKS /Query /FO TABLE /NH /V

SCHTASKS /Change:

SCHTASKS /Change [/S system [/U username [/P [password]]]] /TN taskname { [/RU runasuser] [/RP runaspassword] [/TR taskrun] [/ST starttime] [/RI interval] [ {/ET endtime | /DU duration} [/K] ] [/SD startdate] [/ED enddate] [/ENABLE | /DISABLE] [/IT] [/Z] }

Description:
Changes the program to run, or user account and password used by a scheduled task.

Parameter List:
/S     system     Specifies the remote system to connect to. If omitted the system parameter defaults to the local system.

/U     username Specifies the user context under which SchTasks.exe should execute.

/P [password]     Specifies the password for the given user context. Prompts for input if omitted.
/TN     taskname     Specifies which scheduled task to change.

/RU     username     Specifies the "run as" user account (user context) under which the task runs. For the system account, valid values are "", "NT AUTHORITY\SYSTEM" or "SYSTEM". For v2 tasks, "NT AUTHORITY\LOCALSERVICE" and "NT AUTHORITY\NETWORKSERVICE" are also available as well as the well known SIDs for all three.

/RP     [password]     Specifies the password for the "run as" user. To prompt for the password, the value must be either "*" or none. This password is ignored for the system account. Must be combined with either /RU or /XML switch.
/ST     starttime         Specifies the start time to run the task. The time format is HH:mm (24 hour time) for example, 14:30 for 2:30 PM.

/RI     interval            Specifies the repetition interval in minutes. Valid range: 1 - 599940 minutes.

/ET     endtime           Specifies the end time to run the task. The time format is HH:mm (24 hour time) for example, 14:50 for 2:50 PM.

/DU    duration          Specifies the duration to run the task. The time format is HH:mm. This is not applicable with /ET.

/K                             Terminates the task at the endtime or duration time.

/SD     startdate         Specifies the first date on which the task runs. The format is dd/mm/yyyy.

/ED     enddate          Specifies the last date when the task should run. The format is dd/mm/yyyy.

/IT                            Enables the task to run interactively only if the /RU user is currently logged on at the time the job runs. This task runs only if the user is logged in.

/RL     level               Sets the Run Level for the job. Valid values are LIMITED and HIGHEST. The default is to not change it.
/ENABLE                Enables the scheduled task.

/DISABLE               Disables the scheduled task.

/Z                             Marks the task for deletion after its final run.

/DELAY     delaytime     Specifies the wait time to delay the running of the task after the trigger is fired. The time format is mmmm:ss. This option is only valid for schedule types ONSTART, ONLOGON, ONEVENT.

/?                            Displays this help message.

Examples:
SCHTASKS /Change /RP password /TN "Backup and Restore"
SCHTASKS /Change /TR restore.exe /TN "Start Restore"
SCHTASKS /Change /S system /U user /P password /RU newuser /TN "Start Backup" /IT

SCHTASKS /Run:

SCHTASKS /Run [/S system [/U username [/P [password]]]] [/I] /TN taskname

Description:
Runs a scheduled task on demand.

Parameter List:
/S     system     Specifies the remote system to connect to. If omitted the system parameter defaults to the local system.

/U     username Specifies the user context under which SchTasks.exe should execute.

/P [password]     Specifies the password for the given user context. Prompts for input if omitted.
/I                         Runs the task immediately by ignoring any constraint.

/TN     taskname     Identifies the scheduled task to run now.

/?                         Displays this help message.

Examples:
SCHTASKS /Run /?
SCHTASKS /Run /TN "Start Backup"
SCHTASKS /Run /S system /U user /P password /I /TN "Backup and Restore"

SCHTASKS /End
SCHTASKS /End [/S system [/U username [/P [password]]]] /TN taskname

Description:
Stops a running scheduled task.

Parameter List:
/S     system     Specifies the remote system to connect to. If omitted the system parameter defaults to the local system.

/U     username Specifies the user context under which SchTasks.exe should execute.

/P [password]     Specifies the password for the given user context. Prompts for input if omitted.
/TN     taskname     Identifies the scheduled task to run now.

/?                         Displays this help message.
Examples:
SCHTASKS /End /?
SCHTASKS /End /TN "Start Backup"
SCHTASKS /End /S system /U user /P password /TN "Backup and Restore"



Ref :


http://dosprompt.info/commands/schtasks.asphttp://dosprompt.info/commands/schtasks.asp
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/schtasks.mspx?mfr=true


Example :


SchTasks /Create /SC DAILY /TN "MyName" /TR "C:\ABC\ABC.bat" /ST 11:00 /RI 60 /DU 04:00 /RL LIMITED /K



Sunday, 1 February 2015

NoSQL vs. SQL

Types
One type (SQL database) with minor variations
Many different types including key-value stores ,document databases, wide-column stores, and graph databases
Development History
Developed in 1970s to deal with first wave of data storage applications
Developed in 2000s to deal with limitations of SQL databases, particularly concerning scale, replication and unstructured data storage
Examples
MySQL, Postgres, Oracle Database
MongoDB, Cassandra, HBase, Neo4j
Data Storage Model
Individual records (e.g., "employees") are stored as rows in tables, with each column storing a specific piece of data about that record (e.g., "manager," "date hired," etc.), much like a spreadsheet. Separate data types are stored in separate tables, and then joined together when more complex queries are executed. For example, "offices" might be stored in one table, and "employees" in another. When a user wants to find the work address of an employee, the database engine joins the "employee" and "office" tables together to get all the information necessary.
Varies based on database type. For example, key-value stores function similarly to SQL databases, but have only two columns ("key" and "value"), with more complex information sometimes stored within the "value" columns. Document databases do away with the table-and-row model altogether, storing all relevant data together in single "document" in JSON, XML, or another format, which can nest values hierarchically.
Schemas
Structure and data types are fixed in advance. To store information about a new data item, the entire database must be altered, during which time the database must be taken offline.
Typically dynamic. Records can add new information on the fly, and unlike SQL table rows, dissimilar data can be stored together as necessary. For some databases (e.g., wide-column stores), it is somewhat more challenging to add new fields dynamically.
Scaling
Vertically, meaning a single server must be made increasingly powerful in order to deal with increased demand. It is possible to spread SQL databases over many servers, but significant additional engineering is generally required.
Horizontally, meaning that to add capacity, a database administrator can simply add more commodity servers or cloud instances. The database automatically spreads data across servers as necessary
Development Model
Mix of open-source (e.g., Postgres, MySQL) and closed source (e.g., Oracle Database)
Open-source
Supports Transactions
Yes, updates can be configured to complete entirely or not at all
In certain circumstances and at certain levels (e.g., document level vs. database level)
Data Manipulation
Specific language using Select, Insert, and Update statements, e.g. SELECT fields FROM table WHERE…
Through object-oriented APIs
Consistency
Can be configured for strong consistency
Depends on product. Some provide strong consistency (e.g., MongoDB) whereas others offer eventual consistency (e.g., Cassandra)

NoSQL

What is NoSQL ?

NoSQL is a non-relational database management systems, different from traditional relational database management systems in some significant ways. It is designed for distributed data stores where very large scale of data storing needs (for example Google or Facebook which collects terabits of data every day for their users). These type of data storing may not require fixed schema, avoid join operations and typically scale horizontally.

What is the important features of NoSQL DB?

Schema-free DB: A database schema is the structure of database system, described in a formal language supported by the database management system. In a relation database the schema defines the tables, the fields in each table and the relationships between fields and tables, generally it stored in a data dictionary. In NoSQL, collection is a group of documents where document represent a row and collection represent a table in a relational database. Collections are schema free which means within a single collection different types and structured of documents can be stored.
For example, both of the following documents can be stored in a single collection.
{"name" : "dinesh"} {"salary" : 50000} {"address" : "noida"} 

Note that the previous documents have no common data elements at all. This flexibility means that schema free practice can be possible in NoSQL database.

Horizontally scalable : To scale horizontally means to add more nodes to a system (such as adding a new computer). In NoSQL system, data store can be much faster as it takes advantage of "scaling out" which means to add more nodes to a system and distribute the load over those nodes.

Categories of NoSQL DB?

1.Document Based DB:

Data is stored as documents.
An example format may be like - Employee Name="Dinesh", Employee Address="Noida", Spouse=[{Name:"Sweety"}], Salary="50000"
such databases are CouchDB, Jackrabbit, MongoDB, OrientDB, SimpleDB, Terrastore etc.

2.XML Based DB:
Data is stored in XML format.
such databases are BaseX, eXist, MarkLogic Server etc.

3.Graph Based DB:
Data is stored as a collection of nodes, where nodes are analogous to objects in a programming language. Nodes are connected using edges.
such databases are AllegroGraph, DEX, Neo4j, FlockDB, Sones GraphDB etc.

MongoDB?

MongoDb is a Open Source database written in C++.
If the load increases, by adding more nodes (such as a computer), the performance can be retained.

It can be used to store data for very high performance applications (for example Foursquare is using it in production).
MongoDb stores data as documents. So it is a document oriented database.

Employee Name="Dinesh", Employee Address="Noida", Spouse=[{Name:"Sweety"}], Salary="50000"
Notice there are two different documents (separated by "."). Storing data in this fashion is called as document oriented database.

Features of MongoDB?

1. Since MongoDb offers a Document oriented storage, It is simple and easily programmable.
2. You can set an index on any attribute of a MongoDb record (as Employee Name="Dinesh", Employee Address="Noida", Spouse=[{Name:"Sweety"}], Salary="50000", with respect to which, a record can be sort quickly and ordered.
3. You can set mirror across local as well as wide area networks, which makes it easily scalable.
4. If load increases (more storage space, more processing power), it can be distributed to other nodes across computer networks. This is called as sharding.
5. MongoDb supports rich query to fetch data from the database.
6. MongoDb supports replacing an entire document (database) or some specific fields with it's update() command.
7. MongoDb supports various programming languages like C, C# and .NET, C++, Erlang, Haskell, Java, Javascript, Perl, PHP, Python, Ruby, Scala (via Casbah).
8. It supports Server-side JavaScript execution. Which allows a developer to use a single programming language for both client and server side code.
9. MongoDb is easily installable.

RAR and ZIP File Differences

This time I will discuss about the differences between RAR and ZIP files. Maybe you’ve seen rar and zip files, especially you who like to download files from the internet’ll often find him. Overview file .rar and. zip it makes no difference only difference in file extensinya alone. Both files are equally compressed files from a file or document that you want to compress. So what’s the difference file .rar and files .zip?

RAR Archives: In many cases, creating RAR formats compress/decompress a more dense when compared with the ZIP format. Other advantages of the RAR is a multivolume support. If you had to create a multi-volume archive, then use the RAR is the choice. RAR format also has some other important things that are not encountered in ZIP format. For example, the ability to reconstruct RAR archives broken, protection/key records, and protect vital records of modifications not on purpose.

RAR format also can overcome file size that can be said to be infinite (up to 8,589,934,591 GB). While the maximum size of the ZIP file is only 2 GB. File system that supports files larger than 4 GB is NTFS or more recent than that.

ZIP Archives : ZIP format is the most popular. For example , most of the archives on the internet is a ZIP format. If you will send a RAR archive to a person, that person may not have WinRAR to extract the RAR archive, it could have made you to choose the format of ZIP on the other side. You can send a file that type of self -extracting (can extract itself). Self-extracting archive has a slightly larger size, but it can extract itself without the help of any program. Another advantage is the speed of the ZIP, ZIP archive creation process faster than RAR archives.

So that’s a little difference between rar and zip files. Stay up to us to use a format where, according to our needs. Because the primary function of these formats is to compress large files into smaller ones.

DBT - Models

Models are where your developers spend most of their time within a dbt environment. Models are primarily written as a select statement and ...