oracle 10g DataGuard 双机搭建--创建主库

手动创建pfile,一般最少需要下面5个参数:
db_name       = prod
control_files = ('/u01/app/oracle/oradata/prod/control1.dbf',
                 '/u01/app/oracle/oradata/prod/control2.dbf',
                 '/u01/app/oracle/oradata/prod/control3.dbf')
sga_target    = 400m
undo_management   = AUTO
undo_tablespace   = undotbs

生成spfile文件,为启动到nomount准备:
create spfile from pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/initprod2.ora';

SQL> create spfile from pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/initprod2.ora';

File created.

启动数据库到nomount状态:
startup nomount;

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  419430400 bytes
Fixed Size                  1219736 bytes
Variable Size             121635688 bytes
Database Buffers          289406976 bytes
Redo Buffers                7168000 bytes

创建数据库:
CREATE DATABASE prod
   USER SYS IDENTIFIED BY oracle
   USER SYSTEM IDENTIFIED BY oracle
   LOGFILE GROUP 1 ('/u01/app/oracle/oradata/prod/redo01.log') SIZE 50M,
           GROUP 2 ('/u01/app/oracle/oradata/prod/redo02.log') SIZE 50M,
           GROUP 3 ('/u01/app/oracle/oradata/prod/redo03.log') SIZE 50M
   MAXLOGFILES 5
   MAXLOGMEMBERS 5
   MAXLOGHISTORY 1
   MAXDATAFILES 100
   MAXINSTANCES 1
   CHARACTER SET ZHS16GBK
   NATIONAL CHARACTER SET AL16UTF16
   DATAFILE '/u01/app/oracle/oradata/prod/system01.dbf' SIZE 325M REUSE
   EXTENT MANAGEMENT LOCAL
   SYSAUX DATAFILE '/u01/app/oracle/oradata/prod/sysaux01.dbf' SIZE 325M REUSE
   DEFAULT TEMPORARY TABLESPACE tempts1
      TEMPFILE '/u01/app/oracle/oradata/prod/temp01.dbf'
      SIZE 20M REUSE
   UNDO TABLESPACE undotbs
      DATAFILE '/u01/app/oracle/oradata/prod/undotbs01.dbf'
      SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

Database created.

创建一个用户表空间:
CREATE TABLESPACE users LOGGING
     DATAFILE '/u01/app/oracle/oradata/prod/users01.dbf'
     SIZE 50M REUSE AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED
     EXTENT MANAGEMENT LOCAL;


运行创建字典等对象脚步:
@/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catalog.sql
@/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catproc.sql


此时可以做个冷备份。

你可能感兴趣的:(oracle 10g DataGuard 双机搭建--创建主库)