Oracle 10G手工建立資料庫Helloblock寫作)
1、設定執行個體名:修改/home/oracle/.bash_profile檔案,添加下列這行內容。export ORACLE_SID=orcl修改之後使用命令source /home/oracle/.bash_profile讓它生效。
2、建立相關目錄:mkdir /u01/app/oracle/oradata/orclmkdir /u01/app/oracle/admin/orclmkdir /u01/app/oracle/admin/orcl/adumpmkdir /u01/app/oracle/admin/orcl/bdumpmkdir /u01/app/oracle/admin/orcl/cdumpmkdir /u01/app/oracle/admin/orcl/udump
3、建立密碼檔案:cd /u01/app/oracle/product/10.2.0/db_1/dbsorapwd file=orapworcl password=oracle entries=10 force=y
4、建立參數檔案:cd /u01/app/oracle/product/10.2.0/db_1/dbscat init.ora|grep -v ^#|grep -v ^$>initorcl.ora
修改initorcl.ora檔案,內容如下:db_name=orcldb_block_size=8192undo_management=autoundo_tablespace=undotbssga_target=500mcontrol_files=('/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/oradata/orcl/control02.ctl')audit_file_dest='/u01/app/oracle/admin/orcl/adump'background_dump_dest='/u01/app/oracle/admin/orcl/bdump'core_dump_dest='/u01/app/oracle/admin/orcl/cdump'user_dump_dest='/u01/app/oracle/admin/orcl/udump'
5、產生spfile檔案,並啟動到nomount狀態:sqlplus / as sysdbacreate spfile from pfile;startup nomount;
6、建立資料庫:CREATE DATABASE orcl USER SYS IDENTIFIED BY oracle USER SYSTEM IDENTIFIED BY oracle LOGFILE GROUP 1 ('/u01/app/oracle/oradata/orcl/redo01a.log','/u01/app/oracle/oradata/orcl/redo01b.log') SIZE 300M, GROUP 2 ('/u01/app/oracle/oradata/orcl/redo02a.log','/u01/app/oracle/oradata/orcl/redo02b.log') SIZE 300M, GROUP 3 ('/u01/app/oracle/oradata/orcl/redo03a.log','/u01/app/oracle/oradata/orcl/redo03b.log') SIZE 300M MAXLOGFILES 20 MAXLOGMEMBERS 5 MAXLOGHISTORY 1 MAXDATAFILES 500 MAXINSTANCES 5 CHARACTER SET AL32UTF8 NATIONAL CHARACTER SET AL16UTF16 DATAFILE '/u01/app/oracle/oradata/orcl/system01.dbf' SIZE 500M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SYSAUX DATAFILE '/u01/app/oracle/oradata/orcl/sysaux01.dbf' SIZE 500M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED DEFAULT TABLESPACE users DATAFILE '/u01/app/oracle/oradata/orcl/users01.dbf' SIZE 500M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED DEFAULT TEMPORARY TABLESPACE temp TEMPFILE '/u01/app/oracle/oradata/orcl/temp01.dbf' SIZE 300M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED UNDO TABLESPACE undotbs DATAFILE '/u01/app/oracle/oradata/orcl/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED;
7、執行指令碼: sqlplus / as sysdba@?/rdbms/admin/catalog;@?/rdbms/admin/catproc;@?/rdbms/admin/catblock;@?/rdbms/admin/catoctk;@?/rdbms/admin/owminst.plb;
sqlplus system@?/sqlplus/admin/pupbld.sql;
8、設定預設資料表空間和預設暫存資料表空間:alter database default tablespace users;alter database default temporary tablespace temp;
mail:helloblock@126.com
QQ:1654294099
本文出自 “Helloblock的DBA足跡” 部落格,請務必保留此出處http://helloblock.blog.51cto.com/7899615/1294370