rename備庫資料檔案
1、檢視資料庫角色
SYS@jyp>select db_unique_name,database_role from v$database;
DB_UNIQUE_NAME DATABASE_ROLE
------------------------------ ----------------
jyp PRIMARY
SYS@jzh>select db_unique_name,database_role from v$database;
DB_UNIQUE_NAME DATABASE_ROLE
------------------------------ ----------------
jzh PHYSICAL STANDBY
SYS@jyp>show parameter convert
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string /u01/oracle/oradata/jyp, /u01/
oracle/oradata/jzh
log_file_name_convert string /u01/oracle/oradata/jyp, /u01/
oracle/oradata/jzh
SYS@jyp>show parameter standby
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
standby_archive_dest string ?/dbs/arch
standby_file_management string AUTO
SYS@jyp>select name from v$dbfile;
NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/jyp/users01.dbf
/u01/oracle/oradata/jyp/undotbs01.dbf
/u01/oracle/oradata/jyp/sysaux01.dbf
/u01/oracle/oradata/jyp/system01.dbf
/u01/oracle/oradata/jyp/jzh01.dbf
2、建立測試表空間(資料檔案存放/software目錄下)
SYS@jyp>create tablespace test datafile '/software/test01.dbf' size 10m;
Tablespace created.
SYS@jyp>archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/oracle/arch
Oldest online log sequence 70
Next log sequence to archive 72
Current log sequence 72
SYS@jyp>alter system switch logfile;
System altered.
SYS@jyp>archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/oracle/arch
Oldest online log sequence 71
Next log sequence to archive 73
Current log sequence 73
3、檢視standby alert log
Media Recovery Log /u01/oracle/arch/1_72_867602649.arc
WARNING: File being created with same name as in Primary
Existing file may be overwritten
Errors in file /u01/oracle/diag/rdbms/jzh/jzh/trace/jzh_mrp0_11208.trc:
ORA-01119: error in creating database file '/software/test01.dbf'
ORA-27054: NFS file system where the file is created or resides is not mounted with correct options
Linux-x86_64 Error: 13: Permission denied
File #6 added to control file as 'UNNAMED00006'.---6號檔案在control file記錄UNNAMED00006
Originally created as:
'/software/test01.dbf'
Recovery was unable to create the file as:
'/software/test01.dbf'
Errors with log /u01/oracle/arch/1_72_867602649.arc
MRP0: Background Media Recovery terminated with error 1274
Errors in file /u01/oracle/diag/rdbms/jzh/jzh/trace/jzh_mrp0_11208.trc:
ORA-01274: cannot add datafile '/software/test01.dbf' - file could not be created
Recovery interrupted!
Recovered data files to a consistent state at change 981554
MRP0: Background Media Recovery process shutdown (jzh) ----mrp程式被shutdown
SYS@jzh>select name from v$dbfile;
NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/jzh/system01.dbf
/u01/oracle/oradata/jzh/sysaux01.dbf
/u01/oracle/oradata/jzh/undotbs01.dbf
/u01/oracle/oradata/jzh/users01.dbf
/u01/oracle/oradata/jzh/jzh01.dbf
/u01/oracle/product/11.2.0/db_1/dbs/UNNAMED00006-----資料檔案被建立在$ORACLE_HOME/dbs目錄下,並且命名為UNNAMED00006
6 rows selected.
4、在備庫rename資料檔案
SYS@jzh>alter system set standby_file_management=manual;
System altered.
SYS@jzh>alter database create datafile '/u01/oracle/product/11.2.0/db_1/dbs/UNNAMED00006' as '/u01/oracle/oradata/jzh/test01';
Database altered.
SYS@jzh>select name from v$dbfile;
NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/jzh/system01.dbf
/u01/oracle/oradata/jzh/sysaux01.dbf
/u01/oracle/oradata/jzh/undotbs01.dbf
/u01/oracle/oradata/jzh/users01.dbf
/u01/oracle/oradata/jzh/jzh01.dbf
/u01/oracle/oradata/jzh/test01
6 rows selected.
SYS@jzh>alter system set standby_file_management=auto;
System altered.
SYS@jzh>recover managed standby database disconnect from session;
Media recovery complete.
5、檢視standby alert log
at Sep 12 16:37:08 2015
ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=BOTH;
Sat Sep 12 16:37:25 2015
ALTER DATABASE RECOVER managed standby database disconnect from session
Attempt to start background Managed Standby Recovery process (jzh)
Sat Sep 12 16:37:25 2015
MRP0 started with pid=33, OS id=11451
MRP0: Background Managed Standby Recovery process started (jzh)----MRP程式啟動了。
SYS@jyp>select db_unique_name,database_role from v$database;
DB_UNIQUE_NAME DATABASE_ROLE
------------------------------ ----------------
jyp PRIMARY
SYS@jzh>select db_unique_name,database_role from v$database;
DB_UNIQUE_NAME DATABASE_ROLE
------------------------------ ----------------
jzh PHYSICAL STANDBY
SYS@jyp>show parameter convert
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string /u01/oracle/oradata/jyp, /u01/
oracle/oradata/jzh
log_file_name_convert string /u01/oracle/oradata/jyp, /u01/
oracle/oradata/jzh
SYS@jyp>show parameter standby
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
standby_archive_dest string ?/dbs/arch
standby_file_management string AUTO
SYS@jyp>select name from v$dbfile;
NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/jyp/users01.dbf
/u01/oracle/oradata/jyp/undotbs01.dbf
/u01/oracle/oradata/jyp/sysaux01.dbf
/u01/oracle/oradata/jyp/system01.dbf
/u01/oracle/oradata/jyp/jzh01.dbf
2、建立測試表空間(資料檔案存放/software目錄下)
SYS@jyp>create tablespace test datafile '/software/test01.dbf' size 10m;
Tablespace created.
SYS@jyp>archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/oracle/arch
Oldest online log sequence 70
Next log sequence to archive 72
Current log sequence 72
SYS@jyp>alter system switch logfile;
System altered.
SYS@jyp>archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/oracle/arch
Oldest online log sequence 71
Next log sequence to archive 73
Current log sequence 73
3、檢視standby alert log
Media Recovery Log /u01/oracle/arch/1_72_867602649.arc
WARNING: File being created with same name as in Primary
Existing file may be overwritten
Errors in file /u01/oracle/diag/rdbms/jzh/jzh/trace/jzh_mrp0_11208.trc:
ORA-01119: error in creating database file '/software/test01.dbf'
ORA-27054: NFS file system where the file is created or resides is not mounted with correct options
Linux-x86_64 Error: 13: Permission denied
File #6 added to control file as 'UNNAMED00006'.---6號檔案在control file記錄UNNAMED00006
Originally created as:
'/software/test01.dbf'
Recovery was unable to create the file as:
'/software/test01.dbf'
Errors with log /u01/oracle/arch/1_72_867602649.arc
MRP0: Background Media Recovery terminated with error 1274
Errors in file /u01/oracle/diag/rdbms/jzh/jzh/trace/jzh_mrp0_11208.trc:
ORA-01274: cannot add datafile '/software/test01.dbf' - file could not be created
Recovery interrupted!
Recovered data files to a consistent state at change 981554
MRP0: Background Media Recovery process shutdown (jzh) ----mrp程式被shutdown
SYS@jzh>select name from v$dbfile;
NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/jzh/system01.dbf
/u01/oracle/oradata/jzh/sysaux01.dbf
/u01/oracle/oradata/jzh/undotbs01.dbf
/u01/oracle/oradata/jzh/users01.dbf
/u01/oracle/oradata/jzh/jzh01.dbf
/u01/oracle/product/11.2.0/db_1/dbs/UNNAMED00006-----資料檔案被建立在$ORACLE_HOME/dbs目錄下,並且命名為UNNAMED00006
6 rows selected.
4、在備庫rename資料檔案
SYS@jzh>alter system set standby_file_management=manual;
System altered.
SYS@jzh>alter database create datafile '/u01/oracle/product/11.2.0/db_1/dbs/UNNAMED00006' as '/u01/oracle/oradata/jzh/test01';
Database altered.
SYS@jzh>select name from v$dbfile;
NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/jzh/system01.dbf
/u01/oracle/oradata/jzh/sysaux01.dbf
/u01/oracle/oradata/jzh/undotbs01.dbf
/u01/oracle/oradata/jzh/users01.dbf
/u01/oracle/oradata/jzh/jzh01.dbf
/u01/oracle/oradata/jzh/test01
6 rows selected.
SYS@jzh>alter system set standby_file_management=auto;
System altered.
SYS@jzh>recover managed standby database disconnect from session;
Media recovery complete.
5、檢視standby alert log
at Sep 12 16:37:08 2015
ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=BOTH;
Sat Sep 12 16:37:25 2015
ALTER DATABASE RECOVER managed standby database disconnect from session
Attempt to start background Managed Standby Recovery process (jzh)
Sat Sep 12 16:37:25 2015
MRP0 started with pid=33, OS id=11451
MRP0: Background Managed Standby Recovery process started (jzh)----MRP程式啟動了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10271187/viewspace-1798261/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 線上rename資料檔案Oracle
- oracle uncatalog資料庫備份檔案Oracle資料庫
- 把資料庫控制檔案備份到跟蹤檔案資料庫
- 還原sqlserver資料庫備份檔案.bak的檔案SQLServer資料庫
- Dedecms備份的資料檔案位置及備份資料庫的方法資料庫
- DG備庫手動管理 新增資料檔案
- SQL SERVER備份資料庫檔案(使用SSMS)SQLServer資料庫SSM
- dataguard備庫的資料檔案的遷移
- dataguard之物理備庫丟失資料檔案
- 建立資料庫檔案-日誌檔案-次要資料庫檔案資料庫
- Backup And Recovery User's Guide-備份資料庫-使用RMAN備份資料庫檔案GUIIDE資料庫
- 遠端備份資料庫和檔案的方法資料庫
- Oracle DG備庫手動管理新增資料檔案Oracle
- 使用備份的控制檔案恢復資料庫資料庫
- dataguard之邏輯備庫移動資料檔案
- 資料庫檔案和檔案組資料庫
- rman恢復資料庫--用備份的控制檔案資料庫
- dataguard備庫的資料檔案的遷移實戰
- 無處不在的Oracle資料庫控制檔案備份Oracle資料庫
- 如何恢復在全備後新增了資料檔案的資料庫資料庫
- MySql資料庫——檔案MySql資料庫
- SQL Server資料庫 bcp匯出備份檔案應用SQLServer資料庫
- 使用冷備份與冷備份後的資料庫歸檔日誌檔案進行資料庫不完整恢復資料庫
- RMAN備份資料檔案+控制檔案+歸檔日誌
- oracle資料庫移動資料檔案、日誌檔案和控制檔案Oracle資料庫
- 使用資料庫冷備份方式進行資料庫遷移,資料庫檔案遷移到不同的目錄資料庫
- 非歸檔資料庫RMAN備份資料庫
- oracle10g data guard(dg)__主庫重新命名資料檔案_在備庫上同步重新命名資料檔案Oracle
- 織夢資料庫配置檔案-DedeCMS織夢資料庫檔案在哪裡資料庫
- dataguard之主庫增加資料檔案--物理備庫相應的調整(一)
- Backup And Recovery User's Guide-備份資料庫-備份歸檔重做日誌檔案GUIIDE資料庫
- 通過資料庫檔案還原資料庫資料庫
- 資料庫系統檔案啟動資料庫資料庫
- 用rman建立dataguard備用資料庫繼續(無法找到備份檔案)資料庫
- 資料檔案實驗操作datafile的create/offline/drop/rename等操作
- 雲備份和同步檔案資料
- Oracle資料庫控制檔案在備份恢復中的作用Oracle資料庫
- Oracle 11.2.0.4.4 ADG 備庫資料檔案壞塊處理Oracle