Skip to content

Commit 96bccc3

Browse files
authored
Update README.md
1 parent b609f16 commit 96bccc3

File tree

1 file changed

+81
-90
lines changed

1 file changed

+81
-90
lines changed

python/fa_pg_ora_snap_remote/README.md

Lines changed: 81 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This Python code imports the [fa_pg_ora_snap.py](../fa_pg_ora_snap/) code.
2121
-r replicate the snapshot to the targets specified in the source protection group (optional)\
2222
-o startup mode of the target database (OPEN, MOUNTED, STARTED or DOWN)\
2323
-b use oracle backup mode (optional - defaults to no)
24-
-i ignore tag (optional - see below)\
24+
-i ignore tag (override established source/target volume pairing for cloning - see fa_pg_ora_snap.py for more details)\
2525
-x execute lock - if this is NOT set, no destructive actions will be taken. Instead, the script will simply tell you would it would do. This may prove useful to make sure you have all the settings right before you overwrite a target protection group.\
2626
Note - many database parameters must be specified in the JSON file - see below:
2727

@@ -35,10 +35,29 @@ Note - many database parameters must be specified in the JSON file - see below:
3535
* tgt_protection_group - Pure Flash Array protection group that includes all ASM disks in the target database (optional - if cloning database).
3636
* rescan_scsi_bus - how to scan for new ASM disks (two examples are included in the repository)
3737
* oracle_target_mode - requested state of cloned database (OPEN, DOWN, STARTED or MOUNTED) - overriden by the command line option
38+
39+
* def_user_oracle - default oracle username is no other provided
40+
* def_passwd_oracle - default oracle password is no other provided
41+
* def_user_grid - default grid username is no other provide. defaults to oracle
42+
* def_passwd_grid - default grid password is no other provide.
43+
* def_asm - default ASM instance on the target host
44+
* def_port - default ssh port
45+
* def_cs_db - default connect string for the target database instance
46+
* def_cs_asm - default connect string for the target ASM instance
47+
48+
* ora_src_usr - source database username
49+
* ora_src_pwd - source database password
50+
* ora_src_cs - source database connect string
51+
* ora_backup_mode - whether to use Oracle backup mode - overriden by command line option
52+
53+
* tgt_host - target host to start cloned database on
54+
* tgt_db - target database name
55+
* tgt_user_grid - target account username that owns ASM/Grid Infrastructure
56+
* tgt_pass_grid - target account password that owns ASM/Grid Infrastructure
57+
* tgt_sid - target SID to mount the clone
58+
3859
* local_listener - the listener the target database is to register with
3960
* db_unique_name - the db_unique_name setting of the cloned database
40-
* ora_backup_mode - whether to use Oracle backup mode - overriden by command line option
41-
*
4261

4362
# Notes:
4463

@@ -55,149 +74,121 @@ Tags also include the database ID, database name, if the database was in backup
5574

5675
# A Worked Example
5776

58-
In the example below, the database SWINGPRD running on a different Linux server has its ASM diskgroups in a Pure Flash Array protection group called gct-oradb-demo-prd01-pg\
59-
The code will snapshot that protection group, and then overwrite volumes on the local Linux server, where Oracle is also installed. The code will then start the cloned ASM diskgroups, mount the cloned database and open it read-write.
77+
In the example below, the database SWINGDB is running on Linux server rdmudev01. It has its ASM diskgroups in a Pure Flash Array protection group called gct-oradb-rdmudev01-pg\
78+
The code will place the source database into backup mode, snapshot that protection group, and then overwrite correspodning volumes on Linux server rdmudev02, where Oracle is also installed. The code will then mount the cloned ASM diskgroups on rdmudev02, mount the cloned database and open it read-write.\
79+
All of this is exeuted remotely from a scripting host.\
6080

6181

