Thursday, February 23, 2017

Grant SELECT on all tables in Oracle/PLSQL

Execute the anonymous block below:

DECLARE
  STMT VARCHAR2(100);
BEGIN
FOR x IN (SELECT TABLE_NAME FROM user_tables)
LOOP
  STMT := 'GRANT SELECT ON ' || x.TABLE_NAME || ' TO <user>';
  EXECUTE IMMEDIATE STMT;
END LOOP;
END;

Tuesday, March 1, 2016

Terminal Server Has Exceeded the Maximum Number of Allowed Connections

Open command prompt.

To check which session to reset, see below command line:

query session /server:[server name]

Sample:

query session /server:MyServer2003

Output:








Then, check the ID to be reset and use the command line below:

reset session [ID] /server:MyServer2003

Sample:

reset session 3 /server:MyServer2003

Note: There will be no output after you run this command. Afterwards, try logging in to the server again.