手工重新创建8i数据库
2024-07-21 02:07:13
供稿:网友
手工重新创建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;
完