Oracle 11g单实例RMAN恢复到Oracle 11g RAC(8)

alter database add logfile thread 2 group 4 ('+DATA','+RECOVERY') size 50M;
alter database add logfile thread 2 group 5 ('+DATA','+RECOVERY') size 50M;
alter database add logfile thread 2 group 6 ('+DATA','+RECOVERY') size 50M;
alter database enable thread 2;

15. 重建temp表空间

因为在 recover 的时候不会对temp 表空间进行recover。所以recover 后,我们要手工重建temp表空间。

[root@db1 ~]# su - grid
[grid@db1 ~]$ asmcmd lsof |grep temp
orcl    orcl1          +data/orcl/tempfile/temp.276.954903205 


或 切换到oracle用户
[root@db1 ~]# su - oracle
[oracle@db1 ~]$ sqlplus / as sysdba

SQL> alter tablespace temp add tempfile '+DATA' size 100M;
Tablespace altered.

SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
+DATA/orcl/tempfile/temp.276.954903205
+DATA/orcl/tempfile/temp.281.954903453


SQL> alter database tempfile '+DATA/orcl/tempfile/temp.276.954903205' offline ;
Database altered.

SQL> alter database tempfile '+DATA/orcl/tempfile/temp.276.954903205' drop including datafiles;
alter database tempfile '+DATA/orcl/tempfile/temp.276.954903205' drop including datafiles
*
ERROR at line 1:
ORA-25152: TEMPFILE cannot be dropped at this time

SQL> shutdown immediate;
SQL> startup

SQL>  alter database tempfile '+DATA/orcl/tempfile/temp.276.954903205' drop including datafiles;

Database altered.

16. 确认实例情况

[oracle@db1 oracle]$ srvctl stop database -d orcl -o immediate
[oracle@db1 oracle]$ srvctl start database -d orcl -o open


[oracle@db1 ~]$ sqlplus / as sysdba

SQL> col instance_name for a20
SQL> col host_name for a10
SQL> select instance_number,instance_name ,host_name from gv$instance;

INSTANCE_NUMBER INSTANCE_NAME        HOST_NAME
--------------- -------------------- ----------
          1 orcl1            db1
          2 orcl2            db2

17. 执行catclust.sql脚本创建相关视图

SQL> @$ORACLE_HOME/rdbms/admin/catclust.sql

Package created.
Package body created.
PL/SQL procedure successfully completed.
View created.
Synonym created.
Grant succeeded.
View created.
Grant succeeded.
Synonym created.
View created.
Grant succeeded.
Synonym created.
View created.
Grant succeeded.
Synonym created.
View created.
Grant succeeded.
Synonym created.
View created.
Grant succeeded.
Synonym created.
View created.
Grant succeeded.
Synonym created.
View created.
Grant succeeded.
Synonym created.
View created.
Grant succeeded.
View created.
Grant succeeded.
Synonym created.
Synonym created.
Synonym created.
Synonym created.
Synonym created.
Synonym created.
Synonym created.
Synonym created.
Synonym created.
Synonym created.
Synonym created.
Synonym created.
View created.
Grant succeeded.
Synonym created.
View created.
Grant succeeded.
Synonym created.
PL/SQL procedure successfully completed.

18. 查看在线日志情况

SQL> set pagesize 9999
SQL> col member for a50
SQL> select group#,member from v$logfile order by group#;

GROUP# MEMBER
---------- --------------------------------------------------
    1 +DATA/orcl/onlinelog/group_1.273.954903193
    1 +RECOVERY/orcl/onlinelog/group_1.301.954903195
    2 +RECOVERY/orcl/onlinelog/group_2.300.954903195
    2 +DATA/orcl/onlinelog/group_2.274.954903195
    3 +DATA/orcl/onlinelog/group_3.275.954903197
    3 +RECOVERY/orcl/onlinelog/group_3.299.954903197
    4 +DATA/orcl/onlinelog/group_4.278.954903353
    4 +RECOVERY/orcl/onlinelog/group_4.302.954903353
    5 +DATA/orcl/onlinelog/group_5.279.954903353
    5 +RECOVERY/orcl/onlinelog/group_5.303.954903355
    6 +DATA/orcl/onlinelog/group_6.280.954903355
    6 +RECOVERY/orcl/onlinelog/group_6.304.954903355

12 rows selected.

五、验证数据库及集群情况 1. 查看数据库的状态

[oracle@db1 ~]$ srvctl status database -d orcl

Instance orcl1 is running on node db1
Instance orcl2 is running on node db2

2. 查看数据的配置情况

[oracle@db1 ~]$ srvctl config database -d orcl

Database unique name: orcl
Database name: orcl
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/orcl/spfileorcl.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: orcl
Database instances: orcl1,orcl2
Disk Groups: DATA,RECOVERY
Mount point paths:
Services:
Type: RAC
Database is administrator managed

3. 查看集群配置

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/aa77a59583b6c95f5802bacd557127d5.html