Wednesday, July 12, 2017

Oracle ASMLib Downloads for Oracle Linux 7  


Note: All ASMLib installations require the oracleasmlib and oracleasm-support packages appropriate for their machine.

The oracleasm-support package can be downloaded from the Unbreakable Linux Network(ULN) if you have an active support subscription, or from http://public-yum.oracle.com if you do not.

The oracleasm kernel driver is built into the Unbreakable Enterprise Kernel for Oracle Linux 7 and does not need to be installed manually.

The oracleasm kernel driver for the 64-bit (x86_64) Red Hat Compatible Kernel for Oracle Linux 7 can be installed manually from ULN or http://public-yum.oracle.com using the yum tool:
# yum install kmod-oracleasm

This kernel driver is not version-specific and does not need to be upgraded when the kernel is upgraded.

Oracle ASMLib 2.0


Intel EM64T (x86_64) Architecture

Oracle ASMLib Downloads for Oracle Linux 6  


Note: All ASMLib installations require the oracleasmlib and oracleasm-support packages appropriate for their machine.

The oracleasm-support package can be downloaded from the Unbreakable Linux Network(ULN) if you have an active support subscription, or from http://public-yum.oracle.com if you do not.

The oracleasm kernel driver is built into the Unbreakable Enterprise Kernel for Oracle Linux 6 and does not need to be installed manually.

The oracleasm kernel driver for the 64-bit (x86_64) Red Hat Compatible Kernel for Oracle Linux 6 can be installed manually from ULN or http://public-yum.oracle.com using the yum tool:
# yum install kmod-oracleasm

This kernel driver is not version-specific and does not need to be upgraded when the kernel is upgraded.

Also, see the release notes.
Jump to:

Oracle ASMLib 2.0


Intel IA32 (x86) Architecture


Intel EM64T (x86_64) Architecture

Tuesday, July 11, 2017

How to control SSIS package flow based on record count returned by a query?

One option would be to make use of precedence constraint in conjunction with Execute SQL task to achieve this functionality. Here is an example of how to achieve this in SSIS 2008 R2.
I created a simple table based on the information provided in the question.
Create table script:
CREATE TABLE dbo.AR_Sale(
    Id int NOT NULL IDENTITY PRIMARY KEY,
    Item varchar(30) NOT NULL,
    Price numeric(10, 2) NOT NULL,
    Processed bit NOT NULL
) 
GO
Then populated the new table with some sample data. You can see that one of the row has Processed flag set to zero.
Populate table script:
INSERT INTO dbo.AR_Sale (Item, Price, Processed) VALUES
    ('Item 1', 23.84, 1),
    ('Item 2', 72.19, 0),
    ('Item 3', 45.73, 1);
On the SSIS package, create the following two variables.
  • Processed of data type Int32
  • SQLFetchCount of data type String with value set to SELECT COUNT(Id) ProcessedCount FROM dbo.AR_Sale WHERE Processed = 0
Variables
On the SSIS project, create a OLE DB data source that points to the database of your choice. Add the data source to the package's connection manager. In this example, I have used named the data source as Practice.
On the package's Control Flow tab, drag and drop Execute SQL Task from the toolbox.
Configure the General page of the Execute SQL Task as shown below:
  • Give a proper Name, say Check pre-execution
  • Change ResultSet to Single row because the query returns a scalar value
  • Set the Connection to the OLE DB datasource, in this example Practice
  • Set the SQLSourceType to Variable because we will use the query stored in the variable
  • Set the SourceVariable to User::SQLFetchCount
  • Click Result Set page on the left section
Execute SQL Task - General
Configure the Result Set page of the Execute SQL Task as shown below:
  • Click Add button to add a new variable which will store the count value returned by the query
  • Change the Result Name to 0 to indicate the first column value returned by query
  • Set the Variable Name to User::Processed
  • Click OK
Execute SQL Task - Result Set
On the package's Control Flow tab, drag and drop Send Mail Task and Data Flow Task from the toolbox. The Control Flow tab should look something like this:
Control Flow tab
Right-click on the green arrow that joins the Execute SQL task and Send Mail Task. Click Edit... the Green Arrow is called as Precedence Constraint.
Right-click constraint 1
On the Precedence Constraint Editor, perform the following steps:
  • Set Evaluation operation to Expression
  • Set the Expression to @[User::Processed] == 0. It means that take this path only when the variable Processed is set to zero.
  • Click OK
