How to use the rman command in Oracle database
In this issue, the editor will bring you about how to use rman commands in Oracle database. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.
How to use common commands in Oracle database rman
Connect to rman
1. Connect to the target database (do not use the recovery directory)
[oracle@localhost~] $rmantargetevan/evan@oralifenocatalog
Connect to the target database at the rman prompt:
[oracle@localhost~] $rmannocatalogRMAN > connecttargetevan/evan@oralife
2 connect to the target database and the recovery catalog database
Rmantargetevan/evan@oralifecatalogrman/rman@rcat
Connect to the target database at the rman prompt:
[oracle@localhost~] $rmanRMAN > connecttargetevan/evan@oralifeRMAN > connectcatalogrman/rman@rcat
3 connect to the target database and the secondary database
Connect at the terminal.
Connect at the rman prompt.
Rman command
1. Stand-alone commands, such as: RMAN > shutdownimmediate,RMAN > backup...
two。 Job command
Commands that cannot be used in active commands:
CONNECTCONFIGURECREATECATALOG,DROPCATALOG,UPGRADECATALOGCREATESCRIPT,DELETESCRIPT,REPLACESCRIPTLISTREPORTrun block example: RMAN > RUN {...}
3. Run the sql command
Use sql
For example: RMAN > sql'altersystemswitchlogfile'
How to use common commands in Oracle database rman
4. Run the storage script
Create a storage script using the recovery directory. To run the storage script, you must run it within the run block, such as:
RMAN > run {executescripttest;}
5. Run the OS command
In rman, you must use the run block to run os commands, such as:
RMAN > run {host "ls-l/home";} Total 12drwx-26evanevan409608-1421:27evandrwx-10oracleoinstall409608-1420:58oraclehostcommandcomplete
6. Run a batch file
Example:
TestBat.bat:sql'altersystemswitchlogfile';backup. [oracle@localhost~] $rmantargetevan/evan@oralifenocatalog@/home/oracle/testBat.batlogtestlog.log
Log specifies the log file.
This is how to use the rman command in the Oracle database shared by the editor. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.