It is considered that you have already made the Oracle DB installation.

These instructions are tested on Oracle DB 10.2.0.1.0 for Linux under CentOS 5.0 and Kubuntu 7.04

  1. Go under the user created in step preinstall:
    su - oracle
  2. Expose the environment variables (for bash):
    • If the database does not yet exist:
      export NLS_LANG=.CL8ISO8859P5
      export ORACLE_HOME=/opt/oracle/product/10.2.0/db_1
      export ORACLE_SID=db01
      export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
    • If the database already exists:
      export ORACLE_SID=db01
  3. Create a password file:
    orapwd FILE=/opt/oracle/product/10.2.0/db_1/dbs/orapwdb01 PASSWORD=secret ENTRIES=30
  4. Create a file initialization parameters, for example, ” /opt/oracle/product/10.2.0/db_1/dbs/initdb01.ora” approximately, with the following contents:
    db_cache_size=247463936
    java_pool_size=4194304
    large_pool_size=4194304
    shared_pool_size=104857600
    streams_pool_size=0
    audit_file_dest='/opt/oracle/admin/db01/adump'
    background_dump_dest='/opt/oracle/admin/db01/bdump'
    compatible='10.2.0.1.0'
    control_files='/opt/oracle/oradata/db01/control01.ctl','/opt/oracle/oradata/db01/control02.ctl','/opt/oracle/oradata/db01/control03.ctl'
    core_dump_dest='/opt/oracle/admin/db01/cdump'
    db_block_size=8192
    db_domain=''
    db_file_multiblock_read_count=16
    db_name='db01'
    db_recovery_file_dest='/opt/oracle/flash_recovery_area'
    db_recovery_file_dest_size = 2147483648
    dispatchers='(PROTOCOL=TCP) (SERVICE=oracleXDB)'
    job_queue_processes=10
    nls_language='RUSSIAN'
    nls_territory='RUSSIA'
    open_cursors=300
    pga_aggregate_target=121634816
    processes=150
    remote_login_passwordfile='EXCLUSIVE'
    sga_target=364904448
    undo_management='AUTO'
    undo_tablespace='UNDOTBS1'
    user_dump_dest='/opt/oracle/admin/db01/udump'
    log_archive_dest='/opt/oracle/admin/db01/archlog'
    log_archive_format="arc_%r_%t_%s.log"
  5. Create the required directory:
    mkdir -p /opt/oracle/admin/db01/adump
    mkdir -p /opt/oracle/admin/db01/bdump
    mkdir -p /opt/oracle/admin/db01/cdump
    mkdir -p /opt/oracle/admin/db01/udump
    mkdir -p /opt/oracle/admin/db01/archlog
    mkdir -p /opt/oracle/oradata/db01
  6. Run sqlplus:
    sqlplus /nolog
  7. Connecting to a database (the password is specified in item 3 ):
    connect sys/secret as sysdba;
  8. Create spfile from pfile:
    create spfile='/opt/oracle/product/10.2.0/db_1/dbs/spfiledb01.ora' from pfile='/opt/oracle/product/10.2.0/db_1/dbs/initdb01.ora';
  9. We start instance without connecting to a database:
    startup nomount;
  10. Create a database:
    CREATE DATABASE db01
    LOGFILE GROUP 1 ('/opt/oracle/oradata/db01/redo01.log') SIZE 100M,
            GROUP 2 ('/opt/oracle/oradata/db01/redo02.log') SIZE 100M,
            GROUP 3 ('/opt/oracle/oradata/db01/redo03.log') SIZE 100M
    MAXLOGFILES 5
    MAXLOGMEMBERS 5
    MAXLOGHISTORY 1
    MAXDATAFILES 100
    MaxInstances 1
    ARCHIVELOG
    CHARACTER SET CL8ISO8859P5
    NATIONAL CHARACTER SET AL16UTF16
    DATAFILE '/opt/oracle/oradata/db01/system01.dbf' SIZE 325M REUSE
    EXTENT MANAGEMENT LOCAL
    SYSAUX DATAFILE '/opt/oracle/oradata/db01/sysaux01.dbf' SIZE 325M REUSE
    DEFAULT TEMPORARY TABLESPACE temptbs
            TEMPFILE '/opt/oracle/oradata/db01/temp01.dbf'
            SIZE 200M REUSE EXTENT MANAGEMENT LOCAL UNIFORM SIZE 160M
    UNDO TABLESPACE undotbs1
         DATAFILE '/opt/oracle/oradata/db01/undotbs01.dbf'
         SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

    Please note that the name of the UNDO TABLESPACE (undotbs1) must match the name specified in the parameter undo_tablespace (UNDOTBS1) initdb01.ora file ( claim 4. ). Znachanie does not register.

  11. Create a tablespace “users” to assign default tablespace users:
     CREATE TABLESPACE users LOGGING DATAFILE '/opt/oracle/oradata/db01/users01.dbf'
        SIZE 25M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL;
  12. Create a tablespace “indx” for the indexes:
    CREATE TABLESPACE indx LOGGING DATAFILE '/opt/oracle/oradata/db01/indx01.dbf'
        SIZE 25M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL;
  13. Run the scripts necessary to create vyushek, synonyms and packages (views, synonyms, packages). Pre Asking conclusion log files in:
    spool /home/oracle/catalog.log;
    @/opt/oracle/product/10.2.0/db_1/rdbms/admin/catalog.sql;
    spool off;
    spool /home/oracle/catproc.log;
    @/opt/oracle/product/10.2.0/db_1/rdbms/admin/catproc.sql;
    spool off;
  14. Change the password sys and system to correct us:
    alter user sys identified by syspassword;
    alter user system identified by syspassword;
  15. Exit sqlplus:
    quit;
  16. Adjust the files:
    • If the database does not yet exist:
      1. Create a “$ ORACLE_HOME / network / admin / listener.ora” with the following contents:
        SID_LIST_LISTENER =
          (SID_LIST =
            (SID_DESC =
              (SID_NAME = db01)
              (ORACLE_HOME = /opt/oracle/product/10.2.0/db_1)
            )
          )
        
        LISTENER =
          (DESCRIPTION_LIST =
            (DESCRIPTION =
              (ADDRESS = (PROTOCOL = TCP)(HOST = myhost.mydomain)(PORT = 1521))
            )
          )
      2. Create a “$ ORACLE_HOME / network / admin / tnsnames.ora” with the following contents:
        DB01 =
          (DESCRIPTION =
            (ADDRESS = (PROTOCOL = TCP)(HOST = myhost.mydomain)(PORT = 1521))
            (CONNECT_DATA =
              (SERVER = DEDICATED)
              (SERVICE_NAME = db01)
            )
          )
      3. Create a ” $ORACLE_HOME/network/admin/sqlnet.ora” with the following contents:
        NAMES.DIRECTORY_PATH= (TNSNAMES)
      4. Start the listener:
        $ORACLE_HOME/bin/lsnrctl start
    • If the database already exists:
      1. Adding to the section SID_LIST_LISTENER file ” $ORACLE_HOME/network/admin/listener.ora“:
        (SID_DESC =
                	(SID_NAME = db01)
                	(ORACLE_HOME = /opt/oracle/product/10.2.0/db_1)
                )
      2. Add a section to the “$ ORACLE_HOME / network / admin / tnsnames.ora”:
        DB01 =
          (DESCRIPTION =
            (ADDRESS = (PROTOCOL = TCP)(HOST = myhost.mydomain)(PORT = 1521))
            (CONNECT_DATA =
              (SERVER = DEDICATED)
              (SERVICE_NAME = db01)
            )
          )
  17. Check the running instances:
    $ORACLE_HOME/bin/lsnrctl status

