Oracle 10g 手工建立一個最簡單的資料庫

尛樣兒發表於2010-01-09

[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部落格 ” ,連結:http://blog.itpub.net/23135684/viewspace-624735/,如需轉載,請註明出處,否則將追究法律責任。

相關文章