6282
```
63-
[oracle@gct-oradb-demo-dev01 py]$ python fa_pg_ora_snap.py -f ora_prd01_2_dev01.json -n dec052338 -b -o open -x
83+
$ python fa_pg_ora_snap_remote.py -f rdmudev01_2_rdmudev02_remote.json -n dec161217 -x -b -o open
6484
============
65-
fa_pg_ora_snap.py 1.9.0 started at 2025-12-05 23:38:03.169537
85+
fa_pg_ora_snap_remote.py 1.9.0 started at 2025-12-16 12:17:50.416204
6686
============
6787
connecting to Flash Array:sn1-x90r2-f06-27.puretec.purestorage.com
6888
connected
6989
============
70-
determining if snapshot dec052338 exists for source pg:gct-oradb-demo-prd01-pg
71-
source protection group:gct-oradb-demo-prd01-pg
72-
target protection group:gct-oradb-demo-dev01-pg
90+
determining if snapshot dec161217 exists for protection group:gct-oradb-rdmudev01-pg
91+
source protection group:gct-oradb-rdmudev01-pg
92+
target protection group:gct-oradb-rdmudev02-pg
7393
============
74-
setting local oracle sid and home
75-
============
76-
connecting to source database:gct-oradb-demo-prd01:1521/SJC
94+
connecting to source database:gct-oradb-rdmudev01:1521/swingdb
7795
use backup mode:True
7896
============
7997
reading source database settings
98+
asm diskgroups: SWINGDATA
8099
database name: SWINGDB
81100
database id: 4017528888
82-
database time: 2025/12/05 23:38:03
83-
database unique name: SJC
101+
database time: 2025/12/16 12:17:50
102+
database open mode: READ WRITE
84103
database role: PRIMARY
104+
encrypted tablespaces: 0
85105
archivelog mode: ARCHIVELOG
86106
flashback mode: NO
87-
encrypted tablespaces: 0
88107
platform name: Linux x86 64-bit
89108
version: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production,Version 19.22.0.0.0
90-
control_files: +DATA/SWINGDB/CONTROLFILE/current.266.1201708985, +FRA/SJC/CONTROLFILE/current.256.1218830433
91-
db_recovery_file_dest: +FRA
92-
db_recovery_file_dest_size: 34359738368
109+
control_files: +SWINGDATA/SWINGDB/CONTROLFILE/current.266.1201708985, +SWINGDATA/SWINGDB/CONTROLFILE/current.265.1201708985
110+
db_recovery_file_dest: /nfsmnt/oradb/recovery/gct-oradb-rdmudev01/swingprd
111+
db_recovery_file_dest_size: 107374182400
93112
enable_pluggable_database: FALSE
94113
============
95114
source db begin backup mode
96115
============
97-
creating snapshot for gct-oradb-demo-prd01-pg
116+
creating snapshot for gct-oradb-rdmudev01-pg
98117
============
99118
source db end backup mode
100119
============
101-
querying the volumes for protection group:gct-oradb-demo-prd01-pg
102-
gct-oradb-demo-prd01-data-00
103-
gct-oradb-demo-prd01-data-01
104-
gct-oradb-demo-prd01-fra-00
105-
gct-oradb-demo-prd01-fra-01
120+
querying the volumes for protection group:gct-oradb-rdmudev01-pg
121+
gct-oradb-rdmudev01-00
122+
gct-oradb-rdmudev01-01
106123
============
107124
tagging the snapshot: key:db_name val:SWINGDB
108125
tagging the snapshot: key:db_id val:4017528888
109-
tagging the snapshot: key:db_time val:2025/12/05 23:38:03
110-
tagging the snapshot: key:db_unique_name val:SJC
126+
tagging the snapshot: key:db_time val:2025/12/16 12:17:50
127+
tagging the snapshot: key:db_unique_name val:SWINGDB
111128
tagging the snapshot: key:db_role val:PRIMARY
129+
tagging the snapshot: key:db_open_mode val:READ WRITE
112130
tagging the snapshot: key:archivelog_mode val:ARCHIVELOG
113131
tagging the snapshot: key:flashback_mode val:NO
114132
tagging the snapshot: key:platform_name val:Linux x86 64-bit
115133
tagging the snapshot: key:encrypted_tablespaces val:0
116134
tagging the snapshot: key:version val:Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production,Version 19.22.0.0.0
117135
tagging the snapshot: key:backup_mode val:Yes
118-
tagging the snapshot: key:control_files val:+DATA/SWINGDB/CONTROLFILE/current.266.1201708985, +FRA/SJC/CONTROLFILE/current.256.1218830433
119-
tagging the snapshot: key:db_recovery_file_dest val:+FRA
120-
tagging the snapshot: key:db_recovery_file_dest_size val:34359738368
136+
tagging the snapshot: key:control_files val:+SWINGDATA/SWINGDB/CONTROLFILE/current.266.1201708985, +SWINGDATA/SWINGDB/CONTROLFILE/current.265.1201708985
137+
tagging the snapshot: key:db_recovery_file_dest val:/nfsmnt/oradb/recovery/gct-oradb-rdmudev01/swingprd
138+
tagging the snapshot: key:db_recovery_file_dest_size val:107374182400
121139
tagging the snapshot: key:enable_pluggable_database val:FALSE
122-
tagging the snapshot: key:asm_disk_group val:DATA,FRA
140+
tagging the snapshot: key:asm_disk_groups val:SWINGDATA
141+
tagging the snapshot: key:open_pdbs val:Not Defined
123142
============
124143
excluded volumes
125144
============
126-
listing the volumes for snapshot:dec052338
127-
name:gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-data-00 size:120.0 GB
128-
name:gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-data-01 size:120.0 GB
129-
name:gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-fra-00 size:40.0 GB
130-
name:gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-fra-01 size:40.0 GB
145+
listing the volumes for snapshot:dec161217
146+
name:gct-oradb-rdmudev01-pg.dec161217.gct-oradb-rdmudev01-00 size:74.0 GB
147+
name:gct-oradb-rdmudev01-pg.dec161217.gct-oradb-rdmudev01-01 size:74.0 GB
131148
============
132-
determining if target instance swingdev is running
133-
target instance is not running
149+
checking target instance swingdev on host gct-oradb-rdmudev02 is down
134150
============
135-
determining if target ASM diskgroups are mounted
136-
ASM diskgroup DATA is not mounted on target
137-
ASM diskgroup FRA is not mounted on target
151+
checking target ASM diskgroups are unmounted: SWINGDATA
138152
============
139-
querying the volumes for protection group:gct-oradb-demo-dev01-pg
140-
gct-oradb-demo-dev01-data-00
141-
gct-oradb-demo-dev01-data-01
142-
gct-oradb-demo-dev01-fra-00
143-
gct-oradb-demo-dev01-fra-01
153+
querying the volumes for protection group:gct-oradb-rdmudev02-pg
154+
gct-oradb-rdmudev02-00
155+
gct-oradb-rdmudev02-01
144156
============
145157
querying target volume details
146-
name:gct-oradb-demo-dev01-data-00 id:a67641ac-9a36-c375-baf1-298c8a98ffe5 size:120.0
147-
is a target for gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-data-00 size:120.0 GB
148-
name:gct-oradb-demo-dev01-data-01 id:ee320b80-0bec-5a70-5032-87565859e10f size:120.0
149-
is a target for gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-data-01 size:120.0 GB
150-
name:gct-oradb-demo-dev01-fra-00 id:173bdf4e-5d71-c89d-8e00-9746337999da size:40.0
151-
is a target for gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-fra-00 size:40.0 GB
152-
name:gct-oradb-demo-dev01-fra-01 id:d2680577-4c5f-f094-0a92-98f01e85c7a8 size:40.0
153-
is a target for gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-fra-01 size:40.0 GB
158+
name:gct-oradb-rdmudev02-00 id:9cbf36fe-55c3-acde-33be-bf54ac681b57 size:74.0
159+
is a target for gct-oradb-rdmudev01-pg.dec161217.gct-oradb-rdmudev01-00 size:74.0 GB
160+
name:gct-oradb-rdmudev02-01 id:0cbbb69f-f846-c0e9-81eb-b39ad669e0d3 size:74.0
161+
is a target for gct-oradb-rdmudev01-pg.dec161217.gct-oradb-rdmudev01-01 size:74.0 GB
154162
============
155163
determining volume mapping
156-
nm:gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-data-00 src id:a5abc4c3-f199-c026-7c97-a2468e4b5fda map:0 sz:120.0
157-
checking for tag matched volume
158-
volume gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-data-00 will be synced to gct-oradb-demo-dev01-data-00
159-
nm:gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-data-01 src id:6c2937de-c30e-dde0-9613-fb15a06966b3 map:0 sz:120.0
164+
nm:gct-oradb-rdmudev01-pg.dec161217.gct-oradb-rdmudev01-00 src id:f6e6c606-c82a-947f-69b4-9f92775a8d51 map:0 sz:74.0
160165
checking for tag matched volume
161-
volume gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-data-01 will be synced to gct-oradb-demo-dev01-data-01
162-
nm:gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-fra-00 src id:cbda1d30-1313-4b3e-df61-f1fa35957ac3 map:0 sz:40.0
166+
volume gct-oradb-rdmudev01-pg.dec161217.gct-oradb-rdmudev01-00 will be synced to gct-oradb-rdmudev02-00
167+
nm:gct-oradb-rdmudev01-pg.dec161217.gct-oradb-rdmudev01-01 src id:5dc6f5c3-9f65-d5ad-18b3-17c63d7459e4 map:0 sz:74.0
163168
checking for tag matched volume
164-
volume gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-fra-00 will be synced to gct-oradb-demo-dev01-fra-00
165-
nm:gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-fra-01 src id:feabf082-e2ce-aaa5-b1ea-8adfd586a7c4 map:0 sz:40.0
166-
checking for tag matched volume
167-
volume gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-fra-01 will be synced to gct-oradb-demo-dev01-fra-01
169+
volume gct-oradb-rdmudev01-pg.dec161217.gct-oradb-rdmudev01-01 will be synced to gct-oradb-rdmudev02-01
168170
============
169171
mapping the volumes
170-
gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-data-00 will be syncd to gct-oradb-demo-dev01-data-00
171-
gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-data-01 will be syncd to gct-oradb-demo-dev01-data-01
172-
gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-fra-00 will be syncd to gct-oradb-demo-dev01-fra-00
173-
gct-oradb-demo-prd01-pg.dec052338.gct-oradb-demo-prd01-fra-01 will be syncd to gct-oradb-demo-dev01-fra-01
174-
============
175-
The Oracle base has been set to /u01/app/oracle
176-
--------------------------------------------------------------------------------
177-
Label Filtering Path
178-
================================================================================
179-
DATA00 DISABLED /dev/sde
180-
DATA01 DISABLED /dev/sdf
181-
FRA00 DISABLED /dev/sdb
182-
FRA01 DISABLED /dev/sdd
183-
GRID1 DISABLED /dev/sdc
184-
============
185-
mounting ASM diskgroups on target
186-
mounting diskgroup DATA
187-
mounting diskgroup FRA
188-
ASM diskgroup DATA is mounted on the target
189-
ASM diskgroup FRA is mounted on the target
190-
all ASM diskgroups mounted on the target
172+
gct-oradb-rdmudev01-pg.dec161217.gct-oradb-rdmudev01-00 will be syncd to gct-oradb-rdmudev02-00
173+
gct-oradb-rdmudev01-pg.dec161217.gct-oradb-rdmudev01-01 will be syncd to gct-oradb-rdmudev02-01
174+
============
175+
rescaning the SCSI bus on target gct-oradb-rdmudev02
176+
============
177+
mounting ASM diskgroups on target gct-oradb-rdmudev02
178+
============
179+
checking target ASM diskgroups are mounted: SWINGDATA
180+
ASM diskgroup SWINGDATA mounted on target
191181
============
192182
requested state of swingdev is:OPEN
193183
resetting the target SPFILE
194184
alter system set db_name='SWINGDB' sid='*' scope=spfile;
195-
alter system set control_files='+DATA/SWINGDB/CONTROLFILE/current.266.1201708985','+FRA/SJC/CONTROLFILE/current.256.1218830433' sid='*' scope=spfile;
196-
alter system set db_recovery_file_dest='+FRA' sid='*' scope=spfile;
197-
alter system set db_recovery_file_dest_size=34359738368 sid='*' scope=spfile;
185+
alter system set control_files='+SWINGDATA/SWINGDB/CONTROLFILE/current.266.1201708985','+SWINGDATA/SWINGDB/CONTROLFILE/current.265.1201708985' sid='*' scope=spfile;
186+
alter system set db_recovery_file_dest='/nfsmnt/oradb/recovery/gct-oradb-rdmudev01/swingprd' sid='*' scope=spfile;
187+
alter system set db_recovery_file_dest_size=107374182400 sid='*' scope=spfile;
198188
alter system set enable_pluggable_database=FALSE sid='*' scope=spfile;
199-
alter system set db_unique_name=swingdev sid='*' scope=spfile;
200-
actual state of swingdev is:OPEN
189+
restarting instance
190+
actual state of swingdev on host gct-oradb-rdmudev02 is:OPEN
201191
============
202192
complete
193+
203194
```

0 commit comments

Comments
 (0)