I am new to Teradata technology.
Can anybody let me know, How to get the DDL backup (Only DDL backup, Not Data backup) of DBC tables. ???
I need to collect the DDL's of all the tables which resides (come under) in DBC database. If in case any disaster, i want to use these DDL's at the time of recovery.
Kindly share the required query OR required table so that I will get the required DDL's.
You can get from BAR.
select 'show table ' || trim(databasename) ||'.'|| trim(tablename) ||';'
where databasename = 'DBC'
You can add more filter if you wish to.
You can also check requesttext field, if not latered.
To recover from disaster you will need a lot more than the DDLs of dbc, but anyways you can do the dictionary tables archival using the arcmain utility and restore it when required.
The below script will do the data dictionary archive of a database includes all table, view, macro and trigger definitions, and dictionary entries for stored procedures. You can limit the archival to certain tables as well.
ARCHIVE DICTIONARY TABLES (DBC),
FILE = DBC_DA;
LOGON USER, USER;
RELEASE LOCK (DBC);
As suggested by Qaisar, in case of disaster you wil definitely require alot more than just DDLs.
Also, what kind of a disaster are we preventing here .... can we take some pre-emptive measures to avoid that disaster altogether?