ASMCMD - cp


ASMCMD> help cp
        cp


        Enables you to copy files between Oracle ASM disk
                 groups on local instances to and from remote instances.


        cp [--service ] [--port ] 
                [connect_str:]src_file [connect_str:]tgt_file


        The options for the cp command are described below.


        --service       - name of the ASM instance name if not default +ASM.
        --port          - Listener port number, default is 1521.
        connect_str     - The connection string for use with a remote instance 
                          copy.
        src_file        - Name of the source file to copy.
        tgt_file        - A user alias for the created target file name or 
                          alias directory name.


        cp cannot copy files between two remote instances. The local Oracle 
        ASM instance must be either the source or the target of the operation.


        You can use the cp command to:
                Copy files from a disk group to the operating system
                Copy files from a disk group to a disk group
                Copy files from the an OS File system to a disk group


        Some file types cannot be the source or destination of the cp command.
        These file types include OCR, OCR backup and SPFILE file types.


        To back up, copy, or move an ASM SPFILE, use the spbackup, spcopy,
        or spmove commands.


        connect_str is not required for a local instance copy, which is the 
        default case. In the case of a remote instance copy, you must specify 
        the connect string and Oracle ASM prompts for a password in a 
        non-echoing prompt. The connect_str is in the form of:
                user@host.SID
        user, host, and SID are required in the connect_str parameter. The 
        default port number is 1521.


        src_file must be either the fully qualified file name, the 
        system-generated name, or the Oracle ASM alias.


        The cp command performs a binary copy without any data transformation.


        The following are examples of the cp command. 
        The first example shows a copy of a file in the data disk group to a 
        file on the operating system. 
        The second example shows a copy of a file on the operating system to 
        the DATA disk group.
        The third and fourth example shows how to copy files from ASM to 
        remote server (OS file).
        The fifth example shows how to copy a remote OS File to DATA diskgroup.
        The sixth example shows how to copy a remote OS File to DATA diskgroup
        when listener port is not default. 
          sys           is the user name on the remote server
          server        is the remote server name
          asminstance   ASM Instance name
          /scratch/file OS file.


        If password is not provided in the command line, it will be asked.


ASMCMD [+] > cp +data/orcl/datafile/EXAMPLE.265.691577295 /mybackups/example.bak 
copying +data/orcl/datafile/EXAMPLE.265.691577295 -> /mybackups/example.bak
ASMCMD [+] > cp /mybackups/examples.bak +data/orcl/datafile/myexamples.bak 
copying /mybackups/examples.bak -> +data/orcl/datafile/myexamples.bak


ASMCMD [+] > cp +data/orcl/datafile/EXAMPLE.265.691577295 sys@server.asminstance:/scratch/file
ASMCMD [+] > cp +data/orcl/datafile/EXAMPLE.265.691577295 sys/passwd@server.asminstance:/scratch/file
ASMCMD [+] > cp sys@server.asminstance:/scratch/file +data/orcl/datafile/file
ASMCMD [+] > cp --port 2500 sys@server.SID:/scratch/file 
                                    +data/orcl/datafile/file
        copying /scratch/file -> +data/orcl/datafile/file

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29477587/viewspace-1162426/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29477587/viewspace-1162426/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值