分类: Oracle
2011-08-12 13:58:53
备份数据库
--查找数据文件
SQL> select file_name from dba_data_files
2 ;
FILE_NAME
--------------------------------------------------------------------------------
/dr/tt/user.dbf
/dr/tt/aux1.dbf
/dr/tt/undo1.dbf
/dr/tt/sys1.dbf
--RMAN
run
{
copy current controlfile to '+DB/ABC/con.ctl' ;
copy datafile '/dr/tt/user.dbf' to '+DB/ABC/user.dbf' ;
copy datafile '/dr/tt/aux1.dbf' to '+DB/ABC/aux1.dbf' ;
copy datafile '/dr/tt/undo1.dbf' to '+DB/ABC/undo1.dbf' ;
copy datafile '/dr/tt/sys1.dbf' to '+DB/ABC/sys1.dbf' ;
sql 'alter system archive log current' ;
backup as copy format '/tmp/al_t%t_s%s_p%p' archivelog all ;
}
恢复数据库
--数据库mount
SQL>create pfile='/tmp/re.ora' from spfile;
tt1.__db_cache_size=75497472
tt1.__java_pool_size=4194304
tt1.__large_pool_size=4194304
tt1.__shared_pool_size=96468992
tt1.__streams_pool_size=0
*.audit_file_dest='/oracle/app/admin/tt/adump'
*.background_dump_dest='/oracle/app/admin/tt/bdump'
*.compatible='10.2.0.1.0'
*.cont