生成RMAN rename写法脚本
2016-06-26 19:02
309 查看
select 'set newname for datafile ' || x.FILE# || ' to ' || new_file_Location || substr(x.NAME,instr(x.name,'/',-1)+1 ,length(x.name)-instr(x.name,'/',-1)) from v$datafile x,(select &new_loc new_file_Location from dual);
实验一下
<pre code_snippet_id="1730831" snippet_file_name="blog_20160626_1_5099860" name="code" class="sql">SQL> select 'set newname for datafile ' || x.FILE# || ' to ' || 2 new_file_Location || substr(x.NAME,instr(x.name,'/',-1)+1 ,length(x.name)-instr(x.name,'/',-1)) 3 from v$datafile x,(select &new_loc new_file_Location from dual); Enter value for new_loc: '/home/oracle/' old 3: from v$datafile x,(select &new_loc new_file_Location from dual) new 3: from v$datafile x,(select '/home/oracle/' new_file_Location from dual) 'SETNEWNAMEFORDATAFILE'||X.FILE#||'TO'||NEW_FILE_LOCATION||SUBSTR(X.NAME,INSTR(X.NAME,'/',-1)+1,LENGTH(X.NAME)-INSTR(X.NAME,'/',-1)) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- set newname for datafile 1 to /home/oracle/system01.dbf set newname for datafile 2 to /home/oracle/sysaux01.dbf set newname for datafile 3 to /home/oracle/undotbs01.dbf set newname for datafile 4 to /home/oracle/users01.dbf set newname for datafile 5 to /home/oracle/example01.dbf
相关文章推荐
- Final和Final
- UIView不重载init的问题
- 委托 Action系统无返回值委托 Func有返回委托
- PHP错误管理
- 20612统计八连块
- HI3520D 音频
- 解释器模式(Interpreter)
- js confirm()方法的用法
- Python学习(4)
- Android-PullToRefresh的用法 及源码中你应该知道的一些东西
- PHP Kohana入门体验教程
- 15.4
- chardet demo
- Python学习(2)
- JavaScript设计模式与开发实践 - 观察者模式
- CTC学习笔记(二) 训练和公式推导
- sql自动生成model的模块
- Python学习(2)
- 好用的ProgressBar 和播放动画的Dialog使用
- 二维数组