惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - My Data Support

Oracle性能优化精品资料集锦---从事Oracle十余年DBA倾力奉献 - My Data Support ORACLE版本说明 - My Data Support ORACLE KILL回话 MOS文章分类整理 如何在 SQL Server 2005 实例之间传输登录和密码 动态修改MYSQL配置参数 只导出表结构的SQL语句 查询大字段对象脚本 BMC监控的一个坑 如何清理监听日志 - My Data Support RMAN基于时间点的恢复 - My Data Support RAC一个节点添加本地监听地址 ORACLE坏块检查 远程访问数据库查询数据量一大就Hang - My Data Support 什么时候会刷新备库控制文件refresh the standby database control file? Why AIXTHREAD_SCOPE Should Be Set To 'S' On AIX 在一个RAC集群中最多支持多少节点 - My Data Support Database name和SID Oracle Semaphore Management in UNIX Administration - My Data Support
RAC环境下创建本地数据文件的解决方法
My Data Supp · 2017-03-27 · via 博客园 - My Data Support

引用收藏:http://blog.itpub.net/501889/viewspace-1083311/ 

同事不小心,在RAC环境下创建了本地数据文件,这个肯定会出问题的,节点2不能访问此数据文件。其实发现做错了,立马删掉应该没有问题。数据文件还没有数据。

下面演示一下错误的解决方法,思路就是,把本地文件COPY到共享磁盘中(ASM),在rename即可。

点击(此处)折叠或打开

  1. SQL> alter tablespace USERS add datafile '/home/oracle/user01.dbf' size 10m;//创建错误过程

  2. Tablespace altered.

  3. SQL> alter database datafile 8 offline;

  4. Database altered.

  5. SQL> 
  6. SQL> 
  7. SQL> 
  8. SQL> exit
  9. Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.- 64bit Production
  10. With the Partitioning, Real Application Clusters, OLAP, Data Mining
  11. and Real Application Testing options
  12. oracle@zbdb1:~/product/10.2.0/db_1/bin> rman target /

  13. Recovery Manager: Release 10.2.0.4.- Production on Tue Feb 18 16:17:54 2014

  14. Copyright (c) 1982, 2007, Oracle. All rights reserved.


  15. connected to target database: QT0000J2 (DBID=3109660417)

  16. RMAN> 
  17. RMAN> 

  18. RMAN> 

  19. RMAN> 

  20. RMAN> copy datafile '/home/oracle/user01.dbf' to '+RACDG';

  21. Starting backup at 18-FEB-14
  22. using target database control file instead of recovery catalog
  23. allocated channel: ORA_DISK_1
  24. channel ORA_DISK_1: sid=1060 instance=qt0000j21 devtype=DISK
  25. channel ORA_DISK_1: starting datafile copy
  26. input datafile fno=00008 name=/home/oracle/user01.dbf
  27. output filename=+RACDG/qt0000j2/datafile/users.270.839866683 tag=TAG20140218T161802 recid=1 stamp=839866682
  28. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
  29. Finished backup at 18-FEB-14

  30. RMAN> exit


  31. Recovery Manager complete.
  32. oracle@zbdb1:~/product/10.2.0/db_1/bin> sqlplus / as sysdba;

  33. SQL*Plus: Release 10.2.0.4.- Production on Tue Feb 18 16:19:02 2014

  34. Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


  35. Connected to:
  36. Oracle Database 10g Enterprise Edition Release 10.2.0.4.- 64bit Production
  37. With the Partitioning, Real Application Clusters, OLAP, Data Mining
  38. and Real Application Testing options

  39. SQL> 
  40. SQL> 
  41. SQL> alter database rename file '/home/oracle/user01.dbf' to '+RACDG/qt0000j2/datafile/users.270.839866683'; 

  42. Database altered.

  43. SQL> 
  44. SQL> 
  45. SQL> 
  46. SQL> select name from v$datafiles;
  47. select name from v$datafiles
  48.                  *
  49. ERROR at line 1:
  50. ORA-00942: table or view does not exist


  51. SQL> select name from v$datafile;

  52. NAME
  53. --------------------------------------------------------------------------------
  54. +RACDG/qt0000j2/datafile/system.259.730655367
  55. +RACDG/qt0000j2/datafile/undotbs1.260.730655371
  56. +RACDG/qt0000j2/datafile/sysaux.261.730655371
  57. +RACDG/qt0000j2/datafile/undotbs2.263.730655377
  58. +RACDG/qt0000j2/datafile/users.264.730655377
  59. +RACDG/qt0000j2/datafile/ciimss_ts.268.733087301
  60. +RACDG/qt0000j2/datafile/ciimss_idx_ts.269.733087365
  61. +RACDG/qt0000j2/datafile/users.270.839866683

  62. rows selected.

  63. SQL> select file_name,file_id,ONLINE_STATUS from dba_data_files;

  64. +RACDG/qt0000j2/datafile/users.270.839866683     8 RECOVER

  65. SQL> recover datafile 8;
  66. ORA-00279: change 225618407 generated at 02/18/2014 16:17:27 needed for thread
  67. 1
  68. ORA-00289: suggestion :
  69. /home/oracle/product/10.2.0/db_1/dbs/arch1_2667_730655361.dbf
  70. ORA-00280: change 225618407 for thread 1 is in sequence #2667


  71. Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
  72. auto
  73. Log applied.
  74. Media recovery complete.
  75. SQL> select file_name,file_id,ONLINE_STATUS from dba_data_files;
  76. +RACDG/qt0000j2/datafile/users.270.839866683     8 OFFLINE

  77.  SQL> alter database datafile \'+RACDG/qt0000j2/datafile/users.270.839866683\' online;