Announcements

Oracle training based on real-time expertise as per industry standards. Upcoming batch details are here.

View batch schedule

Free Oracle mock interview. Register using the link.

Register

#DBAchallenge: submit your questions.

Ask questions
Swipe for more →
Browse by Topic
Latest Posts

    Thursday, September 19, 2024

    Running SQL and O/S Commands Within RMAN

    Running SQL and O/S Commands Within RMAN

    Sometimes you may want to run an SQL statement from within RMAN. Use RMAN’s sql command to do this. For example:

    RMAN> sql "alter system switch logfile";

    If there are single quote marks in your SQL, you need to use two single quote marks as shown in this next example:

    RMAN> sql "alter database datafile ''/d0101/ordadta/brdstn/users_01.dbf'' offline";

    You can also run O/S commands using a similar technique with the host command:

    RMAN> host "ls";

    Some SQL commands, such as ALTER DATABASE, are directly supported by RMAN. These can be executed directly from the RMAN command prompt, without using the sql command. For example:

    RMAN> alter database mount;

    Note that the complete syntax of the SQL ALTER DATABASE command is not supported from within RMAN.

    No comments:

    Post a Comment

    🌟 Proud to be an Oracle ACE Pro! 🚀

    🌟 Proud to be an Oracle ACE Pro! 🚀 I’m excited to share my official Oracle ACE Profile with the Oracle community. 👨‍💻 Mallikarjun ...