Ola, segue mais uns scripts que uso com frequência para receber alertas:
Ver os Jobs que estão rodando como Scheduler, versão 10g em diante:
[et_pb_dmb_code_snippet _builder_version=”4.0.6″ code=”U2VsZWN0IEpvYl9OYW1lLCBTdWJzdHIoTGFzdF9TdGFydF9EYXRlLCAxLCAxNykgTGFzdF9TdGFydF9EYXRlLApTdWJzdHIoTGFzdF9SdW5fRHVyYXRpb24sIC0xNSwgMjApIExhc3RfUnVuX0R1cmF0aW9uLCBTdWJzdHIoTmV4dF9SdW5fRGF0ZSwgMSwgMTcpIE5leHRfUnVuX0RhdGUsIFN0YXRlCkZyb20gRGJhX1NjaGVkdWxlcl9Kb2JzCldoZXJlIE93bmVyID0gJ1hYWFgnCk9yZGVyIEJ5IEpvYl9OYW1lOw==” hover_enabled=”0″]U2VsZWN0IEpvYl9OYW1lLCBTdWJzdHIoTGFzdF9TdGFydF9EYXRlLCAxLCAxNykgTGFzdF9TdGFydF9EYXRlLApTdWJzdHIoTGFzdF9SdW5fRHVyYXRpb24sIC0xNSwgMjApIExhc3RfUnVuX0R1cmF0aW9uLCBTdWJzdHIoTmV4dF9SdW5fRGF0ZSwgMSwgMTcpIE5leHRfUnVuX0RhdGUsIFN0YXRlCkZyb20gRGJhX1NjaGVkdWxlcl9Kb2JzCldoZXJlIE93bmVyID0gJ1hYWFgnCk9yZGVyIEJ5IEpvYl9OYW1lOw==[/et_pb_dmb_code_snippet]
Obs1.: XXXX alterar por um conhecido ou deixar sem o where para todos;
Obs2.: No post: Scripts/SQL Úteis I – Oracle tem um para Oracle 9i;
Para ver os objetos inválidos no banco:
[et_pb_dmb_code_snippet _builder_version=”4.0.6″ code=”U2VsZWN0IE93bmVyLApDYXNlCldoZW4gU3Vib2JqZWN0X05hbWUgSXMgTnVsbCBUaGVuCk9iamVjdF9OYW1lCkVsc2UKT2JqZWN0X05hbWUgfHwgJzonIHx8IFN1Ym9iamVjdF9OYW1lCkVuZCBBcyBPYmplY3QsIE9iamVjdF9UeXBlIFR5cGUs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IGFiYWl4bwotLSBBbmQgT2JqZWN0X1R5cGUgJ1NZTk9OWU0nCi0tIFBhcmEgdHJhemVyIHRhbWLDqW0gb3MgaW5kaWNlcyBuYW8gcGFydGljaW9uYWRvcwpVbmlvbiBBbGwKU2VsZWN0IE93bmVyLCBJbmRleF9OYW1lIE9iamVjdCwgJ0lOREVYJyBUeXBlLCBOdWxsIEFzIExhc3RfRGRsX1RpbWUKRnJvbSBBbGxfSW5kZXhlcwpXaGVyZSBTdGF0dXMgTm90IEluICgnVVNBQkxFJywgJ1ZBTElEJywgJ04vQScpOw==[/et_pb_dmb_code_snippet]
Obs.: No post: Scripts/SQL Úteis I – Oracle tem um mais simples!
Número de sessões abertas, com total e máximo:
[et_pb_dmb_code_snippet _builder_version=”4.0.6″ code=”U2VsZWN0IE1hY2hpbmUsIFByb2dyYW0sIFRvX0NoYXIoTnJfU2Vzc2lvbnMpCkZyb20gKFNlbGVjdCBOdmwoVXBwZXIoTWFjaGluZSksICcgJykgTWFjaGluZSwgUHJvZ3JhbSwgQ291bnQoKikgTnJfU2Vzc2lvbnMKRnJvbSBWJHNlc3Npb24KV2hlcmUgVXNlcm5hbWUgSXMgTm90IE51bGwKR3JvdXAgQnkgTWFjaGluZSwgUHJvZ3JhbQpIYXZpbmcgQ291bnQoKikgPiAxKSBTcQpXaGVyZSBQcm9ncmFtIElzIE5vdCBOdWxsClVuaW9uIEFsbAotLSBGYXplciB1bSB0b3RhbCBlIHBlZ2FyIG8gbWF4aW1vIGRlIHNlc3PDtWVzClNlbGVjdCAnVG90YWwvTWF4aW1vJywgJyAtLS0tLS0tLS0tLSA+ICcsCihTZWxlY3QgQ291bnQoKikKRnJvbSBWJHNlc3Npb24pIHx8ICcgLyAnIHx8IFZwLlZhbHVlCkZyb20gU3lzLnZfJHBhcmFtZXRlciBWcApXaGVyZSBWcC5OYW1lID0gJ3Nlc3Npb25zJzs=” hover_enabled=”0″]U2VsZWN0IE1hY2hpbmUsIFByb2dyYW0sIFRvX0No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FjZV9OYW1lOw==” hover_enabled=”0″]U2VsZWN0IFRzLlRhYmxlc3BhY2VfTmFtZSwgTnVsbCBBcyBUb3RhbF9HYiwgTnVsbCBBcyBVdGlsaXphZG9fR2IsClRvX0NoYXIoU3VtKE52bChGcy5CeXRlcywgMCkpIC8gMTA0ODU3NiwgJzk5LDk5OSw5OTAuOTknKSBBcyBMaXZyZV9HYiwgTnVsbCBBcyBVdGlsaXphZG8KRnJvbSBVc2VyX0ZyZWVfU3BhY2UgRnMsIFVzZXJfVGFibGVzcGFjZXMgVHMKV2hlcmUgRnMuVGFibGVzcGFjZV9OYW1lKCspID0gVHMuVGFibGVzcGFjZV9OYW1lCkFuZCBUcy5UYWJsZXNwYWNlX05hbWUgTGlrZSAnJVhYWFglJwpHcm91cCBCeSBUcy5UYWJsZXNwYWNlX05hbWUKT3JkZXIgQnkgVHMuVGFibGVzcGFjZV9OYW1lOw==[/et_pb_dmb_code_snippet]
Obs1.: Alterar o XXXX para um conhecido ou deixar sem para trazer tudo;
Obs2.: No Post: Scripts/SQL Úteis I – Oracle tem um pouco mais complexo!
Att,
capin