RAC 手工建库

如果在创建库的时候,用DBCA有问题,有时候通过修改AIO可以解决,有时候环境复杂,修改aio也没效果,那么,可以尝试手工建库(当然,如果连手工建库都还有03113错误,那么很可能说明AIO是太小了,呵呵),或者其他原因导致你的dbca不能用,那么可以尝试手工建库,然后动态的加节点进去,下面是一个试验过程:
 
在两个节点做:
创建所需的目录(要和init.ora中的相应设置对应):
mkdir /oracle/admin/cin/bdump;
mkdir /oracle/admin/cin/cdump;
mkdir /oracle/admin/cin/create;
mkdir /oracle/admin/cin/pfile;
mkdir /oracle/admin/cin/udump;
 
检查环境变量(主要看SID要和init.ora中的实例名对应):
[m80b]/oracle/dbs> env | grep ORA
ORACLE_BASE=/oracle
ORACLE_SID=cin1
ORACLE_TERM=xterm
ORA_NLS33=/oracle/ocommon/nls/admin/data
ORACLE_HOME=/oracle
[m80b]/oracle/dbs> 
 
[m80a]/oracle/dbs> env | grep ORA
ORACLE_BASE=/oracle
ORACLE_SID=cin2
ORACLE_TERM=xterm
ORA_NLS33=/oracle/ocommon/nls/admin/data
ORACLE_HOME=/oracle
[m80a]/oracle/dbs> 
 
编辑/etc/oratab文件:
把 *:/oracle:Y 改成 cin:/oracle:Y
 
创建口令文件(这一步可以不做,如果不创建口令文件后面需要用os认证连接):
[m80a]/oracle/bin/orapwd file=/oracle/dbs/orapwcin2 password=change_on_install
 
[m80b]/oracle/bin/orapwd file=/oracle/dbs/orapwcin1 password=change_on_install
 
以下的过程在一台机器上做就可以了:
================
/oracle/bin/sqlplus /nolog @/oracle/admin/cin/scripts/CreateDB.sql
================
connect SYS/change_on_install as SYSDBA
set echo on
spool /oracle/admin/cin/create/CreateDB.log
startup nomount pfile="/oracle/admin/cin/pfile/initcin.ora";
SQL> CREATE DATABASE cin
   2  CONTROLFILE REUSE
   3  MAXINSTANCES 32
   4  MAXLOGHISTORY 100
   5  MAXLOGFILES 64
   6  MAXLOGMEMBERS 5
   7  MAXDATAFILES 1024
   8  DATAFILE '/dev/rsystem' SIZE 300M 
   9  REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED 
  10  UNDO TABLESPACE "UNDOTBS1" DATAFILE 
  11  '/dev/rundotbs1' SIZE 100M REUSE 
  12  CHARACTER SET WE8ISO8859P1 
  13  LOGFILE GROUP 1 ('/dev/rredo1') SIZE 102400K REUSE, 
  14  GROUP 2 ('/dev/rredo2') SIZE 102400K REUSE;
 
Database created.
 
SQL> 
spool off
exit;
================
================
 
================
================
/oracle/bin/sqlplus /nolog @/oracle/admin/cin/scripts/CreateDBFiles.sql
================
SQL> CREATE TABLESPACE "INDX" LOGGING DATAFILE 
   2  '/dev/rindx' SIZE 100M REUSE 
   3  AUTOEXTEND ON 
   4  NEXT  1280K 
   5  MAXSIZE UNLIMITED 
   6  EXTENT MANAGEMENT LOCAL;
 
Tablespace created.
 
SQL> 
 
SQL> CREATE TABLESPACE "TOOLS" LOGGING DATAFILE 
   2  '/dev/rtools' SIZE 100M REUSE 
   3  AUTOEXTEND ON 
   4  NEXT  320K 
   5  MAXSIZE UNLIMITED 
   6  EXTENT MANAGEMENT LOCAL;
 
Tablespace created.
 
SQL> 
 
SQL> CREATE UNDO TABLESPACE "UNDOTBS2" DATAFILE 
   2  '/dev/rundotbs2' SIZE 100M REUSE;
 
Tablespace created.
 
SQL> 
 
SQL> CREATE TEMPORARY TABLESPACE TEMP TEMPFILE 
   2  '/dev/rtemp' SIZE 90M REUSE;
CREATE TEMPORARY TABLESPACE TEMP TEMPFILE
*
ERROR at line 1:
ORA-01119: error in creating database file '/dev/rtemp'
ORA-27042: not enough space on raw partition to fullfill request
Additional information: 2
(不知道这个是为什么,sigh..,明明空间有128M,可是我只能却不能使用其中的100M)
 
SQL> CREATE TEMPORARY TABLESPACE TEMP TEMPFILE 
   2  '/dev/rtemp' SIZE 40M REUSE;
Tablespace created.
SQL> 
 
SQL> CREATE TABLESPACE "USERS" LOGGING DATAFILE 
   2  '/dev/rusers' SIZE 100M REUSE 
   3  AUTOEXTEND ON 
   4  NEXT  1280K 
   5  MAXSIZE UNLIMITED 
   6  EXTENT MANAGEMENT LOCAL;
 
Tablespace created.
 
SQL> 
 
================
================
/oracle/bin/sqlplus /nolog @/oracle/admin/cin/scripts/CreateDBCatalog.sql
================
spool /oracle/admin/cin/create/CreateDBCatalog.log
@/oracle/rdbms/admin/catalog.sql;
 
@/oracle/rdbms/admin/catexp7.sql;
 
@/oracle/rdbms/admin/catblock.sql;
 
@/oracle/rdbms/admin/catproc.sql;(时间特别长)
 
@/oracle/rdbms/admin/catoctk.sql;
 
@/oracle/rdbms/admin/owminst.plb;(时间也很长)
 
connect SYSTEM/manager
@/oracle/sqlplus/admin/pupbld.sql;
@/oracle/sqlplus/admin/help/hlpbld.sql helpus.sql;
 
================
================
/oracle/bin/sqlplus /nolog @/oracle/admin/cin/scripts/CreateClustDBViews.sql
================
connect SYS/change_on_install as SYSDBA
@/oracle/rdbms/admin/catclust.sql;
 
================
================
/oracle/bin/sqlplus /nolog @/oracle/admin/cin/scripts/postDBCreation.sql
================
 
@/oracle/rdbms/admin/utlrp.sql;
 
ALTER DATABASE DATAFILE '/dev/rindx' AUTOEXTEND OFF;
 
ALTER DATABASE DATAFILE '/dev/rsystem' AUTOEXTEND OFF;
 
ALTER DATABASE DATAFILE '/dev/rtools' AUTOEXTEND OFF;
 
ALTER DATABASE DATAFILE '/dev/rundotbs1' AUTOEXTEND OFF;
 
ALTER DATABASE DATAFILE '/dev/rundotbs2' AUTOEXTEND OFF;
 
ALTER DATABASE DATAFILE '/dev/rusers' AUTOEXTEND OFF;
 
ALTER DATABASE TEMPFILE '/dev/rtemp' AUTOEXTEND OFF;
 
SQL> shutdown 
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> conn / as sysdba
Connected to an idle instance.
SQL> host ls /oracle/admin/cin/pfile/initcin.ora
/oracle/admin/cin/pfile/initcin.ora
 
SQL> create spfile='/dev/rspfile' FROM pfile='/oracle/admin/cin/pfile/initcin.ora';
File created.
SQL> 
 
SQL> host ls /oracle/dbs/initcin1.ora
/oracle/dbs/initcin1.ora
SQL> startup pfile="/oracle/dbs/initcin1.ora";
ORACLE instance started.
 
Total System Global Area  202866576 bytes
Fixed Size                   741264 bytes
Variable Size             167772160 bytes
Database Buffers           33554432 bytes
Redo Buffers                 798720 bytes
Database mounted.
Database opened.
SQL> 
 
SQL> ALTER DATABASE ADD LOGFILE 
   2  THREAD 2 GROUP 3 ('/dev/rredo3') SIZE 102400K REUSE,
   3   GROUP 4 ('/dev/rredo4') SIZE 102400K REUSE;
 
Database altered.
SQL> 
 
SQL> ALTER DATABASE ENABLE PUBLIC THREAD 2;
Database altered.
SQL> 
 
SQL> shutdown ;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> 
 
好了,看看是不是可以启动:
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
With the Partitioning and Real Application Clusters options
JServer Release 9.2.0.1.0 - Production
[m80b]/oracle> sqlplus /nolog
 
SQL*Plus: Release 9.2.0.1.0 - Production on Sat Dec 21 20:04:03 2002
 
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
 
SQL> conn / as sysdba 
Connected to an idle instance.
SQL> startup
ORACLE instance started.
 
Total System Global Area  202866576 bytes
Fixed Size                   741264 bytes
Variable Size             167772160 bytes
Database Buffers           33554432 bytes
Redo Buffers                 798720 bytes
Database mounted.
Database opened.
SQL> 
 
ok,成功,可以加入第2个节点了:
 
在另一台机器上做:
SQL> host ls /oracle/admin/cin/pfile/initcin.ora
/oracle/admin/cin/pfile/initcin.ora
 
SQL> create spfile='/dev/rspfile' FROM pfile='/oracle/admin/cin/pfile/initcin.ora';
File created.
SQL> host ls /oracle/dbs/initcin2.ora
/oracle/dbs/initcin2.ora
 
SQL> 
 
SQL> startup
ORACLE instance started.
 
Total System Global Area  202866576 bytes
Fixed Size                   741264 bytes
Variable Size             167772160 bytes
Database Buffers           33554432 bytes
Redo Buffers                 798720 bytes
Database mounted.
Database opened.
SQL> 
 
ok成功。

http://www.cnoug.org/viewthread.php?tid=264&highlight=%2Blunar



你可能感兴趣的:(thread,oracle,sql,PHP,OS)