測試平臺(tái)信息:
Oracle:10gR2
操作系統(tǒng):Redhat 4.5
Target DB:ORCL
?
幾點(diǎn)說明:
(1)RMAN 異機(jī)恢復(fù)的時(shí)候,db_name必須相同。 如果說要想改成其他的實(shí)例名, 可以在恢復(fù)成功后,用 nid 命令修改。 實(shí)例名的信息會(huì)記錄到控制文件里,所以如果在恢復(fù)的時(shí)候,如果實(shí)例名不一致,恢復(fù)的時(shí)候會(huì)報(bào)錯(cuò)。
(2)如果恢復(fù)的路徑和源庫不一致,就需要在restore時(shí)用set 命令指定新位置。 并且使用switch datafile all將信息更新的到控制文件。
?????? 在做duplicate的時(shí)候,RMAN 會(huì)自動(dòng)根據(jù)pfile中的log_file_name_convert和db_file_name_convert來進(jìn)行set 的轉(zhuǎn)換。 手工restore時(shí),只能只只能使用set 命令。
(3)異機(jī)恢復(fù)對相同目錄和不同目錄都做了說明。
(4)最后測試了NID 修改DBID 和DBNAME.
?
?
一 . Target 庫準(zhǔn)備工作:
1. 查詢 DBID
SQL> select name,dbid from v$database;
NAME??????????? DBID
--------- ----------
ORCL????? 1230508166
?
2. 備份 DB
?
RMAN 的shell 備份腳本:
?
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u03/RMAN/auto_c_%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET;
run {
?crosscheck archivelog all;
?delete expired archivelog all;
?crosscheck backup;
?delete expired backup;
?allocate channel c1 type disk;
?backup incremental level 0 database format '/u03/RMAN/db0%u_%s_%p.bak' include current controlfile;
?sql 'alter system archive log current';
?backup filesperset 1 format '/u03/RMAN/arch%u_%s_%p.bak'
?backup spfile tag='spfile' format='/u03/RMAN/ORCL_spfile_%U_%T';
?archivelog all delete input;
?release channel c1;
}
exit;
~
備份出來的文件如下:
[oracle@rhel133 RMAN]$ ls -lth
total 5.8G
-rw-r-----? 1 oracle oinstall 6.9M Apr? 9 14:30 auto_c_c-1230508166-20130409-04
-rw-r-----? 1 oracle oinstall? 96K Apr? 9 14:30 ORCL_spfile_0so6lccp_1_1_20130409
-rw-r-----? 1 oracle oinstall 6.9M Apr? 9 14:27 auto_c_c-1230508166-20130409-03
-rw-r-----? 1 oracle oinstall 6.8M Apr? 9 12:20 auto_c_c-1230508166-20130409-02
-rw-r-----? 1 oracle oinstall 6.8M Apr? 9 11:32 auto_c_c-1230508166-20130409-00
-rw-r-----? 1 oracle oinstall 6.8M Apr? 9 09:37 auto_c_c-1230508166-20130409-01
-rw-r-----? 1 oracle oinstall 2.5K Apr? 9 09:37 arch0io6kr7a_18_1.bak
-rw-r-----? 1 oracle oinstall 2.5K Apr? 9 09:37 arch0ho6kr78_17_1.bak
-rw-r-----? 1 oracle oinstall 4.4M Apr? 9 09:37 arch0go6kr75_16_1.bak
-rw-r-----? 1 oracle oinstall? 22M Apr? 9 09:37 arch0fo6kr6t_15_1.bak
-rw-r-----? 1 oracle oinstall 135M Apr? 9 09:37 arch0eo6kr63_14_1.bak
-rw-r-----? 1 oracle oinstall 161M Apr? 9 09:37 arch0do6kr59_13_1.bak
-rw-r-----? 1 oracle oinstall 1.1M Apr? 9 09:36 db00bo6kr52_11_1.bak
-rw-r-----? 1 oracle oinstall 5.4G Apr? 9 09:36 db00ao6kq0u_10_1.bak
檢查數(shù)據(jù)文件所在位置,在Auxiliary庫需將所有的數(shù)據(jù)文件從/u02改變到/u01下:
SQL> select file_id,file_name from dba_data_files order by file_id;
?? FILE_ID FILE_NAME
---------- --------------------------------------------------
???????? 1 /u02/oradata/orcl/system01.dbf
???????? 2 /u02/oradata/orcl/undotbs01.dbf
???????? 3 /u02/oradata/orcl/sysaux01.dbf
???????? 4 /u02/oradata/orcl/DEALSPACE_002.dbf
???????? 5 /u02/oradata/orcl/DEALSPACE_001.dbf
???????? 6 /u02/oradata/orcl/l5mspace01.dbf
???????? 7 /u02/oradata/orcl/RCFSPACE_002.dbf
???????? 8 /u02/oradata/orcl/RCFSPACE_001.dbf
???????? 9 /u02/oradata/orcl/DTSPACE_001.dbf
9 rows selected.
SQL> select file_id,file_name from dba_temp_files;
?? FILE_ID FILE_NAME
---------- --------------------------------------------------
???????? 1 /u01/oradata/orcl/temp01.dbf
二 . Auxiliary 庫準(zhǔn)備工作:
由于我是在同一臺(tái)機(jī)器上做測試,所以將所有target庫相關(guān)的文件全部清除。
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
[oracle@rhel133 orcl]$ ls
control01.ctl? control02.ctl? control03.ctl? redo01.log? redo02.log? redo03.log? temp01.dbf
[oracle@rhel133 orcl]$ pwd
/u01/oradata/orcl
[oracle@rhel133 orcl]$ rm -rf *
[oracle@rhel133 orcl]$ cd /u02/oradata/orcl/
[oracle@rhel133 orcl]$ ls
DEALSPACE_001.dbf? DTSPACE_001.dbf? RCFSPACE_001.dbf? sysaux01.dbf? undotbs01.dbf
DEALSPACE_002.dbf? l5mspace01.dbf?? RCFSPACE_002.dbf? system01.dbf
[oracle@rhel133 orcl]$ rm *
[oracle@rhel133 dbs]$ ls
cntrlorcl.dbf? hc_orcl.dat? initorcl.ora? lkDUMMY? lkORCL? snapcf_orcl.f? spfileorcl.ora
[oracle@rhel133 dbs]$ rm *
1. 創(chuàng)建口令文件
[oracle@rhel133 dbs]$ orapwd file=?/dbs/orapworcl password=oracle
?
2. 創(chuàng)建相關(guān)的目錄
[oracle@rhel133 u01]$ mkdir oradata
[oracle@rhel133 oradata]$ pwd
/u01/oradata
3.
創(chuàng)建初始化參數(shù)
如果要恢復(fù)rman備份的spfile,數(shù)據(jù)庫必須先啟動(dòng)到mount狀態(tài),所以,得從其它的數(shù)據(jù)庫先找個(gè)臨時(shí)的pfile啟動(dòng)到mount狀態(tài),然后再通過rman來恢復(fù)rman備份的spfile.
[oracle@rhel133 dbs]$ export ORACLE_SID=orcl
[oracle@rhel133 dbs]$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on Tue Apr 9 15:01:01 2013
Copyright (c) 1982, 2007, Oracle.? All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
Oracle instance started
Total System Global Area??? 1224736768 bytes
Fixed Size???????????????????? 1266416 bytes
Variable Size??????????????? 683674896 bytes
Database Buffers???????????? 524288000 bytes
Redo Buffers????????????????? 15507456 bytes
RMAN> restore spfile to pfile '/u01/app/oracle/product/10201/dbs/initorcl.ora' from '/u03/RMAN/ORCL_spfile_0so6lccp_1_1_20130409';
Starting restore at 09-APR-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=541 devtype=DISK
channel ORA_DISK_1: autobackup found: /u03/RMAN/ORCL_spfile_0so6lccp_1_1_20130409
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 09-APR-13
4. 將用 pfile 將 Auxiliary 庫啟動(dòng)到 nomout 狀態(tài)
SQL>? startup nomount pfile=?/dbs/initorcl.ora
ORACLE instance started.
Total System Global Area 1325400064 bytes
Fixed Size????????????????? 1267236 bytes
Variable Size??????????? 1256196572 bytes
Database Buffers?????????? 52428800 bytes
Redo Buffers?????????????? 15507456 bytes
5.
恢復(fù)控制文件
RMAN> restore controlfile from '/u03/RMAN/auto_c_c-1230508166-20130409-04';
Starting restore at 09-APR-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=101 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
output filename=/u01/oradata/orcl/control01.ctl
output filename=/u01/oradata/orcl/control02.ctl
output filename=/u01/oradata/orcl/control03.ctl
Finished restore at 09-APR-13
6. 將 DB 啟動(dòng)到 mout 狀態(tài)
RMAN> alter database mount;
?
database mounted
released channel: ORA_DISK_1
7. restore 數(shù)據(jù)庫
?
因?yàn)槲覀兊穆窂讲煌晕覀冃枰褂胹et 命令轉(zhuǎn)換一下路徑。
?
注意,restore 的時(shí)候不會(huì)對temp 表空間進(jìn)行restore。所以等restore 之后,我們需要手工創(chuàng)建temp表空間。
RMAN> run
2> {
3> set newname for datafile 1 to "/u01/oradata/orcl/system01.dbf";
4> set newname for datafile 2 to "/u01/oradata/orcl/undotbs01.dbf";
5> set newname for datafile 3 to "/u01/oradata/orcl/sysaux01.dbf";
6> set newname for datafile 4 to "/u01/oradata/orcl/DEALSPACE_002.dbf";
7> set newname for datafile 5 to "/u01/oradata/orcl/DEALSPACE_001.dbf";
8> set newname for datafile 6 to "/u01/oradata/orcl/l5mspace01.dbf";
9> set newname for datafile 7 to "/u01/oradata/orcl/RCFSPACE_002.dbf";
10> set newname for datafile 8 to "/u01/oradata/orcl/RCFSPACE_001.dbf";
11> set newname for datafile 9 to "/u01/oradata/orcl/DTSPACE_001.dbf";
12> restore database;
13> switch datafile all;
14> }
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 09-APR-13
Starting implicit crosscheck backup at 09-APR-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=101 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=100 devtype=DISK
Crosschecked 12 objects
Finished implicit crosscheck backup at 09-APR-13
Starting implicit crosscheck copy at 09-APR-13
using channel ORA_DISK_1
using channel ORA_DISK_2
Finished implicit crosscheck copy at 09-APR-13
searching for all files in the recovery area
cataloging files...
no files cataloged
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/oradata/orcl/system01.dbf
restoring datafile 00002 to /u01/oradata/orcl/undotbs01.dbf
restoring datafile 00003 to /u01/oradata/orcl/sysaux01.dbf
restoring datafile 00004 to /u01/oradata/orcl/DEALSPACE_002.dbf
restoring datafile 00005 to /u01/oradata/orcl/DEALSPACE_001.dbf
restoring datafile 00006 to /u01/oradata/orcl/l5mspace01.dbf
restoring datafile 00007 to /u01/oradata/orcl/RCFSPACE_002.dbf
restoring datafile 00008 to /u01/oradata/orcl/RCFSPACE_001.dbf
restoring datafile 00009 to /u01/oradata/orcl/DTSPACE_001.dbf
channel ORA_DISK_1: reading from backup piece /u03/RMAN/db00ao6kq0u_10_1.bak
channel ORA_DISK_1: restored backup piece 1
piece handle=/u03/RMAN/db00ao6kq0u_10_1.bak tag=TAG20130409T091718
channel ORA_DISK_1: restore complete, elapsed time: 00:17:57
Finished restore at 09-APR-13
datafile 1 switched to datafile copy
input datafile copy recid=37 stamp=812304874 filename=/u01/oradata/orcl/system01.dbf
datafile 2 switched to datafile copy
input datafile copy recid=38 stamp=812304874 filename=/u01/oradata/orcl/undotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=39 stamp=812304874 filename=/u01/oradata/orcl/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=40 stamp=812304874 filename=/u01/oradata/orcl/DEALSPACE_002.dbf
datafile 5 switched to datafile copy
input datafile copy recid=41 stamp=812304874 filename=/u01/oradata/orcl/DEALSPACE_001.dbf
datafile 6 switched to datafile copy
input datafile copy recid=42 stamp=812304874 filename=/u01/oradata/orcl/l5mspace01.dbf
datafile 7 switched to datafile copy
input datafile copy recid=43 stamp=812304874 filename=/u01/oradata/orcl/RCFSPACE_002.dbf
datafile 8 switched to datafile copy
input datafile copy recid=44 stamp=812304874 filename=/u01/oradata/orcl/RCFSPACE_001.dbf
datafile 9 switched to datafile copy
input datafile copy recid=45 stamp=812304874 filename=/u01/oradata/orcl/DTSPACE_001.dbf
如果不需要更改文件目錄的話,
就簡單了
RMAN> restore database;
?
8. recover DB
RMAN> recover database;
Starting recover at 09-APR-13
using channel ORA_DISK_1
using channel ORA_DISK_2
starting media recovery
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_2: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=5
channel ORA_DISK_1: reading from backup piece /u03/RMAN/arch0fo6kr6t_15_1.bak
channel ORA_DISK_2: restoring archive log
archive log thread=1 sequence=6
channel ORA_DISK_2: reading from backup piece /u03/RMAN/arch0io6kr7a_18_1.bak
channel ORA_DISK_2: restored backup piece 1
piece handle=/u03/RMAN/arch0io6kr7a_18_1.bak tag=TAG20130409T093640
channel ORA_DISK_2: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: restored backup piece 1
piece handle=/u03/RMAN/arch0fo6kr6t_15_1.bak tag=TAG20130409T093640
channel ORA_DISK_1: restore complete, elapsed time: 00:00:04
archive log filename=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2013_04_09/o1_mf_1_5_8p7mmykf_.arc thread=1 sequence=5
channel default: deleting archive log(s)
archive log filename=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2013_04_09/o1_mf_1_5_8p7mmykf_.arc recid=17 stamp=812305026
archive log filename=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2013_04_09/o1_mf_1_6_8p7mmykb_.arc thread=1 sequence=6
unable to find archive log
archive log thread=1 sequence=1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 04/09/2013 16:17:20
RMAN-06054: media recovery requesting unknown log: thread 1 seq 1 lowscn 3524945668
RMAN> list backupset;
其中的這么一個(gè)archivelog的備份文件,/u03/RMAN/arch0io6kr7a_18_1.bak的最大SCN是3524945667,系統(tǒng)recover到這個(gè)文件后找不到下一次SCN,就會(huì)報(bào)這個(gè)錯(cuò),這是正常的,如不想出現(xiàn)這個(gè)錯(cuò)誤的話,則需要用recover database until scn 3524945667 來不完全恢復(fù)。
如需要全完恢復(fù),則需將備份之后產(chǎn)生的所有archivelog。
BS Key? Size?????? Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
14????? 2.00K????? DISK??????? 00:00:01???? 09-APR-13
??????? BP Key: 14?? Status: AVAILABLE? Compressed: YES? Tag: TAG20130409T093640
??????? Piece Name: /u03/RMAN/arch0io6kr7a_18_1.bak
? List of Archived Logs in backup set 14
? Thrd Seq???? Low SCN??? Low Time? Next SCN?? Next Time
? ---- ------- ---------- --------- ---------- ---------
? 1??? 6?????? 3524945662 09-APR-13 3524945667 09-APR-13
9.
用
open resetlogs
打開數(shù)據(jù)庫
RMAN> alter database open resetlogs;
database opened
在open resetlogs 之后,
自動(dòng)在原來默認(rèn)的路徑創(chuàng)建了
temp
表空間和
3
組
redo
文件。
?
如果恢復(fù)目錄和原來相同,就不用修改。
如果目錄不同,我們就需要把這些文件移到我們現(xiàn)在的 data 目錄。
?
10. ? NID 修改 DBID 和 DBNAME
SQL> select name,dbid from v$database;
NAME??????????? DBID
--------- ----------
ORCL????? 1230508166
?
幾點(diǎn)說明:
(1)在修改DBID期間仍然可能會(huì)遇到不可恢復(fù)的錯(cuò)誤。所以修改之前備份數(shù)據(jù)庫,特使是控制文件。因?yàn)閚id 會(huì)修改控制文件中的信息。
(2)需要將DB 啟動(dòng)到mount 狀態(tài)才能修改。
?
SQL> shutdown immediate
SQL> startup mount;
?
在執(zhí)行 NID 命令之前:一定要關(guān)閉所有的 session 連接。
????? nid 命令到執(zhí)行的最后會(huì)關(guān)閉數(shù)據(jù)庫,如果有session 連接,就會(huì)阻止這個(gè)操作,修改dbid就會(huì)被掛死。如果中斷這個(gè)操作。修改就會(huì)失敗,數(shù)據(jù)庫就不能mount。需要恢復(fù)。
?
( 1 )只改 DBID , 不改 db_name
?
[oracle@rhel133 orcl]$ nid target=sys/oracle
DBNEWID: Release 10.2.0.4.0 - Production on Tue Apr 9 16:48:51 2013
Copyright (c) 1982, 2007, Oracle.? All rights reserved.
Connected to database ORCL (DBID=1230508166)
Connected to server version 10.2.0
Control Files in database:
??? /u01/oradata/orcl/control01.ctl
??? /u01/oradata/orcl/control02.ctl
??? /u01/oradata/orcl/control03.ctl
Change database ID of database ORCL? (Y/[N]) => y
Proceeding with operation
Changing database ID from 1230508166 to 1340095604
??? Control File /u01/oradata/orcl/control01.ctl - modified
??? Control File /u01/oradata/orcl/control02.ctl - modified
??? Control File /u01/oradata/orcl/control03.ctl - modified
??? Datafile /u01/oradata/orcl/system01.dbf - dbid changed
??? Datafile /u01/oradata/orcl/undotbs01.dbf - dbid changed
??? Datafile /u01/oradata/orcl/sysaux01.dbf - dbid changed
??? Datafile /u01/oradata/orcl/DEALSPACE_002.dbf - dbid changed
??? Datafile /u01/oradata/orcl/DEALSPACE_001.dbf - dbid changed
??? Datafile /u01/oradata/orcl/l5mspace01.dbf - dbid changed
??? Datafile /u01/oradata/orcl/RCFSPACE_002.dbf - dbid changed
??? Datafile /u01/oradata/orcl/RCFSPACE_001.dbf - dbid changed
??? Datafile /u01/oradata/orcl/DTSPACE_001.dbf - dbid changed
??? Datafile /u01/oradata/orcl/temp01.dbf - dbid changed
??? Control File /u01/oradata/orcl/control01.ctl - dbid changed
??? Control File /u01/oradata/orcl/control02.ctl - dbid changed
??? Control File /u01/oradata/orcl/control03.ctl - dbid changed
??? Instance shut down
Database ID for database ORCL changed to 1340095604.
All previous backups and archived redo logs for this database are unusable.
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database ID.
DBNEWID - Completed succesfully.
SQL> startup
ORACLE instance started.
Total System Global Area 1325400064 bytes
Fixed Size????????????????? 1267236 bytes
Variable Size??????????? 1256196572 bytes
Database Buffers?????????? 52428800 bytes
Redo Buffers?????????????? 15507456 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
SQL> select name,dbid from v$database;
NAME??????????? DBID
--------- ----------
ORCL????? 1340095604
已成功更改dbid。
?
( 2 )修改 DBID 和 DB_NAME
?
注意一點(diǎn),修改 DB_NAME 之前,要將 spfile 創(chuàng)建成 pfile ,因?yàn)樾薷? dbname 之后,原來的參數(shù)文件就沒用了。 所以要保證最新的參數(shù)。 還有修改DB_NAME的值為最新值。 修改完之后,然后用這個(gè)新參數(shù)啟動(dòng)DB.
SQL> shutdown immediate
SQL> startup mount;
[oracle@rhel133 dbs]$ nid target=sys/oracle dbname=test64
DBNEWID: Release 10.2.0.4.0 - Production on Tue Apr 9 16:59:05 2013
Copyright (c) 1982, 2007, Oracle.? All rights reserved.
Connected to database ORCL (DBID=1340095604)
Connected to server version 10.2.0
Control Files in database:
??? /u01/oradata/orcl/control01.ctl
??? /u01/oradata/orcl/control02.ctl
??? /u01/oradata/orcl/control03.ctl
Change database ID and database name ORCL to TEST64? (Y/[N]) => yes
Proceeding with operation
Changing database ID from 1340095604 to 380502617
Changing database name from ORCL to TEST64
??? Control File /u01/oradata/orcl/control01.ctl - modified
??? Control File /u01/oradata/orcl/control02.ctl - modified
??? Control File /u01/oradata/orcl/control03.ctl - modified
??? Datafile /u01/oradata/orcl/system01.dbf - dbid changed, wrote new name
??? Datafile /u01/oradata/orcl/undotbs01.dbf - dbid changed, wrote new name
??? Datafile /u01/oradata/orcl/sysaux01.dbf - dbid changed, wrote new name
??? Datafile /u01/oradata/orcl/DEALSPACE_002.dbf - dbid changed, wrote new name
??? Datafile /u01/oradata/orcl/DEALSPACE_001.dbf - dbid changed, wrote new name
??? Datafile /u01/oradata/orcl/l5mspace01.dbf - dbid changed, wrote new name
??? Datafile /u01/oradata/orcl/RCFSPACE_002.dbf - dbid changed, wrote new name
??? Datafile /u01/oradata/orcl/RCFSPACE_001.dbf - dbid changed, wrote new name
??? Datafile /u01/oradata/orcl/DTSPACE_001.dbf - dbid changed, wrote new name
??? Datafile /u01/oradata/orcl/temp01.dbf - dbid changed, wrote new name
??? Control File /u01/oradata/orcl/control01.ctl - dbid changed, wrote new name
??? Control File /u01/oradata/orcl/control02.ctl - dbid changed, wrote new name
??? Control File /u01/oradata/orcl/control03.ctl - dbid changed, wrote new name
??? Instance shut down
Database name changed to TEST64.
Modify parameter file and generate a new password file before restarting.
Database ID for database TEST64 changed to 380502617.
All previous backups and archived redo logs for this database are unusable.
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.
[oracle@rhel133 dbs]$ vi initorcl.ora? 修改dbname為test64
[oracle@rhel133 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Apr 9 17:01:06 2013
Copyright (c) 1982, 2007, Oracle.? All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1325400064 bytes
Fixed Size????????????????? 1267236 bytes
Variable Size??????????? 1256196572 bytes
Database Buffers?????????? 52428800 bytes
Redo Buffers?????????????? 15507456 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
SQL>? select name,dbid from v$database;
NAME??????????? DBID
--------- ----------
TEST64???? 380502617
另外sid也可以在這個(gè)時(shí)候進(jìn)行修改:
?
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
