Script to find out patch of database
OS: Windows
Database: Oracle 9i realease 2
I learnt there is a script to find out the patch level of a database, can anyone advise please.
That works, when the database is running. I don't know a script, but you may call an executable and catch the release number, for example:
rman
Recovery Manager: Release 10.2.0.2.0 - Production on Thu Oct 12 13:44:03 2006
But patching does not necessarily mean all components are always patched to the highest level.
Werner
Similar Messages
-
Script to find out important ports in an xml file.
Is there any script to find out important ports detail in the xml file ??
928983 wrote:
Is there any script to find out important ports detail in the xml file ??Use the grep command -- http://bit.ly/KqYTVf
Thanks,
Hussein -
Script to find out that users do not have inheritable permission checked
Hi all,
I just check our AD (windows 2003 R2) and some users have "allow inheritable permissions from the parent to propagate to this object and all child objects. include these with entries expilitly defined here" checked if I open active directory
users and computers console and highlight this user and go to properties and select security and click advanced). some users do not have ""allow inheritable permissions from the parent to propagate to this object and all child objects. " checked.
Is there a way to script to find out which users do not have "allow inheritable permissions from the parent to propagate to this object and all child objects. .." checked?
Thank you for your help.There are several ways to use ADO in a VBScript program. The alternative below uses an ADO command object, so we can specify a "Page Size". This overcomes the 1000 (or 1500) limit on records returned, as it turns on paging. I have also modified
the script for comma delimited output. This script should be run at a command prompt so the output can be redirected to a text file. For example:
cscript //nologo FindUsers.vbs > report.csv
The modified script follows:
Option Explicit
Dim adoCommand, adoConnection, strBase, strFilter, strAttributes
Dim objRootDSE, strDNSDomain, strQuery, adoRecordset, strNTName, strDN
Dim objUser, objSecurityDescriptor, intNTSecDescCntrl, strInheritable
Const SE_DACL_PROTECTED = &H1000
' Setup ADO objects.
Set adoCommand = CreateObject("ADODB.Command")
Set adoConnection = CreateObject("ADODB.Connection")
adoConnection.Provider = "ADsDSOObject"
adoConnection.Open "Active Directory Provider"
Set adoCommand.ActiveConnection = adoConnection
' Search entire Active Directory domain.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
strBase = "<LDAP://" & strDNSDomain & ">"
' Filter on user objects.
strFilter = "(&(objectCategory=person)(objectClass=user))"
' Comma delimited list of attribute values to retrieve.
strAttributes = "distinguishedName,sAMAccountName"
' Construct the LDAP syntax query.
strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
adoCommand.CommandText = strQuery
adoCommand.Properties("Page Size") = 500
adoCommand.Properties("Timeout") = 30
adoCommand.Properties("Cache Results") = False
' Run the query.
Set adoRecordset = adoCommand.Execute
' Enumerate the resulting recordset.
' Write a header line.
Wscript.Echo """NT Name"",""Distinguished Name"",""Allow inheritable permissions"""
Do Until adoRecordset.EOF
' Retrieve values.
strNTName = adoRecordset.Fields("sAMAccountName").Value
strDN = adoRecordset.Fields("distinguishedName").Value
strDN = Replace(strDN, "/", "\/")
Set objUser = GetObject("LDAP://" & strDN)
Set objSecurityDescriptor = objUser.Get("ntSecurityDescriptor")
intNtSecDescCntrl = objSecurityDescriptor.Control
If (intNtSecDescCntrl And SE_DACL_PROTECTED) <> 0 Then
strInheritable = "Disabled"
Else
strInheritable = "Enabled"
End If
Wscript.Echo """" & strNTName & """,""" & strDN & """," & strInheritable
' Move to the next record in the recordset.
adoRecordset.MoveNext
Loop
' Clean up.
adoRecordset.Close
adoConnection.Close
Richard Mueller
MVP ADSI -
Script to find out table and index candidates to keep in the buffer pool
I am looking for a script to find out tables and indexes to keep in the buffer pool.
Could you help me on this ?
thanks...
Markusthis is more of a open question. As you know ur data well. We do not know whats ur data. cachin tables in buffer pool is okay, but it might age out after not being used...instead you can use the KEEP POOL...to cache small tables/popular tables into the keep pool...as keep pool guarantees full caching .....
here are some links on keep pool cacheing
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/memory.htm#sthref410
http://www.dba-oracle.com/oracle_tips_cache_small_fts.htm
http://www.dba-oracle.com/t_script_automate_keep_pool_tables_indexes.htm
http://www.dba-oracle.com/oracle_news/news_caching_keep_pool_large_objects_clob_blob.htm
Edited by: user630084 on Apr 8, 2009 5:48 AM -
How to find out that the database table is empty
Hello all,
How to find out in ABAP in the best performant way, that the database table is empty. The table could have several milions of records or be empty. SELECT count( * ) looks to me as not the best way.
Kind regards
Radim Benek
Moderator message: FAQ, please search for previous discussions of similar topics.
example: "SELECT SINGLE" vs. "SELECT UP TO 1 ROWS"
Moderator message: Please Read before Posting in the Performance and Tuning Forum
Edited by: Thomas Zloch on Aug 11, 2011 5:06 PMHi,
One approach is:
check lt_mytable is initial.
This will be true if there are no lines.
Another:
describe table lt_mytable lines lv_count
if lv_count = 0.
"Empty
Thanks.
Anitha a -
How can find out LONG column database?
Hi,
in my database ORA-1461 error occured
01461, 00000, "can bind a LONG value only for insert into a LONG column
how can find out LONG column in my database ?DESCRIBE
The description for tables, views, types and synonyms contains the following information:
each column's name
whether or not null values are allowed (NULL or NOT NULL) for each column
datatype of columns, for example, CHAR, DATE, LONG, LONGRAW, NUMBER, RAW, ROWID, VARCHAR2 (VARCHAR), or XMLType
precision of columns (and scale, if any, for a numeric column)
Extract of the link;
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12019.htm#SQPUG040
Secondly with reference to the error;
Do not try to insert LONG datatypes into other types of columns.
Hope this helps.
Adith -
Wmi script to find out the time when the user was added to local administration group
Hi Friends,
i need a script/query based on wmi/wql that find out the time when the user was added to local administration group on this computer
Regards
Tanoj
OSLM ENGINEER - SCCM 2007 & 2012WMI does not keep security information.
Unless you have enabled auditing, this information is not retained in any way.
If auditing is enabled, you can write a powershell script to look for the specific event in the eventlog. More specifically, you should look for all security events with id 4732 containing the group.
this one command does the trick
get-eventlog -logname security -instanceid 4732 -message *administrators*
https://technet.microsoft.com/en-us/library/dd772663(v=ws.10).aspx
MCP/MCSA/MCTS/MCITP -
How to find out object / schema / database level replication is active
Hi,
I am an experienced DBA but new to streams and I am asked to support an existing streams configuration between two Oracle 10g databases. I was told it is bi-directional but one database is standby and it never took traffic. My questions are
1. How will I find out whether it is a database or schema level replication? Any queries that I can run to find it out?
2. How do I find out it is bi-directional and it iis current. What queries I can run to confirm?
3. How will I find out the excluded objects? Any queries please...
Thanks for the help
Regards
Ramahttp://www.morganslibrary.org/reference/dyn_perf_view.html#dyst
SELECT name FROM dba_dependencies
WHERE referenced_name = 'DBMS_STREAMS_ADM' AND name LIKE 'DBA%'
UNION
SELECT referenced_name FROM dba_dependencies
WHERE name = 'DBMS_STREAMS_ADM' AND referenced_name LIKE 'DBA%'; -
How to find out whether Oracle database was upgraded ??
Hi,
I need to find out whether my Oracle database was upgraded, If yes how to find out by SQL query .I know their is database_properties table, but when I try to query that it didnt gave me the output which I required.
Like in SAP we have uvers table which keep info about the upgrade history, whether such history is avaliable in oracle ?? . Iam looking out for output which is like old database Release 9.2.0.7 and new database release 10.2.0.2.
Whether similar such history is maintained in Oracle database.
Awaiting for your feedback.
Kind Regards
NeenadHi all,
After checking all the material,I dont think prior to 10g, oracle register its earlier version.
The views of v$version show the current version for various components and also dba_registry displays info about catlog/catproc versions.
In 10g, you can use the following query to know the version when the database was broughtup.
select startup_time,version,db_name from dba_hist_database_instance.
Anways thanks to all of you.
Kind Regards
Neenad -
Hi All,
Please some one help me how to find below the patches applied or not.
Patch 11i.CAC.B
Patch 11i.ALR.G
11i.JTA.F
AME PATCH :DELIVERY OF GA AND RULE PRIORITY FUNCTIONALITY.
I need urgent Please help me.
Thanks...Hi,
You can run below query to find out specific patch number:
select bug_id, bug_number from ad_bugs where bug_number='&no.';Also you can find out using OAM > Sitemap > Maintenance > Applied Patches - here search for specific patch
You can see all applied patches in you env using patchset.sh utility
Refer:
*Oracle Applications Current Patchset Comparison Utility - patchsets.sh [ID 139684.1]*
thanks,
X A H E E R -
How to find out who updated database tables
Hi
We are using Oracle Database 10g Release 10.2.0.4.0.
A user, via pl/sql developer, has been updating data on our database. This resulted in certain reports not balancing. At that time, we did not have database triggers on the tables concerned. We now need to go back at least a month or more to see who had updated these tables. We have a username, is there any script that we can use? How accurate is v$active_session_history? Would it give us all the info we need?781424 wrote:
Hi
We are using Oracle Database 10g Release 10.2.0.4.0.
A user, via pl/sql developer, has been updating data on our database. This resulted in certain reports not balancing. At that time, we did not have database triggers on the tables concerned. We now need to go back at least a month or more to see who had updated these tables. We have a username, is there any script that we can use? How accurate is v$active_session_history? Would it give us all the info we need?It is little easy to know with AUDITING, or use Log miner to analyze log files. -
Need a Script to find out the Grayed out agents in SCOM 2012
Hi,
I am trying to create a Dashboard view to list the Grayed Out servers in my SCOM 2012 environment by using the script below but it does not work as expected.
Is there something wrong with this script or could you suggest me any other solution please?
#Get all agent objects which are not available (grey)
$agentclass = Get-SCOMClass -Name "Microsoft.SystemCenter.Agent"
$agentobjects = Get-SCOMMonitoringObject -Class:$agentclass | Where-Object {$_.IsAvailable -eq $false}
foreach ($agent in $agentobjects)
$dataObject = $ScriptContext.CreateFromObject($agent, "Id=Id,State=HealthState,Display Name=DisplayName", $null)
#Get the watcher state for the agent
$watcher = Get-SCOMClass -name "Microsoft.SystemCenter.HealthServiceWatcher"| get-scomclassinstance | Where-Object {$_.Displayname -eq $agent.DisplayName}
$dataObject["Watcher State"] = $watcher.HealthState.toString()
$ScriptContext.ReturnCollection.Add($dataObject)
Thanks
SriniTry some of these:
Stefan
Maurice
Similar
Topic
Regards, Blake Email: mengotto<at>hotmail.com Blog: http://discussitnow.wordpress.com/ If my response was helpful, please mark it as so, if it answered your question, then please also mark it accordingly. Thank you. -
Find out the calling database in a sproc called from a different database
Hello, I'm trying to figure out how to identify the calling database within a sproc on a different database without using a parameter. Any ideas?
ThanksHi First Kit Carson,
Regarding your description, are you looking for something as below?
CREATE DATABASE TestDB1
CREATE DATABASE TestDB2
GO
USE TestDB1
CREATE TABLE TestDB2.dbo.T1(ID INT);
CREATE TABLE TestDB2.dbo.T2(ID INT);
GO
CREATE PROC dbo.PROC1
AS
SELECT * FROM TestDB2.dbo.T1
GO
CREATE PROC dbo.PROC2
AS
SELECT * FROM TestDB2.dbo.T2
GO
SELECT *
FROM sys.dm_sql_referenced_entities ('dbo.PROC2', 'OBJECT');
SELECT R.SPECIFIC_CATALOG,r.SPECIFIC_NAME,cat.* FROM
INFORMATION_SCHEMA.ROUTINES R
CROSS APPLY
SELECT referenced_server_name,referenced_database_name,referenced_schema_name,referenced_entity_name,referenced_minor_name,referenced_class_desc
FROM sys.dm_sql_referenced_entities(R.SPECIFIC_SCHEMA+'.'+R.SPECIFIC_NAME,'OBJECT')
) AS cat
WHERE R.ROUTINE_TYPE='PROCEDURE'
GO
USE master
DROP DATABASE TESTDB1,TESTDB2
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support -
Hi,
Can you please on the above issue? I have one script which works fine for sp2010 but not sp2013 below,
Script
function Check_User_In_ActiveDirectory([string]$LoginName, [string]$domaincnx)
$returnValue = $false
#Filter on User which exists and activated
#$strFilter = "(&(objectCategory=user)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(samAccountName=$LoginName))"
#Filter on User which only exists
#$strFilter = "(&(objectCategory=user)(objectClass=user)(samAccountName=$LoginName))"
#Filter on User and NTgroups which only exists
$strFilter = "(&(|(objectCategory=user)(objectCategory=group))(samAccountName=$LoginName))"
$objDomain = New-Object System.DirectoryServices.DirectoryEntry($domaincnx)
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.PageSize = 1000
$objSearcher.Filter = $strFilter
$objSearcher.SearchScope = "Subtree"
#$objSearcher.PropertiesToLoad.Add("name")
$colResults = $objSearcher.FindAll()
if($colResults.Count -gt 0)
#Write-Host "Account exists and Active: ", $LoginName
$returnValue = $true
return $returnValue
function ListOrphanedUsers([string]$SiteCollectionURL, [string]$mydomaincnx)
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
$site = new-object Microsoft.SharePoint.SPSite($SiteCollectionURL)
$web = $site.openweb()
#Debugging - show SiteCollectionURL
write-host "SiteCollectionURL: ", $SiteCollectionURL
Write-Output "SiteCollectionURL - $SiteCollectionURL"
$siteCollUsers = $web.SiteUsers
write-host "Users Items: ", $siteCollUsers.Count
foreach($MyUser in $siteCollUsers)
if(($MyUser.LoginName.ToLower() -ne "sharepoint\system") -and ($MyUser.LoginName.ToLower() -ne "nt authority\authenticated users") -and ($MyUser.LoginName.ToLower() -ne "nt authority\local service"))
#Write-Host " USER: ", $MyUser.LoginName
$UserName = $MyUser.LoginName.ToLower()
$Tablename = $UserName.split("\")
Write-Host "User Login: ", $MyUser.LoginName
$returncheck = Check_User_In_ActiveDirectory $Tablename[1] $mydomaincnx
if($returncheck -eq $False)
#Write-Host "User not exist: ", $MyUser.LoginName, "on domain", $mydomaincnx
Write-Output $MyUser.LoginName
$web.Dispose()
$site.Dispose()
function ListOrphanedUsersForAllColl([string]$WebAppURL, [string]$DomainCNX)
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
$Thesite = new-object Microsoft.SharePoint.SPSite($WebAppURL)
$oApp = $Thesite.WebApplication
write-host "Total of Site Collections: ", $oApp.Sites.Count
$i = 0
foreach ($Sites in $oApp.Sites)
$i = $i + 1
write-host "Collection N° ", $i, "on ", $oApp.Sites.Count
if($i -gt 0)
$mySubweb = $Sites.RootWeb
$TempRelativeURL = $mySubweb.Url
ListOrphanedUsers $TempRelativeURL $DomainCNX
function StartProcess()
# Create the stopwatch
[System.Diagnostics.Stopwatch] $sw;
$sw = New-Object System.Diagnostics.StopWatch
$sw.Start()
#cls
ListOrphanedUsersForAllColl "http://portal" "LDAP://DC=Srabon,DC=com"
ListOrphanedUsersForAllColl "http://portal/sites/Test" "LDAP://DC=Srabon,DC=com"
$sw.Stop()
# Write the compact output to the screen
write-host "Time: ", $sw.Elapsed.ToString()
StartProcess
# Can be executed with that command : "Check-SharePoint-Orphaned-Users.ps1 > orphaned_users.txt"
srabonHi Srabon,
Try this it works in SP2007, SP2010, and SP2013.
Mod line 70: $WebAppURL="http://intranet.contoso.com" to your "http://WebApp"
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
#Functions to Imitate SharePoint 2007, 2010, 2013
function global:Get-SPWebApplication($WebAppURL)
return [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup($WebAppURL)
function global:Get-SPSite($url)
return new-Object Microsoft.SharePoint.SPSite($url)
function global:Get-SPWeb($url)
$site= New-Object Microsoft.SharePoint.SPSite($url)
if ($site -ne $null)
$web=$site.OpenWeb();
return $web
#Check if User exists in ActiveDirectory
function CheckUserExistsInAD()
Param( [Parameter(Mandatory=$true)] [string]$UserLoginID )
#Search the User in ActiveDirectory
$forest = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
foreach ($Domain in $forest.Domains)
$context = new-object System.DirectoryServices.ActiveDirectory.DirectoryContext("Domain", $Domain.Name)
$domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetDomain($context)
$root = $domain.GetDirectoryEntry()
$search = [System.DirectoryServices.DirectorySearcher]$root
$search.Filter = "(&(objectCategory=User)(samAccountName=$UserLoginID))"
$result = $search.FindOne()
if ($result -ne $null)
return $true
return $false
$WebAppURL="http://intranet.contoso.com"
#Get all Site Collections of the web application
$WebApp = Get-SPWebApplication $WebAppURL
#Iterate through all Site Collections
foreach($site in $WebApp.Sites)
#Get all Webs with Unique Permissions - Which includes Root Webs
$WebsColl = $site.AllWebs | Where {$_.HasUniqueRoleAssignments -eq $True} | ForEach-Object {
$OrphanedUsers = @()
#Iterate through the users collection
foreach($User in $_.SiteUsers)
#Exclude Built-in User Accounts , Security Groups & an external domain "corporate"
if (($User.LoginName.ToLower() -ne "nt authority\authenticated users") -and
($User.LoginName.ToLower() -ne "sharepoint\system") -and
($User.LoginName.ToLower() -ne "nt authority\local service") -and
($user.IsDomainGroup -eq $false ) -and
($User.LoginName.ToLower().StartsWith("corporate") -ne $true) )
$UserName = $User.LoginName.split("\") #Domain\UserName
$AccountName = $UserName[1] #UserName
if ( ( CheckUserExistsInAD $AccountName) -eq $false )
Write-Host "$($User.Name)($($User.LoginName)) from $($_.URL) doesn't Exists in AD!"
#Display Orphaned users
$OrphanedUsers+=$User.LoginName
# <<<UNCOMMENT to Remove Users#
# Remove the Orphaned Users from the site
# foreach($OrpUser in $OrphanedUsers)
# $_.SiteUsers.Remove($OrpUser)
# Write-host "Removed the Orphaned user $($OrpUser) from $($_.URL) "
$web.Dispose()
$site.Dispose()
-Ivan -
Find out all oracle databases on the system
hi
i want to list all the oracle databases existing on the system.Not all the table list but the database list for Oracle.
Can anyone help in this matter. I would be thankful.
trushantAssuming you really mean databases (as distinguished by different SIDs or service names), I don't think there's any way to that with JDBC; you have to know the name of the database before you can connect to it.
If you mean the list of all schemas (which are called databases in other database products) then you can inspect the ALL_TABLES table:
SELECT DISTINCT OWNER
FROM ALL_TABLES;This won't list all schemas, but it will list all schemas that the connecting user has access to (if there's a table in the schema); users with DBA privileges see everything, of course. You could also look at the ALL_USERS table.
If neither of those answer the question you're asking, please clarify what you mean.
Maybe you are looking for
-
Need help with my CD DVD Drive
I'll apologize in advance, because I know this message is going to be confusing, but if you can stick with me to the end, you will understand why. Basically, the problem is that although my Powermac G4 can read almost any commercial disk, it is unpre
-
OSB singlethreaded processing PS not working when delivery failure is set
Hi, Below is my process flow JMSQ -> JMS PS -> BS - > Endpoint So i have the requirement to send the messages one at a time so i did 2 settings 1. JMS connection -> Max messages per session =1 2. Created WorkManager with Max threads 1 This works fine
-
Playing a single album on shuffle
Can someone let me know how I can play one album on shuffle in itunes when I have multiple albums by that artist? I know this is probably really simple but all I seem to be able to do is shuffle through that artist's entire catalogue...
-
Active windows keep auto moving to background?
When I have an application open such as Email, Safari, textEdit, etc.. the window keeps automatically moving to the back ground about every 13 seconds, and I have to keep clicking on the back ground of the window to bring it back to the front so I ca
-
Setting IconImage on a few hundred JFrames at once
Hi, I have an application with a few hundred classes and also a large amount of JFrames spread over those classes. Now I have to have a custom IconImage displayed in the upper left corner of the JFrames. As of the Swing Tutorial I know that with //As