Hi,
Sometimes You can get “RMAN-06171: not connected to target database ” error.
Details of error are as follows.
RMAN-06171: not connected to target database
Cause: A command was issued but no connection to the target database has been established.
Action: Issue a CONNECT TARGET command to connect to the target database.
This error is related with the Database shutdown. If Database is stopped you can get this error during RMAN Backup and restore recover operation.
Check your database if it is open or not ?
Do you want to learn more details about RMAN, then read the following articles.
https://ittutorial.org/rman-backup-restore-and-recovery-tutorials-for-beginners-in-the-oracle-database/