Add numChannels support

This commit is contained in:
2025-10-15 17:19:17 +01:00
parent 2fed2ded69
commit b71ca508ea
3 changed files with 57 additions and 7 deletions

View File

@@ -58,6 +58,8 @@ DB_FILE_NAME_CONVERT='SHED','SCLONE'
- `-s <sourcehost>` - Source host name (use when there are multiple databases with the same name on different hosts)
- `-t "YYYY-MM-DD HH:MM:SS"` - Recovery point timestamp (defaults to latest point-in-time)
- `-d` - Dry-run mode (shows mutation variables without executing)
- `-v` or `--verbose` - Enable verbose logging (prints INFO lines and debug context)
- `-c <numChannels>` - Optional: configure number of RMAN channels for the clone; when provided the script adds `"numChannels": <numChannels>` to the `config` block in the GraphQL variables
## Examples
@@ -159,6 +161,41 @@ When multiple databases with the same name exist on different hosts:
## Script Workflow
### Configuration (rsc.json)
The scripts read RSC credentials and endpoint details from `rsc.json` in the repository root. An example file `rsc.json.example` is included. The expected JSON fields are:
```
{
"client_id": "<your-client-id>",
"client_secret": "<your-client-secret>",
"access_token_uri": "https://<rsc-host>/api/client_token",
"name": "<optional-friendly-name>"
}
```
Security note: `rsc.json` is listed in `.gitignore`. Ensure the file permissions are restricted (recommended `chmod 600 rsc.json`). If `rsc.json` was accidentally committed to git, consider purging it from history.
### Examples
- Basic dry-run with verbose output:
```
./rsc_clone.sh -n SCLONE -o SHED_to_SCLONE.txt -h pve-ora19c-3 -d -v SHED
```
- Execute clone and request 4 RMAN channels:
```
./rsc_clone.sh -n SCLONE -o SHED_to_SCLONE.txt -h pve-ora19c-3 -c 4 SHED
```
- Trigger an on-demand log backup with verbose logging:
```
./rsc_log_backup.sh -v <dbName>
```
1. **Parameter Validation** - Validates required parameters and options file
2. **Database Discovery** - Locates source database in RSC
3. **Host Resolution** - Resolves target host ID in RSC