Query to find the user is having access to sql server DB

Hi,
Please help me in this.
Query to find the whether the user is having access to sql server DB.
Cheers,
sajith

TUBBY_ORCL?Select 1 from dual where 'ORACLE' = 'SQL SERVER';
no rows selected
Elapsed: 00:00:00.01

Similar Messages

  • Query to find the memory of database in oracle,sql

    Hi All,
    Please let me know the query to find the memory of database in oracle,sql.
    Thanks,
    sajith

    How do I find the overall database size?
    The biggest portion of a database's size comes from the datafiles. To find out how many megabytes are allocated to ALL datafiles:
    select sum(bytes)/1024/1024 "Meg" from dba_data_files;
    To get the size of all TEMP files:
    select nvl(sum(bytes),0)/1024/1024 "Meg" from dba_temp_files;
    To get the size of the on-line redo-logs:
    select sum(bytes)/1024/1024 "Meg" from sys.v_$log;
    Putting it all together into a single query:
    select a.data_size+b.temp_size+c.redo_size "total_size"
    from ( select sum(bytes) data_size
    from dba_data_files ) a,
    ( select nvl(sum(bytes),0) temp_size
    from dba_temp_files ) b,
    ( select sum(bytes) redo_size
    from sys.v_$log ) c;
    Another query ("Free space" reports data files free space):
    col "Database Size" format a20
    col "Free space" format a20
    select round(sum(used.bytes) / 1024 / 1024 ) || ' MB' "Database Size"
    , round(free.p / 1024 / 1024) || ' MB' "Free space"
    from (select bytes from v$datafile
    union all
    select bytes from v$tempfile
    union all
    select bytes from v$log) used
    , (select sum(bytes) as p from dba_free_space) free
    group by free.p
    This is what I use :P From http://www.orafaq.com/wiki/Oracle_database_FAQ#How_do_I_find_the_overall_database_size.3F

  • Is there one tell  me the correct way to access remote SQL server

    Hi
    I have tried to access a remote SQL server by many ways but all failed
    here is my trying :
    String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
    String url= "jdbc:microsoft:sqlserver://217.52.98.102:1433";
    Class.forName(driver);
    Connection conn = DriverManager.getConnection(url,"sa"," " );
    String selectStr = "select * from FleetWatch..table_name";
    Statement st = conn.createStatement();
    ResultSet rs = st.executeQuery(selectStr);
    DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
    // connect to the DB by using the driver.
    String connString = "217.52.98.102:1433;databasename=FleetWatch";
    String strDBConnect = "jdbc:microsoft:sqlserver://" + connString;
    conn = DriverManager.getConnection(strDBConnect, "sa", "");
    String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
    Class driverClass = Class.forName(driver, true, jdbcLoader);
    Driver currDriver = (Driver)driverClass.newInstance();
    Properties prop = new Properties();
    prop.setProperty("sa", (String)paras.get("sa");
    prop.setProperty("password", (String)paras.get(" ");
    String url= "jdbc:microsoft:sqlserver://217.52.98.102:1433";
    conn = currDriver.connect((String)paras.get(url, prop);
    pls tell if you know the correct way to access a remote sql server and
    access it befor tell me its step to ensure it's connect

    String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
    String url= "jdbc:microsoft:sqlserver://your servername:1433";
    Class.forName(driver);
    Connection conn = DriverManager.getConnection(url,"username ","password " );
    this user name and password may be diff becoz if u have only sql authentication then u have to know that user name or it can have windows nt authentication so if it is so then no probs can use ur windows nt login..
    know the server name where ur sqlserver is connected to.
    set the classpath for the sqlserverdrivers jar files which u have downloaded where ur working on.
    then it works
    i did the same and worked for me.
    try it.

  • I want to impersonate user when I access Microsoft SQL Server from powershell

    Hi,
    Actually I have to perform some SQL operation on my MSSQL server database. but problems is that I have given all credentials (windows fix login/password which can access database) in connection string. but when I execute the script then it is always using
    my windows login and password and then giving error that not able to connect with it.
    My personal windows credentials does not have access to my enterprise database that is why I am using service ID.
    I came to know that I have to do user impersonation of user when i access database but how to do that?? can you guys give me the syntax for that as i have to perform all sql operation using impersonation.
    Please reply me as soon as possible as i stuck since long
    Vipul Mistry Sr. Embedded Engineer www.eInfochips.com

    Hi Guys,
    thanks a lot for your support and replies but I found the solution. With below code i was able to do my task and I used $AuthType =3 for my purpose. Hope this will help others also.
    $varDBServer = "N0SQL104,1675"
    $varDBInstance = ""
    $varDBSchema = "Data_Dev"
    $varDBUser = "S0060VMSD"
    $varDBPassword = "SDCFG345D"
    #### Choose authentication type (0=SSO, 1= SQL, 2=Domain)
    $AuthType = 3
    #### Load the required assembly for sql server administration
    #### Requieres SQLServerNativeClient, SQLSysClrTypes and SharedManagementObjects
    [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
    $varSQLServer = New-Object -typeName Microsoft.SqlServer.Management.Smo.Server -argumentList "$varDBServer\$varDBInstance"
    switch ($AuthType) {
    1 {
    #### Access the SQL-Server with your current credentials (pass-through)
    $varSQLServer.ConnectionContext.LoginSecure = $true
    2 {
    #### Access the SQL-Server with SQL-Server credentials in mixed mode authentications
    $varSQLServer.ConnectionContext.LoginSecure = $false
    $varSQLServer.ConnectionContext.Login = $varDBUser
    $varSQLServer.ConnectionContext.Password = $varDBPassword
    3 {
    #### Access the SQL-Server with given domain user credentials
    $varSQLServer.ConnectionContext.LoginSecure = $true
    $varSQLServer.ConnectionContext.ConnectAsUser = $true
    $varSQLServer.ConnectionContext.ConnectAsUserName = $varDBUser
    $varSQLServer.ConnectionContext.ConnectAsUserPassword = $varDBPassword
    } default {
    Write-Host "Please select an authentication type: 0=SSO, 1= SQL, 2=Domain"
    exit -1
    #### Try connection to SQL-Server with given parameters
    Write-Host "`nTry connection to SQL-Server with given parameters`n"
    try {
    $varBuildOfSQLServer = $varSQLServer.Version.get_Build()
    Write-Host "Build of SQL-Server '$varDBServer' is $varBuildOfSQLServer"
    } catch {
    Write-Host "ERROR: Cannot access SQL-Server '$varDBServer'. Exit script!"
    exit –1
    Vipul Mistry Sr. Embedded Engineer www.eInfochips.com

  • Query to find the users

    i have created user call mastermap
    osod
    boundary
    i need to get only above users in my query not the default and sample schemas like scott,dbsmnp...etc
    select username ifrom dba_users ....lists everyuser
    please let me know if any query for above request
    thanks for help

    856483 wrote:
    i have created user call mastermap
    osod
    boundary
    i need to get only above users in my query not the default and sample schemas like scott,dbsmnp...etc
    select username ifrom dba_users ....lists everyuser
    please let me know if any query for above request
    thanks for help
    select username from dba_users where USERNAME IN('MASTERMAP','OSOD','BOUNDARY');

  • Query to find the user ID create date and locked date

    Hi,
    As title, below is my query, it seem that it will not work as my expectation, can someone help?
    SELECT T0.[USER_CODE], T0.[U_NAME], T0.[LOCKED], T0.[LstLogoutD] AS 'Last Logon Date' , T1.[CreateDate]  FROM OUSR T0  INNER JOIN AUSR T1 ON T0.USERID = T1.userSign WHERE T0.[LOCKED] = 'N' AND
          T1.logInstanc = 1
    Thanks

    Try this
    After the Mr. Nagarajan post
    SELECT
    T0.[USER_CODE], T0.[U_NAME], Case when Isnull((Select Min(T1.date) from usr5 T1 where T0.USER_Code = T1.usercode GROUP by T1.Usercode), 0) <> 0 then (Select Min(T1.date) from usr5 T1 where T0.USER_Code = T1.usercode GROUP by T1.Usercode) else T0.[updateDate] end 'Creation date', T0.[lastLogin], T0.[Locked] FROM [dbo].[OUSR] T0
    Regards,

  • Find the service which controls agent on job server and find out the login it's using ?

    How do I find the service that's controlling my SQL server agent on the job server and find out the login it's using ? Is there a query for this ?

    Go to SQL Server Configuration Manager and you will see the SQL Server Agent service there with all the information you need.
    Programmatic way:
    http://stackoverflow.com/questions/7324407/get-service-account-details-of-the-sql-agent-service
    Kalman Toth Database & OLAP Architect
    IPAD SELECT Query Video Tutorial 3.5 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Is there any way of importing stuffs from Microsoft Access to SQL Server?

    I have quite a big store of information Microsoft Access DB, but now i am required to switch to SQL Server?
    Is there any way of importing to SQL Server, either by Java programming or manually?
    Thank you in advance.

    I like to give some tips on how to fulfil the requirement.. I haven't tried this. If you succeeded, it is well and good.
    1) Using Java:
    If you like to Java to import the data from MS Access to SQL Server, you have to write a JDBC Program in such a way that it has to retrieve the data from each MSAccess tables and store it in temperory java varaible.After writng into the temp. varaibles, the same thing will be written into SQL Server. The whole process is repeated for all the tables in MS Access.
    2) Manual Process:
    Try to get the data scripts from MS-Access for all the tables and Load the same into SQL Server
    I hope that Manual Process consumes less time compared in writing the codes for transformation..
    I hope that you got some idea on reading this. If you have any doubts, try to get back to me..

  • Query to find the list of users having access to a particular scenario

    Hi,
    I am learning Hyperion Planning 9.2 x version. I wanted to know the query to find the list of users having access to Plan Iteration - 1 scenarion.
    As I am new to Hyperion Essbase and Hyperion Planning, I am assuming these ideas work out to get the desired result.
    1) As Hyperion Planning uses Relational DB to store the User Security information, we can query the list of users who is having access to Plan Iteration - 1 Scenario.
    I am not sure if this solution works. Please correct me If I am wrong.
    2) We can also query from the essbase editor to find out who all having access to this scenario.
    If the above is correct, can you please provide me the query.
    I am really need of this and I will be happy if any one provide the solution.
    Thanks & Regards,
    Upendra. Bestha

    Hi,
    If you are looking for some SQL to retrieve the access rights by member then you can use something like (SQL Server code though can easily be modified for Oracle)
    SELECT usr.object_name as Username,mem.object_name as Member,
    'Access Rights' = CASE acc.access_mode
    WHEN -1 THEN 'None'
    WHEN 1 THEN 'Read'
    WHEN 2 THEN 'Write'
    WHEN 3 THEN 'Write'
    ELSE 'Unknown' END,
    'Relation' = CASE acc.flags
    WHEN 0 THEN 'Member'
    WHEN 5 THEN 'Children'
    WHEN 6 THEN 'Children (inclusive)'
    WHEN 8 THEN 'Descendants'
    WHEN 9 THEN 'Descendants (inclusive)'
    ELSE 'Unknown' END
    FROM
    hsp_access_control acc, hsp_object mem, hsp_object usr
    WHERE acc.object_id = mem.object_id
    AND acc.user_id = usr.object_id
    AND mem.object_name = 'Plan Iteration - 1'
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Find query technical name for a deleted query/workbook in the User Menu

    Hi,
    When a BEx workbook or BEx query is published in a role, people with that role will see the query / workbook in their user menu.
    It is possible to change the caption/title of the 'node' in the user menu so it does not necessarily have the same name as the report.
    I am now in a situation where a user tries to run a query/workbook from the user menu, and runs in an error message 'query does not exist on server'.
    How can I found out to which query/workbook a node in the user menu refers?
    I have tried the Metadata repository but because of the many nodes in the user menu this is a laborious task.
    I was hoping to find a table where I could use the role name and node name to find the 'target' report but I haven't been able to find such a table.
    Any (other) suggestions?
    Many thanks,
    Jan.

    Hi,
    You can publish the workbook to the role and as user have access to the role he can access the workbook also.
    Regards,
    Kams

  • Query to find the list of BP without having Particular GL transactions.

    Hi Experts,
    I want the query to find the List of Business partner who is not having Journal entry for Certain General ledger.
    Scenario: we are creating JE for TDS posting.
    so, i want to know the list of BP , who and all not having particular TDS GL for the particular period.
    Thanks in advance,
    Dwarak

    Hi Dwarak,
    Sure, no problem
    DECLARE @AcctCode AS NVARCHAR(100)
    SELECT @AcctCode=T0.AcctCode FROM OACT T0 WHERE T0.AcctCode='[%0]'
    DECLARE @DateFrom AS DATETIME
    SELECT @DateFrom=T1.RefDate FROM JDT1 T1 WHERE T1.RefDate=[%1]
    DECLARE @DateTo AS DATETIME
    SELECT @DateTo=T2.RefDate FROM JDT1 T2 WHERE T2.RefDate=[%2]
    SELECT CardCode FROM OCRD WHERE CardType='S'
    AND CardCode NOT IN(
    SELECT DISTINCT ContraAct FROM JDT1
    WHERE Account=@AcctCode AND RefDate BETWEEN @DateFrom AND @DateTo)
    Ok, now, here's the problem that I just encountered. This query will work, but, no matter how we fill the parameter, it will show you the very same result. To be honest, I don't know what's wrong with this query.
    If you change all the variables ( @AcctCode and @DateFrom and @DateTo ) directly, it will give you the accurate result. Take this as an example:
    SELECT CardCode FROM OCRD WHERE CardType='S'
    AND CardCode NOT IN(
    SELECT DISTINCT ContraAct FROM JDT1
    WHERE Account='10030201' AND RefDate BETWEEN '2011-09-01' AND '2011-09-20')
    I hard-code the account code, date from and date to for selection. System will show you the accurate result, but using parameter as in first query, system show same result no matter how we fill the parameter.
    Sorry, it seems that I could only partially solved your problem here. I already tried to create a stored procedure and executing the stored procedure with parameter, but still, somehow SBO show very same result no matter if we change the parameter.
    So, my solution need user to manually change the parameter in query. I know, this is a stupid solution, I'm afraid I can't help you to achieve perfect solution here. Maybe anyone here in the forum could guide me to fix my mistake in first query and how to rectify it?
    Best Regards,
    Hendry Wijaya

  • Query to find the Views and synonyms that are accessing through db_link

    HI all,
    Oracle 10g
    I need a Query to find the Views and synonyms that are accessing through db_link.
    ie.
    database A have the db_link to database B through a schema A
    now i need to find what are the Synonyms and views that are accessing through db_link either directly or indirectly..
    regards,
    Deepak
    Edited by: Deepak_DBA on Dec 10, 2010 5:38 PM

    On the second database (B) use this query to find the SQL which used by the schema A (DB LINK USER). Check the SQL_FULLTEXT column.
    select sql_fulltext,sql_id,module,parsing_schema_name,parsing_user_id,first_load_time,loads,users_executing,rows_processed,plsql_exec_time,sorts,fetches,invalidations,parse_calls,cpu_time,elapsed_time,disk_reads,buffer_gets
    from V$sqlarea
    where parsing_schema_name = 'A' --and to_char(first_load_time,'dd/mm/yyyy') like  '%11/08/2007'
    order by first_load_time desc;
    Regards
    Asif Kabir

  • Query to find the application user

    Hi,
    what is the query to find the application user in sql command?
    I tried the below query
    select app_user from dual;
    app_user invalid identifierthanks.

    Use bind variable notation:
    select :app_user from dualThis is a reduced example, right? Can't see any reason to run such a query instead of using one of the documented methods of referencing built-in substitution values.
    Please try to use the documentation to answer such basic questions.

  • How to revoke a user from having access to a table

    Hi,
    what is the syntax to revoke a user from having access to a certain table ??
    I want to revoke SELECT, UPDATE, INSERT, and DELETE ?
    thanks,

    Hi,
    Try this:
    revoke select, update, delete, insert on your_table from some_user;You can find more info at the docs:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_9020.htm

  • Unable to find the IT Resource in Access Policy

    Hi,
    i have created the IT Resource in OIM11gR2 PS1. then i am trying to create the new access policy. i am unable to find the IT Resource in access policy. can someone please help on this.
    Shyam

    can you verify the access permissions. By default SYSTEM ADMINISTRATORS role should have read/write permission
    or you can click ->Assign Role. then select ALL USERS role and provide read/write permission to it and see if this works.

Maybe you are looking for