Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

86

积分

0

好友

2

主题
1#
发表于 2014-11-14 16:24:19 | 查看: 5384| 回复: 12
环境:11g r2
primary端是asm+db的简单结构,standby也是asm+db的结构,通过rman将数据库还原到standby后,将standby端的db加到grid中通过集群来管理,但是用集群就不能启动db,手工用sqlplus登录进去后可以启动,集群也能认到db的online状态。
主库的:
[grid@dataguard_primary ~]$ srvctl config database -d bjlcrmdb
Database unique name: bjlcrmdb
Database name: bjlcrmdb
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/bjlcrmdb/spfilebjlcrmdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Database instance: bjlcrmdb
Disk Groups: DATA
Services:

备库:
[grid@dataguard_standby ~]$ srvctl config database -d nhcrmdb
Database unique name: nhcrmdb
Database name:
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: /u01/app/oracle/product/11.2.0/db_1/dbs/spfilenhcrmdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PHYSICAL_STANDBY
Management policy: AUTOMATIC
Database instance: nhcrmdb
Disk Groups: DATA
Services:

备库启动报错:
[grid@dataguard_standby ~]$ crs_start ora.nhcrmdb.db
Attempting to start `ora.nhcrmdb.db` on member `dataguard_standby`
CRS-5010: Update of configuration file "/u01/app/oracle/product/11.2.0/db_1/dbs/initnhcrmdb.ora" failed: details at "(:CLSN00014:)" in "/u01/app/11.2.0/grid/log/dataguard_standby/agent/ohasd/oraagent_grid/oraagent_grid.log"
CRS-5017: The resource action "ora.nhcrmdb.db start" encountered the following error:
CRS-5010: Update of configuration file "/u01/app/oracle/product/11.2.0/db_1/dbs/initnhcrmdb.ora" failed: details at "(:CLSN00014:)" in "/u01/app/11.2.0/grid/log/dataguard_standby/agent/ohasd/oraagent_grid/oraagent_grid.log"
. For details refer to "(:CLSN00107:)" in "/u01/app/11.2.0/grid/log/dataguard_standby/agent/ohasd/oraagent_grid/oraagent_grid.log".

Start of `ora.nhcrmdb.db` on member `dataguard_standby` failed.
Attempting to stop `ora.nhcrmdb.db` on member `dataguard_standby`
ORA-12547: TNS:lost contact
Stop of `ora.nhcrmdb.db` on member `dataguard_standby` succeeded.
CRS-0215: Could not start resource 'ora.nhcrmdb.db'.
2#
发表于 2014-11-14 16:26:05
ls -l /u01/app/oracle/product/11.2.0/db_1/dbs/initnhcrmdb.ora
ls -ld /u01/app/oracle/product/11.2.0/db_1/dbs

回复 只看该作者 道具 举报

3#
发表于 2014-11-14 16:30:15
[oracle@dataguard_standby ~]$ ls -l /u01/app/oracle/product/11.2.0/db_1/dbs/initnhcrmdb.ora
-rw-r--r-- 1 oracle oinstall 17 Nov 12 02:17 /u01/app/oracle/product/11.2.0/db_1/dbs/initnhcrmdb.ora
[oracle@dataguard_standby ~]$ ls -ld /u01/app/oracle/product/11.2.0/db_1/dbs
drwxr-xr-x 2 oracle oinstall 4096 Nov 13 15:06 /u01/app/oracle/product/11.2.0/db_1/dbs
[oracle@dataguard_standby ~]$
[oracle@dataguard_standby dbs]$ ls -l  /u01/app/oracle/product/11.2.0/db_1/dbs/spfilenhcrmdb.ora
-rw-r----- 1 oracle oinstall 4608 Nov 13 15:06 /u01/app/oracle/product/11.2.0/db_1/dbs/spfilenhcrmdb.ora


回复 只看该作者 道具 举报

