2025 Cloning Flashcards
What is zero copy cloning
Enables users to take a “point-in’time” snapshot of tables, schemas, and databases and generate a reference to an underlining partition that originally shares the underlying storage until users makes a change
In INFORMATION_SCHEMA.TABLE_STORAGE_METRICS table, how can you use ID and CLONE_GROUP_ID to tell if a table is a clone
If the two values are different, then the table is cloned.
When created, does the cloned table include the source table load history?
No, so users can reload the same files in the clone object as were loaded in the source table.
What are the minimum set of privileges required to create a clone
SELECT on the source table
OWNERSHIP privilege for source objects like pipes, streams, and tasks
USAGE privilege on other objects
If you create a clone of a database or a schema, does the clone include all the child objects
Yes, all active at the time of the clone
How do permissions work on a clone
- Parent object privileges don’t transfer automatically unless you specify COPY GRANTS
- But if you do use COPY GRANTS on a container, all its contents will maintain their original privilege structure
What can be cloned in Snowflake
Databases
Schemas
Tables
Streams
Stages
File Formats
Sequences
Tasks
What type of tables can be cloned
Permanent/transient/temporary
Temporary tables can only be cloned to a temporary or transient table
Can you use Time Travel to clone a table at a specific point in time
Yes, using AT or BEFORE
When does a cloned table reference a cloned sequence
When the database containing both is cloned
If a cloned table with a FK is cloned but the associated table with the PK is not cloned, where does the FK point
To the original source table. If they were both cloned, the clone would point a the clone.
What happens when a table being cloned has a clustering key?
The clone has the same clustering key, but auto clustering is suspended by default.
When a database is cloned, what is not cloned
Internal named stages (and any pipes associated with those stages) and external tables
What happens to tasks in a cloned database/schema
They are suspneded by default
When cloning, should you execute any DML commands on the source object
No, cloning is not instantaneous and does not lock the source object
Should you use zero-copy cloning when there is a need to mask specific columns for security reasons?
No, cloning preserves the data as-is. Instead, copy the data and apply masking
When cloning a table, is it possible to copy the permissions from the original table
Yes, and only tables. You use the COPY GRANTS syntax
When cloning any database, what happens to pipes referring to internal stages
They are not cloned