Below script is going to generate DDL for DBLINK with values instead of password. So that you can create links without knowing the password.
The following can be used to create a script for DB Links without password.
The SQL script for creating the DB Link would need to be run the user who owns the DB Link if it’s not a PUBLIC.
Script to generate Index DDL from a table with DBMS_METADATA.GET_DEPENDENT_DDL
Here is a simple script to generate the DDL code for all indexes in a particular table.