4#
发表于 2014-11-14 16:30:50
[oracle@dataguard_standby dbs]$ strings /u01/app/oracle/product/11.2.0/db_1/dbs/spfilenhcrmdb.ora
bjlcrmdb.__db_cache_size=150994944
nhcrmdb.__db_cache_size=163577856
bjlcrmdb.__java_pool_size=4194304
nhcrmdb.__java_pool_size=4194304
bjlcrmdb.__large_pool_size=4194304
nhcrmdb.__large_pool_size=4194304
bjlcrmdb.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
nhcrmdb.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
bjlcrmdb.__pga_aggregate_target=134217728
nhcrmdb.__pga_aggregate_target=134217728
bjlcrmdb.__sga_target=268435456
nhcrmdb.__sga_target=
268435456
bjlcrmdb.__shared_io_pool_size=0
nhcrmdb.__shared_io_pool_size=0
bjlcrmdb.__shared_pool_size=100663296
nhcrmdb.__shared_pool_size=88080384
bjlcrmdb.__streams_pool_size=0
nhcrmdb.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/nhcrmdb/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='+DATA/nhcrmdb/controlfile/current.258.863404609','+DATA/nhcrmdb/controlfile/current.261.863404609'#Set by RMAN
*.db_block_size=8192
*.db_create_file_dest='+DATA
*.db_domain=''
*.db_file_name_convert='bjlcrmdb','nhcrmdb'
*.db_name='bjlcrmdb'
*.db_recovery_file_dest='+DATA'
*.db_recovery_file_dest_size=2147483648
*.db_unique_name='nhcrmdb'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=nhcrmdbXDB)'
*.fal_client='nhcrmdb'
*.fal_server='bjlcrmdb'
*.log_archive_config='DG_CONFIG=(bjlcrmdb,nhcrmdb)'
*.log_archive_dest_1='location=+data'
*.log_archive_dest_2='service=bjlcrmdb async lgwr register valid_for=(online_logfi
le,primary_role) db_unique_name=bjlcrmdb'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_format='%S_%t_%r.log'
*.log_file_name_convert='bjlcrmdb','nhcrmdb'
*.open_cursors=300
*.pga_aggregate_target=134217728
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=268435456
*.standby_file_management='AUTO'
*.undo_tablespace='UNDOTBS1'
[oracle@dataguard_standby dbs]$

回复 只看该作者 道具 举报

5#
发表于 2014-11-14 16:34:46
你确定grid用户能正常更新   /u01/app/oracle/product/11.2.0/db_1/dbs/initnhcrmdb.ora 吗?

回复 只看该作者 道具 举报

6#
发表于 2014-11-14 16:34:49
你确定grid用户能正常更新   /u01/app/oracle/product/11.2.0/db_1/dbs/initnhcrmdb.ora 吗?

回复 只看该作者 道具 举报

7#
发表于 2014-11-14 16:49:16
谢谢回复。权限已经更新了:
[oracle@dataguard_standby dbs]$ ls -l *nhcrmdb*
-rw-rw---- 1 oracle oinstall 1544 Nov 11 20:49 hc_nhcrmdb.dat
-rwxrwxr-x 1 oracle oinstall   18 Nov 13 15:49 initnhcrmdb.ora
-rw-r----- 1 oracle oinstall 1536 Nov 12 02:36 orapwnhcrmdb
-rwxrwxr-x 1 oracle oinstall 4608 Nov 13 15:06 spfilenhcrmdb.ora
但是启动还是报错:crs_start 报错信息跟之前一样:
Attempting to start `ora.nhcrmdb.db` on member `dataguard_standby`
CRS-5010: Update of configuration file "/u01/app/oracle/product/11.2.0/db_1/dbs/initnhcrmdb.ora" failed: details at "(:CLSN00014:)" in "/u01/app/11.2.0/grid/log/dataguard_standby/agent/ohasd/oraagent_grid/oraagent_grid.log"
CRS-5017: The resource action "ora.nhcrmdb.db start" encountered the following error:
CRS-5010: Update of configuration file "/u01/app/oracle/product/11.2.0/db_1/dbs/initnhcrmdb.ora" failed: details at "(:CLSN00014:)" in "/u01/app/11.2.0/grid/log/dataguard_standby/agent/ohasd/oraagent_grid/oraagent_grid.log"
. For details refer to "(:CLSN00107:)" in "/u01/app/11.2.0/grid/log/dataguard_standby/agent/ohasd/oraagent_grid/oraagent_grid.log".

Start of `ora.nhcrmdb.db` on member `dataguard_standby` failed.
Attempting to stop `ora.nhcrmdb.db` on member `dataguard_standby`
ORA-12547: TNS:lost contact
Stop of `ora.nhcrmdb.db` on member `dataguard_standby` succeeded.
CRS-0215: Could not start resource 'ora.nhcrmdb.db'.


