In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you how Oracle ASM uses the cp command in asmcmd to perform remote replication. I hope you will get something after reading this article. Let's discuss it together.
Oracle ASM uses the cp command in asmcmd to perform remote replication
The syntax of the cp command is:
Cp src_file [--target target_type] [--service service_name] [--port port_num] [connect_str:] tgt_file
-- target target_type is used to specify the target type of instance to which the asmcmd command must connect to to perform a copy operation. Valid options are ASM,IOS or APX.
-- service service_name if the default value is not + ASM, it is used to specify the Oracle ASM instance name.
-- the default value of port port_num is 1521, which is used to specify the listening port
Connect_str is used to specify the connection string to the remote instance. Connect_str does not need to be specified for local instance replication. For remote instance replication, you must specify a connection string and prompt for a password. Its format is as follows:
User@host.SID
Both user,host and SID need to be specified. The default port is 1521, which can also be modified using the-- port option. Connection permissions (sysasm or sysdba) are determined by the-- privilege option when you start the asmcmd command.
The source file name to which the src_file is copied, which must be a full path file name or an Oracle ASM alias. When performing an asmcmd replication, Oracle ASM creates an OMF file such as:
Diskgroup/db_unique_name/file_type/file_name.#.#
Where db_unique_name is set to ASM,# as a number. During replication, the cp command creates a directory structure for the destination address and an alias for the OMF file that is actually created.
An alias for the destination file name or an alias directory name created by the tgt_file copy operation.
Note that the cp command cannot copy files between two remote instances. The local Oracle ASM instance must be a source or destination address when executing the cp command.
You can use the cp command to perform the following three replication operations:
1. Copy files from the disk group to the operating system
two。 Copy files from a disk group to a disk group
3. Copy files from the operating system to the disk group
Note that some files, such as OCR and SPFILE files, cannot be copied. To back up, copy, or move Oracle ASM SPFILE files, you can use the spbackup,spcopy or spmove command. In order to copy OCR backup files, the source address must be a disk group.
If the file is stored in an Oracle ASM disk group, the copy operation can be Little-Endian and Big-Endian. Orale ASM automatically converts the file format. It is possible to copy different byte order platforms between non-Oracle ASM files and Oracle ASM disk groups, and execute the command to convert the files after the copy is completed.
First show all the files in the + data/cs/datafile directory
ASMCMD [+ data/cs/datafile] > ls-ltType Redund Striped Time Sys NameDATAFILE UNPROT COARSE AUG 17 11:00:00 N jy01.dbf = > + DATA/cs/DATAFILE/JY.331.976296525DATAFILE UNPROT COARSE AUG 17 11:00:00 Y USERS.275.970601909DATAFILE UNPROT COARSE AUG 17 11:00:00 Y UNDOTBS2.284.970602381DATAFILE UNPROT COARSE AUG 17 11:00:00 Y UNDOTBS1.274.970601905DATAFILE UNPROT COARSE AUG 17 11:00:00 Y TEST.326.976211663DATAFILE UNPROT COARSE AUG 17 11:00:00 Y SYSTEM.272.970601831DATAFILE UNPROT COARSE AUG 17 11:00:00 Y SYSAUX.273.970601881DATAFILE UNPROT COARSE AUG 17 11:00:00 Y JY.331.976296525DATAFILE UNPROT COARSE MAR 12 18:00:00 Y USERS.261.970598319DATAFILE UNPROT COARSE MAR 12 18:00:00 Y UNDOTBS1.260.970598319DATAFILE UNPROT COARSE MAR 12 18:00:00 Y SYSTEM.258.970598233DATAFILE UNPROT COARSE MAR 12 18:00:00 Y SYSAUX.259.970598293
Copy the + data/cs/datafile/JY.331.976296525 file from the disk group to the operating system
ASMCMD [+] > cp + data/cs/datafile/JY.331.976296525 / home/grid/JY.bakcopying + data/cs/datafile/JY.331.976296525-> / home/grid/JY.bak
Copy files from the operating system to a disk group
ASMCMD [+] > cp / home/grid/JY.bak + data/cs/datafile/JY.bakcopying / home/grid/JY.bak-> + data/cs/datafile/JY.bakASMCMD [+] > ls-lt + data/cs/datafile/Type Redund Striped Time Sys NameDATAFILE UNPROT COARSE AUG 17 11:00:00 N jy01.dbf = > + DATA/cs/DATAFILE/JY.331.976296525DATAFILE UNPROT COARSE AUG 17 11:00:00 Y USERS.275.970601909DATAFILE UNPROT COARSE AUG 17 11: 00:00 Y UNDOTBS2.284.970602381DATAFILE UNPROT COARSE AUG 17 11:00:00 Y UNDOTBS1.274.970601905DATAFILE UNPROT COARSE AUG 17 11:00:00 Y TEST.326.976211663DATAFILE UNPROT COARSE AUG 17 11:00:00 Y SYSTEM.272.970601831DATAFILE UNPROT COARSE AUG 17 11:00:00 Y SYSAUX.273.970601881DATAFILE UNPROT COARSE AUG 17 11:00:00 N JY.bak = > + DATA/ASM/DATAFILE/JY.bak.453.984396007DATAFILE UNPROT COARSE AUG 17 11:00:00 Y JY .331.976296525DATAFILE UNPROT COARSE MAR 12 18:00:00 Y USERS.261.970598319DATAFILE UNPROT COARSE MAR 12 18:00:00 Y UNDOTBS1.260.970598319DATAFILE UNPROT COARSE MAR 12 18:00:00 Y SYSTEM.258.970598233DATAFILE UNPROT COARSE MAR 12 18:00:00 Y SYSAUX.259.970598293
Copy the + data/cs/datafile/JY.331.976296525 file from the disk group to the disk group of the remote ASM instance
ASMCMD [+] > cp + data/cs/datafile/JY.331.976296525 sys@10.138.130.175.+ASM1:+TEST/JY.bakEnter password: * copying + data/cs/datafile/JY.331.976296525-> 10.138.130.175:+TEST/JY.bakASMCMD [+ test] > ls-ltType Redund Striped Time Sys Name N rman_ Backup/ N arch/ Y JY/ Y DUP/ Y CS_DG/ Y ASM/DATAFILE MIRROR COARSE AUG 17 16:00:00 N JY.bak = > + TEST/ASM/DATAFILE/JY.bak.342.984413875
Copy the + data/cs/datafile/JY.331.976296525 file from the disk group to the operating system of the server where the remote ASM instance resides
ASMCMD [+] > cp + data/cs/datafile/JY.331.976296525 sys@10.138.130.175.+ASM1:/home/grid/JY.bakEnter password: * copying + data/cs/datafile/JY.331.976296525-> 10.138.130.175:/home/grid/JY.bak [grid@jytest1 ~] $ls-lrt-rw-r- 1 grid oinstall 104865792 Aug 17 16:21 JY.bak
Using the asmcmd cp command is more convenient than using dbms_file_transfer.
After reading this article, I believe you have some understanding of "how Oracle ASM uses the cp command in asmcmd to perform remote replication". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.