We see a similar (two instances):

  LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 12-FEB-2008 12:32:00
  Copyright (c) 1991, 2005, Oracle.  All rights reserved.
  Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
  STATUS of the LISTENER
  ------------------------
  Alias                     LISTENER
  Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
  Start Date                12-FEB-2008 12:23:02
  Uptime                    0 days 0 hr. 8 min. 58 sec
  Trace Level               off
  Security                  ON: Local OS Authentication
  SNMP                      OFF
  Listener Parameter File   /opt/oracle/product/10.2.0/db_1/network/admin/listener.ora
  Listener Log File         /opt/oracle/product/10.2.0/db_1/network/log/listener.log
  Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myhost.mydomain)(PORT=1521)))
  Services Summary...
  Service "db01" has 1 instance(s).
    Instance "db01", status READY, has 1 handler(s) for this service...
  Service "db01_XPT" has 1 instance(s).
    Instance "db01", status READY, has 1 handler(s) for this service...
  Service "db02" has 1 instance(s).
    Instance "db02", status READY, has 1 handler(s) for this service...
  Service "db02_XPT" has 1 instance(s).
    Instance "db02", status READY, has 1 handler(s) for this service...
  Service "oracleXDB" has 2 instance(s).
    Instance "db01", status READY, has 1 handler(s) for this service...
    Instance "db02", status READY, has 1 handler(s) for this service...
  The command completed successfully
(Visited 26 times, 1 visits today)
adminOracleTips
It is considered that you have already made the Oracle DB installation. These instructions are tested on Oracle DB 10.2.0.1.0 for Linux under CentOS 5.0 and Kubuntu 7.04 Go under the user created in step preinstall: su - oracle Expose the environment variables (for bash): If the database does not yet exist: export NLS_LANG=.CL8ISO8859P5 export ORACLE_HOME=/opt/oracle/product/10.2.0/db_1 export ORACLE_SID=db01 export...

Do you want to be notified about new DBA updates, releases, jobs and free tips? Join our email newsletter. It's fast and easy. You will be among the first to know about hot new DBA updates and stuff, it will help you enhance your DBA skills.
We take your privacy very seriously