下面是我截取的错误日志里的部分:
2014-11-13 15:53:05.713: [ USRTHRD][2999884688] {0:0:406} CrsCmd::ClscrsCmdData::stat entity 1 statflag 33 useFilter 0
2014-11-13 15:53:05.740: [ USRTHRD][2999884688] {0:0:406} endp=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))
2014-11-13 15:53:05.741: [ USRTHRD][2999884688] {0:0:406} Utils::getCrsHome crsHome /u01/app/11.2.0/grid
2014-11-13 15:53:05.741: [ USRTHRD][2999884688] {0:0:406} clsnInstConnection::makeConnectStr UsrOraEnv  m_oracleHome /u01/app/11.2.0/grid Crshome /u01/app/11.2.0/grid
2014-11-13 15:53:05.741: [ USRTHRD][2999884688] {0:0:406} Utils::getCrsHome crsHome /u01/app/11.2.0/grid
2014-11-13 15:53:05.741: [ USRTHRD][2999884688] {0:0:406} makeConnectStr = (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/u01/app/11.2.0/grid/bin/oracle)(ARGV0=oracle+ASM)(ENVS='ORACLE_HOME=/u01/app/11.2.0/grid,ORACLE_SID=+ASM')(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))(CONNECT_DATA=(SID=+ASM)))
2014-11-13 15:53:05.742: [ USRTHRD][2999884688] {0:0:406} InstConnection::connectInt: server not attached
2014-11-13 15:53:05.821: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ORA-12547: TNS:lost contact

2014-11-13 15:53:05.821: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] InstConnection::connectInt (1) Exception OCIException
2014-11-13 15:53:05.821: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] InstAgent::stop: connect1 errcode 12547
2014-11-13 15:53:05.821: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] InstAgent::stop: connect2 oracleHome /u01/app/oracle/product/11.2.0/db_1 oracleSid nhcrmdb
2014-11-13 15:53:05.821: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] InstConnection::connectInt: server not attached
2014-11-13 15:53:05.931: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ORA-12547: TNS:lost contact

2014-11-13 15:53:05.931: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] InstConnection::connectInt (1) Exception OCIException
2014-11-13 15:53:05.931: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] InstConnection:connect:excp OCIException OCI error 12547
2014-11-13 15:53:05.931: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] InstConnection::connectInt: server not attached
2014-11-13 15:53:06.039: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ORA-12547: TNS:lost contact

2014-11-13 15:53:06.039: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] InstConnection::connectInt (1) Exception OCIException
2014-11-13 15:53:06.043: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] InstAgent::stop: connect2 errcode 12547
2014-11-13 15:53:06.044: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] clsnUtils::error Exception type=2 string=
ORA-12547: TNS:lost contact

2014-11-13 15:53:06.044: [    AGFW][3013626768] {0:0:406} sending status msg [ORA-12547: TNS:lost contact
] for clean for resource: ora.nhcrmdb.db 1 1
2014-11-13 15:53:06.044: [    AGFW][3017829264] {0:0:406} Agent sending reply for: RESOURCE_CLEAN[ora.nhcrmdb.db 1 1] ID 4100:1636
2014-11-13 15:53:06.046: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ConnectionPool::releaseConnection InstConnection 09a59240
2014-11-13 15:53:06.046: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ConnectionPool::removeConnection connection count 1
2014-11-13 15:53:06.046: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ConnectionPool::removeConnection sid  nhcrmdb, InstConnection 09a59240
2014-11-13 15:53:06.046: [ USRTHRD][3013626768] {0:0:406} InstConnection::breakCall pConnxn:09a59240  DetachLock:086ff114 m_pSvcH:00000000
2014-11-13 15:53:06.046: [ USRTHRD][3013626768] {0:0:406} InstConnection:~InstConnection: this 09a59240
2014-11-13 15:53:06.046: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ConnectionPool::removeConnection delete InstConnection 09a59240
2014-11-13 15:53:06.046: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ConnectionPool::removeConnection freed 1
2014-11-13 15:53:06.046: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ConnectionPool::stopConnection
2014-11-13 15:53:06.046: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ConnectionPool::removeConnection connection count 0
2014-11-13 15:53:06.047: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ConnectionPool::removeConnection freed 0
2014-11-13 15:53:06.047: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ConnectionPool::stopConnection sid nhcrmdb status  1
2014-11-13 15:53:06.047: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] InstAgent::stop db/asm
2014-11-13 15:53:06.047: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ConnectionPool::stopConnection
2014-11-13 15:53:06.047: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ConnectionPool::removeConnection connection count 0
2014-11-13 15:53:06.047: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ConnectionPool::removeConnection freed 0
2014-11-13 15:53:06.047: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] ConnectionPool::stopConnection sid nhcrmdb status  1
2014-11-13 15:53:06.047: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] InstAgent::stop Container->stop, isShutdown = 0
2014-11-13 15:53:06.047: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] InstAgent::stop: }
2014-11-13 15:53:06.047: [ora.nhcrmdb.db][3013626768] {0:0:406} [clean] clean  }

