الاثنين، 30 يناير 2012

Creating the DATABASE Manually

Creating  the DATABASE Manually


  1. Setting the environment

  1. Preparing the O/S

  1. Preparing Parameter file

  1. Preparing Password file

  1. Starting the Instance

  1. Creating the Database

  1. Adding the data dictionary views

  1. Adding the  Pl/Sql support

  1. Creating the Product Profile

  1. Running the optional Scripts

  1. Adding utility table spaces

  1. Creating the Spfile

  1. Backup database

Setting the environment variable

ORACLE _SID = <STRING>

Unix:-- It is set in login scripts

NT/W2K :-- user Environment Variables


NOTE:-- The  value of the DB_NAME initialization parameter should match the SID setting.


Preparing  the O/S

 Create  Data files, Log files, Control file, User trace files, background procese trace files, alert log file dir’s.


NT/W2K

<drive>\oracle\oradata\<Sid>\data
<drive>\oracle\oradata\<Sid>\log
<drive>\oracle\oradata\<Sid>\control

<drive>\oracle\admin\<Sid>\udump
<drive>\oracle\admin\<Sid>\bdump

Unix

Mount point\oracle\data\<Sid>\data
Mount point\oracle\data\<Sid>\log
Mount point\oracle\data\<Sid>\control

Mount point\oracle\admin\<Sid>\udump
Mount point\oracle\admin\<Sid>\bdump


Ex:-

Nt/W2k
unix







Preparing the parameter file:

NT/W2K

db_name = "<dbname>"
instance_name = <sting>
service_names = <string>
db_files = <int> 
control_files = <file spec>

eg:("C:\oracle\oradata\<sid>\control01.ctl"

open_cursors = <int>
max_enabled_roles = <int>
db_file_multiblock_read_count = <int>
db_block_buffers = <int>
shared_pool_size = <int>
large_pool_size = <int>
java_pool_size = <int>
log_checkpoint_interval = <int>
log_checkpoint_timeout = <int>
processes = <int>
parallel_max_servers = <int>
log_buffer = <int>
global_names = FALSE
oracle_trace_collection_name = ""
resource_manager_plan = system_plan
user_dump_dest = <file spec>

eg : C:\oracle\admin\<sid>\udump

db_block_size = <int>
remote_login_passwordfile = exclusive
os_authent_prefix = ""
job_queue_processes = <int>
job_queue_interval = <int>
open_links = <int>
distributed_transactions = <int>
sort_area_size = <int>
sort_area_retained_size = <int>
UTL_FILE_DIR=*

UNIX

db_name = "<dbname>"
instance_name = <sting>
service_names = <string>
db_files = <int> 
control_files = <file spec>

eg:("/u02/oracle/oradata/<sid>/control01.ctl"

open_cursors = <int>
max_enabled_roles = <int>
db_file_multiblock_read_count = <int>
db_block_buffers = <int>
shared_pool_size = <int>
large_pool_size = <int>
java_pool_size = <int>
log_checkpoint_interval = <int>
log_checkpoint_timeout = <int>
processes = <int>
parallel_max_servers = <int>
log_buffer = <int>
global_names = FALSE
oracle_trace_collection_name = ""
resource_manager_plan = system_plan
user_dump_dest = <file spec>
eg : /u02/oracle/admin/<sid>/udump
db_block_size = <int>
remote_login_passwordfile = exclusive
os_authent_prefix = ""
job_queue_processes = <int>
job_queue_interval = <int>
open_links = <int>
distributed_transactions = <int>
sort_area_size = <int>
sort_area_retained_size = <int>
UTL_FILE_DIR=*

Preparing the password file


Unix

Orapwd<sid>.ora

Location:  $ORACLE_HOME/dbs


NT/W2K
Orapwd<sid>.ora
Location :  %ORACLE_HOME%\database


Syntax:

Orapwd file=<filespec> password= <password> entries =<int>


Note: When ever a password file is creates SYS user is the part of password file


 Eg:  Unix

 Orapwd file=$ORACLE_HOME/dbs/orapwd<sid> password=<password> entries=10

NT

Ever  Oracle Instance in NT O/S is handled by NT service

The NT sevice=oracle service<sid>

When ever we create a Database we must create the service.  For this we use “ORADIM” utility.  It starts the Database automatically.

Oradim  -new –sid <sid>
              -startup –sid <sid>
              -shutdown –sid <sid>
              -modify –sid <sid>

-new :-- is used for to create a new service.
-startup:-- is used for to start  the service.
-shutdown :--is used to shutdown the service.
-delete:-- o remove the service.
-modify :-- to modify the service settings.
-intpwd:-- password for SYS user.


Syntax:

Oradim –new –sid  <sid> -intpwd <password> -pfile <parameter file>
-startupmode   auto/manually –maxusers <int>

Note:  To create a service the users must have the NT administrator privileges.


Starting the Instance

$:/C:\> sqlplus  /nolog

sql:\> conn sys/password as sysdba
sql:\> startup nomount


Creating the Database

Create database <db_name>
            Maxdatafiles  <int>
            Maxlogfiles  <int>  (>/= 2* maxinstances)
            Maxlogmembers <int> (1-5)
            Maxloghistory    <int>
            Maxinstances  <int>

Logfile
     Group <#> (‘filespec’,’filespec’----) size <int> [k/m],
     Group <#> (‘filespec’,’filespec’----) size <int> [k/m],
     Group <#> (‘filespec’,’filespec’----) size <int> [k/m]

Datafile  ‘filespec’ size <int> [k/m];



Eg:
 
 Create database sri
            Maxdatafiles  150
            Maxlogfiles  10
            Maxlogmembers 5
            Maxloghistory    1000
            Maxinstances  1

Log file
     Group 1  (‘c:\oracle\oradata\sri\log\log1.log) size 10 m,
     Group 2  (‘c:\oracle\oradata\sri\log\log2.log) size 10 m

Datafile  ‘c:\oracle\oradata\sri\data\system.dbf’ size 150 m ;


Creating the Data dictionary views:


Run the catalog.sql  script

Location :
UNIX   $ORACLE_HOME/RDBMS/ADMIN
NT    % ORACLE_HOME%\RDBMS\ADMIN

Adding  the PL/SQL support:

Run the catproc.sql script

Location :
UNIX   $ORACLE_HOME/RDBMS/ADMIN
NT    % ORACLE_HOME%\RDBMS\ADMIN

Creating the product profile:

Sql:\.> conn system/manger

Run  pupbld.sql script

Location :
UNIX   $ORACLE_HOME/SQLPLUS/ADMIN
NT    % ORACLE_HOME%\SQLPLUS\ADMIN


 Run the optional scripts:

Catrep.sql      to  enable the replication

Initjvm.sql     to installs the java virtual metion



Adding the utility tablespaces

Creating the Spfile

Back up the Database

ليست هناك تعليقات:

إرسال تعليق