/*创建Oracle文件目录*/
C
>
mkdir
C:
oracle
admin
gdqy
bdump
C > mkdir C: oracle admin gdqy cdump
C > mkdir C: oracle admin gdqy create
C > mkdir C: oracle admin gdqy pfile
C > mkdir C: oracle admin gdqy udump
C > mkdir C: oracle admin gdqy cdump
C > mkdir C: oracle admin gdqy create
C > mkdir C: oracle admin gdqy pfile
C > mkdir C: oracle admin gdqy udump
/*创建数据库文件目录*/
C
>
mkdir
C:
oracle
oradata
gdqy
/*定义新的oracle实例*/
C
>
C:
oracle
ora92
bin
oradim
.
exe -new -sid gdqy -startmode m
C > C: oracle ora92 bin oradim . exe -edit -sid gdqy -startmode a
C > C: oracle ora92 bin oradim . exe -edit -sid gdqy -startmode a
/*定义oracle密码文件*/
C:
oracle
ora92
bin
orapwd file
=
C:
oracle
ora92
database
PWDgdqy
.
ora password
=
change_on_install entries
=
5
/* 启动实例,创建数据库*/
/
*以sys登录sql*plus*
/
C > C: oracle ora92 bin sqlplus / nolog
SQL >
SQL > conn sys / orac1 as sysdba
SQL > set echo on
--SQL > spool C: oracle ora92 assistants dbca logs CreateDB . log
/ *启动实例* /
--SQL > startup nomount pfile = " C:oracleadmingdqyscriptsinit.ora " ;
SQL > startup nomount pfile = " c:oracleadmingdqypfileinit.ora " ;
ORACLE 例程已经启动。
( startup nomount为非安装启动,这种方式启动下可执行:重建控制文件、重建数据库。读取init . ora文件,启动instance,即启动SGA和后台进程,这种启动只需要init . ora文件。
startup pfile = 参数文件名,带初始化参数文件的启动方式。先读取参数文件,再按参数文件中的设置启动数据库。 )
Total System Global Area 131144544 bytes
Fixed Size 453472 bytes
Variable Size 109051904 bytes
Database Buffers 20971520 bytes
Redo Buffers 667648 bytes
/ *创建数据库* /
SQL > CREATE DATABASE gdqy
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE 'C: oracle oradata gdqy system01 . dbf' SIZE 250M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE 'C: oracle oradata gdqy temp01 . dbf' SIZE 40M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
UNDO TABLESPACE " UNDOTBS1 " DATAFILE 'C: oracle oradata gdqy undotbs01 . dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
LOGFILE GROUP 1 ( 'C: oracle oradata gdqy redo01 . log' ) SIZE 102400K ,
GROUP 2 ( 'C: oracle oradata gdqy redo02 . log' ) SIZE 102400K ,
GROUP 3 ( 'C: oracle oradata gdqy redo03 . log' ) SIZE 102400K
数据库已创建。
--SQL > spool off
SQL >
----------------------------------------------------------------------
SQL > exit ;
SQL > connect SYS / orac1 as SYSDBA
SQL > create spfile = 'C: oracle ora92 database spfilegdqy . ora' FROM pfile = 'C: oracle admin gdqy pfile init . ora' ;
SQL > shutdown
数据库已经关闭。
已经卸载数据库。
ORACLE例程已经关闭。
SQL > startup
ORACLE例程已经启动。
----------------------------------------------------------------------
C > C: oracle ora92 bin sqlplus / nolog
SQL >
SQL > conn sys / orac1 as sysdba
SQL > set echo on
--SQL > spool C: oracle ora92 assistants dbca logs CreateDB . log
/ *启动实例* /
--SQL > startup nomount pfile = " C:oracleadmingdqyscriptsinit.ora " ;
SQL > startup nomount pfile = " c:oracleadmingdqypfileinit.ora " ;
ORACLE 例程已经启动。
( startup nomount为非安装启动,这种方式启动下可执行:重建控制文件、重建数据库。读取init . ora文件,启动instance,即启动SGA和后台进程,这种启动只需要init . ora文件。
startup pfile = 参数文件名,带初始化参数文件的启动方式。先读取参数文件,再按参数文件中的设置启动数据库。 )
Total System Global Area 131144544 bytes
Fixed Size 453472 bytes
Variable Size 109051904 bytes
Database Buffers 20971520 bytes
Redo Buffers 667648 bytes
/ *创建数据库* /
SQL > CREATE DATABASE gdqy
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE 'C: oracle oradata gdqy system01 . dbf' SIZE 250M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE 'C: oracle oradata gdqy temp01 . dbf' SIZE 40M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
UNDO TABLESPACE " UNDOTBS1 " DATAFILE 'C: oracle oradata gdqy undotbs01 . dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
LOGFILE GROUP 1 ( 'C: oracle oradata gdqy redo01 . log' ) SIZE 102400K ,
GROUP 2 ( 'C: oracle oradata gdqy redo02 . log' ) SIZE 102400K ,
GROUP 3 ( 'C: oracle oradata gdqy redo03 . log' ) SIZE 102400K
数据库已创建。
--SQL > spool off
SQL >
----------------------------------------------------------------------
SQL > exit ;
SQL > connect SYS / orac1 as SYSDBA
SQL > create spfile = 'C: oracle ora92 database spfilegdqy . ora' FROM pfile = 'C: oracle admin gdqy pfile init . ora' ;
SQL > shutdown
数据库已经关闭。
已经卸载数据库。
ORACLE例程已经关闭。
SQL > startup
ORACLE例程已经启动。
----------------------------------------------------------------------
/*创建各个表空间*/
CREATE TABLESPACE RBS
DATAFILE 'c: oracle oradata gdqy rbs01 . dbf' SIZE 256M REUSE
AUTOEXTEND ON NEXT 5120K
MINIMUM EXTENT 512K
DEFAULT STORAGE
( INITIAL 512K NEXT 512K MINEXTENTS 8 MAXEXTENTS 4096 );
CREATE TABLESPACE USERS
DATAFILE 'c: oracle oradata gdqy users01 . dbf' SIZE 128M REUSE
AUTOEXTEND ON NEXT 1280K
MINIMUM EXTENT 128K
DEFAULT STORAGE
( INITIAL 128K NEXT 128K MINEXTENTS 1
MAXEXTENTS 4096 PCTINCREASE 0 );
CREATE TABLESPACE TEMP
DATAFILE 'c: oracle oradata gdqy temp01 . dbf' SIZE 32M REUSE
AUTOEXTEND ON NEXT 640K
MINIMUM EXTENT 64K
DEFAULT STORAGE
( INITIAL 64K NEXT 64K MINEXTENTS 1
MAXEXTENTS UNLIMITED PCTINCREASE 0 )
TEMPORARY ;
CREATE TABLESPACE TOOLS
DATAFILE 'c: oracle oradata gdqy tools01 . dbf' SIZE 64M REUSE
AUTOEXTEND ON NEXT 320K
MINIMUM EXTENT 32K
DEFAULT STORAGE
( INITIAL 32K NEXT 32K MINEXTENTS 1
MAXEXTENTS 4096 PCTINCREASE 0 );
CREATE TABLESPACE INDEX
DATAFILE 'c: oracle oradata gdqy index01 . dbf' SIZE 32M REUSE
AUTOEXTEND ON NEXT 1280K
MINIMUM EXTENT 128K
DEFAULT STORAGE
( INITIAL 1282K NEXT 128K MINEXTENTS 1
MAXEXTENTS 4096 PCTINCREASE 0 );
DATAFILE 'c: oracle oradata gdqy rbs01 . dbf' SIZE 256M REUSE
AUTOEXTEND ON NEXT 5120K
MINIMUM EXTENT 512K
DEFAULT STORAGE
( INITIAL 512K NEXT 512K MINEXTENTS 8 MAXEXTENTS 4096 );
CREATE TABLESPACE USERS
DATAFILE 'c: oracle oradata gdqy users01 . dbf' SIZE 128M REUSE
AUTOEXTEND ON NEXT 1280K
MINIMUM EXTENT 128K
DEFAULT STORAGE
( INITIAL 128K NEXT 128K MINEXTENTS 1
MAXEXTENTS 4096 PCTINCREASE 0 );
CREATE TABLESPACE TEMP
DATAFILE 'c: oracle oradata gdqy temp01 . dbf' SIZE 32M REUSE
AUTOEXTEND ON NEXT 640K
MINIMUM EXTENT 64K
DEFAULT STORAGE
( INITIAL 64K NEXT 64K MINEXTENTS 1
MAXEXTENTS UNLIMITED PCTINCREASE 0 )
TEMPORARY ;
CREATE TABLESPACE TOOLS
DATAFILE 'c: oracle oradata gdqy tools01 . dbf' SIZE 64M REUSE
AUTOEXTEND ON NEXT 320K
MINIMUM EXTENT 32K
DEFAULT STORAGE
( INITIAL 32K NEXT 32K MINEXTENTS 1
MAXEXTENTS 4096 PCTINCREASE 0 );
CREATE TABLESPACE INDEX
DATAFILE 'c: oracle oradata gdqy index01 . dbf' SIZE 32M REUSE
AUTOEXTEND ON NEXT 1280K
MINIMUM EXTENT 128K
DEFAULT STORAGE
( INITIAL 1282K NEXT 128K MINEXTENTS 1
MAXEXTENTS 4096 PCTINCREASE 0 );
创建系统视图