Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Diagnostics;
- using System.Threading;
- using System.Net.NetworkInformation;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.RegularExpressions;
- using System.Text;
- namespace Imp
- {
- class Program
- {
- public static void Main(string[] args)
- {
- string[] table = File.ReadAllLines("tabele.txt");
- Process cmd = new Process();
- cmd.StartInfo.RedirectStandardInput = true;
- cmd.StartInfo.RedirectStandardOutput = true;
- cmd.StartInfo.UseShellExecute = false;
- cmd.StartInfo.CreateNoWindow = false;
- cmd.StartInfo.FileName = "cmd.exe";
- cmd.Start();
- int x=0;
- Thread t = new Thread(new ThreadStart(Compress()));
- while(x<table.Length)
- {
- for(int i=0; i<table.Length; i++)
- {
- cmd.StandardInput.WriteLine("imp market3_user/for8667319com file=expm.dat tables={0}",table[i]);
- Thread.Sleep(1000);
- }
- if(x>0)
- {
- x-=1;
- t.Start(x);
- }
- x++;
- }
- //t.Start();
- Console.ReadLine();
- }
- public static void Compress(int x)
- {
- string[] table = File.ReadAllLines("tabele.txt");
- for(; x<table.Length; x++)
- {
- SQLplus query = new SQLplus("market3_user/for8667319com");
- string result = query.execute(@"DECLARE
- CURSOR cu_indeksy_m IS
- SELECT index_name
- FROM all_indexes
- WHERE index_type = 'NORMAL'
- AND temporary = 'N'
- AND table_owner = 'MARKET3_USER'
- AND table_name = '{table[i]} '
- ORDER by table_name ASC, index_name ASC;
- BEGIN
- execute immediate 'alter table {table[i]} move ROW STORE COMPRESS ADVANCED storage (INITIAL 65536)';
- FOR i IN cu_indeksy_m LOOP
- execute immediate 'alter index ' || i.index_name || ' rebuild COMPRESS ADVANCED HIGH storage (INITIAL 65536)';
- Dbms_Output.put_line('Skompresowano index: ' || i.index_name);
- END LOOP;
- END;
- /");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment