Skip to content

Commit

Permalink
Teradata dump roles, childrenV, parentsV (#67)
Browse files Browse the repository at this point in the history
* Add dumping TempTables and DiskSpace in teradata

* Add dumping TempTables and DiskSpace in teradata

* dump roles, childrenV, parentcV for teradata

* dump tempTables and discSpace if metadata-stats true

* add where clause in ChildrenV and ParentV tables
  • Loading branch information
okerbez authored Jul 25, 2022
1 parent 2df3dfb commit cb3d038
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public void addTasksTo(List<? super Task<?>> out, ConnectorArguments arguments)
String whereDatabaseNameClause = new SqlBuilder().withWhereInVals("\"DatabaseName\"", arguments.getDatabases()).toWhereClause();
String whereDataBaseNameClause = new SqlBuilder().withWhereInVals("\"DataBaseName\"", arguments.getDatabases()).toWhereClause();
String whereBDatabaseNameClause = new SqlBuilder().withWhereInVals("\"B_DatabaseName\"", arguments.getDatabases()).toWhereClause();
String whereChildDBClause = new SqlBuilder().withWhereInVals("\"ChildDB\"", arguments.getDatabases()).toWhereClause();
String whereParentDBClause = new SqlBuilder().withWhereInVals("\"ParentDB\"", arguments.getDatabases()).toWhereClause();

out.add(new DumpMetadataTask(arguments, FORMAT_NAME));
out.add(new FormatTask(FORMAT_NAME));
Expand Down Expand Up @@ -122,6 +124,18 @@ public void addTasksTo(List<? super Task<?>> out, ConnectorArguments arguments)
out.add(new TeradataJdbcSelectTask(DiskSpaceVFormat.ZIP_ENTRY_NAME,
TaskCategory.OPTIONAL,
"SELECT %s FROM DBC.DiskSpaceV" + whereDataBaseNameClause + " ;"));

out.add(new TeradataJdbcSelectTask(RoleMembersVFormat.ZIP_ENTRY_NAME,
TaskCategory.OPTIONAL,
"SELECT %s FROM DBC.RoleMembersV ;"));

out.add(new TeradataJdbcSelectTask(All_RI_ChildrenVFormat.ZIP_ENTRY_NAME,
TaskCategory.OPTIONAL,
"SELECT %s FROM DBC.All_RI_ChildrenV " + whereChildDBClause + " ;"));

out.add(new TeradataJdbcSelectTask(All_RI_ParentsVFormat.ZIP_ENTRY_NAME,
TaskCategory.OPTIONAL,
"SELECT %s FROM DBC.All_RI_ParentsV " + whereParentDBClause + " ;"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,31 @@ public static enum Header {
VProc, DatabaseName, AccountName, MaxPerm, MaxSpool, MaxTemp, CurrentPerm, CurrentSpool, CurrentPersistentSpool, CurrentTemp, PeakPerm, PeakSpool, PeakPersistentSpool, PeakTemp, MaxProfileSpool, MaxProfileTemp, TrustUserName, AppProxyUser, AllocatedPerm, AllocatedSpool, AllocatedTemp, PermSkew, SpoolSkew, TempSkew
}
}

public static interface RoleMembersVFormat {

public static String ZIP_ENTRY_NAME = "dbc.RoleMembersV.csv";

public static enum Header {
RoleName, Grantor, Grantee, WhenGranted, DefaultRole, WithAdmin
}
}

public static interface All_RI_ChildrenVFormat {

public static String ZIP_ENTRY_NAME = "dbc.All_RI_ChildrenV.csv";

public static enum Header {
IndexId, IndexName, ChildDB, ChildTable, ChildKeyColumn, ParentDB, ParentTable, ParentKeyColumn, InconsistencyFlag, CreatorName, CreateTimeStamp
}
}

public static interface All_RI_ParentsVFormat {

public static String ZIP_ENTRY_NAME = "dbc.All_RI_ParentsV.csv";

public static enum Header {
IndexId, IndexName, ChildDB, ChildTable, ChildKeyColumn, ParentDB, ParentTable, ParentKeyColumn, InconsistencyFlag, CreatorName, CreateTimeStamp
}
}
}

0 comments on commit cb3d038

Please sign in to comment.