dbca -silent 问题

grid安装好后,建立了一个diskgroup DATA,然后用dbca -silent建立数据库,用以下命令
dbca -silent  -createDatabase \
                -templateName /u01/app/oracle/product/11.2.0/dbhome_1/assistants/dbca/templates/General_Purpose.dbc  -gdbName prim \
                -sid prim -sysPassword oracle -systemPassword oracle \
                -emConfiguration ALL \
                        -dbsnmpPassword oracle \
                        -sysmanPassword oracle \
                        -hostUserName oracle -hostUserPassword oracle \
                -disableSecurityConfiguration ALL \
                -datafileDestination '+DATA' \
                -redoLogFileSize 10  \
                -storageType ASM -asmsnmpPassword 'oracle' -diskGroupName '+DATA' \
                         -characterSet ZHS16GBK -nationalCharacterSet AL16UTF16 \
                -totalMemory 200  -memoryPercentage 20 \
                -databaseType OLTP
总是报错:
ORA-01261: Parameter db_create_file_dest destination string cannot be translated
纳闷了,这个参数不是通过 -datafileDestination 来指定的么?最后看了一下临时的init文件,发现有这么两行:
db_create_file_dest=++DATA
db_recovery_file_dest=++DATA
这下知道了,-datafileDestination和-diskGroupName写磁盘组的名字的时候是不用+号的,应该为
dbca -silent  -createDatabase \
                -templateName /u01/app/oracle/product/11.2.0/dbhome_1/assistants/dbca/templates/General_Purpose.dbc  -gdbName prim \
                -sid prim -sysPassword oracle -systemPassword oracle \
                -emConfiguration ALL \
                        -dbsnmpPassword oracle \
                        -sysmanPassword oracle \
                        -hostUserName oracle -hostUserPassword oracle \
                -disableSecurityConfiguration ALL \
                -datafileDestination 'DATA' \
                -redoLogFileSize 10  \
                -storageType ASM -asmsnmpPassword 'oracle' -diskGroupName 'DATA' \
                         -characterSet ZHS16GBK -nationalCharacterSet AL16UTF16 \
                -totalMemory 200  -memoryPercentage 20 \
                -databaseType OLTP
再次执行,又报了这一堆:
ORA-19504: failed to create file "+DATA"
ORA-15045: ASM file name '+DATA' is not in reference form
ORA-17502: ksfdcre:5 Failed to create file +DATA
ORA-15081: failed to submit an I/O operation to a disk
ORA-06512: at "SYS.X$DBMS_BACKUP_RESTORE", line 5816
ORA-06512: at line 20
看样子是权限不对,查看了一下磁盘组DATA所对应的磁盘权限
$ ls -l /dev/sdb
brw-rw---- 1 grid asmadmin 8, 16 Oct  7 01:06 /dev/sdb
这可是照文档写的权限呀,能有什么问题,看了一下grid和oracle用户,都是属于oinstall组,那先暂时改为这个吧(用udev固定的权限)
chown grid:oinstall /dev/sdb
再次执行上面的dbca -silent,前面都是正常的,到最后了报了又一堆:
PRCR-1079 : Failed to start resource ora.prim.db
CRS-5016: ?? "/u01/app/11.2.0/grid/bin/setasmgidwrap" (??? "/u01/app/11.2.0/grid/bin/oraagent.bin" ??, ???? "start") ??: ????? "(:CLSN00010:)" (?? "/u01/app/11.2.0/grid/log/ora1/agent/ohasd/oraagent_grid/oraagent_grid.log")
/u01/app/11.2.0/grid/bin/setasmgidwrap: line 67: /opt/oracle/bin/setasmgid: ????
ORA-01031: insufficient privileges
ORA-01031: insufficient privileges
CRS-2674: ???? 'ora.prim.db' (? 'ora1' ?)
DBCA_PROGRESS : 87%
ORA-01034: ORACLE not available
ORA-01034: ORACLE not available
用sqlplus 手工启动一下数据库,发现没有找到init文件,用grid用户登录到asm,这里面有spfile文件,于是在$ORACLE_HOME/dbs里加了个init文件指向ASM里的spfile,
就可以正常启动数据库了
$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Sun Oct 7 00:44:38 2012
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area  313860096 bytes
Fixed Size                  1336232 bytes
Variable Size             205524056 bytes
Database Buffers          100663296 bytes
Redo Buffers                6336512 bytes
Database mounted.
Database opened.
我试着加database到crs里
grid$srvctl add database -d prim -o $ORACLE_HOME -p '+DATA/prim/spfileprim.ora' -r PRIMARY -s open -y MANUAL -a "+DATA"
PRCA-1000 : ASM Disk Group +DATA does not exist
PRCR-1070 : Failed to check if resource ora.+DATA.dg is registered
Invalid resource name
[oracle@ora1 ~]$ srvctl add database -d prim -o $ORACLE_HOME -p '+DATA/prim/spfileprim.ora' -r PRIMARY -s open -y MANUAL -a "DATA"
$ srvctl stop database -d prim
PRCC-1016 : prim was already stopped
[oracle@ora1 ~]$ ps -fe|grep smon
grid      4323     1  0 Oct06 ?        00:00:00 asm_smon_+ASM
oracle    8925     1  0 00:44 ?        00:00:00 ora_smon_prim
oracle    9134  9036  0 00:49 pts/2    00:00:00 grep smon
库明明已经启动着呀,手动停止一下,
$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Sun Oct 7 00:50:43 2012
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
再次启动数据库:
[oracle@ora1 ~]$ srvctl start database -d prim
PRCR-1079 : Failed to start resource ora.prim.db
CRS-5016: ??3ì "/u01/app/11.2.0/grid/bin/setasmgidwrap" (óé′úàí "/u01/app/11.2.0/grid/bin/oraagent.bin" ?üéú, ó?óú2ù×÷ "start") ꧰ü: ?ê??D??¢?? "(:CLSN00010:)" (??óú "/u01/app/11.2.0/grid/log/ora1/agent/ohasd/oraagent_grid/oraagent_grid.log")
/u01/app/11.2.0/grid/bin/setasmgidwrap: line 67: /opt/oracle/bin/setasmgid: �T2?1?
ORA-01031: insufficient privileges
ORA-01031: insufficient privileges
CRS-2674: ?′?ü???ˉ 'ora.prim.db' (?ú 'ora1' é?)
这个错误明显是权限问题
[oracle@ora1 ~]$ ls -l /opt/oracle/bin/setasmgid
ls: /opt/oracle/bin/setasmgid: Permission denied
#ls -ld /opt/oracle
total 8
drwxr-x--- 3 root  501 4096 Mar 19  2012 /opt/oracle
原来是上次手工清理不干净留下的问题,那就改权限吧
# chown root:oinstall /opt/oracle
再看一下
# ls -l /opt/oracle/bin
total 1868
-rws--x--- 1 root oinstall 1908072 Oct  3 20:05 setasmgid
再启动,还是那个问题,问了一下百度,找到了一篇
http://space.itpub.net/23135684/viewspace-689072
按照他的方法,问题解决

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/44413/viewspace-745814/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/44413/viewspace-745814/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值