alter database create datafile
本實驗是在備份了控制檔案後新建立了一個表空間STRU,然後刪除了所有控制檔案,用備份的控制檔案代替後的恢復過程
在resetlogs開啟資料庫時報下面錯誤
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF'
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\EPORT_TAB_S01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\TS16K.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\TS01.DBF
C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\UNNAMED00009
9 rows selected.
SQL> alter database create datafile 'C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\UNNAMED00009' as 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\STRU.DBF';
Database altered.
SQL> recover database using backup controlfile;
ORA-00279: change 2413396 generated at 01/05/2018 09:10:32 needed for thread 1
ORA-00289: suggestion :
C:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2018_01_05\O1_MF_1_61_%
U_.ARC
ORA-00280: change 2413396 for thread 1 is in sequence #61
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
C:\app\Administrator\oradata\orcl\REDO01.LOG
Log applied.
Media recovery complete.
SQL> ALTER DATABASE OPEN RESETLOGS;
Database altered.
SQL> select *
2 from t1;
A
----------
11
12
13
SQL> select file_name
2 from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
C:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\EPORT_TAB_S01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\TS16K.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\TS01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\STRU.DBF
9 rows selected.
SQL> select *
2 from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC
---------- ---------- ---------- ---------- ---------- ---------- ---
STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------------- ------------- ------------ ------------ ------------
1 1 1 52428800 512 1 NO
CURRENT 2414015 05-JAN-18 2.8147E+14
2 1 0 52428800 512 1 YES
UNUSED 0 0
3 1 0 52428800 512 1 YES
UNUSED 0 0
SQL>
在resetlogs開啟資料庫時報下面錯誤
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF'
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\EPORT_TAB_S01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\TS16K.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\TS01.DBF
C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\UNNAMED00009
9 rows selected.
SQL> alter database create datafile 'C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\UNNAMED00009' as 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\STRU.DBF';
Database altered.
SQL> recover database using backup controlfile;
ORA-00279: change 2413396 generated at 01/05/2018 09:10:32 needed for thread 1
ORA-00289: suggestion :
C:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2018_01_05\O1_MF_1_61_%
U_.ARC
ORA-00280: change 2413396 for thread 1 is in sequence #61
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
C:\app\Administrator\oradata\orcl\REDO01.LOG
Log applied.
Media recovery complete.
SQL> ALTER DATABASE OPEN RESETLOGS;
Database altered.
SQL> select *
2 from t1;
A
----------
11
12
13
SQL> select file_name
2 from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
C:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\EPORT_TAB_S01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\TS16K.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\TS01.DBF
C:\APP\ADMINISTRATOR\ORADATA\ORCL\STRU.DBF
9 rows selected.
SQL> select *
2 from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC
---------- ---------- ---------- ---------- ---------- ---------- ---
STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------------- ------------- ------------ ------------ ------------
1 1 1 52428800 512 1 NO
CURRENT 2414015 05-JAN-18 2.8147E+14
2 1 0 52428800 512 1 YES
UNUSED 0 0
3 1 0 52428800 512 1 YES
UNUSED 0 0
SQL>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26870952/viewspace-2149728/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- alter database disable thread 2Databasethread
- ORA-01031 CREATE TRIGGER ON DATABASEDatabase
- ORA-279 signalled during: alter database recover logfileDatabase
- RMAN restore fails with ORA-01180: can not create datafile 1 (文件 ID 1265151.1)RESTAI
- 4.3.3 使用CREATE DATABASE語句建立CDBDatabase
- Oracle設定日誌引數-ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;OracleDatabase
- 2.4.1 使用 CREATE DATABASE 子句建立資料庫Database資料庫
- 【PDB】Oracle 建立pdb說明(create pluggable database)OracleDatabase
- create table,show tables,describe table,DROP TABLE,ALTER TABLE ,怎麼使用?
- 2.4 使用 CREATE DATABASE 語句建立資料庫Database資料庫
- 4、MySQL建立資料庫(CREATE DATABASE語句)MySql資料庫Database
- 4.3.4 使用CREATE DATABASE語句建立一個CDB:示例Database
- 執行alter database open resetlogs提示ORA-00392和ORA-00312錯誤Database
- 【SQL】14 UNION 操作符、SELECT INTO 語句、INSERT INTO SELECT 語句、CREATE DATABASE 語句、CREATE TABLE 語句SQLDatabase
- [重慶思莊每日技術分享]-ORA-1142 signalled during: ALTER DATABASE END BACKUPDatabase
- “alter database switchover to xx“過程不當導致的primary-primary 雙主問題Database
- RMAN-06214: Datafile Copy
- SQL__ALTERSQL
- MySQL ALTER命令MySql
- [20201103]set newname for datafile.txt
- mysql加快alter操作MySql
- ORA-19909: datafile 1 belongs to an orphan incarnation
- mysql的ALTER TABLE命令MySql
- alter table set unused column
- The database owner SID recorded in the master database differs from the database owner SID recorded in database 'DB_NAME'DatabaseAST
- create_singlethread_workqueue, create_workqueuethread
- 【SQL】16 SQL CREATE INDEX 語句、 撤銷索引、撤銷表以及撤銷資料庫、ALTER TABLE 語句、AUTO INCREMENT 欄位SQLIndex索引資料庫REM
- alter table move與shrink space
- ALTER SYSTEM FLUSH BUFFER_POOL
- alter table nologging /*+APPEND PARALLEL(n)*/APPParallel
- alter table drop unused columns checkpoint
- Oracle Database Cloud - Database as a Service Quick StartOracleDatabaseCloudUI
- Error querying database. XXXXXXXXXXXXX, No database selected。ErrorDatabase
- Convert a Physical Standby Database into a Snapshot Standby DatabaseDatabase
- 利用offline datafile檔案方式遷移資料
- Rename or Move a datafile In Oracle 19c RAC-20220117Oracle
- 如何獲取 alter 裡面的字串?字串
- 開心檔之MySQL ALTER命令MySql
- Database TimeoutDatabase