hi welcome to this database lessons
video series in this video we will do a
small exercise of how to connect to the
database which we just installed in our
desktop the prerequisite for this video
is a couple of in this video series you
know if you go back there are a couple
of videos about how to install Oracle
11g in video when Oracle 11g in your PC
Windows 7 PC those would be the
prerequisites if we haven't done that
that's fine you can still watch this and
understand the concept okay so so we
install the Oracle database so if you
want to see what Oracle services are
running open your windows 7 services
panel right control panel Administrative
Tools and services ok you know what let
me show that also just in case okay
control panel Administrative
tools and services so here if you look
for Oracle so you have a lot of services
with regard to Oracle running so the
services that we are interested at this
point is this one Oracle service and
demo dB
why it is horrible service demo DB the
database that we installed the instance
that we installed is demo DB and that's
running as well as the other services
that we would be interested is this DNS
listener service I will explain that
later okay so right now this service
database has started and it's an
automatic mode those who knows who those
who know Windows they know what is
automatic mode basically like now when
you start the machine
this service automatically starts simply
it's an automatic mode so right now it's
started so I'm going to explain how to
connect to that so to connect to that
just go type CMD in your Windows run
field
okay so I know the database name is demo
DB so I need to set an environment
environment variable to tell that this
is the database I'm going to connect to
okay so there are two variables one is
Oracle underscore seed and the other one
is Oracle underscore hope I'll explain
that now okay
so I'm going to set Oracle underscore
set equal to the or dB
okay so this is nothing but an operating
system environment like what you're
saying for a variable Oracle underscore
said we are setting this value demo DB
as this variable why we are doing it
because Oracle uses it Oracle whenever
it does it's one process for our
whenever we interact it looks for what
is the Oracle Sid okay so I want to
verify if that one has been sit properly
okay demo DB okay so this is a Windows
command whenever you set something to
some value and then if you want to make
sure that something is right is
correctly pointing to the value that we
set you do this you replace min-ye this
is the string that we used right you put
a percentage side before and a
percentage sign after that so we are
basically we want to see the value of
this string okay so when I say echo
percentage sign Oracle's I said
percentage sign then the operating
system knows that it has to give me the
value right so Windows echo is a command
we can we can just say like
anything we can you know deco in the
sense anything we can make windows to
repeat it's kind of like this and I echo
let's say alright cool so it's going to
say just article echo Apple let's go to
say Apple
okay so button again when I set a value
for that for example I said Apple equal
to Mac just just a value for the string
Apple right and then I do echo Apple
it's still going to echo only Apple but
then if I echo percentage app percentage
then Windows knows that it has to bring
back the value that is assigned for the
string Apple so the value is Mac so
that's a Windows work okay so basically
we need to set a value for this article
underscore set and that should point to
the the database of the instance that we
use okay because why we need to do that
because our whenever we interact with
Oracle Oracle will look for these values
for these strings
okay so again like my verify echo Oracle
Sid is demo DB okay so now the next
parameter okay I need to set the Oracle
home okay Oracle home is the location
where I've installed Oracle
okay I've installed Oracle in this
location if you see the the installation
video you would know that okay I
basically install Oracle on c colon app
slash Sam slash product / 11 - OH
DB home so by doing this what I'm saying
- the the the system is Oracle
installation files are located here and
whenever anything needs to be executed
it will use the files that are located
in this folder okay so there are two
important parameters Oracle set which I
set it to the instance or the database
and the second one is our little home
which I said to the folder where Oracle
has been installed okay and I also
verified it
so verifying it I'm verifying it okay so
now to connect sequel plus slash no log
okay so why no luck because okay so a
why no log I'll explain that now right
now
you know I've logged in into this
machine as an administrator right and as
an administrator I don't need to give a
password or username to connect okay and
I run sequel plus with no log right
basically I am Telling single person own
as username and password at this moment
okay so now I'm going to connect as
whatever you sir I want weather again
let's say you know I want to connect us
the the most powerful user within the
Oracle database okay so I'm going to
connect / s this DBA this DBA is the the
powerful use of in Oracle ok so what's
happening is I am issuing a connect
statement and then slash so slash means
it will use the The Voice credentials
like I logged in as an administrator
this machine right so I don't need to
specify any username one other thing and
then I'm saying that you know I want to
connect us sis DBA so meaning that you
know I have 60 B of privilege and then I
want to correct access DBA so these
things I'm going to explain in in
subsequent videos but then this is the
connection method once you install
Oracle database set your Oracle Sid
first open the command prompt say to
your Oracle said say to your Oracle home
connect when sequel plus slash no log
connect as this DBA and you are
connected just to verify you fear on the
right if you are connected to the right
instance or right database you need to
be verified whenever you make any
connection you need to verify it first
ok to verify it there is a view called B
dollar instance this is where you verify
and when you put de SC which is
described space V dollar instance it
will explain it will give what are the
columns that are there in this view okay
so we dollar instance ok BC I'm gonna
I'm gonna use instance name okay we can
see like line which instance name it's
running and which hostname it's running
and what is its status I mean what is it
status those information you can find
out ok so select instance okay okay so
these column names are generally not
case-sensitive okay select instance name
status from radom instance so the
instance name is demo DB it's open that
means now it's available for use so this
is of you connect ok unverified okay so
thank you