Академический Документы
Профессиональный Документы
Культура Документы
when ever we need to create DB 1st we need to create intance that means we need to
create memory and
allocate memory start the BG process then go and start DB files then we can DB is
compeltely DB is open.
ORACLE_SID=ORCL
export ORACLE_SID=ORCL
export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/db_1
PATH is nothing but where exactly the binaries are located or installed like
suppose i want to enter into the db and gving the queries .so we are giving the
queries at sqlplus prompt so we are using sql language for commnicating with the
database.
so for entering into sqlplus prompt either we can go with sqlplus prompt or sql
developer .
sqlplus is command line utility thorugth which we can execute sql comamnds.
here we are using sqlplus commad line utilty ,so sqlplus actually present under in
oracle home.so sqlplus we call it as kind of binary.so for that sqlplus path we
have to set PATH variabl
PATH=$ORACLE_HOME/bin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
so these are variables we need to set as the environment variables but where do i
need to set these variables.
so i need to open a file name called .bash_proile .this file is hidden file (when
ever we give "." before
the fiile that we can treat as a hidden file in linux)
hidden files are not visible using ls command ,for that we have use ls -la
open the bash profile set env variables and run this file.
to cross check bash profile correctly loaded or not ,in linux we use echo command
Eg: echo $ORACLE_SID
step :2
db_name='devdb'
#shared_pool_size=100
db_block_size=8192
diagnostic_dest='/u01/oradata/orcl'
control_files=(/u01/oradata/orcl/control01.ctl)
open_cursors=300
undo_tablespace='UNDOTBS1'
compatible='11.2.0'
SGA_target=400M
why do we need a parameter file -- in oracle any thign that you want to assign a
value that we can say or regarded as a parameter files in oracle DB.
suppose just i want to give database name then we can use parameter that is
db_name=orcl
control_file='/u01...'
diagnostic_files= which means we are tring to diagnose or find the problem and the
recorded it in the file.
1.alert log:
------------
what does the alert log file contains -- the name it self saying when ever we hvae
problem alerts are being generated and that will be recorded in the log(log means
recirding) file
what will name of the alert logile -- the name of the alert log file will be always
alert_sid.log --- alert_orcl.log
alert log file is compeltely text file we can read the errors
alert files is very big file -- it will be recodirng everything like start up of
database shut down of the DB,how many users logged in,what commands they are
firing.
one very important question -- what happens if the alert file gets deleted. ? wil
it effect the DB -- answer is no
time to time we have delete the alert log file ,bcoz alert log will be increased
and become very big.
when ever we just satrt DB a new laert file will be created ,basically 1 alert log
file will be created
trace file:
----------
trace file -- tracing is some thing means finding problem,it also do the same
thing.trace files also used to find the problem.
why do we need 2 types of files alert log file and trace file --- in alert log
we can open,read and resolve the errors but in oracle there are some issues which
we cant resolve the
issues as a DBA bcoz there are lot of bugs in DB software and we have to depend on
oracle support in that case .
when we join in the company what they will do ,they give oracle support account.if
we unable to solve the issue we can raise SR to oracle support.inorder to find and
resolve the issue
by oracle support or team we have to provide some particulat file/s that files we
can call it as trace files .
which file we need to provide to oracle support team --- last trace or trace file
near to the problem
trace file is a semy binary file,its not in a readable formart -- we have tools in
oracel we can convert it into text format and we can find and resolve the issue.
- next parameter
shared_pool_size=100m
from 11g on wards automatic memory management -- no need to define the size for
memory components
hard disk space divided in the form of blocks ,like this space in datafiles
divided as blocks so you can have block sizes ranging from 2k,4k,8k,16k,32k.
before creating the DB you have to mention the block size but after creating the
DB we cant change then block size. bcoz when you create the DB oracle use that size
and store the data
in the datafiles.
just ref pasting all the parameters that we need to use in manual method in DB
creation
db_name='orcl'
#shared_pool_size=100
db_block_size=8192
diagnostic_dest='/u01/oradata/orcl'
control_files='/u01/oracle/oradata/orcl/control01.ctl'
open_cursors=300
undo_tablespace='UNDOTBS'
compatible='11.2.0'
SGA_target=300M
compatible -- it means this pfile is compatible with which version, we are going to
create this pfile on which version of the oracle software.
The Oracle Database enables you to control the compatibility of your
database with the COMPATIBLE initialization parameter.
vi postdb.sql
spool postdb1.log
@$ORACLE_HOME/rdbms/admin/catalog.sql
@$ORACLE_HOME/rdbms/admin/catproc.sql
spool off
connect system/oracle
spool postdb2.log
@$ORACLE_HOME/sqlplus/admin/pupbld.sql
spool off
catalog.sql creates all the data dictionary views,