JDBC Query to connect to MySql Database
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2022 09:19 AM
Hi I have a script file where we need to execute this query commands on Mysql database server.
And our instance is integrated with jdbc and now may I know how to connect with Database and where can I place this script file so that to get the output.
Thanks in advance
- Labels:
-
Orchestration (ITOM)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2022 09:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2022 10:30 PM
Hi Rahul,
any idea on how we can execute this script on mysql database, below is my script
set time on
set sqlprompt "_user 'ON' _connect_identifier':'_date> "
SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP OFF
set pages 30000
COLUMN spool_file_log NEW_VALUE spool_file_log
SELECT DB_UNIQUE_NAME||'_AUDIT_EVIDENCE_'||'_'||TO_CHAR(SYSDATE , 'DDMONYYYY_HH24MISS')||'.html' spool_file_log from v$database;
SPOOL &spool_file_log
SELECT to_char(SYSDATE,'DD-MON-YYYY HH12:MI:SS AM') Report_Generate_AT FROM DUAL;
SELECT NAME,OPEN_MODE FROM V$DATABASE;
SELECT INST_ID,INSTANCE_NAME,HOST_NAME FROM GV$INSTANCE;
SELECT COUNT(*),USERNAME,INST_ID FROM GV$SESSION WHERE USERNAME IS NOT NULL GROUP BY USERNAME,INST_ID ORDER BY INST_ID;
SHOW PARAMETER AUDIT;
SELECT * FROM DBA_USERS ORDER BY USERNAME;
select PROFILE,RESOURCE_NAME,RESOURCE_TYPE,LIMIT from dba_profiles where RESOURCE_TYPE like 'PASSWORD%' order by PROFILE;
set long 1000
select '<PRE>'||DBMS_METADATA.GET_DDL('FUNCTION','DC_PASSWD_VERIFY_FUNCTION','SYS')|| '</PRE>' from DUAL;
SELECT * FROM DBA_SYS_PRIVS ORDER BY GRANTEE;
SELECT * FROM DBA_ROLE_PRIVS ORDER BY GRANTEE;
SELECT * FROM DBA_TAB_PRIVS where GRANTEE in (select username from dba_users where profile in ('DC_SUPPORT_PROFILE','DC_USER_PROFILE')) ORDER BY GRANTEE;
spool off
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2022 10:57 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2022 11:34 PM
Query will run against a given DB not Servers. I may think of server name may go in where clause of the query.
The Server Details given in Screen Shot is the Server where database is running.
Regards
RP