SQL & PL/SQL :: QUERY - Host Name And Max Logon Day?
Oct 27, 2010
I want to host name and max logon day from the below query But host name not belongs to start with 'IRS%' and 'EMEAUKIMIV00023828'.
My question is How to handle the backslash in oracle 8i and also check the below query is ok or not,
select host, max(logon_day) from (
select host,logon_day from system.stats$user_log
where host not like 'IRS%'
AND not in ('EMEAUKIMIV00023828'))
group by host;
I have a table that has three columns. UserId - DateStamp - Action
An action contains user activities such as "logon". A user may logon multiple times in a day.I'm trying to create a query that displays the number of unique logons for each user per day.
By doing the following:
select userid, to_char(creationtimestamp,'YYYY-MM-DD'), count(*) from useraction where action = 'logon' group by to_char(creationtimestamp,'YYYY-MM-DD'), userid order by to_char(creationtimestamp,'YYYY-MM-DD') desc;
I can get the following results userid - date - count 1 - 2/21/2010 - 8 1 - 2/22/2010 - 3 2 - 2/22/2010 - 2 1 - 2/23/2010 - 1 4 - 2/23/2010 - 6 6 - 2/23/2010 - 1
What I'm trying to get is 2/21/2010 - 1 2/22/2010 - 2 2/22/2010 - 3
I'm looking to create an after logon trigger... my question is - can this trigger be created by any user (i.e. other than sys) and - if so - what's required to ensure it fires for EVERY other user that log's on to the database?
How to grep client's IP address when LOGON to database? I write a trigger , but when compile , it show Error , Here is code :
CREATE OR REPLACE TRIGGER On_Logon AFTER LOGON ON The_user.Schema DECLARE v_addr VARCHAR2(11); BEGIN IF (ora_sysevent = 'LOGON') THEN v_addr := ora_client_ip_address; raise_application_error( '-20001', 'user IP: '||v_addr); END IF; END; [code]....
getting logon timestamp for our auditing process. In some website, it says to get the logon timestamp I have to select it from timestamp column of dba_audit_session but when I do this, some results has a logoff earlier than logon. Is timestamp column really the logon timestamp?
why my logon trigger always creates 2 records with different timestamp. Also is this the proper way of excepting records to insert?
Script.
CREATE OR REPLACE TRIGGER TR_LOGON_AUDIT AFTER LOGON ON DATABASE BEGIN If user<> 'DBSNMP' then -- don't want to insert this if user <> 'SYS' then -- don't want to insert this
[code]....
Result when select.
OS_USERNAME LOGON_TIMESTAMP ----------- ---------------- GAN 2010-08-05 14:27:52 GAN 2010-08-05 14:27:55
Which Privileges required to create a trigger like after logon on database. I have grant Create any trigger privilege to user but still not able to create and give me an error insufficient Privilege.
we have an application that is running from remote host to connect database using JDBC driver 10.2.0.2
but i am getting ORA-01017 error intermittently. we fetching stored username/pwd after every 5 min but for certain interval it's giving error and we get connection sucessful after some time with same username pwd.
the application monitor more number of databases but facing problem with only 1 instance.
-I have a Oracle Client 11.2.0.1 (*Administrator*) installed on a client machine on Redhat 6. -I have a database 11.2.0.1 testdb installed on another machine.
I configured tnsnames.ora for the client machine to connect my database testdb.If I use sqlplus to connect to the testdb from client machine, it's successful.However, If I use one of the jdbc connection string from the client machine, it reports "ORA-01017: invalid username/password; logon denied"
Case 2,
-I have a Oracle Client 11.2.0.1 (*Runtime*) installed on a client machine on Redhat 6. -I have a database 11.2.0.1 testdb installed on another machine.
I configured tnsnames.ora for the client machine to connect my database testdb.
-If I use sqlplus to connect to the testdb from client machine, it's successful. -If I use one of the jdbc connection string from the client machine, it 's successful too.
For case 1 and case 2, the only difference is the Oracle client (one is Runtime, the other is administrator)The database I have is set to
SQL> show parameters case
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ sec_case_sensitive_logon boolean FALSE
I am working in the company which is using PL/SQL to create web interface. Of course we are using mod_plsql. I was using OWA_UTIL get_cgi_env ('REMOTE_ADDR') in the packages and it was always properly returning the IP address of the client. But Now I want to use it in after logon on schema trigger and it is never initialized.
Maybe some other way to obtain the IP of the client machine just before calling the package which is showing the interface?
Here is the simplified code of the trigger:
CREATE OR REPLACE TRIGGER dev_debug_trg AFTER LOGON ON SCHEMA DECLARE l_ip VARCHAR2(200); BEGIN
is it possible to login as SYSDBA in oracle forms from normal logon procedure?
logon(sys_acc, sys_pwd||'@'||:GLOBAL.db_conn);
The reason behind this is to make a form which will alter user's password. But all the users are in SYS account and it is necessary to login as SYSDBA in forms to execute alter statement.
I have a log-in problem. I created the new database and when I try to log-in with system user, its giving ORA-01017: invalid username/password; log-in denied, and when I try to log-in with "/ as sysdba" its successfully logged in.
When I try to change SYSTEM user password, I successful change and connecting and after few seconds when I try to connect its again giving same error "ORA-01017: invalid username/password; log-in denied
One of our requirements is to secure the listener and other Oracle services by running them as a local OS account rather than as LocalSystem on the server.
I created a local OS account (assume it's named oracleuser), assigned it to the User and ORA_DBA groups on the server, and then I went to the Local Policies and added oracleuser to "Deny log on locally" and "Log on as a service".
I opened up the Services utility and stopped the four Oracle services we have running (OracleMTSRecoveryService, xxx_home1iSQL*Plus, xxx_home1TNSListener, and OracleServiceMYDB). I changed the "Log on as" for each service to oracleuser with its password (copied and pasted so I know there are no typo's), and restarted the services.
All the services except the listener started up. Attempting to start the listener caused the following error:
"The xxx_home1TNSListener service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service."
I tried rebooting the server and had the same result.For now just the listener service has been switched back to logging in as LocalSystem while the other services continue to use the local OS account and the database seems stable, but I do need to figure this out.
"ORA-01017: invalid username/password; logon denied" when attempting to log on to db, in three different applications. Error is observed in Toad, Crystal Reports, and MS ODBC Administrator connect test. However, same db credentials work in SQLPLUS.
Customer is attempting to log into reporting database hosted by my company, and using Cisco VPN client.I am unable to reproduce this at this time, on my machine, using same credentials and VPN profile.
Here is what we know/tried:
1. PING HOSTNAME is successful on CUSTOMER’S machine
2. TNSPING HOSTNAME is successful on CUSTOMER’S machine
3. SQLPLUS is successful with USER2/(pw)@HOSTNAME.int on CUSTOMER’S machine
4. We corrected timeout error on CUSTOMER’S side, by adding TCP.CONNECT_TIMEOUT=1000 in SQLNET.ORA (Also observed extremely slow performance on CUSTOMER SIDE)
5. We corrected dns suffix problem on CUSTOMER’S side, observed in NSLOOKUP by adding: IP ADDRESS AND HOSTNAME to Windows HOSTS file and commenting out default suffix COMPANY.com from SQLNET.ORA file
6. VPN configuration and VPN credentials are good.
We tested CUSTOMER’S VPN profle, CUSTOMER’S VPN credentials, and user USER2/(pw)@HOSTNAME on my machine (WIN7). I am able to maintain persistant connection to HOSTNAME for hours
7. TNSNames entries are good. Able to connect to db in Toad, and Crystal, on CUSTOMER’S machine using different Oracle user, USER3 (only has grant connect). Unable to logon to db, with Oracle user USER1, or USER2. (USER2 was created to try to resolve login problem w USER1, but issue still exists.)
8. CUSTOMER has Windows VISTA, does not have admin privileges, has Oracle 10 installed for client. Using same Cisco VPN client I have installed.
I'm setting up APEX REST security by following the instructions from [URL]...Everything works great according to document.
I can acquire a token, then passing it in the header to get needed data from REST service. Consumer acquires an token by going on web browser to [URL]...
It will be redirected to[URL]... asking for username and password on browser. Once entering them correctly, it will be directed to Redirect URI defined in the OAuth2 client with the token in the URL.
My question is that is it possible to do token acquiring by coding (like in Salesforce) without going to web browser? We've tried doing that, it will stop due to redirect to sign-on.
We are going to test migration of g10 to g11. To reduce maintenance of configuration we want to install new Oracle on the same server and start on the same port with the same SID. To achieve that we are going to configure new Oracle on different IP and hostname (managed by DNS, whatever). So listener will be configured like for different servers with identical SIDs.
I will be duplicating my production database back to a few weeks ago on my test server, to retrieve certain data. I am running 11g standard edition, not using a recovery catalog.
Below are the basic steps I plan to take in a nutshell.
1. Copy the backup files to the test system
2. In the rman run block (on the test server) A. Set newname for each of the datafiles and tempfiles (don't have many files) B. Duplicate command to point in time, specifying backup location and no filename check.
Here i have three tier application. I want to know it host name from sid or sqlid . I want to know which query run on which host. Because i have one user from application to database. So i want to know which query consume more time on which host ?