你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle手工建库步骤

[日期:2012-04-10] 来源:Linux社区  作者:wuweilong [字体:大 中 小]
4、用刚才创建的参数文件把实例启动到nomount状态
[Oracle@ora10g ~]$ export ORACLE_SID=wwl02
[oracle@ora10g ~]$ echo $ORACLE_SID
wwl02
[oracle@ora10g wwl02]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Nov 19 03:18:47 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount pfile = /orasoft/product/10.2.0/db_1/dbs/initwwl02.ora
ORACLE instance started.

Total System Global Area  218103808 bytes
Fixed Size                  1218604 bytes
Variable Size             109053908 bytes
Database Buffers          104857600 bytes
Redo Buffers                2973696 bytes

5、创建数据库,数据库名称为wwl02
SQL> create database wwl02
  2    user sys identified by oracle
  3    user system identified by oracle
  4  datafile '/oradata/wwl02/data/system01.dbf' size 300m
  5  sysaux datafile '/oradata/wwl02/data/sysaux01.dbf' size 100m
  6  default temporary tablespace temp tempfile '/oradata/wwl02/data/temp01.dbf' size 100m
  7  undo tablespace undotbs datafile '/oradata/wwl02/data/undotbs01.dbf' size 100m
  8  logfile
  9     group 1 '/oradata/wwl02/data/redo01a.log' size 10m,
 10     group 2 '/oradata/wwl02/data/redo02a.log' size 10m,
   group 3 '/oradata/wwl02/data/redo03a.log' size 10m
character set zhs16gbk; 11   12 

Database created.

6、执行建库后的脚本,创建系统的视图和数据字典
SQL> @?/rdbms/admin/catalog.sql
SQL> @?/rdbms/admin/catproc.sql
conn system/oracle
SQL> @?/sqlplus/admin/pupbld.sql


7、检查数据库现在是否open状态。
SQL> select instance_name,status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
wwl02            OPEN

1 row selected.

8、将创建数据库用的pfile参数创建成spfile
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string
SQL> create spfile from pfile = '/orasoft/product/10.2.0/db_1/dbs/initwwl02.ora';

File created.

9、重启数据库后,数据库开始默认使用spfile启动数据库。
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  218103808 bytes
Fixed Size                  1218604 bytes
Variable Size             109053908 bytes
Database Buffers          104857600 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /orasoft/product/10.2.0/db_1/d
                                                 bs/spfilewwl02.ora
SQL>

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@ora10g wwl02]$ exit
logout
[root@ora10g ~]# exit
logout

10、至此,手工建库已完成。

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款