<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.osnexus.com/index.php?action=history&amp;feed=atom&amp;title=Guides%3ANightly_Database_Analysis_from_iSCSI_Snapshots</id>
	<title>Guides:Nightly Database Analysis from iSCSI Snapshots - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.osnexus.com/index.php?action=history&amp;feed=atom&amp;title=Guides%3ANightly_Database_Analysis_from_iSCSI_Snapshots"/>
	<link rel="alternate" type="text/html" href="https://wiki.osnexus.com/index.php?title=Guides:Nightly_Database_Analysis_from_iSCSI_Snapshots&amp;action=history"/>
	<updated>2026-10-07T15:43:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.osnexus.com/index.php?title=Guides:Nightly_Database_Analysis_from_iSCSI_Snapshots&amp;diff=28214&amp;oldid=prev</id>
		<title>Qadmin: osn-seo-utilities: db-analysis-iscsi-snapshot @ cf7d5275edd5 (approved in the portal)</title>
		<link rel="alternate" type="text/html" href="https://wiki.osnexus.com/index.php?title=Guides:Nightly_Database_Analysis_from_iSCSI_Snapshots&amp;diff=28214&amp;oldid=prev"/>
		<updated>2026-10-07T05:45:08Z</updated>

		<summary type="html">&lt;p&gt;osn-seo-utilities: db-analysis-iscsi-snapshot @ cf7d5275edd5 (approved in the portal)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;By Steve Umbehocker, CTO, OSNexus &amp;amp;middot; Updated October 3, 2026&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Offline database analysis means running reports, audits and heavy queries against a point-in-time copy of production data on a separate server, so that the production database never sees the load. QuantaStor makes that copy with a snapshot schedule that snapshots every database volume in a pool at the same instant, presents those snapshots to an analysis server over iSCSI, and rotates old copies out on its own. This guide builds the whole nightly loop with the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;qs&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; CLI and a short bash script that triggers the schedule, waits for the new snapshots, swaps the old mounts for new ones and verifies them.&lt;br /&gt;
