ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Create database Manually

Create database Manually

原创 Linux操作系统 作者:yanggq 时间:2019-05-22 13:18:06 0 删除 编辑

1.set env var,create init.ora file
2.create orapw$sid password file
3.create spfile
4.startup nomount
5.create database
6.catalog.sql
7.catproc.sql
8.catexp.sql
9.other sql run

10./etc/vfstab
cat vfstab

11.edit /var/opt/oracle/oratab
add the new database in it like the following:

webdb:/u01/app/oracle/product/9.2.0.4:Y
opdb:/u01/app/oracle/product/9.2.0.4:Y
opdb9:/u01/app/oracle/product/9.2.0.4:Y
~
create spfile='/u01/app/oracle9i/dbs/spfileopdb9.ora' from pfile='/u01/app/oracle9i/admin/opdb9/pfile/initopdb9.ora';

CREATE DATABASE opdb
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE '/u04/u10/oradata/opdb/system01.dbf' SIZE 250M REUSE
AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE TEMP
TEMPFILE '/u04/u10/oradata/opdb/temp01.dbf'
SIZE 40M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
UNDO TABLESPACE "UNDOTBS1" DATAFILE
'/u04/u10/oradata/opdb/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
CHARACTER SET WE8ISO8859P1
LOGFILE GROUP 1 ('/u04/u10/oradata/opdb/redo01.log')
SIZE 102400K reuse,
GROUP 2 ('/u04/u10/oradata/opdb/redo02.log')
SIZE 102400K reuse,
GROUP 3 ('/u04/u10/oradata/opdb/redo03.log')
SIZE 102400K reuse
/


CREATE TABLESPACE "CWMLITE" LOGGING DATAFILE '/u04/u10/oradata/opdb9/cwmlite01.dbf' SIZE 20M REUSE AUTOEXTEND
ON NEXT 640K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO

CREATE TABLESPACE "DRSYS" LOGGING DATAFILE '/u04/u10/oradata/opdb9/drsys01.dbf'
SIZE 20M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

CREATE TABLESPACE INDX DATAFILE '/u04/u10/oradata/opdb9/indx01.dbf'
SIZE 25M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
CREATE TABLESPACE "ODM" LOGGING DATAFILE '/u04/u10/oradata/opdb9/odm01.dbf'
SIZE 20M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
CREATE TABLESPACE "TOOLS" LOGGING DATAFILE '/u04/u10/oradata/opdb9/tools01.dbf'
SIZE 10M REUSE AUTOEXTEND ON NEXT 320K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
CREATE TABLESPACE "USERS" LOGGING DATAFILE '/u04/u10/oradata/opdb9/users01.dbf' SIZE 25M REUSE
AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

CREATE TABLESPACE "XDB" LOGGING DATAFILE '/u04/u10/oradata/opdb9/xdb01.dbf'
SIZE 20M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ;

create tablespace RBS
datafile '/u04/u10/oradata/opdb9/rbs01.dbf' size 97M
default storage (initial 1M next 1M maxextents 48 pctincrease 0)
/

create rollback segment RBS01
tablespace RBS
storage(initial 1M next 1M minextents 2 maxextents 80 optimal 4M)
/

create rollback segment RBS2
tablespace RBS
storage(initial 1M next 1M minextents 2 maxextents 80 optimal 4M)
/

create rollback segment RBS03
tablespace RBS
storage(initial 1M next 1M minextents 2 maxextents 80 optimal 4M)
/


alter rollback segment RBS01 online;
alter rollback segment RBS2 online;
alter rollback segment RBS03 online;

create tablespace TEMP temporary
datafile '/u04/u10/oradata/opdb9/temp01.dbf' size 97M
default storage (initial 1M next 1M maxextents 515 pctincrease 1)
/

select to_char(sysdate,'DD-MON-RR:HH24:MI') end_create_db from dual;

spool off


spool catout.log

select to_char(sysdate,'DD-MON-RR:HH24:MI') start_catalog from dual;

set echo off
REM Creates data dictionary and public synonyms
@$ORACLE_HOME/rdbms/admin/catalog.sql

REM Required for PL/SQL
@$ORACLE_HOME/rdbms/admin/catproc.sql

REM For lock graphs
@$ORACLE_HOME/rdbms/admin/catblock.sql

REM for I/O on a table basis
@$ORACLE_HOME/rdbms/admin/catio.sql

REM For pinning
@$ORACLE_HOME/rdbms/admin/dbmspool.sql

REM For Replication (not really required)
@$ORACLE_HOME/rdbms/admin/catrep.sql

connect system/manager

@$ORACLE_HOME/sqlplus/admin/pupbld


lsnrctl configure and start


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26706/viewspace-64561/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2002-10-29

  • 博文量
    78
  • 访问量
    50626