示例#1
0
        file_name = path.join(self.cfg.output_dir, file_name.replace("/", "-"))
        self._write(text, file_name)


    def _haveDependencies(self, key):
        return self.cfg.schema.dependencies.has_key(key)

    def _printDependencies(self, key):
        """ Prints the dependecy table for given key/object """
        if (self._haveDependencies(key)):
            return self.html.table("Dependencies" + self.html.anchor('deps'),
                                    ['Referenced Owner', 'Referenced Name',
                                     'Referenced Link', 'Referenced Type',
                                     'Dependency Type'],
                                    self.cfg.schema.dependencies[key])
        else:
            return ''


if __name__ == '__main__':
    import cx_Oracle
    import orasdict
    import oraschema
    from osdconfig import OSDConfig
    c = OSDConfig()
    c.connection = cx_Oracle.connect('s0/asgaard')
    c.dictionary = orasdict.OraSchemaDataDictionary(c)
    c.schema = oraschema.OracleSchema(c)
    doclet = OraSchemaDoclet(c)

示例#2
0
    def _get_all_sequences(self, data_dict):
        debug_message('generating sequences')
        sequences = []
        for name in data_dict.sequence_names:
            min_value, max_value, step, cycled, ordered, cache_size = data_dict.sequences[name]
            seq = OracleSequence(name, min_value, max_value, step, cycled, ordered, cache_size)
            sequences.append(seq)
            self.ddlSource.getDDLScript('SEQUENCE', name)
        return sequences


    def _get_all_jobs(self, data):
        debug_message('generating jobs')
        jobs = []
        for job, log_user, priv_user, schema_user, total_time, broken, interval, failures, what in data.jobs:
            jobs.append(OracleJob(job, log_user, priv_user, schema_user, total_time, broken, interval, failures, what))
        return jobs



if __name__ == '__main__':
    import cx_Oracle
    import orasdict
    from osdconfig import OSDConfig
    #connection = cx_Oracle.connect('s0/asgaard')
    cfg = OSDConfig()
    cfg.connection = cx_Oracle.connect('s0/asgaard')
    cfg.dictionary = orasdict.OraSchemaDataDictionary(cfg)
    schema = OracleSchema(cfg)

示例#3
0
        """Execute query end return results in array"""
        cur = self.cfg.connection.cursor()
        cur.execute(querystr)
        results = cur.fetchall()
        cur.close()
        return results


    def _prepareStatement(self, stmt):
        if self.cfg.useOwners == False:
            stmt = stmt.userSql()
        else:
            if len(self.cfg.owners) == 0:
                stmt = stmt.ownerSql()
            else:
                inClause = []
                for i in self.cfg.owners:
                    inClause.append("'%s'" % i.upper())
                stmt = stmt.ownerSql(inClause="%s, %s" % (self.cfg.currentUser, ','.join(inClause)))
        return stmt


if __name__ == '__main__':
    import cx_Oracle
    from osdconfig import OSDConfig
    c = OSDConfig()
    c.connection = cx_Oracle.connect('buap/p6a6u3b0@cpd_prod')
    s = OraSchemaDataDictionary(c)
    #print s.all_java_sources