oracle 10 手工建庫

netwant發表於2011-05-26

oracle手工建庫

確定環境,安裝軟體,配置init.ora引數檔案,建立spfile然後create database,最後在執行指令碼就OK。

[@more@]

ORACLE 10G 手動建庫
1)確定例項名。
export ORACLE_SID=test
2)建立密碼檔案。
orapwd file=orapwtest password=oracle
3)建立pfile。
cat init.ora|grep -v ^ #|grep -v ^ $ > inittest.ora
在inittest.ora裡只包含如下初始化引數:
db_name=test
processes=150
control_files='/opt/oracle/oradata/control01.ctl'
db_block_size=8192
log_buffer=50000000
sga_target=300m
undo_management=auto
undo_tablespace=undotbs
background_dump_dest
core_dump_dest
user_dump_dest
4)建立spfile並啟動例項。
sql>sqlplus / as sysdba
sql>create spfile from pfile
sql>startup nomount
5)手工建立資料庫(使用create database命令)
ˎ̥CREATE DATABASE test
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE GROUP 1 ('/opt/oracle/oradata/test/redo01.log') SIZE 100M,
GROUP 2 ('/opt/oracle/oradata/test/redo02.log') SIZE 100M,
GROUP 3 ('/opt/oracle/oradata/test/redo03.log') SIZE 100M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/opt/oracle/oradata/test/system01.dbf' SIZE 325M REUSE
EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/opt/oracle/oradata/test/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/opt/oracle/oradata/test/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs
DATAFILE '/opt/oracle/oradata/test/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
6)執行相關指令碼。
CONNECT SYS/password AS SYSDBA
@/u01/oracle/rdbms/admin/catalog.sql
@/u01/oracle/rdbms/admin/catproc.sql
@?/rdbms/admin/catblock.sql
@?/rdbms/admin/catoctk.sql
@?/rdbms/admin/owminst.plb
connect system/oracle
@?/sqlplus/admin/pupbld.sql


Oracle 10G增加了drop database 命令:

startup mount exclusive force;

alter system enable restricted session;

drop database;

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

相關文章