使用asmcmd命令在本地和远程 asm 实例之间 拷贝asm file的方法 参考原文: How to Copy asm files between remote ASM instances using ASMCMD command (Doc ID 785580.1) 适用于: Oracle Database - Enterprise Edition - Version 11.1.0.6 to 11.2.0.2 [R
使用asmcmd命令在本地和远程 asm 实例之间 拷贝asm file的方法
参考原文:
How to Copy asm files between remote ASM instances using ASMCMD command (Doc ID 785580.1)
适用于:
Oracle Database - Enterprise Edition - Version 11.1.0.6 to 11.2.0.2 [Release 11.1 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 14-Jan-2011***
***Checked for relevance on 09-Jul-2014 ***
目标:
本文档的目的是提供使用asmcmd命令在本地实例和远程实例之间拷贝asm file的方法。
解决方案:
11g 有新特性--可以在本地和远程实例之间拷贝asm file
也可以用于 从asm 磁盘组拷贝文件到os
cp -ifr
user_name@host_name.
The user_name, host_name, and SID are required. The default port number is 1521.
--->注意,此处的sid是 asm实例的sid,不是数据库实例的sid
举例:
asmcmd>cp -ifr +DATA/RAC/PARAMETERFILE/spfile.257.678975489
sys@stgrac1.1521.+ASM2:+FRA/RAC/ARCHIVELOG/spfile
ASMCMD remote copy 的一些解释:
asmcmd remote copy 的运行需要通过监听器建立连接
asmcmd remote connection 可能由于一些错误导致连接失败。
ASMCMD-08202: internal error: [asmcmdshare_error_msg_05] [8201]
[8201] means unable to connect remote ASM Instance.
该错误的可能原因如下:
* not able to reach remote host. 不能连接远程主机
* Remote host listener is down. 远程监听器down掉
* Remote ASM Instance is not registered with listener and running non-default port. 远程asm实例没有注册到监听器中,并且监听器运行在非默认端口
* sysasm remote connection does not work. sysasm远程连接不工作
* Incorrect password given for sys user. sys 用户的错误密码
* Remote ASM Instance password file missing. 远程asm实例的 密码文件丢失
我们需要启用额外的tracing(跟踪),以得到asmcmd connection 失败的准确信息。
++设置 DBI_TRACE 环境变量,以便进行 asmcmd perl tracing
export DBI_TRACE=1
++现在使用asmcmd连接,并再现该问题:
Example 1:
--->例子开始
asmcmd>cp +data/spfileorcl.ora.289.686235413
sys@stgrac1.1521.+ASM1:+test
-> DBI->connect(dbi:Oracle:host=stgrac1;port=1521;sid=+ASM1, sys, ****, HASH (0x8b2b044))
connect using '(DESCRIPTION=(ADDRESS=(HOST=stgrac1)(PROTOCOL=tcp)(PORT=1521))(CONNECT_DATA=(SID=+ASM1)))'
ERROR: '1031' 'ORA-01031: insufficient privileges
(DBD ERROR: OCISessionBegin)'
DBI connect('host=stgrac1;port=1521;sid=+ASM1','sys',...) failed: ORA-01031: insufficient privileges (DBD ERROR: OCISessionBegin)
KK FROM HERE A
ASMCMD-08202: internal error: [asmcmdshare_error_msg_05] [8201]
--->例子结束
可以看到由于ORA-01031错误,asmcmd 拷贝文件失败。
如果-a选项不使用的话,asmcmd 默认使用sysasm 权限。
这里的问题是:远程的asm实例中,sysasm 权限没有被授予sys user
把sysasm权限给sys用户。当你授予系统权限时,密码文件会被更新。
SQL> grant sysasm to sys;
Grant succeeded.
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS TRUE TRUE TRUE
现在,远程asm 拷贝能正常工作了。
关于更多细节,请参考下面的文章:
Note.730067.1 - Troubleshooting ORA-1031 Insufficient Privilege
Note.578796.1 - ORA-01031 While Connecting as SYSASM
Example 2:
ASMCMD> cp -ifr thread_2_seq_5.264.678983423
sys@bderac2-vip.1521.+ASM2:+FRA/RAC/ARCHIVELOG/
Enter password: ***
ASMCMD-08016: copy source->'+FRA/RAC/ARCHIVELOG/2009_02_16/thread_2_seq_5.264.678983423' and target->'+FRA/RAC/ARCHIVELOG/thread_2_seq_5.264.678983423' failed
ORA-17628: Oracle error 19505 returned by remote Oracle server
ORA-06512: at "SYS.X$DBMS_DISKGROUP", line 258
ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute)
ASMCMD>
cp命令失败的原因是:
目标的asm file 名字没有指定, 或者 文件名字不应该包括file number/incarnation.
--->注意,我对本句的翻译有点疑问,
原文为The cp command failed because the target ASM file name was not specified or File name should not contain the file number/incarnation
不指定文件名字,我们不能拷贝omf 命名格式的文件。
cp -ifr thread_2_seq_5.264.678983423 sys@bderac2-vip.1521.+ASM2:+FRA/RAC/ARCHIVELOG/thread_2_seq_5
The file number/incarnation 会在拷贝的过程中被自动创建.

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

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools