一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

oracle 11.2 RAC 系列安装新主机,识别老存储-2-准备识别数据库

时间:2022-06-29 09:44:22 编辑:袖梨 来源:一聚教程网

假设原来的主机已经完全不能启动了(比如硬件故障等),只能在存储上的ASM中查找数据库使用的参数文件:
[grid@lunar5 ~]$ ss
 
SQL*Plus: Release 11.2.0.4.0 Production on Mon Feb 15 21:48:15 2016
 
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
 
SYS@+ASM1>col name for a55
SYS@+ASM1>col type for a25
SYS@+ASM1>SELECT f.group_number, f.file_number, a.name name, f.type type
  2  FROM v$asm_file f, v$asm_alias a
  3  WHERE f.group_number=a.group_number and f.file_number=a.file_number
  4   and f.type='PARAMETERFILE'
  5  ORDER BY 1, 2;
 
    GROUP_NUMBER      FILE_NUMBER NAME                                                    TYPE
---------------- ---------------- ------------------------------------------------------- -------------------------
               2              272 spfile.272.892409049                                    PARAMETERFILE
               2              272 spfilelunar.ora                                         PARAMETERFILE
 
Elapsed: 00:00:00.09
SYS@+ASM1>
这里看到,数据库使用的参数文件是spfilelunar.ora,它是spfile.272.892409049的别名文件。
我们在ASM中查看一下:
ASMCMD> pwd
+datadg2/lunar
ASMCMD> ls -l
Type           Redund  Striped  Time             Sys  Name
                                                 Y    ARCHIVELOG/
                                                 Y    CONTROLFILE/
                                                 Y    DATAFILE/
                                                 Y    ONLINELOG/
                                                 Y    PARAMETERFILE/
                                                 Y    TEMPFILE/
                                                 N    spfilelunar.ora => +DATADG2/LUNAR/PARAMETERFILE/spfile.272.892409049
ASMCMD>   
我们将这个文件复制到文件系统,然后查看该文件内容,以便确定是否为我们需要使用的数据库的参数文件:
1
ASMCMD> cp +DATADG2/LUNAR/PARAMETERFILE/spfile.272.892409049 /tmp/lunar.db.spfile
copying +DATADG2/LUNAR/PARAMETERFILE/spfile.272.892409049 -> /tmp/lunar.db.spfile
ASMCMD>
检查数据库的spfile的内容:
[root@lunar5 ~]# ll /tmp/lunar.db.spfile
-rw-r----- 1 grid oinstall 2560 Feb 15 21:51 /tmp/lunar.db.spfile
[root@lunar5 ~]# strings /tmp/lunar.db.spfile
*.audit_file_dest='/u01/app/oracle/admin/lunar/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.4.0'
*.control_files='+DATADG2/lunar/controlfile/current.256.892408309','+DATADG2/lunar/controlfile/current.257.892408311'
*.db_block_size=8192
*.db_cache_size=157286400
*.db_create_file_dest='+DATADG2'
*.db_domain=''
*.db_name='lunar'
*.db_recovery_file_dest='+DATADG2'
*.db_recovery_file_dest_size=4194304000
*.diagnostic_dest='/u01/app/oracle'
lunar2.instance_number=
lunar1.instance_number=1
*.java_pool_size=31457280
*.large_pool_size=31457280
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=228589568
*.processes=150
*.remote_listener='lunar-scan:1521'
*.remote_login_passwordfile='exclusive'
*.shared_pool_size=419430400
lunar2.thread=2
lunar1.thread=1
lunar2.undo_tablespace='UNDOTBS2'
lunar1.undo_tablespace='UNDOTBS1'
[root@lunar5 ~]#
这里确定的,该文件+datadg2/lunar/spfilelunar.ora(也就是+DATADG2/LUNAR/PARAMETERFILE/spfile.272.892409049)就是我们需要使用的数据库参数文件。

热门栏目