真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

rac恢復(fù)到單實(shí)例

1、將使用rman備份的rac的備份文件傳輸?shù)疆惖貑喂?jié)點(diǎn)上
[oracle@ora0 ~]$ ls /data_back/racbk/
20120514_3snav1p2_1_1.bk  40nav1sh_1_1_20120514.arc  43nav1sh_1_1_20120514.arc    48nav1vu_1_1_20120514.ctl
20120514_3tnav1p2_1_1.bk  41nav1sh_1_1_20120514.arc  44nav1t7_1_1_20120514.arc
20120514_3unav1pa_1_1.bk  42nav1sh_1_1_20120514.arc  46nav1uq_1_1_20120514.spfil

在絳縣等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強(qiáng)發(fā)展的系統(tǒng)性、市場(chǎng)前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供做網(wǎng)站、網(wǎng)站建設(shè) 網(wǎng)站設(shè)計(jì)制作按需網(wǎng)站設(shè)計(jì),公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),高端網(wǎng)站設(shè)計(jì),成都全網(wǎng)營銷,外貿(mào)網(wǎng)站建設(shè),絳縣網(wǎng)站建設(shè)費(fèi)用合理。

2、解決pfile
[oracle@ora0 ~]$ rman target /
RMAN> startup

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/oracle/product/10.2.0/dbs/initora10g.ora'

starting Oracle instance without parameter file for retrival of spfile
Oracle instance started
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 05/14/2012 13:17:11
ORA-00205: error in identifying control file, check alert log for more info
#############報(bào)錯(cuò),不用理會(huì)############################
恢復(fù)spfile
RMAN> restore spfile from '/data_back/racbk/46nav1uq_1_1_20120514.spfil';

連入sql界面
SQL> conn /as sysdba
Connected.
SQL> select status from  v$instance;

STATUS
------------
STARTED

SQL> create pfile from spfile;

File created.

刪除spfile 修改pfile
從RAC數(shù)據(jù)庫中創(chuàng)建參數(shù)文件,如果RAC使用PFILE,可以直接COPY后修改。
         修改的參數(shù)有: audit_file_dest, background_dump_dest, core_dump_dest,user_dump_dest, log_archive_dest_1等,
         與路徑有關(guān)的參數(shù),修改為你單實(shí)例環(huán)境的對(duì)應(yīng)路徑。如:
        background_dump_dest=/u01/oracle/ora/9.2.0/admin/DEV_dbtest/bdump
       重要的: 移除cluster_database_instances,cluster_database參數(shù),因?yàn)榛謴?fù)到的是單實(shí)例環(huán)境。
                      移除一個(gè)UNDO_TABLESPACE設(shè)置,這里假設(shè)保留的是APPS_UNDOTBS1

#############################
*.audit_file_dest='/u01/oracle/admin/db/adump'
*.background_dump_dest='/u01/oracle/admin/db/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/oracle/product/10.2.0/dbs/control_01.ctl'
*.core_dump_dest='/u01/oracle/admin/db/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='db'
*.job_queue_processes=10
*.log_archive_dest_1='LOCATION=/home/oracle/arc'
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile='exclusive'
*.sga_target=283115520
*.undo_management='AUTO'
undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/oracle/admin/db/udump'
################################################
SQL> startup nomount;
ORACLE instance started.

Total System Global Area  285212672 bytes
Fixed Size                  2020224 bytes
Variable Size              92277888 bytes
Database Buffers          188743680 bytes
Redo Buffers                2170880 bytes
SQL>

3、恢復(fù)控制文件,啟動(dòng)數(shù)據(jù)庫到mount狀態(tài)
RMAN> restore controlfile from '/data_back/racbk/48nav1vu_1_1_20120514.ctl';
RMAN> alter database mount;
database mounted
released channel: ORA_DISK

4、修改數(shù)據(jù)文件和日志文件路徑
select 'set newname  for datafile '||chr(39)||name||chr(39)||' to '||chr(39)||replace(name,'+DG0/db/datafile/','/home/oracle/data2/')||chr(39)||';' from v$datafile;
#######################

