Ocm Create The Database Jp

データベースの作成

SIDの設定

[oracle@fy ~]$ vi ~/.bash_profile
export ORACLE_SID=prod
[oracle@fy ~]$ . ~/.bash_profile

See Also:
SID

フォルダ作成

[oracle@fy oracle]$ cd $ORACLE_BASE
[oracle@fy app]$ mkdir -p oradata/$ORACLE_SID
[oracle@fy app]$ mkdir -p flash_recovery_area/$ORACLE_SID
[oracle@fy app]$ mkdir -p admin
[oracle@fy app]$ cd admin
[oracle@fy admin]$ mkdir bdump  
[oracle@fy admin]$ mkdir adump
[oracle@fy admin]$ mkdir cdump
[oracle@fy admin]$ mkdir dpdump
[oracle@fy admin]$ mkdir udump
[oracle@fy admin]$ mkdir pfile
[oracle@fy admin]$ cd ..
 
# こちらのパスにコントロールファイルとデータファイルを作成するから
# フルパスを確認する
[oracle@fy app]$ pushd oradata/$ORACLE_SID
~/app/oradata/prod ~/app ~
[oracle@fy prod]$ pwd
/u01/oracle/app/oradata/prod
[oracle@fy prod]$ popd
~/app ~

パスワードファイルの作成

cd $ORACLE_HOME/dbs
[oracle@fy dbs]$ orapwd file=orapw$ORACLE_SID password=oraclex

See Also:
orapwd

パラメータ設定

初期化パラメータファイルの作成

# テンプレートinit.oraを処理し、#と空白行を削除する方法ならかなり楽
[oracle@fy ~]$ cd $ORACLE_BASE/admin/$ORACLE_SID/pfile
[oracle@fy pfile]$ vi init.ora
db_block_size = 4096
db_name = prod
sga_target = 300M
log_buffer = 2048000
control_files = (/u01/oracle/app/oradata/prod/control01.ctl, /u01/oracle/app/oradata/prod/oradata/control02.ctl)
 
# デフォルト場所で作成
[oracle@fy pfile]$ pwd
/u01/oracle/oracle/admin/pfile
[oracle@fy dbs]$ vi init$ORACLE_SID.ora
ifile=/u01/oracle/oracle/admin/pfile/init.ora

See Also:
OFA

インスタンス起動して、初期化パラメータを確認しサーバ初期化パラメータファイルを作成する

[oracle@fy fy]$ sqlplus / as sysdba
 
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Apr 1 11:57: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  314572800 bytes
Fixed Size                  2020448 bytes
Variable Size             134220704 bytes
Database Buffers          176160768 bytes
Redo Buffers                2170880 bytes
 
SQL> create spfile from pfile;
 
File created.
 
SQL> alter system set undo_management=auto scope=spfile;
 
System altered.
 
SQL> alter system set undo_tablespace=undotbs scope=spfile;
 
System altered.
 
SQL> create pfile from spfile;
 
File created.
 
SQL> shutdown immediate;
 
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[oracle@fy fy]$ cd $ORACLE_HOME/dbs
 
[oracle@fy dbs]$ cat initprod.ora
*.control_files='/u01/oracle/oracle/oradata/prod/control01.ora','/u01/oracle/oracle/oradata/prod/control02.ora'
*.db_block_size=4096
*.db_name='prod'
*.log_buffer=2048000
*.sga_target=300m

データベース作成する

SQL> startup nomount;
ORACLE instance started.
 
Total System Global Area  314572800 bytes
Fixed Size                  2020448 bytes
Variable Size             134220704 bytes
Database Buffers          176160768 bytes
Redo Buffers                2170880 bytes
 
SQL> CREATE DATABASE prod
   CONTROLFILE REUSE
   USER SYS IDENTIFIED BY oraclex
   USER SYSTEM IDENTIFIED BY oraclex
   LOGFILE GROUP 1 ('/u01/oracle/oracle/oradata/prod/redo01.log') SIZE 10M REUSE,
           GROUP 2 ('/u01/oracle/oracle/oradata/prod/redo02.log') SIZE 10M REUSE,
           GROUP 3 ('/u01/oracle/oracle/oradata/prod/redo03.log') SIZE 10M REUSE
   MAXLOGFILES 50
   MAXLOGMEMBERS 50
   MAXLOGHISTORY 100
   MAXDATAFILES 500
   MAXINSTANCES 5
   CHARACTER SET AL32UTF8
   NATIONAL CHARACTER SET AL16UTF16
   DATAFILE '/u01/oracle/oracle/oradata/prod/system01.dbf' SIZE 325M REUSE
   EXTENT MANAGEMENT LOCAL
   SYSAUX DATAFILE '/u01/oracle/oracle/oradata/prod/sysaux01.dbf' SIZE 325M REUSE
   DEFAULT TABLESPACE users DATAFILE '/u01/oracle/oracle/oradata/prod/users01.dbf' SIZE 10M AUTOEXTEND ON NEXT 10M REUSE
   DEFAULT TEMPORARY TABLESPACE temp
      TEMPFILE '/u01/oracle/oracle/oracle/oradata/prod/temp01.dbf'
      SIZE 20M AUTOEXTEND ON NEXT 10M REUSE
   UNDO TABLESPACE undotbs
      DATAFILE '/u01/oracle/oracle/oradata/prod/undotbs01.dbf'
      SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

See Also:
ocm manual create database alert.log

データ・ディクショナリ・ビューの作成

SQL> @?/rdbms/admin/catalog.sql
...
SQL> @?/rdbms/admin/catproc.sql
...

See Also:
ocm log of catalog.sql catproc.sql

Reference:
Oracle Database 管理者ガイド Oracle Databaseの手動作成
http://otndnld.oracle.co.jp/document/products/oracle10g/102/doc_cd/server.102/B19224-02/create.htm#975920