SQL
-
Snowflake RBAC 기본구조프로그래밍/Snowflake 2023. 3. 31. 01:25
Snwoflake는 기본적인 User별 다양한 RBAC설계를 할 수 있는데 기본적으로 다음과 같은 구조를 가지고 있습니다. - AccountAdmin : 가장 상위 레벨의 권한을 가진 User로 하위에 있는 모든 역할을 할 수 있습니다. 해당 권한은 2-4명 이내로 가지고 있는 것이 적절하다고 보여집니다. 특별한 설정 없이 해당 계정으로 Object들을 생성하면 다른 하위 권한의 User들은 함부로 내용을 확인할 수 없습니다. 특별한 권한 정리가 안된다면, Snowflake의 Integration등은 AccountAdmin에서만 생성할 수 있습니다. * Integration등이 생성이 되어야 stage등을 만들어 S3등과 연동할 수 있습니다. ** Owner를 변경하여 Sysadmin에서 해당 권한을 가..
-
Snowflake Time Travel프로그래밍/Snowflake 2023. 3. 30. 00:11
Snowflake에는 Time Travel이란 기능이 있습니다. 특정 시점으로 데이터를 돌려주는 것인데요. 에디션에 따라 다르지만 최대 7일까지인 것으로 알고 있습니다. 데이터를 적재하다가 특정 이슈로 다시 ETL 프로세스를 실행시켜 데이터를 넣어야 하는 상황에서 이미 적재된 데이터를 되돌리기 좋은 기능인 것 같습니다. 혹은 실수로 데이터를 없앤 경우도 사용할 수 있죠. 물론 권한에 따라서 삭제할 일은 많이 없을 수 있지만..유용한 기능인 것 같습니다. [사용법] - time travel 사용 select * from (TIMESTAMP => 'Mon, 27 March 2023 00:00:00 +0900'::timestamp_tz); 이런 방법으로 특정 시점의 테이블 데이터를 호출할 수 있습니다. - 테..