SQL> select 'set newname  for datafile '||chr(39)||name||chr(39)||' to '||chr(39)||replace(name,'+DG0/db/datafile/','/home/oracle/data2/')||chr(39)||';' from v$datafile;

'SETNEWNAMEFORDATAFILE'||CHR(39)||NAME||CHR(39)||'TO'||CHR(39)||REPLACE(NAME,'+DG0/DB/DATAFILE/','/HOME/ORACLE/DATA2/')||CHR(39)||';'
------------------------------------------------------------------------------------------------------------------------------------------------------
set newname  for datafile '+DG0/db/datafile/sysaux.257.780159407' to '/home/oracle/data2/sysaux.257.780159407';
set newname  for datafile '+DG0/db/datafile/system.256.780159407' to '/home/oracle/data2/system.256.780159407';
set newname  for datafile '+DG0/db/datafile/timelineweb01.dbf' to '/home/oracle/data2/timelineweb01.dbf';
set newname  for datafile '+DG0/db/datafile/undotbs1.258.780159409' to '/home/oracle/data2/undotbs1.258.780159409';
set newname  for datafile '+DG0/db/datafile/undotbs2.264.780159511' to '/home/oracle/data2/undotbs2.264.780159511';
set newname  for datafile '+DG0/db/datafile/users.259.780159409' to '/home/oracle/data2/users.259.780159409';

6 rows selected.

######################
5. 恢復(fù)數(shù)據(jù)庫到新的目錄(我的環(huán)境是原來是RAW恢復(fù)到文件系統(tǒng))
 select 'alter database rename file  '||chr(39)||member||chr(39)||' to '||chr(39)||replace(member,'+DG0/db/onlinelog/','/home/oracle/data2/')||chr(39)||';' from v$logfile;
SQL>  select 'alter database rename file  '||chr(39)||member||chr(39)||' to '||chr(39)||replace(member,'+DG0/db/onlinelog/','/home/oracle/data2/')||chr(39)||';' from v$logfile;

'ALTERDATABASERENAMEFILE'||CHR(39)||MEMBER||CHR(39)||'TO'||CHR(39)||REPLACE(MEMBER,'+DG0/DB/ONLINELOG/','/HOME/ORACLE/DATA2/')||CHR(39)||';'
------------------------------------------------------------------------------------------------------------------------------------------------------
alter database rename file  '+DG0/db/onlinelog/group_2.262.780159469' to '/home/oracle/data2/group_2.262.780159469';
alter database rename file  '+DG0/db/onlinelog/group_1.261.780159467' to '/home/oracle/data2/group_1.261.780159467';
alter database rename file  '+DG0/db/onlinelog/group_3.265.780159539' to '/home/oracle/data2/group_3.265.780159539';
alter database rename file  '+DG0/db/onlinelog/group_4.266.780159539' to '/home/oracle/data2/group_4.266.780159539';

在sql界面執(zhí)行與日志文件有關(guān)的語句:
alter database rename file  '+DG0/db/onlinelog/group_2.262.780159469' to '/home/oracle/data2/group_2.262.780159469';
alter database rename file  '+DG0/db/onlinelog/group_1.261.780159467' to '/home/oracle/data2/group_1.261.780159467';
alter database rename file  '+DG0/db/onlinelog/group_3.265.780159539' to '/home/oracle/data2/group_3.265.780159539';
alter database rename file  '+DG0/db/onlinelog/group_4.266.780159539' to '/home/oracle/data2/group_4.266.780159539';

在rman界面執(zhí)行如下腳本:

RMAN> catalog start with '/data_back/racbk/';
查出catalog的scn號(hào)
Rman > list backup #找出最大的scn
然后運(yùn)行如下腳本
run {
set newname  for datafile '+DG0/db/datafile/sysaux.257.780159407' to '/home/oracle/data2/sysaux.257.780159407';
set newname  for datafile '+DG0/db/datafile/system.256.780159407' to '/home/oracle/data2/system.256.780159407';
set newname  for datafile '+DG0/db/datafile/timelineweb01.dbf' to '/home/oracle/data2/timelineweb01.dbf';
set newname  for datafile '+DG0/db/datafile/undotbs1.258.780159409' to '/home/oracle/data2/undotbs1.258.780159409';
set newname  for datafile '+DG0/db/datafile/undotbs2.264.780159511' to '/home/oracle/data2/undotbs2.264.780159511';
set newname  for datafile '+DG0/db/datafile/users.259.780159409' to '/home/oracle/data2/users.259.780159409';
set until scn 1385018;
restore database ;
switch datafile all;
recover database;
}

6,打開數(shù)據(jù)庫
SQL> alter database open resetlogs;

Database altered.

7、
處理臨時(shí)文件:
先創(chuàng)建一個(gè)臨時(shí)表空間temp1
SQL> create temporary tablespace temp1 tempfile  '/home/oracle/data2/temp2.dbf' size 512m  autoextend on next 1m maxsize unlimited;

Tablespace created.
SQL> alter database default temporary tablespace temp1;

Database altered.

刪掉不用的undo表空間及文件
SQL> select tablespace_name,status from dba_data_files;

TABLESPACE_NAME                STATUS
------------------------------ ---------
USERS                          AVAILABLE
SYSAUX                         AVAILABLE
UNDOTBS1                       AVAILABLE
SYSTEM                         AVAILABLE
UNDOTBS2                       AVAILABLE
TIMELINEWEB                    AVAILABLE

6 rows selected.

SQL> show parameter undo

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS1
SQL> drop tablespace undotbs2 including contents and datafiles;

Tablespace dropped.

SQL>

刪除通過RMAN回復(fù)過來的臨時(shí)文件。完成臨時(shí)文件的整個(gè)處理過程。
SQL> drop tablespace temp including contents and datafiles;
Tablespace dropped.

刪除不用的日志
select thread#,status,enabled from v$thread; --查找thread,那個(gè)可以刪除

SQL> select thread#,status,enabled from v$thread;

   THREAD# STATUS ENABLED
---------- ------ --------
         1 OPEN   PUBLIC
         2 CLOSED PUBLIC

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------
         1          1          0   52428800          1 YES UNUSED                       0
         2          1          1   52428800          1 NO  CURRENT                1385019 14-MAY-12
         3          2          0   52428800          1 YES UNUSED                       0
         4          2          1   52428800          1 NO  CURRENT                1385019 14-MAY-12

SQL> select * from v$logfile;

    GROUP# STATUS  TYPE    MEMBER                                        IS_
---------- ------- ------- --------------------------------------------- ---
         2         ONLINE  /home/oracle/data2/group_2.262.780159469      NO
         1         ONLINE  /home/oracle/data2/group_1.261.780159467      NO
         3         ONLINE  /home/oracle/data2/group_3.265.780159539      NO
         4         ONLINE  /home/oracle/data2/group_4.266.780159539      NO

SQL> ALTER DATABASE DISABLE THREAD 2;

Database altered.

SQL> alter database drop logfile group 3
  2  ;

Database altered.

SQL> alter database drop logfile group 4;
alter database drop logfile group 4
*
ERROR at line 1:
ORA-00350: log 4 of instance db2 (thread 2) needs to be archived
ORA-00312: online log 4 thread 2: '/home/oracle/data2/group_4.266.780159539'

SQL>  alter database clear unarchived logfile group 4;

Database altered.

SQL> alter database drop logfile group 4;

Database altered.

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------
         1          1          0   52428800          1 YES UNUSED                       0
         2          1          1   52428800          1 NO  CURRENT                1385019 14-MAY-12

SQL> select * from v$logfile;

    GROUP# STATUS  TYPE    MEMBER                                        IS_
---------- ------- ------- --------------------------------------------- ---
         2         ONLINE  /home/oracle/data2/group_2.262.780159469      NO
         1         ONLINE  /home/oracle/data2/group_1.261.780159467      NO

SQL>


本文標(biāo)題:rac恢復(fù)到單實(shí)例
文章位置:http://weahome.cn/article/ppdeej.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部