Equal to zero
Right-click on the green arrow that joins the Execute SQL task and Data Flow Task. Click Edit... On the Precedence Constraint Editor, perform the following steps:
  • Set Evaluation operation to Expression
  • Set the Expression to @[User::Processed] != 0. It means that take this path only when the variable Processed is not set to zero.
  • Click OK
Not equal to zero
Control flow tab would look like this. You can configure the Send Mail Task to send email and the Data Flow Task to update the data according to your requirements.
Control Flow final
When I execute the package with the data set to based on the populate table script, the package will execute the Data Flow Task because there is one row that is not processed.
Data Flow Task logic
When I execute the package after setting Processed flag to 1 on all the rows in the table using the script UPDATE dbo.AR_Sale SET Processed = 1, the package will execute the Send Mail Task.
Send Mail Task logic
Hope that helps.

Formatting a USB Drive with ext4 for Use with Linux

I wish to use an external USB drive exclusively on a Linux system (in my case, Debian).  I want to use the ext4 filesystem. Note that this method wipes out the filesystem on the drive. 
Install hotplug-type package such that upon plugging the USB drive in the device is attached to somewhere in the system. I use KDE and it automatically prepares such an environment.  When a USB drive is plugged in, I should see a message like this one in the system log:
$ sudo tail /var/log/messages
Dec 16 02:07:51 kernel: [ 3000.544361] scsi11 : usb-storage 3-2:1.0
...
Dec 16 02:07:56 mochi kernel: [ 3005.882879]  sdb: sdb1
...
or I may see something like this instead (I’m using USB 3.0 adapter now):
$ sudo tail -n 100 /var/log/messages | grep sd
...
May  3 12:38:33 mochi kernel: [   12.773057] sd 6:0:0:0: [sdb] Spinning up disk...
May  3 12:38:39 mochi kernel: [   18.782284] sd 6:0:0:0: [sdb] 3906963456 512-byte logical blocks: (2.00 TB/1.81 TiB)
May  3 12:38:39 mochi kernel: [   18.783052] sd 6:0:0:0: [sdb] Write Protect is off
May  3 12:38:39 mochi kernel: [   18.794337]  sdb: sdb1
May  3 12:38:39 mochi kernel: [   18.795569] sd 6:0:0:0: [sdb] Attached SCSI disk
Here, I find the device is at /dev/sdb and there is only one partition, /dev/sdb1, for example. I can also see all the disk devices as follows:
$ sudo fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
240 heads, 63 sectors/track, 10337 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbd3cc0bb
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       10338    78149633    5  Extended
/dev/sda5               1          46      340992   83  Linux
/dev/sda6              46          52       48128   83  Linux
/dev/sda7              52         698     4881408   83  Linux
/dev/sda8             698        1086     2928640   83  Linux
/dev/sda9            1086        1861     5858304   83  Linux
/dev/sda10           1861        2830     7323648   83  Linux
/dev/sda11           9305       10338     7812096   82  Linux swap / Solaris
/dev/sda12           2830        9304    48949248   83  Linux
Partition table entries are not in disk order
Disk /dev/sdb: 2000.4 GB, 2000365289472 bytes
255 heads, 63 sectors/track, 243197 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005f107
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      243198  1953480704    7  HPFS/NTFS
When the USB drive is new, the partition is most likely formatted in FAT or NTFS unless the drive is preformatted specifically for OS X.  Now, prepare the partition for Linux:
$ sudo fdisk /dev/sdb
See help for detail by pressing “m” on the fdisk command shell.  For example, press “p” to see the list of partitions in the disk.  To create a new one press “n” (probably after deleting one or more partitions by pressing “d”).  Finally press “w” to actually make changes to the drive.  To use ext4 filesystem, do:
$ sudo mkfs.ext4 /dev/sdb1
after exiting fdisk.
If I always mount this drive on boot, add a line like this to /etc/fstab:
/dev/sdc1 /media/usbdrive ext4 defaults 0 0
assuming /media/usbdrive is the mount point.  If I use KDE, adding an entry to /etc/fstabis no longer necessary; I can easily manage external drives with Device Notifier.

  How to Change Instance Type & Security Group of EC2 in AWS By David Taylor Updated April 29, 2023 EC2 stands for Elastic Compute Cloud...