public OracleDll(OracleDBConnection connection, String objectType, String objectName) { InitializeComponent(); this.dbConnection = connection; DataTable data = new DataTable(); OracleConnection databaseConnection = connection.getDatabaseConnection(); String query = "SELECT DBMS_METADATA.GET_DDL('" + objectType + "'," + "'" + objectName + "')AS DDL FROM DUAL"; Console.WriteLine(query); OracleCommand command = new OracleCommand(query, databaseConnection); OracleDataReader reader; command.CommandText = query; command.CommandType = CommandType.Text; reader = command.ExecuteReader(); data.Load(reader); foreach (DataRow row in data.Rows) { String ColumnData = row[0].ToString(); this.richTextBox1.AppendText(ColumnData); } reader.Close(); }
public OracleTableSpaceData(OracleDBConnection connection) { InitializeComponent(); this.dbConnection = connection; OracleConnection databaseConnection = connection.getDatabaseConnection(); String query = "SELECT ts.TABLESPACE_NAME, " + "TO_CHAR(SUM(NVL(fs.bytes, 0)) / 1024 / 1024, '99,999,990.99') AS MB_FREE " + "FROM " + "USER_FREE_SPACE fs, " + "USER_TABLESPACES ts, " + "USER_USERS us " + "WHERE fs.TABLESPACE_NAME(+) = ts.TABLESPACE_NAME " + "GROUP BY ts.tablespace_name"; OracleCommand command = new OracleCommand(query, databaseConnection); OracleDataReader reader; DataTable data = new DataTable(); command.CommandText = query; command.CommandType = CommandType.Text; reader = command.ExecuteReader(); data.Load(reader); this.tableSpaceData.DataSource = data; reader.Close(); }
public OracleIndexes(OracleDBConnection connection, String indexName) { InitializeComponent(); this.dbConnection = connection; OracleConnection databaseConnection = connection.getDatabaseConnection(); String query = "SELECT INDEX_NAME, INDEX_TYPE, USER_INDEXES.TABLE_NAME, UNIQUENESS " + "FROM USER_INDEXES, USER_TABLES " + "WHERE INDEX_NAME = '" + indexName + "' " + "AND USER_INDEXES.TABLE_NAME = USER_TABLES.TABLE_NAME"; OracleCommand command = new OracleCommand(query, databaseConnection); OracleDataReader reader; command.CommandText = query; command.CommandType = CommandType.Text; reader = command.ExecuteReader(); while (reader.Read()) { this.indexList.Rows.Add("NAME", reader["INDEX_NAME"]); this.indexList.Rows.Add("TYPE", reader["INDEX_TYPE"]); this.indexList.Rows.Add("TABLE", reader["TABLE_NAME"]); this.indexList.Rows.Add("UNIQUENESS", reader["UNIQUENESS"]); } reader.Close(); }