ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle 10g 手工创建一个最简单的数据库

Oracle 10g 手工创建一个最简单的数据库

原创 Linux操作系统 作者:尛样儿 时间:2010-01-09 20:33:30 0 删除 编辑

[root@blliu ~]# su - oracle
[oracle@blliu ~]$ cd $ORACLE_HOME/dbs
[oracle@blliu dbs]$ touch initorcl.ora
[oracle@blliu dbs]$ vi initorcl.ora                  //加入db_name=orcl
[oracle@blliu dbs]$ export ORACLE_SID=orcl
[oracle@blliu dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Jan 25 19:03:23 2010

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

Total System Global Area  171966464 bytes
Fixed Size                  2082496 bytes
Variable Size             113248576 bytes
Database Buffers           50331648 bytes
Redo Buffers                6303744 bytes
SQL> create database orcl
  2  datafile
  3  '/u01/app/oracle/orcl/system01.dbf' size 300m autoextend on next 10m
  4  sysaux datafile
  5  '/u01/app/oracle/orcl/sysaux01.dbf' size 300m autoextend on next 10m
  6  logfile
  7  group 1 ('/u01/app/oracle/orcl/redo101.log') size 10m,
  8  group 2 ('/u01/app/oracle/orcl/redo201.log') size 10m
  9  character set zhs16gbk;

Database created.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  171966464 bytes
Fixed Size                  2082496 bytes
Variable Size             113248576 bytes
Database Buffers           50331648 bytes
Redo Buffers                6303744 bytes
Database mounted.
Database opened.
SQL> @?/rdbms/admin/catalog.sql    //创建数据库的基表,视图,同义词等

PL/SQL procedure successfully completed.

SQL> @?/rdbms/admin/catproc.sql   //创建数据库的程序包,过程,函数,同义词等

PL/SQL procedure successfully completed.

SQL>
SQL> SET SERVEROUTPUT OFF
SQL> connect system/manager
Connected.
SQL> @?/sqlplus/admin/pupbld.sql    //创建使用SQLPLUS工具连接所需的视图,同义词等
SQL>
SQL> -- End of pupbld.sql
SQL> exit    
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@blliu dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Jan 25 19:24:00 2010

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create table test (id number);

Table created.

SQL> insert into test values (1);

1 row created.

SQL> commit;

Commit complete.


至此,一个最简单的Oracle数据库就创建成功了,我们可以在此基础上创建undo tablespace,temporary tablespace,安装其他组建使其变得更加完整。

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

请登录后发表评论 登录
全部评论
Oracle数据库管理员,Oracle数据库系统构架员;2012年7月出版《构建最高可用Oracle数据库系统:Oracle 11gR2 RAC管理、维护与性能优化》一书;Oracle 10g OCM。

注册时间:2010-01-05

  • 博文量
    483
  • 访问量
    5651513