对于每一个文件的 file.id and file.incarnation number,重命名文件别名 参考原文: Rename Alias of Datafile as Per file.id and file.incarnation number (Doc ID 1494661.1) 适用于: Oracle Database - Enterprise Edition - Version 11.2.0.0 and late
对于每一个文件的 file.id and file.incarnation number,重命名文件别名参考原文:
Rename Alias of Datafile as Per file.id and file.incarnation number (Doc ID 1494661.1)
适用于:
Oracle Database - Enterprise Edition - Version 11.2.0.0 and later
Information in this document applies to any platform.
目标:
对于每一个数据库命名来说,remove 数据文件的别名,并move他们到正确的目录。
方法:
1. 从控制文件中检查 当前的文件别名。
2. 从asmcmd中验证别名和omf文件名
3. 做一次数据库的全备
4.使表空间offline, 如果该表空间只有一个datafile,那么使这个datafile offline
5.使用rman 运行 set new filename的命令。
RESTORE TABLESPACE ikp;
SWITCH DATAFILE ALL
RECOVER TABLESPACE
6.确认控制文件是不是用新名字取代了别名。 使用rmalias 命令 从asmcmd remove 掉别名
做为一个可选的方法,你可以用sqlplus命令去rename datafile
症状:
asm file 和 别名
使用传输表空间,几个tablespace 附加带使用asm 的rac 数据库中。
在asm里边,实际的文件看似在错误的路径下,位于
而不是在原始的路径
需要move 文件到asm中的正确路径下,比如
变化:
当通过各种方法(asmcmd cp 或者 DBMS_FILE_TRANSFER)在asm级别 拷贝 datafile ,
假设你使用asmcmd cp 命令从文件系统 往 asm 里边 拷贝 o1_mf_dcs_83w90ymg_.dbf
ASMCMD>cp /tmp/o1_mf_dcs_83w90ymg_.dbf +DATA/ORASV3/DATAFILE/o1_mf_dcs_83w90ymg_.dbf
ASMCMD>pwd
+data/asm/datafile
ASMCMD> ls -a
+DATA/ORASV3/DATAFILE/o1_mf_dcs_83w90ymg_.dbf => o1_wf_dcs_83w90ymg_.dbf.350.792589015
The database show the datafile to be:
+DATA/ORASV3/DATAFILE/o1_mf_dcs_83w90ymg_.dbf
原因:
在上面的例子中,
ASMCMD> ls -a
+DATA/ORASV3/DATAFILE/o1_mf_dcs_83w90ymg_.dbf => o1_wf_dcs_83w90ymg_.dbf.350.792589015
+DATA/ORASV3/DATAFILE/o1_mf_dcs_83w90ymg_.dbf ------------ this is alias
o1_wf_dcs_83w90ymg_.dbf.350.792589015 -------------------- original file
不论何时,通过dbca 或者rman restore 创建dataifle,这些datafile 会被创建在正确的目录下---diskgroup name /database name/datafile
但是当文件是用过asmcmd cp 方式拷贝的,这些文件对于asm来说是未知的,给这些file一个身份。asm 给一个a file_id and incarnation_number
换句话说, 这是 在你选择作为数据文件的存放地(target) 建立了一个别名,
然后datafile的实际存放在+DATA/ASM/DATAFILE,比如 diskgroup name/ASM/datafile/filename.file_id.incarnation_number
在同一个磁盘组,我们只有alias。在同一个磁盘组中,我们不能move dataiile
如果你想move 在其他磁盘组中的 database ,请参考How to move ASM database files from one diskgroup to another ? (Doc ID 330103.1)
这一点在下面的连接中提到: in http://docs.oracle.com/cd/B28359_01/server.111/b31107/asmfiles.htm#i1023283
在asm中创建的每一个file,会获得一个 系统生成的filename,也就是fully qualified filename.
the fully qualified filename 代表一个 在asm file system 中的完全路径名。
一个 fully qualified filename 的例子为:
+dgroup2/sample/controlfile/Current.256.541956473
你可以使用 fully qualified filename 来引用(read or retrieve) 一个asm file
你可以使用其他简短的文件名格式,比如 alias ASM filename ,该alias ASM filename 描述为 "Alias ASM Filenames",来引用 一个asm file
根据 建立文件的请求,asm 来生成fully qualified filename。一个创建文件的请求不会 也不能 指定fully qualified filename
作为替代,使用更简单的语法指定一个file,比如一个别名(alias) 或者一个磁盘组名。
然后,asm 建立file,根据文件类型,把该file放置在正确的asm path下,然后指派一个 fully qualified filename
如果在创建文件请求中指定了alias,asm 也能创建alias,以便别名可以引用 fully qualified filename
asm 文件创建请求可以是单个文件建立, 或者是多个文件建立请求。
你可以用下面的查询来找到别名(输入关键字),这个查询需要在asm instance下去执行。
这里,我们使用'test'作为关键字。
SQL> select f.file_number, a.name , ('+' || g.name||'.'||f.file_number||'.'||f.
2 incarnation) asm_filename, f.type
3 from v$asm_diskgroup g, v$asm_file f , v$asm_alias a
4 where g.group_number=f.group_number
5 and g.group_number=a.group_number
6 and f.file_number=a.file_number
7 and a.name like '%test%'
8 order by f.file_number ;
FILE_NUMBER NAME ASM_FILENAME TYPE
----------- ------------------------------ ----------------------------------- --------------------
267 test.ctl +DATA1.267.790251625 CONTROLFILE
291 test.291.784665795 +DATA.291.784665795 DATAFILE
291 test +DATA.291.784665795 DATAFILE
296 test.dbf.296.790030721 +DATA.296.790030721 DATAFILE
296 test.dbf +DATA.296.790030721 DATAFILE
ASMCMD> pwd
+DATA/DATA/datafile
ASMCMD> ls -lt
Type Redund Striped Time Sys Name
N test => +DATA/ASM/DATAFILE/test.291.784665795>>>>>>>>>>>>>>
N test.dbf => +DATA/ASM/DATAFILE/test.dbf.296.790030721>>>>>>>>
DATAFILE UNPROT COARSE AUG 22 10:00:00 Y BIG1.316.791388381
DATAFILE UNPROT COARSE AUG 22 10:00:00 Y BIG2.313.791388437
DATAFILE UNPROT COARSE AUG 22 10:00:00 Y SYSAUX.257.779883619
DATAFILE UNPROT COARSE AUG 22 10:00:00 Y SYSTEM.256.779883617
DATAFILE UNPROT COARSE AUG 22 10:00:00 Y UNDOTBS1.258.779883619
DATAFILE UNPROT COARSE AUG 22 10:00:00 Y UNDOTBS2.261.779883897
DATAFILE UNPROT COARSE AUG 22 10:00:00 Y USERS.259.779883619
ASMCMD>

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Notepad++7.3.1
Easy-to-use and free code editor

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Zend Studio 13.0.1
Powerful PHP integrated development environment