How to Install SQL * Plus Client in Linux

How to install SQL * PLUS client in linux

Go to Oracle Linux x86-64 instant clients download page

Download the matching client

oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm

Install

rpm -ivh oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm

Set environment variables in your ~/.bash_profile

ORACLE_HOME=/usr/lib/oracle/11.2/client64
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_HOME
export LD_LIBRARY_PATH
export PATH

Reload your .bash_profile by simply typing source ~/.bash_profile (suggested by jbass) or Log-out user and log-in again.

Now you're ready to use SQL*Plus and connect your server. Type in :

sqlplus "username/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.1)(PORT=1521))(CONNECT_DATA=(SID=YOURSID)))"

sqlplus remote connection giving ORA-21561

Append the name of your server to the hosts file.

If your /etc/hosts file looks like this:

127.0.0.1   localhost localhost.localdomain

It should be changed to:

127.0.0.1   localhost localhost.localdomain hostname

hostname can be obtained from the command "hostname".

Interfaces in C#

Imagine that you have a pizza store (I'm stealing this example from a famous Design Patterns book). You know that all pizzas need to be ordered, prepared, baked and boxed. Well, you can define this common behavior into an interface:

public interface IPizza
{
void Order();
void Prepare();
void Bake();
void Box();
}

And have your different kinds of pizzas implement that interface. When you implement an interface, you're forcing that class to have the same methods and parameters as the interface, for example:

public class PepperoniPizza : IPizza
{
public void Order()
{
//Order Pepperoni pizza
}

public void Prepare()
{
//Prepare Pepperoni pizza
}

public void Bake()
{
//Bake Pepperoni pizza
}

public void Box()
{
//Box Pepperoni pizza
}
}

You would pretty much have the same with Hawaiian, Cheese or any other Pizza.

In real life there are several uses for Interfaces. You can create contracts to extend an application, or ensure that it works on different situations.

Hope this helps

Generic Question: Thoughts on soft keyboard UI for mobile devices

I feel that it is much easier to type on keyboards that display the letter you are pressing as you press it. Also that the said letter is not put in until you lift your finger off of it. Like seen on the iPod and iPhone, and my current phone the LG Dare.

This is really good if you are working with a small space for the keyboard. If you are developing a keyboard I suggest using this method.

Should I unit test a class for having MEF attributes?

After thinking some hours and reading some TDD blogs again I should say, YES, I have to test whether my class has MEF attributes or not.

So before refactoring my classes I write unit tests in that way:

[TestClass]
public class When_SampleClass_mefable
{
[TestMethod]
[TestCategory("LFF.Kabu.Win.Login.ViewModel.SampleClass")]
public void Should_SampleClass_be_marked_with_Export_Attibute()
{
//arrange
var info = (typeof (SampleClass));

//act
var attr = info.GetCustomAttributes(true);

var hasExportAttribute =
attr.Where(x => x.GetType() == typeof (ExportAttribute))
.Where(x => ((ExportAttribute)x).ContractType == typeof(SampleClass))
.Count() > 0;
//assert
Assert.IsTrue(hasExportAttribute, "SampleClass is not marked with Export.");
}
}

For other MEF attributes like [ImportingConstructor] or [PartCreationPolicy] I do it the same way.



Related Topics



Leave a reply



Submit