小编给大家分享一下数据库中数据文件不一致如何恢复,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!还原数据文件无法recover 成功的场景:1、数据库时在非归档的模式下运行:SQL>archiveloglistDatabaselogmodeNoArchiveModeAutom免费主机域名aticarchivalDisabledArchivedestination/u01/archivelogOldestonlinelogsequence1Currentlogsequence22、移动其中的一个数据文件,然后将其 offline,具体操作如下:colfile_namefora50;selectfile_name,ONLINE_STATUSfromdba_data_files;SQL>colfile_namefora50;SQL>selectfile_name,ONLINE_STATUSfromdba_data_files;FILE_NAMEONLINE_———————————————————/u01/app/oradata/orclpri/users01.dbfONLINE/u01/app/oradata/orclpri/undotbs01.dbfONLINE/u01/app/oradata/orclpri/sysaux01.dbfONLINE/u01/app/oradata/orclpri/system01.dbfSYSTEM/u01/app/oradata/orclpri/datafileep_scs_idx.dbfONLINE/u01/app/oradata/orclpri/bpep_scs.dbfONLINE/u01/bpep_caweb.dbfONLINE/u01/app/oradata/orclpri/bpep_caweb_idx.dbfONLINE/u01/app/oradata/orclpri/readonly01.dbfONLINE/u01/app/oradata/orclpri/readwrite01.dbfONLINE/u01/test.dbfONLINEFILE_NAMEONLINE_———————————————————/u01/app/oradata/orclpri/test2.dbfONLINE/u01/app/oradata/orclpri/test3.dbfONLINE我们还是以 test数据文件来做实验。先做 一个MV操作:SQL>!mv/u01/test.dbf/u02/然后将MV过之后的数据文件 offlineSQL>alterdatabasedatafile’/u01/test.dbf’offlinedrop;Databasealtered.切换日志文件:SQL>altersystemswitchlogfile;Systemaltered.多切换几次日志文件。关闭数据库:SQL>shutdownimmediate;Databaseclosed.Databasedismounted.ORACLEinstanceshutdown.将数据库启动到mount 状态:SQL>startupmount;ORACLEinstancestarted.TotalSystemGlobalArea849530880bytesFixedSize1339824bytesVariableSize566234704bytesDatabaseBuffers276824064bytesRedoBuffers5132288bytesDatabasemounted.将MV过的数据文件做rename 操作:SQL>alterdatabaserenamefile’/u01/test.dbf’to’/u02/test.dbf’;Databasealtered.将数据库打开:SQL>alterdatabaseopen;查看各个数据文件的状态:SQL>selectfile_name,ONLINE_STATUSfromdba_data_files;FILE_NAMEONLINE_———————————————————/u01/app/oradata/orclpri/users01.dbfONLINE/u01/app/oradata/orclpri/undotbs01.dbfONLINE/u01/app/oradata/orclpri/sysaux01.dbfONLINE/u01/app/oradata/orclpri/system01.dbfSYSTEM/u01/app/oradata/orclpri/datafileep_scs_idx.dbfONLINE/u01/app/oradata/orclpri/bpep_scs.dbfONLINE/u01/bpep_caweb.dbfONLINE/u01/app/oradata/orclpri/bpep_caweb_idx.dbfONLINE/u01/app/oradata/orclpri/readonly01.dbfONLINE/u01/app/oradata/orclpri/readwrite01.dbfONLINE/u02/test.dbfRECOVERFILE_NAMEONLINE_———————————————————/u01/app/oradata/orclpri/test2.dbfONLINE/u01/app/oradata/orclpri/test3.dbfONLINE将数据文件做 online 操作,会产生如下操作:SQL>alterdatabasedatafile’/u02/test.dbf’online;alterdatabasedatafile’/u02/test.dbf’online*ERRORatline1:ORA-01113:fi免费主机域名le11needsmediarecoveryORA-01110:datafile11:’/u02/test.dbf’尝试 做recover数据文件操作:SQL>recoverdatafile’/u02/test.dbf’;ORA-00279:change2684134generatedat12/04/201621:49:15neededforthread1ORA-00289:suggestion:/u01/archivelog/1_2_929742548.dbfORA-00280:change2684134forthread1isinsequence#2Specifylog:{
这篇文章主要介绍“分析PostgreSQL中的大表连接”,在日常操作中,相信很多人在分析PostgreSQL中的大表连接问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”分析PostgreSQL中的大表连接”的疑惑有所帮助!接下来,…