&lt;br /&gt;
== Why it matters ==&lt;br /&gt;
&lt;br /&gt;
Nightly reporting, data-quality checks and ad-hoc analysis all compete with production I/O when they run against the live database. Copying databases to a reporting server every night is slow and doubles the capacity bill. A snapshot avoids both: it is created near-instantly, records metadata rather than copying blocks, and consumes pool space only for blocks that change afterwards.&lt;br /&gt;
&lt;br /&gt;
A snapshot schedule adds two things a hand-rolled snapshot script lacks. All ZFS members of a schedule that live in the same [[Storage Pools|storage pool]] are snapshotted by a single ZFS command, so a database spread across data, log and index volumes is captured as one crash-consistent set rather than several copies taken seconds apart. The schedule also owns rotation, so you never write cleanup code that deletes the wrong snapshot.&lt;br /&gt;
&lt;br /&gt;
== How it works ==&lt;br /&gt;
&lt;br /&gt;
The moving parts on the appliance side are all documented reference features:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[Snapshot Schedules]]&amp;#039;&amp;#039;&amp;#039; take the snapshots, name them &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;volume&amp;gt;_GMT&amp;lt;YYYYMMDD&amp;gt;_&amp;lt;HHMMSS&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; from the UTC start time of the run, and keep only &amp;#039;&amp;#039;&amp;#039;Max Short Term Snapshots&amp;#039;&amp;#039;&amp;#039; of each volume in the rotating window.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Triggering&amp;#039;&amp;#039;&amp;#039; runs a schedule immediately, in addition to its timed runs. From the CLI it is &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;qs snap-schedule-trigger&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, and over the [[QuantaStor REST API Reference Guide|REST API]] it is the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;snapshotScheduleTrigger&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; call. Triggering a disabled schedule does nothing, so the schedule must stay enabled.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lazy cloning.&amp;#039;&amp;#039;&amp;#039; A schedule snapshot sits in the Offline state with no iSCSI target until it is needed. Assigning it to a host materializes it: the clone is created, the target is registered and the state moves to Normal. Each volume, snapshots included, gets its own target IQN and presents at LUN 0 (see [[Storage Volumes]]).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Host assignment&amp;#039;&amp;#039;&amp;#039; is the LUN masking that lets only the analysis server see the snapshot ([[Hosts and Host Groups]]).&lt;br /&gt;
&lt;br /&gt;
On the analysis server, open-iscsi logs in to the snapshot&amp;#039;s target and the filesystem is mounted like any local disk. Because the snapshot is a writable clone (Read/Write is the default access mode for snapshots), the database engine or the filesystem can replay its journal on mount as it would after a power loss. Those writes land in the clone and never touch the production volume.&lt;br /&gt;
&lt;br /&gt;
== Design and sizing ==&lt;br /&gt;
&lt;br /&gt;
Put every volume of one database, or every database you want captured at the same instant, in the &amp;#039;&amp;#039;&amp;#039;same storage pool&amp;#039;&amp;#039;&amp;#039; and the &amp;#039;&amp;#039;&amp;#039;same schedule&amp;#039;&amp;#039;&amp;#039;. Atomicity holds per pool, and &amp;#039;&amp;#039;&amp;#039;Disable Atomicity&amp;#039;&amp;#039;&amp;#039; on the schedule&amp;#039;s Advanced Settings tab breaks it into batches, so leave it off for this use. A schedule run also snapshots only members owned by the appliance it runs on.&lt;br /&gt;
&lt;br /&gt;
The snapshots are crash-consistent. If your database needs a cleaner point, the schedule runs &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;/var/opt/osnexus/custom/schedule-prestart.sh&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; on the appliance at the start of every run, before any snapshot is taken, with &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;--name=&amp;lt;schedule name&amp;gt; --id=&amp;lt;schedule id&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. It blocks the run for up to five minutes, which is enough to ask the database to checkpoint.&lt;br /&gt;
&lt;br /&gt;
Retention for an analysis schedule is short. You only need the snapshot being analyzed and the one about to replace it:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Setting !! Suggested value !! Reason&lt;br /&gt;
|-&lt;br /&gt;
| Max Short Term Snapshots (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;--max-snaps&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;) || 3 || The mounted snapshot is never the oldest one in the window&lt;br /&gt;
|-&lt;br /&gt;
| Hourly to quarterly retention (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;--rc-*&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;) || 0 || Long-term tags exempt snapshots from rotation, holding space you don&amp;#039;t need&lt;br /&gt;
|-&lt;br /&gt;
| Schedule type || Calendar, one hour per day || The schedule must be enabled for triggers to work, so give it a harmless timed run&lt;br /&gt;
|-&lt;br /&gt;
| Offset || Different from any replication schedule on the same volumes || A member snapshotted by another schedule within the last 10 seconds is skipped&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Capacity cost tracks write volume, not database size: each snapshot holds the blocks overwritten since it was taken, and the mounted clone adds whatever the analysis server writes. Check &amp;#039;&amp;#039;&amp;#039;Max Total Source Snapshots&amp;#039;&amp;#039;&amp;#039; on the Snapshot Settings tab against pool free space before you commit.&lt;br /&gt;
&lt;br /&gt;
[[File:Guide-db-analysis-iscsi-snapshot-db-snap-schedule-retention.png|frame|center|The Snapshot Settings tab: clear the long-term counts and keep Max Short Term Snapshots small, and watch the Max Total Source Snapshots figure]]&lt;br /&gt;
&lt;br /&gt;
== Setting it up ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;1. Create the schedule.&amp;#039;&amp;#039;&amp;#039; In the web interface, go to &amp;#039;&amp;#039;&amp;#039;Storage Management → Schedules → Snapshot Schedule → Create&amp;#039;&amp;#039;&amp;#039;, or use the CLI. This schedule runs at 1 AM every day, keeps three snapshots per volume and no long-term copies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;qs snap-schedule-create --name=db-nightly \&lt;br /&gt;
  --days=mon,tue,wed,thu,fri,sat,sun --hours=1am \&lt;br /&gt;
  --volume-list=db-sales,db-finance,db-hr \&lt;br /&gt;
  --max-snaps=3 --rc-hourly=0 --rc-dailies=0 --rc-weeklies=0 \&lt;br /&gt;
  --rc-monthlies=0 --rc-quarterlies=0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Guide-db-analysis-iscsi-snapshot-db-snap-schedule-interval.png|frame|center|The Schedule Interval tab: tick the days and the single hour the schedule should fire on its own]]&lt;br /&gt;
&lt;br /&gt;
To add another database later, use &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;qs snap-schedule-add --schedule=db-nightly --volume-list=db-ops&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; or the &amp;#039;&amp;#039;&amp;#039;Update Selections&amp;#039;&amp;#039;&amp;#039; dialog ([[Snapshot Schedule Add/Remove Volumes]]). &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;qs snap-schedule-assoc-list --schedule=db-nightly&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; confirms the members.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;2. Register the analysis server.&amp;#039;&amp;#039;&amp;#039; Read its IQN from &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;/etc/iscsi/initiatorname.iscsi&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (install &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;open-iscsi&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iscsi-initiator-utils&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; if it is missing) and add a Host with that IQN, as described in [[ISCSI Initiator Setup]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;qs host-add --hostname=analytics1 --host-type=linux \&lt;br /&gt;
  --iqn=iqn.1994-05.com.redhat:5a66857c49dc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Guide-db-analysis-iscsi-snapshot-db-snap-add-host.png|frame|center|The Add Host dialog: set Operating System Type to Linux and paste the server&amp;#039;s IQN into iSCSI Initiator]]&lt;br /&gt;
