I was going through the script for a cold backup, and I saw the statement "select 'host cp '|| name ||' &dir' from v$datafile order by 1;" I want to know why we need to add 'host' before the cp command. Thanks in advance.

    Requires Free Membership to View

This script assumes that you will be running a SQL script from SQL*Plus, but you really want to perform an OS command. In this case, you will be using the Unix/Linux copy command, cp, to copy a file. In SQL*Plus, the "host" command will execute any OS command outside of SQL*Plus before returning control to the user.

This was first published in March 2006

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.