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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Spread Privacy
Spread Privacy
H
Hacker News: Front Page
PCI Perspectives
PCI Perspectives
Webroot Blog
Webroot Blog
罗磊的独立博客
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
Last Week in AI
Last Week in AI
美团技术团队
Help Net Security
Help Net Security
The Hacker News
The Hacker News
C
Cisco Blogs
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
The Register - Security
The Register - Security
IT之家
IT之家
WordPress大学
WordPress大学
Jina AI
Jina AI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Help Net Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
NISL@THU
NISL@THU
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
B
Blog
T
Tenable Blog
博客园 - 三生石上(FineUI控件)
T
The Exploit Database - CXSecurity.com
S
Security Affairs
小众软件
小众软件
Hacker News: Ask HN
Hacker News: Ask HN
Security Latest
Security Latest
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
W
WeLiveSecurity
A
Arctic Wolf
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence

博客园 - My Data Support

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