&lt;br /&gt;
The appliance port at 192.0.2.10 in the examples below must have iSCSI enabled, or discovery returns no portals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;3. Install the refresh script&amp;#039;&amp;#039;&amp;#039; on the analysis server. It needs the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;qs&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; CLI pointed at the appliance (the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;QS_SERVER&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; variable or &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;~/.qs.cnf&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, per the [[QuantaStor CLI Command Reference|CLI reference]]), plus &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;jq&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iscsiadm&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/bash&lt;br /&gt;
set -euo pipefail  # usage: refresh-db-snaps.sh [--use-existing-snaps]&lt;br /&gt;
&lt;br /&gt;
SCHEDULE=db-nightly&lt;br /&gt;
HOST=analytics1                      # Host object holding this server&amp;#039;s IQN&lt;br /&gt;
PORTAL=192.0.2.10                    # iSCSI-enabled port on the appliance&lt;br /&gt;
VOLUMES=&amp;quot;db-sales db-finance db-hr&amp;quot;  # source volumes; each mounts at $MNT/&amp;amp;lt;volume&amp;amp;gt;&lt;br /&gt;
MNT=/mnt/dbsnap&lt;br /&gt;
PART=-part1                          # set to &amp;quot;&amp;quot; if the filesystem uses the whole disk&lt;br /&gt;
STATE=/var/lib/dbsnap                # which snapshot is mounted where&lt;br /&gt;
WAIT=600                             # seconds to wait for new snapshots&lt;br /&gt;
&lt;br /&gt;
USE_EXISTING=0&lt;br /&gt;
[ &amp;quot;${1:-}&amp;quot; = &amp;quot;--use-existing-snaps&amp;quot; ] &amp;amp;amp;&amp;amp;amp; USE_EXISTING=1&lt;br /&gt;
mkdir -p &amp;quot;$STATE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
latest() {  # names are &amp;amp;lt;volume&amp;amp;gt;_GMTYYYYMMDD_HHMMSS (UTC): last sorted is newest&lt;br /&gt;
  qs volume-list --json | jq -r &amp;#039;.. | objects | .name? // empty&amp;#039; \&lt;br /&gt;
    | grep -E &amp;quot;^${1}_GMT[0-9]{8}_[0-9]{6}\$&amp;quot; | sort -u | tail -1 || true&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
declare -A NEW OLD&lt;br /&gt;
if [ &amp;quot;$USE_EXISTING&amp;quot; = 1 ]; then&lt;br /&gt;
  for v in $VOLUMES; do NEW[$v]=$(latest &amp;quot;$v&amp;quot;); done&lt;br /&gt;
else&lt;br /&gt;
  for v in $VOLUMES; do OLD[$v]=$(latest &amp;quot;$v&amp;quot;); done&lt;br /&gt;
  qs snap-schedule-trigger --schedule=&amp;quot;$SCHEDULE&amp;quot;&lt;br /&gt;
  deadline=$((SECONDS + WAIT))&lt;br /&gt;
  for v in $VOLUMES; do&lt;br /&gt;
    while NEW[$v]=$(latest &amp;quot;$v&amp;quot;); [ &amp;quot;${NEW[$v]}&amp;quot; = &amp;quot;${OLD[$v]}&amp;quot; ]; do&lt;br /&gt;
      [ &amp;quot;$SECONDS&amp;quot; -lt &amp;quot;$deadline&amp;quot; ] || { echo &amp;quot;no new snapshot of $v&amp;quot; &amp;amp;gt;&amp;amp;amp;2; exit 1; }&lt;br /&gt;
      sleep 10&lt;br /&gt;
    done&lt;br /&gt;
  done&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
changed=0  # remount only if some volume has a newer snapshot than the one mounted&lt;br /&gt;
for v in $VOLUMES; do&lt;br /&gt;
  [ -n &amp;quot;${NEW[$v]}&amp;quot; ] || { echo &amp;quot;no snapshot of $v yet&amp;quot; &amp;amp;gt;&amp;amp;amp;2; exit 1; }&lt;br /&gt;
  [ &amp;quot;${NEW[$v]}&amp;quot; = &amp;quot;$(cat &amp;quot;$STATE/$v&amp;quot; 2&amp;amp;gt;/dev/null)&amp;quot; ] || changed=1&lt;br /&gt;
done&lt;br /&gt;
[ &amp;quot;$changed&amp;quot; = 1 ] || { echo &amp;quot;snapshots unchanged, mounts left in place&amp;quot;; exit 0; }&lt;br /&gt;
&lt;br /&gt;
for v in $VOLUMES; do&lt;br /&gt;
  # Detach the previous snapshot: unmount, log out, remove the assignment.&lt;br /&gt;
  if [ -f &amp;quot;$STATE/$v&amp;quot; ]; then&lt;br /&gt;
    old=$(cat &amp;quot;$STATE/$v&amp;quot;); oldiqn=$(cat &amp;quot;$STATE/$v.iqn&amp;quot;)&lt;br /&gt;
    if mountpoint -q &amp;quot;$MNT/$v&amp;quot;; then umount &amp;quot;$MNT/$v&amp;quot;; fi&lt;br /&gt;
    iscsiadm -m node -T &amp;quot;$oldiqn&amp;quot; -p &amp;quot;$PORTAL&amp;quot; --logout || true&lt;br /&gt;
    iscsiadm -m node -T &amp;quot;$oldiqn&amp;quot; -p &amp;quot;$PORTAL&amp;quot; -o delete || true&lt;br /&gt;
    qs volume-unassign --volume=&amp;quot;$old&amp;quot; --host-list=&amp;quot;$HOST&amp;quot; || true&lt;br /&gt;
    rm -f &amp;quot;$STATE/$v&amp;quot; &amp;quot;$STATE/$v.iqn&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  # Attach the new one. Assigning it materializes the lazy clone and its target.&lt;br /&gt;
  snap=${NEW[$v]}&lt;br /&gt;
  qs volume-assign --volume=&amp;quot;$snap&amp;quot; --host-list=&amp;quot;$HOST&amp;quot;&lt;br /&gt;
  iqn=$(qs volume-get --volume=&amp;quot;$snap&amp;quot; --json \&lt;br /&gt;
        | jq -r &amp;#039;.. | objects | .iqn? // empty&amp;#039; | head -1)&lt;br /&gt;
  iscsiadm -m discovery -t sendtargets -p &amp;quot;$PORTAL&amp;quot; &amp;amp;gt;/dev/null&lt;br /&gt;
  iscsiadm -m node -T &amp;quot;$iqn&amp;quot; -p &amp;quot;$PORTAL&amp;quot; --login&lt;br /&gt;
  dev=/dev/disk/by-path/ip-$PORTAL:3260-iscsi-$iqn-lun-0$PART&lt;br /&gt;
  for _ in $(seq 30); do [ -b &amp;quot;$dev&amp;quot; ] &amp;amp;amp;&amp;amp;amp; break; sleep 1; done&lt;br /&gt;
  mkdir -p &amp;quot;$MNT/$v&amp;quot;&lt;br /&gt;
  mount &amp;quot;$dev&amp;quot; &amp;quot;$MNT/$v&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  # Verify: mounted and not empty, then record it for the next run.&lt;br /&gt;
  mountpoint -q &amp;quot;$MNT/$v&amp;quot; &amp;amp;amp;&amp;amp;amp; [ -n &amp;quot;$(ls -A &amp;quot;$MNT/$v&amp;quot;)&amp;quot; ] \&lt;br /&gt;
    || { echo &amp;quot;mount check failed for $snap&amp;quot; &amp;amp;gt;&amp;amp;amp;2; exit 1; }&lt;br /&gt;
  echo &amp;quot;$snap&amp;quot; &amp;amp;gt; &amp;quot;$STATE/$v&amp;quot;; echo &amp;quot;$iqn&amp;quot; &amp;amp;gt; &amp;quot;$STATE/$v.iqn&amp;quot;&lt;br /&gt;
  echo &amp;quot;$v -&amp;amp;gt; $snap mounted at $MNT/$v&amp;quot;&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;set -e&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; stops the script if an unmount fails, which is what you want when a report still has files open: the old snapshot stays mounted and nothing is half-swapped.&lt;br /&gt;
&lt;br /&gt;
== Operating and testing ==&lt;br /&gt;
&lt;br /&gt;
Choose one of two timing models:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Script-driven.&amp;#039;&amp;#039;&amp;#039; Cron runs &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;refresh-db-snaps.sh&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; when you want the copy, for example after the nightly ETL load finishes. The trigger makes the snapshots, and the script waits up to &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;WAIT&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; seconds for a new name to appear on every volume.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Schedule-driven.&amp;#039;&amp;#039;&amp;#039; The schedule&amp;#039;s own 1 AM run makes the snapshots and cron runs &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;refresh-db-snaps.sh --use-existing-snaps&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; at 1:30 AM. The script compares the newest snapshot names with what it last mounted and exits without touching the mounts if nothing is new. This is also the safe way to re-run the script by hand during the day.&lt;br /&gt;
&lt;br /&gt;
[[File:Guide-db-analysis-iscsi-snapshot-db-snap-host-assignments.png|frame|center|The Hosts view: the analysis server&amp;#039;s initiator IQN, and in Storage Volume Assignments, the volumes currently assigned to it]]&lt;br /&gt;
&lt;br /&gt;
To test, run the script by hand once and check four things:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;qs volume-list&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; shows a new &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;db-sales_GMT...&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; snapshot for each volume, all with the same timestamp.&lt;br /&gt;
# &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;qs volume-assign-list --host=analytics1&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; lists exactly one snapshot per source volume.&lt;br /&gt;
# &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iscsiadm -m session&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; shows one session per snapshot target.&lt;br /&gt;
# The database engine starts against &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;/mnt/dbsnap&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and your reports return yesterday&amp;#039;s numbers.&lt;br /&gt;
&lt;br /&gt;
Run it a second time with &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;--use-existing-snaps&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and confirm it reports the snapshots as unchanged. If no new snapshot ever appears, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;qs snap-schedule-get --schedule=db-nightly&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; shows whether the schedule is enabled. A schedule left with no members disables itself.&lt;br /&gt;
&lt;br /&gt;
Old snapshots need no cleanup code. Once the script has unassigned a snapshot ([[Remove Storage Assignment]] is the equivalent in the web interface), the schedule rotates it out when it falls outside the window. To keep one copy for an audit, put a hold on it with &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;qs volume-hold-add --volume=&amp;lt;snapshot&amp;gt; --hold-tag=keep-for-audit&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. A held snapshot is excluded from schedule cleanup until the hold is released.&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&lt;br /&gt;
=== Is a snapshot taken by the schedule consistent across several database volumes? ===&lt;br /&gt;
&lt;br /&gt;
Yes, for volumes in the same storage pool. The schedule snapshots all of its ZFS members in a pool with a single ZFS command, so they share one point in time and are crash-consistent with each other. Volumes in different pools, or a schedule with Disable Atomicity ticked, don&amp;#039;t get that guarantee.&lt;br /&gt;
&lt;br /&gt;
=== Does running analysis on the snapshot slow down the production database? ===&lt;br /&gt;
&lt;br /&gt;
The analysis reads come from the snapshot&amp;#039;s clone, which shares unchanged blocks with the production volume in the same pool. The analysis server&amp;#039;s queries therefore still use the pool&amp;#039;s disks, but none of the work runs inside the production database engine, and writes to the clone never reach the production volume. If pool I/O is a concern, schedule the refresh and heavy reports outside peak hours.&lt;br /&gt;
&lt;br /&gt;
=== What does --use-existing-snaps do? ===&lt;br /&gt;
&lt;br /&gt;
It skips the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;snap-schedule-trigger&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; call and works with snapshots the schedule has already made. If the newest snapshot of every volume is the one already mounted, the script exits without unmounting anything. Otherwise it swaps in the newer snapshots exactly as a normal run would.&lt;br /&gt;
&lt;br /&gt;
=== Can I trigger the schedule over the REST API instead of the CLI? ===&lt;br /&gt;
&lt;br /&gt;
Yes. The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;snapshotScheduleTrigger&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; call takes the schedule name or ID and signals the schedule manager to run it immediately, the same as &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;qs snap-schedule-trigger&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. The CLI is the simpler choice for a bash script, and the API suits tools that already speak JSON-RPC.&lt;br /&gt;
&lt;br /&gt;
=== How much pool space do the snapshots use? ===&lt;br /&gt;
&lt;br /&gt;
Each snapshot holds only the blocks overwritten in production since it was taken, plus anything the analysis server writes to its clone. With Max Short Term Snapshots at 3 and no long-term retention, you hold roughly three days of change per volume.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;#039;&amp;#039;Part of the [[Guides:Index|QuantaStor Guides]] series. For reference documentation, see the [[Main Page|QuantaStor documentation]].&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;br /&gt;
&amp;lt;!-- osn-seo-utilities: ../review/articles/wiki-db-analysis-iscsi-snapshot.md @ cf7d5275edd5 --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Qadmin</name></author>
	</entry>
</feed>