回复 只看该作者 道具 举报

8#
发表于 2014-11-14 16:49:58
standby库的集群状态:
[grid@dataguard_standby dataguard_standby]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.DATA.dg    ora....up.type ONLINE    ONLINE    data...ndby
ora....ER.lsnr ora....er.type ONLINE    ONLINE    data...ndby
ora.asm        ora.asm.type   ONLINE    ONLINE    data...ndby
ora.cssd       ora.cssd.type  ONLINE    ONLINE    data...ndby
ora.diskmon    ora....on.type OFFLINE   OFFLINE               
ora.evmd       ora.evm.type   ONLINE    ONLINE    data...ndby
ora.nhcrmdb.db ora....se.type ONLINE    OFFLINE               
ora.ons        ora.ons.type   OFFLINE   OFFLINE            

sqlplus 手工启动,集群可以认到并将db 显示为online

回复 只看该作者 道具 举报

9#
发表于 2014-11-14 16:51:34
检查oracle和grid用户 $ORACLE_HOME/bin/oracle 文件权限.

回复 只看该作者 道具 举报

10#
发表于 2014-11-14 16:51:52
id grid

回复 只看该作者 道具 举报

11#
发表于 2014-11-14 17:10:21
这是主库的:
[grid@dataguard_primary ~]$ ls -l /u01/app/oracle/product/11.2.0/db_1/bin/oracle
-rwxr-s--x 1 oracle asmadmin 192296241 Aug 22  2012 /u01/app/oracle/product/11.2.0/db_1/bin/oracle
[grid@dataguard_primary ~]$ ls -l /u01/app/11.2.0/grid/bin/oracle
-rwsr-s--x 1 grid oinstall 169801706 Nov 11 19:27 /u01/app/11.2.0/grid/bin/oracle
[grid@dataguard_primary ~]$ id grid
uid=500(grid) gid=6000(oinstall) groups=6000(oinstall),5000(asmadmin),5001(asmdba),5002(asmoper)
[grid@dataguard_primary ~]$ id oracle
uid=501(oracle) gid=6000(oinstall) groups=6000(oinstall),5001(asmdba),6001(dba)
[grid@dataguard_primary ~]$

这是standby库的:
[grid@dataguard_standby dbs]$  ls -l /u01/app/oracle/product/11.2.0/db_1/bin/oracle
-rwxr-x--x 1 oracle oinstall 192296241 Aug 22  2012 /u01/app/oracle/product/11.2.0/db_1/bin/oracle
[grid@dataguard_standby dbs]$ ls -l /u01/app/11.2.0/grid/bin/oracle
-rwsr-s--x 1 grid oinstall 169801706 Nov 11 19:30 /u01/app/11.2.0/grid/bin/oracle
[grid@dataguard_standby dbs]$ id grid
uid=500(grid) gid=6000(oinstall) groups=6000(oinstall),5000(asmadmin),5001(asmdba),5002(asmoper)
[grid@dataguard_standby dbs]$ id oracle
uid=501(oracle) gid=6000(oinstall) groups=6000(oinstall),5001(asmdba),6001(dba)
[grid@dataguard_standby dbs]$

回复 只看该作者 道具 举报

12#
发表于 2014-11-14 17:11:23
主库:
[grid@dataguard_primary ~]$ id grid
uid=500(grid) gid=6000(oinstall) groups=6000(oinstall),5000(asmadmin),5001(asmdba),5002(asmoper)
[grid@dataguard_primary ~]$ id oracle
uid=501(oracle) gid=6000(oinstall) groups=6000(oinstall),5001(asmdba),6001(dba)
[grid@dataguard_primary ~]$
备库:
[grid@dataguard_primary ~]$ id grid
uid=500(grid) gid=6000(oinstall) groups=6000(oinstall),5000(asmadmin),5001(asmdba),5002(asmoper)
[grid@dataguard_primary ~]$ id oracle
uid=501(oracle) gid=6000(oinstall) groups=6000(oinstall),5001(asmdba),6001(dba)
[grid@dataguard_primary ~]$

回复 只看该作者 道具 举报

13#
发表于 2014-11-14 17:17:45
chmod 6751 oracle

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-20 22:42 , Processed in 0.054473 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569