手工建立(Create)一個Oracle 10g資料庫

xz43發表於2011-01-30
作者: | 連結:
 
1.首先要有一個引數檔案,這個我利用了歷史的引數檔案
$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Thu Sep 17 18:21:20 2009

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

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1778384896 bytes
Fixed Size                  1261332 bytes
Variable Size             301990124 bytes
Database Buffers         1459617792 bytes
Redo Buffers               15515648 bytes

2.建立指令碼,參考其他資料庫,編寫一個
SQL> create database dbstat
  2    logfile   group 1 ('/data1/dbstat/redo1.log') size 50M,
  3              group 2 ('/data1/dbstat/redo2.log') size 50M,
  4              group 3 ('/data1/dbstat/redo3.log') size 50M
  5    character set          ZHS16GBK
  6    national character set utf8
  7    datafile '/data1/dbstat/system.dbf'
  8              size 500M  autoextend on  next 10M maxsize unlimited extent management local
 12    sysaux datafile '/data1/dbstat/sysaux.dbf'
 13              size 500M autoextend on  next 10M  maxsize unlimited
 17    undo tablespace undotbs1
 18              datafile '/data1/dbstat/undo.dbf'  size 100M
 20    default temporary tablespace temp
 21              tempfile '/data1/dbstat/temp.dbf' size 100M;


Database created.

3.在後臺跑一跑其他指令碼:
 
[oracle@dbstatsvr dbstat]$ nohup sqlplus "/ as sysdba" @?/rdbms/admin/catalog.sql &
[1] 5399
[oracle@dbstatsvr dbstat]$ nohup: appending output to `nohup.out'

[oracle@dbstatsvr dbstat]$

[1]+  Stopped                 nohup sqlplus "/ as sysdba" @?/rdbms/admin/catalog.sql
[oracle@dbstatsvr dbstat]$
[oracle@dbstatsvr dbstat]$ nohup sqlplus "/ as sysdba" @?/rdbms/admin/catproc.sql &
[2] 5402
[oracle@dbstatsvr dbstat]$ nohup: appending output to `nohup.out'

這樣就基本上有了一個資料庫的雛形了。

4.還有一個指令碼要執行
這是資料庫用普通使用者登入會出現一個錯誤,提示以SYSTEM執行PUPBLD.SQL指令碼:

SQL> connect sms/sms
Error accessing PRODUCT_USER_PROFILE
Warning:  Product user profile information not loaded!
You may need to run PUPBLD.SQL as SYSTEM
Connected.

這個指令碼會建立一個表,用於限制使用者執行某些特定的SQL*PLUS命令:

SQL> @?/sqlplus/admin/pupbld.sql
DROP SYNONYM PRODUCT_USER_PROFILE
             *
ERROR at line 1:
ORA-01434: private synonym to be dropped does not exist


  DATE_VALUE FROM PRODUCT_USER_PROFILE
                  *
ERROR at line 3:
ORA-00942: table or view does not exist


DROP TABLE PRODUCT_USER_PROFILE
           *
ERROR at line 1:
ORA-00942: table or view does not exist


ALTER TABLE SQLPLUS_PRODUCT_PROFILE ADD (LONG_VALUE LONG)
*
ERROR at line 1:
ORA-00942: table or view does not exist



Table created.

DROP TABLE PRODUCT_PROFILE
           *
ERROR at line 1:
ORA-00942: table or view does not exist


DROP VIEW PRODUCT_PRIVS
*
ERROR at line 1:
ORA-00942: table or view does not exist



View created.


Grant succeeded.

DROP PUBLIC SYNONYM PRODUCT_PROFILE
                    *
ERROR at line 1:
ORA-01432: public synonym to be dropped does not exist



Synonym created.

DROP SYNONYM PRODUCT_USER_PROFILE
             *
ERROR at line 1:
ORA-01434: private synonym to be dropped does not exist



Synonym created.

DROP PUBLIC SYNONYM PRODUCT_USER_PROFILE
                    *
ERROR at line 1:
ORA-01432: public synonym to be dropped does not exist



Synonym created.

SQL> connect sms/sms
Connected.








 


 


 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9399028/viewspace-686540/,如需轉載,請註明出處,否則將追究法律責任。

相關文章