手工重新创建8i数据库

发表于:2007-05-25来源:作者:点击数: 标签:
手工重新创建8i 数据库 作者:llmmysun 1.查看原来的数据库文件,保存其位置和大小 SYSTEM /home/ora817/oradata/clubcore/system01.dbf 800M TOOLS /home/ora817/oradata/clubcore/tools01.dbf 250M RBS /home/ora817/oradata/clubcore/rbs01.dbf 1024M TEMP

手工重新创建8i数据库 
作者:llmmysun

1.查看原来的数据库文件,保存其位置和大小

SYSTEM
/home/ora817/oradata/clubcore/system01.dbf   800M

TOOLS
/home/ora817/oradata/clubcore/tools01.dbf  250M

RBS
/home/ora817/oradata/clubcore/rbs01.dbf   1024M

TEMP
/home/ora817/oradata/clubcore/temp01.dbf  2048

USERS
/home2/ora817/oradata/clubcore/users01.dbf  2048

INDX
/home3/ora817/oradata/clubcore/indx01.dbf 2048

CLUB_CORE
/home2/ora817/oradata/clubcore/club_core01.dbf  2048

 --查询原用户名,并导出原用户下数据 
 
--2.查询数据库sid
 ORACLE_SID=clubcore
 
 --3.确定原表空间名称和大小
 TABLESPACE                                                      USED MB
------------------------------------------------------------ ----------
   FREE MB      TOTAL
---------- ----------
CLUB_CORE                                                             0
      2048       2048

INDX                                                                  0
      2048       2048

RBS                                                                 116
       908       1024


TABLESPACE                                                      USED MB
------------------------------------------------------------ ----------
   FREE MB      TOTAL
---------- ----------
SYSTEM                                                               90
       710        800

TEMP                                                                  0
      2048       2048

TOOLS                                                                 0
       250        250


TABLESPACE                                                      USED MB
------------------------------------------------------------ ----------
   FREE MB      TOTAL
---------- ----------
USERS                                                                 2
      2046       2048


7 rows selected.

--4.确定重做日志文件的位置
GROUP# STATUS
---------- --------------
MEMBER
--------------------------------------------------------------------------------
         1
/home3/ora817/oradata/redo0101.log

         1
/home4/ora817/oradata/redo0102.log

         2
/home3/ora817/oradata/redo0201.log


    GROUP# STATUS
---------- --------------
MEMBER
--------------------------------------------------------------------------------
         2
/home4/ora817/oradata/redo0202.log

         3
/home3/ora817/oradata/redo0301.log

         3
/home4/ora817/oradata/redo0302.log


6 rows selected.

--创建密钥文件 orapwd file=orapwsid password=***  entries=5       

--执行创建数据库脚本

CREATE DATABASE clubcore
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 7
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE '/home/ora817/oradata/clubcore/system01.dbf' SIZE 800M REUSE AUTOEXTEND ON NEXT  10240K MAXSIZE UNLIMITED
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET ZHS16GBK
LOGFILE GROUP 1 ('/home3/ora817/oradata/redo0101.log','/home4/ora817/oradata/redo0102.log') SIZE 40960K,
GROUP 2 ('/home3/ora817/oradata/redo0201.log','/home4/ora817/oradata/redo0202.log') SIZE 40960K,
GROUP 3 ('/home3/ora817/oradata/redo0301.log','/home4/ora817/oradata/redo0302.log') SIZE 40960K;

--创建数据文件
CREATE TABLESPACE "INDX" LOGGING DATAFILE '/home3/ora817/oradata/clubcore/indx01.dbf' SIZE 2048M REUSE AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED;
CREATE TABLESPACE "USERS" LOGGING DATAFILE '/home2/ora817/oradata/clubcore/users01.dbf' SIZE 2048M REUSE AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED;
CREATE TABLESPACE "TOOLS" LOGGING DATAFILE '/home/ora817/oradata/clubcore/tools01.dbf ' SIZE 250M REUSE AUTOEXTEND ON NEXT  320K MAXSIZE UNLIMITED;
CREATE TABLESPACE "CLUB_CORE" LOGGING DATAFILE '/home2/ora817/oradata/clubcore/club_core01.dbf' SIZE 2048M REUSE AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED;
CREATE TABLESPACE "RBS" LOGGING DATAFILE '/home/ora817/oradata/clubcore/rbs01.dbf' SIZE 1024M REUSE AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED;
create temporary tablespace TEMP  tempfile '/home/ora817/oradata/clubcore/temp01.dbf' size 2048M;

--创建回滚段
create public rollback segment rb1 tablespace RBS  storage (initial 100K next 100K minextents 20 maxextents 100 optimal 50M);
create public rollback segment rb2 tablespace RBS  storage (initial 100K next 100K minextents 20 maxextents 100 optimal 50M);
create public rollback segment rb3 tablespace RBS  storage (initial 100K next 100K minextents 20 maxextents 100 optimal 50M);
create public rollback segment rb4 tablespace RBS  storage (initial 100K next 100K minextents 20 maxextents 100 optimal 50M);
create public rollback segment rb5 tablespace RBS  storage (initial 100K next 100K minextents 20 maxextents 100 optimal 50M);
create public rollback segment rb6 tablespace RBS  storage (initial 100K next 100K minextents 20 maxextents 100 optimal 50M);

--创建相应的数据库包
connect SYS/change_on_install as SYSDBA
@?/rdbms/admin/catalog.sql;
@?/rdbms/admin/catproc.sql;
connect SYSTEM/manager
@?/sqlplus/admin/pupbld.sql;



原文转自:http://www.ltesting.net