Clone Linux Directory

rsync -axHAWXS –numeric-ids –info=progress2 /u02 /u01

Posted in Linux | Leave a comment

Excel VBA code to graph DBA_HIST_SYSMETRIC_SUMMARY data

Option Explicit
Sub DBA_HIST_SYSMETRIC_SUMMARY()

Application.ScreenUpdating = False

Call Workbook_Activate

‘ get worksheets
Dim shData As Worksheet, shOutput As Worksheet
Set shData = ThisWorkbook.Worksheets(“Dataset”)

Dim Cht As Chart

‘ Delete charts
On Error Resume Next
Application.DisplayAlerts = False
ActiveWorkbook.Charts.Delete
ActiveSheet.Cells.NumberFormat = “General”

Application.DisplayAlerts = True
On Error GoTo 0

Application.DisplayAlerts = True

‘ Clear output worksheet
shData.Range(“A1”).CurrentRegion.ClearContents
shData.Cells.Delete
shData.Cells.ClearFormats

Dim Row, Start_Row, Cht_Count, LastColumn As Integer
Dim Column, X, Y, Z, i As Integer
Dim Series, Series1, Series2, Series3, Series4, Series5, Series6, Series7, Series8 As String
Dim DateColumn, Machine_Name, instance_name, metric_name, start_date, tabname, legend_name As String

‘ Clear immediate screen
Application.SendKeys “^g ^a {DEL}”

‘ get start time
Dim dtime As Double
dtime = Time

‘ Select data
Call SelectDataFromDatabase

‘ Get range of data on whole worksheet
Dim rg As Range
Set rg = shData.Range(“A1”).CurrentRegion

Application.GoTo Reference:=shData.Range(“A1”), Scroll:=False

‘ Find last column
LastColumn = rg.Columns.Count
Debug.Print LastColumn

‘ Find date column
Y = 0
Do While Y < LastColumn
Y = Y + 1
Debug.Print Y
Debug.Print VarType(Worksheets(“Dataset”).Cells(1, Y).Value)
If VarType(Worksheets(“Dataset”).Cells(1, Y).Value) = 7 Then
DateColumn = Worksheets(“Dataset”).Cells(1, Y).Value
Exit Do
End If
Loop

Debug.Print DateColumn

If DateColumn = Null Then
MsgBox “Error no date column found.”
End If

Columns(Y).Select
Selection.NumberFormat = “mm-dd-yy”

‘ Copy timestamp column values to new column after column E.
Columns(Y).Copy
Columns(Y).Insert

‘ Format the new column to show only time.
Columns(Y + 1).NumberFormat = “h:mm;@”

‘ Main code
Application.DisplayAlerts = False

Application.GoTo Reference:=Sheet1.Range(“A1”), Scroll:=False

Start_Row = 1
Row = 1
Cht_Count = 1

‘ Reset last column after adding time column above.
LastColumn = rg.Columns.Count
Debug.Print LastColumn

‘ There are 4 static columns(machine name, database instance, date, and time). This formula calculates the number of series selected in the select statement for assignment to the charts.
X = (LastColumn – 4) / 2

‘ rg.Columns.AutoFit

Machine_Name = Range(“A1”).Value
instance_name = “Database ” + Range(“B1”).Value

start_date = rg.Cells(Row, Y).Text
Debug.Print rg.Cells(Row, Y).Address

‘_____________________________________________________________________________________________

‘ metric_name = Range(“C1”).Value
‘ legend_name = metric_name

Debug.Print rg.Rows.Count
Debug.Print rg.Columns.Count
Debug.Print rg.Cells(1 & Row).Address

While Row <= rg.Rows.Count
tabname = rg.Cells(Row, Y).Text

While rg.Cells(Row, Y).Text = start_date
‘ Start_Row = ActiveCell.row

‘ Debug.Print rg.Cells(row, 5).Address

Debug.Print "Start_Row = " & Start_Row
Debug.Print "row = " & Row
Debug.Print start_date
Debug.Print rg.Cells(Row, Y).Text
Debug.Print rg.Cells(Row, Y).Address    ' works
Row = Row + 1

Wend

‘ Set Cht = Charts.Add
Set Cht = Charts.Add

With Cht
‘ example .SetSourceData Source:=.Range(.Cells(42, “A”), .Cells(193, .Range(“C6”) + 1))

‘ .SetSourceData Source:=Range(Cells(1, 1), Cells(row – 1, LastColumn))
‘ .SetSourceData Sheets(“Dataset”).Range(“E” & start_row : lastcolumn & row) ‘works

‘ Debug.Print rg.Cells(Start_Row, “F”).Address
‘ There are 4 static columns before the data begins.

Debug.Print rg.Cells(Start_Row, LastColumn – (LastColumn – 4) / 2).Address
Debug.Print rg.Cells(Row – 1, LastColumn).Address

‘ .SetSourceData Range(Cells(Start_Row, “F”), Cells(row – 1, LastColumn))

.SetSourceData Source:=Sheets(“Dataset”).Range(Sheets(“Dataset”).Cells(Start_Row, LastColumn – (LastColumn – 4) / 2), Sheets(“Dataset”).Cells(Row – 1, LastColumn))

‘ .SetSourceData Source:=Sheets(“Dataset”).rg(Cells(Start_Row, “F”), Cells(row – 1, LastColumn))
‘ etSourceData Source:=.Range(.Cell’ 42, “A”), .Cells(193, .Range(“C6”) + 1))

‘ .SetSourceData Source:=Range(Cells(Start_Row, “F”), Cells(row – 1, LastColumn))

‘ example Range(Cells(42, “A”), Cells(193, [c6] + 1))

.ChartType = xlColumnClustered

.Location where:=xlLocationAsNewSheet
‘ Debug.Print Cells(Start_Row, “F”).Address

‘ ActiveChart.ChartArea.Select

‘ .Legend.Select
.Legend.Position = xlRight

‘ The series descriptions always start on the 3rd column(i.e. C) of the spreadsheet. X is the number of series. 2 is the 2 columns to skip over (i.e. A and B).
i = 3
While i <= X + 2
Debug.Print rg.Cells(i).Value
.SeriesCollection(i – 2).Name = rg.Cells(i)
i = i + 1
Wend
i = 3

.HasTitle = False ‘ added line – not sure why it works!
.HasTitle = True
.ChartTitle.Text = “Chart Title”

.ChartTitle.Text = instance_name

.Axes(1).TickLabels.Orientation = 55

Debug.Print tabname
.Name = tabname

Cht_Count = Cht_Count + 1

Cht.Deselect

End With

‘ Debug.Print Now
‘ Debug.Print rg.Address
‘ Application.SendKeys “^g ^a {DEL}”

‘ start_date = Range(Sheets(“Dataset”).Cells(Start_Row, “F”).text
‘ Start_Date = Range(“E” & row).Text

‘ Bad method
‘ Sheets(“Sheets1”).Activate ‘ Bad method
‘ Range(“E” & row).Select
‘ start_date = Selection.Value

‘ Good method
start_date = rg.Cells(Row, Y).Text
Debug.Print rg.Cells(Row, Y).Address

Debug.Print ActiveWorkbook.FullName
Debug.Print start_date

Start_Row = Row

‘ Next i ‘ For loop
Wend

Call SortWorksheetsTabs

Debug.Print rg.Address
Debug.Print "Time is: " & (Time - dtime) * 1000
Debug.Print Time
Debug.Print Now
Debug.Print "Finished"
Debug.Print Cht_Count

‘ Set Sheet = Worksheets(Metric_na)

End Sub
‘ Connect and select fast
Sub SelectDataFromDatabase()

Dim shData As Worksheet, shOutput As Worksheet
Set shData = ThisWorkbook.Worksheets(“Dataset”)

‘ Go to the VBE’s Tools, References then locate and put a check beside ‘Microsoft ActiveX Data Objects 6.1 Library’ to include the library in your project.
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset

Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
Dim strCon As String

Dim recArray As Variant

‘DataSource argument according to my tnsnames.ora
strCon = “Provider=OraOLEDB.Oracle;Data Source=cdbp;User ID=system;Password=password;”

cn.Open (strCon)

‘ select distinct(metric_id), metric_name from DBA_HIST_SYSMETRIC_SUMMARY order by 1;

rs.Open ” select ” & _
” host_name, global_name, ” & _
” c.metric_name, d.metric_name, y.metric_name, z.metric_name, a.metric_name, b.metric_name, ” & _
” end_time, ” & _
” c.average, d.average, y.average, z.average, a.average, b.average ” & _
” from ” & _
” (select host_name from v$instance) host, ” & _
” (select global_name from global_name) instance, ” & _
” (select end_time, snap_id from dba_hist_sysmetric_summary where metric_id = 2000) X, ” & _
” (select snap_id, metric_name, average from dba_hist_sysmetric_summary where metric_id = 2000) Y, ” & _
” (select snap_id, metric_name, average from dba_hist_sysmetric_summary where metric_id = 2047) Z, ” & _
” (select snap_id, metric_name, average from dba_hist_sysmetric_summary where metric_id = 2100) A, ” & _
” (select snap_id, metric_name, average from dba_hist_sysmetric_summary where metric_id = 2092) B, ” & _
” (select snap_id, metric_name, average from dba_hist_sysmetric_summary where metric_id = 2092) C, ” & _
” (select snap_id, metric_name, average from dba_hist_sysmetric_summary where metric_id = 2092) D ” & _
” where x.snap_id = y.snap_id ” & _
” and x.snap_id = z.snap_id ” & _
” and x.snap_id = a.snap_id ” & _
” and x.snap_id = b.snap_id ” & _
” and x.snap_id = c.snap_id ” & _
” and x.snap_id = d.snap_id ” & _
” order by end_time “, cn

‘ ThisWorkbook.Worksheets(“Dataset”).Range(“A:A”).CopyFromRecordset rs
‘ shData.Range(“A:A”).CopyFromRecordset rs
shData.Range(“A1”).CopyFromRecordset rs

rs.Close
cn.Close

Set rs = Nothing
Set cn = Nothing

End Sub
Sub SortWorksheetsTabs()
Application.ScreenUpdating = False
Dim ShCount As Integer, i As Integer, j As Integer
ShCount = Sheets.Count

For i = 1 To ShCount – 1
For j = i + 1 To ShCount
If UCase(Sheets(j).Name) < UCase(Sheets(i).Name) Then
Sheets(j).Move before:=Sheets(i)
End If
Next j
Next i

Application.ScreenUpdating = True
End Sub

Private Sub Workbook_Activate()
On Error Resume Next
With Application
.DisplayFullScreen = True
.CommandBars(“Worksheet Menu Bar”).Enabled = False
End With

End Sub

Private Sub Workbook_Deactivate()
On Error Resume Next
With Application
.DisplayFullScreen = False
.CommandBars(“Worksheet Menu Bar”).Enabled = True
End With

End Sub

Sub SelectForMetrics()

Dim shData2 As Worksheet, shOutput As Worksheet
Set shData2 = ThisWorkbook.Worksheets(“Metrics”)

‘ Go to the VBE’s Tools, References then locate and put a check beside ‘Microsoft ActiveX Data Objects 6.1 Library’ to include the library in your project.
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset

Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
Dim strCon As String

Dim recArray As Variant

‘ Clear output worksheet
shData2.Range(“A1”).CurrentRegion.ClearContents
shData2.Cells.Delete
shData2.Cells.ClearFormats

‘DataSource argument according to my tnsnames.ora
strCon = “Provider=OraOLEDB.Oracle;Data Source=MRCP;User ID=ldcdba;Password=Fdfsda8_9sda;”

cn.Open (strCon)

rs.Open ” select distinct(metric_id) metric_id, metric_name from DBA_HIST_SYSMETRIC_SUMMARY order by 1 “, cn

‘ ThisWorkbook.Worksheets(“Sheet1”).Range(“A:A”).CopyFromRecordset rs
‘ shData.Range(“A:A”).CopyFromRecordset rs
shData2.Range(“A1”).CopyFromRecordset rs

Application.GoTo Reference:=shData2.Range(“A1”), Scroll:=False

rs.Close
cn.Close

Set rs = Nothing
Set cn = Nothing

End Sub

Sub Datavalidation1()
Dim shData2 As Worksheet
Set shData2 = ThisWorkbook.Worksheets(“Metrics”)

Dim Metric_rg As Range
Set Metric_rg = shData2.Range(“F1:G161”).CurrentRegion

Range(“B3”).Validation.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, Formula1:=”=Fruits”

End Sub

Sub Datavalidation2()

ActiveWorkbook.Names.Add Name:=”Metric”, RefersTo:=ThisWorkbook.Worksheets(“Metrics”).Range(“A1:B161”)
Range(“F3″).Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Formula1:=”=Fruit”

End Sub

Posted in Excel, Oracle, Uncategorized | Leave a comment

RHEL No Internet

chattr -i /etc/resolv.conf

echo “nameserver 8.8.8.8” >> /etc/resolv.conf

systemctl reload NetworkManager

Posted in Linux | Leave a comment

sar Excel chart loop

Option Explicit

Public Sub sar_chart_loop()

‘ Clears immediate window
Application.SendKeys “^g ^a {DEL}”

Dim ser As Excel.Series

‘ Application.DisplayAlerts = False
‘ Application.ScreenUpdating = False

Call Macro3
Call Macro4

Dim TabName As String, ChartTitle As String, Previous_TabName As String, Machine_Name As String

Dim Sheet As Worksheet

Dim LastColumn As Integer
Dim Tab_Counter As Integer

Dim AChart As Chart
Dim ChartRng As Range

Dim myrange As Range
Dim mySheet As Worksheet
Dim lastrownumber As Integer
Dim Loop_Count As Integer, Chart_Count As Integer

Dim start_cell As Range, last_cell As Range

Dim start_column As Long, last_column As Long
Dim DataRange As Range

Dim Rng As Range
Dim LR As Long ‘LR = Last Row
Dim LC As Long ‘LC = Last Column

ActiveWorkbook.Worksheets(1).Activate

‘ Counts how many time “Time” appears in the worksheet. This will be the number of charts created.
Loop_Count = Application.WorksheetFunction.CountIf(ActiveSheet.Cells, “Time”)

Application.DisplayAlerts = False
For Each AChart In ActiveWorkbook.Charts
AChart.Delete
Next
Application.DisplayAlerts = True

Range(“A1”).Activate

Machine_Name = ActiveCell.Offset(1, 0).Text

ActiveSheet.Name = Machine_Name

LR = Cells(Rows.Count, 1).End(xlUp).Row
LC = Cells(1, Columns.Count).End(xlToLeft).Column
‘ MsgBox Loop_Count

LastColumn = ActiveSheet.Cells.SpecialCells(xlLastCell).Column
LastColumn = Range(“A1”).End(xlToRight).Column
Debug.Print LastColumn

‘ LastColumn = ActiveSheet.Cells.Find(“*”, SearchOrder:=xlByColumns, SearchDirection:=xlNext).Column

‘ msgbox ActiveCell.Address

While Chart_Count < Loop_Count

‘MsgBox ActiveCell.Address
‘ msgbox ActiveCell.Value

‘ Range(Selection, Selection.End(xlToRight)).Select
‘ Set myrange = Range(Selection, Selection.End(xlToRight)).Select

‘ ‘ msgbox Application.Selection.Address, vbInformation, “myrange”

‘ ActiveCell.Offset(0, 4).Select
‘ ‘ msgbox ActiveCell.Address

‘ Find starting row
Cells.Find(What:=”Time”, after:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

‘ msgbox ActiveCell.Address
Set start_cell = ActiveCell
‘ ‘ msgbox ActiveCell.Row
‘ ‘ msgbox ActiveCell.Column

‘ ChartTitle = Machine_Name + ” ” + ActiveCell.Offset(0, -1).Value
ChartTitle = Machine_Name + ” Memory”
‘MsgBox ChartTitle

TabName = ActiveCell.Offset(1, -1).Text

If TabName = Previous_TabName Then
Tab_Counter = Tab_Counter + 1
TabName = TabName + “_” + CStr(Tab_Counter)
Else
Tab_Counter = 0
End If

Previous_TabName = ActiveCell.Offset(1, -2).Text

‘MsgBox Tab_Counter
‘MsgBox TabName
‘MsgBox Previous_TabName

‘ Find last_cell
Cells.Find(What:=”Time”, after:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

‘ If ActiveCell.Row = 1 from the previous find for the last_cell then we have wrapped around.
If ActiveCell.Row <> 1 Then
Set last_cell = ActiveCell.Offset(-1, LastColumn – ActiveCell.Column)
Else
Cells.Find(What:=”Time”, after:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, _
MatchCase:=False, SearchFormat:=False).Activate

Set start_cell = ActiveCell
Set last_cell = Cells(LR, LC)

' msgbox ActiveCell.Row

End If

Debug.Print start_cell.Address
Debug.Print last_cell.Address
Debug.Print ActiveCell
Debug.Print LR
Debug.Print LC
Debug.Print LastColumn

‘ Range(start_cell, last_cell).Select ‘ Works

Set ChartRng = Worksheets(Machine_Name).Range(start_cell.Address, last_cell.Address)

Range(start_cell.Address, last_cell.Address).Select

' Create Chart
ActiveSheet.Shapes.AddChart2(201, xlColumnClustered).Select

ActiveChart.Location Where:=xlLocationAsNewSheet

ActiveChart.ChartArea.Select

ActiveChart.Legend.Select

‘ ActiveChart.Legend.Select
Selection.Position = xlTop
ActiveChart.ChartTitle.Text = ChartTitle
‘ ‘ msgbox TabName
ActiveSheet.Name = TabName
ActiveChart.Axes(1).TickLabels.Orientation = 55
ActiveWorkbook.Worksheets(1).Activate

Chart_Count = Chart_Count + 1

Wend

Application.Goto Reference:=Range(“A1”)

End Sub

‘____________________________________________________________________
Sub macro2()

Application.CutCopyMode = False

‘ Selection.Copy
‘ Columns(“C:C”).Select
‘ Application.CutCopyMode = False
‘ Selection.NumberFormat = “h:mm;@”
‘ range(“C2”).Select
‘ Cells.Find(What:=”timestamp”, after:=ActiveCell, LookIn:=xlFormulas2, _
‘ LookAt:=xlPart, SearchOrder:=xlByRows, searchdirection:=xlNext, _
‘ MatchCase:=False, SearchFormat:=False).Activate
‘ range(“C1:J144”).Select
‘ range(“C144”).Activate
ActiveSheet.Shapes.AddChart2(201, xlColumnClustered).Select
ActiveChart.SetSourceData Source:=Range(“Sheet1!$C$1:$J$144”)
ActiveChart.ChartTitle.Select
‘ range(“L130”).Select
ActiveWindow.SmallScroll Down:=-109
‘ ActiveSheet.ChartObjects(“Chart 1”).Activate
ActiveChart.ChartTitle.Select
ActiveChart.ChartTitle.Text = “CPU”
Selection.Format.TextFrame2.TextRange.Characters.Text = “CPU”
With Selection.Format.TextFrame2.TextRange.Characters(1, 3).ParagraphFormat
.TextDirection = msoTextDirectionLeftToRight
.Alignment = msoAlignCenter
End With
With Selection.Format.TextFrame2.TextRange.Characters(1, 3).Font
.BaselineOffset = 0
.Bold = msoFalse
.NameComplexScript = “+mn-cs”
.NameFarEast = “+mn-ea”
.Fill.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(89, 89, 89)
.Fill.Transparency = 0
.Fill.Solid
.Size = 14
.Italic = msoFalse
.Kerning = 12
.Name = “+mn-lt”
.UnderlineStyle = msoNoUnderline
.Spacing = 0
.Strike = msoNoStrike
End With
ActiveChart.Axes(xlCategory).Select
ActiveChart.Axes(xlCategory).CategoryType = xlCategoryScale
ActiveChart.Legend.Select
ActiveChart.Legend.Select
Selection.Position = xlTop
ActiveChart.ChartArea.Select
ActiveChart.Location Where:=xlLocationAsNewSheet
Application.CommandBars(“Format Object”).Visible = False
Sheets(“Chart1”).Select
Sheets(“Chart1”).Name = “Chart Day”

End Sub
Sub Macro3()
‘
‘ Macro3 Macro
‘

‘
If [$D1].Value <> “Time” Then
Range(“C1”).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy

Range("D1").Select
Selection.EntireColumn.Insert
ActiveCell.FormulaR1C1 = "Time"
Range("C2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy

Range("D2").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.NumberFormat = "h:mm;@"

    Range(Selection, Selection.End(xlDown)).Select
Selection.Replace What:="Timestamp", Replacement:="Time", LookAt:=xlWhole _
    , SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False, FormulaVersion:=xlReplaceFormula2

End If

End Sub
Sub Macro4()
‘
‘ Macro4 Macro
‘

‘
Range(“C1”).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = “mm.dd.yy”
End Sub
Sub Macro5()
‘
‘ Macro5 Macro
‘

‘
ActiveSheet.Shapes.AddChart2(201, xlColumnClustered).Select
‘ ActiveChart.SetSourceData Source:=Range(“Sheet1!$F$1:$L$144”)
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:=”Chart2″
ActiveChart.ChartArea.Select
ActiveChart.Legend.Select
ActiveChart.Legend.Select
Selection.Position = xlTop

    ActiveChart.ChartTitle.Text = ChartTitle
    ActiveSheet.Shapes.Name = TabName

    Selection.TickLabels.Orientation = 55

ActiveChart.Name = “Chart Name”

End Sub
Sub Macro7()
‘
‘ Macro7 Macro
‘

‘
Selection.TickLabels.Orientation = -5
Selection.TickLabels.Orientation = -55
Selection.TickLabels.Orientation = -5
Selection.TickLabels.Orientation = xlHorizontal
Selection.TickLabels.Orientation = 5
Selection.TickLabels.Orientation = 55
End Sub

End Sub
Sub Macro6()
‘
‘ Macro6 Macro
‘

‘
Range(“C1”).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
End Sub
Sub Macro8()
‘
‘ Macro8 Macro
‘

‘
Range(Selection, Selection.End(xlDown)).Select
Selection.Replace What:=”Timestamp”, Replacement:=”Time”, LookAt:=xlWhole _
, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False, FormulaVersion:=xlReplaceFormula2
End Sub

Sub Find_String_in_Range()
Dim cell As Range
For Each cell In Range(“B5:B10”)
If InStr(cell.Value, “Dr.”) > 0 Then
cell.Offset(0, 1).Value = “Doctor”
End If
Next cell
End Sub

Posted in Uncategorized | Tagged , , | Leave a comment

Oracle Licensing Notes

Helpful article https://www.dba-oracle.com/oracle_tips_prices.htm

Oracle Database Licensing Information User Manual

https://support.oracle.com/rs?type=doc&id=1317265.1

Pricing https://www.oracle.com/assets/technology-price-list-070617.pdf

Compliance https://www.oracle.com/corporate/license-management-services/compliance.html

https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/CONTROL_MANAGEMENT_PACK_ACCESS.html#GUID-A5CA11BA-AE1F-4A2E-9C59-A98BA1F4E5C2

Cores + perpetual + Support + (compression + tuning pack + diagnostics pack + partitioning pack)
If any VM in a cluster is using a feature then all VMs in the cluster get billed.
Perpetual = the ability to run the software without support or upgrades.

select (select instance_name from v$instance) DB, version, description, detected_usages, last_usage_date from dba_feature_usage_statistics where name like ‘Automatic Workload%’ or name like ‘AWR%’ ;

show parameter CONTROL_MANAGEMENT_PACK_ACCESS

The value of control_management_pack_access controls access to Oracle Diagnostic Pack and Oracle Tuning Pack and can be set to non, diagnostic or diagnostic+tuning

Feature availability by edition https://docs.oracle.com/cd/E21659_01/html/E10594/editions.htm

Things to think about when auditing Oracle licensing.

·        Find your Oracle installations

·        Editions, packs, and options.

·        NUP – Named user plus model

·        CPU – Licensing model and don’t forget the cores.

·        Virtualization

Posted in Oracle | Leave a comment

Get Windows Product Key

From a cmd prompt

wmic path softwareLicensingService get OA3xOriginalProductKey
Posted in Windows | Leave a comment

Oracle 11g Views

http://www.dba-oracle.com/t_eoi40_11g_rman_v_dollar.htm

Exploring Oracle Internals – General Oracle 11g Database Administration

One key task of the Oracle database professional is to perform daily monitoring to ensure that the database environment is healthy for Oracle 11g. The following key v$ dynamic views allow the DBA to quickly drill down into the Oracle 11g database engine to quickly assess the database status

V$DATABASE
V$INSTANCE
V$OPTION
V$LICENSE
V$CONTROLFILE
V$TABLESPACE
V$DATAFILE
V$LOG
V$LOGFILE
V$ARCHIVED_LOG
V$TEMPFILE

Oracle 11g New Features

The follow v$ views are used by the new 11g result cache:

V$RESULT_CACHE_STATISTICS
V$RESULT_CACHE_MEMORY
V$RESULT_CACHE_OBJECTS
V$RESULT_CACHE_DEPENDENCY
V$CLIENT_RESULT_CACHE_STATS                                                
 
The Oracle 11g RAT suite includes database replay and the following v$ view provides details on usage and status for this key new 11g feature with Oracle.

V$WORKLOAD_REPLAY_THREAD

For the new 11g feature for the Incident Repair component of the 11g ADR, there are the following v$ views:

V$IR_FAILURE
V$IR_REPAIR                                                                
V$IR_MANUAL_CHECKLIST                                                      
V$IR_FAILURE_SET                                                            

The 11g health monitor (HM) is linked to the following v$ views listed below:

V$HM_CHECK
V$HM_CHECK_PARAM                        
V$HM_RUN                                                                  
V$HM_FINDING                                                               
V$HM_RECOMMENDATION         
V$HM_INFO                                                                  

V$ Views-Oracle 11g NFS New Features

Oracle 11g provides a new feature to setup NFS based files within Oracle 11g. The following v$ views provide the details for NFS configurationwithin Oracle 11g.

V$NFS_CLIENTS
V$NFS_OPEN_FILES
V$NFS_LOCKS
V$IOSTAT_NETWORK

Oracle 11g Backup and Recovery

Backup and Recoveryis the most important function of the serious Oracle DBA and can mean the difference between life and death in terms of corporate safety and job security. The following v$ views provide details for Oracle 11g Backup and Recovery.

V$RMAN_BACKUP_SUBJOB_DETAILS
V$RMAN_BACKUP_JOB_DETAILS
V$BACKUP_SET_DETAILS
V$BACKUP_PIECE_DETAILS
V$BACKUP_COPY_DETAILS
$BACKUP
V$RECOVERY_STATUS
V$RECOVERY_FILE_STATUS
V$BACKUP_SET
V$BACKUP_PIECE
V$BACKUP_DATAFILE
V$BACKUP_REDOLOG
V$BACKUP_CORRUPTION
V$BACKUP_DEVICE
V$BACKUP_SPFILE
V$BACKUP_SYNC_IO
V$BACKUP_ASYNC_IO
V$RECOVER_FILE
V$RMAN_STATUS
V$RMAN_OUTPUT
V$BACKUP_DATAFILE_DETAILS
V$BACKUP_CONTROLFILE_DETAILS
V$BACKUP_ARCHIVELOG_DETAILS
V$BACKUP_SPFILE_DETAILS
V$BACKUP_DATAFILE_SUMMARY
V$BACKUP_CONTROLFILE_SUMMARY
V$BACKUP_ARCHIVELOG_SUMMARY
V$BACKUP_SPFILE_SUMMARY
V$BACKUP_SET_SUMMARY
V$RECOVERY_PROGRESS
V$RMAN_BACKUP_TYPE
V$RMAN_CONFIGURATION

Oracle 11g RAC and ASM, Oracle 11g Data Guard and 11g Streams

Oracle 11g RAC and ASM provide highly available robust architectures for performance, service and reliability as part of the Oracle Maximum Availability Architecture (MAA). The following v$ views provide details on these key HA technologies.

11g Data Guard

V$DATAGUARD_CONFIG
V$DATAGUARD_STATUS
V$MANAGED_STANDBY
V$LOGSTDBY
V$LOGSTDBY_STATS
V$LOGSTDBY_TRANSACTION
V$LOGSTDBY_PROCESS
V$LOGSTDBY_PROGRESS
V$LOGSTDBY_STATE


11g Streams

V$STREAMS_APPLY_COORDINATOR
V$STREAMS_APPLY_SERVER
V$STREAMS_APPLY_READER
V$STREAMS_CAPTURE
V$STREAMS_TRANSACTION
V$STREAMS_MESSAGE_TRACKING

11g RAC

V$CLUSTER_INTERCONNECTS
V$CONFIGURED_INTERCONNECTS
V$DYNAMIC_REMASTER_STATS
V$DLM_MISC
V$DLM_LATCH
V$DLM_CONVERT_LOCAL
V$DLM_CONVERT_REMOTE
V$GES_ENQUEUE
V$GES_BLOCKING_ENQUEUE
V$DLM_ALL_LOCKS
V$DLM_LOCKS
V$DLM_RESS
V$GLOBAL_BLOCKED_LOCKS 

11g ASM

V$ASM_TEMPLATE
V$ASM_ALIAS
V$ASM_FILE
V$ASM_CLIENT
V$ASM_DISKGROUP
V$ASM_DISKGROUP_STAT
V$ASM_DISK
V$ASM_DISK_STAT
$ASM_DISK_IOSTAT
V$ASM_OPERATION
V$ASM_ATTRIBUTE

Performance Tuning Oracle 11g

Performance tuning is a complex task that daunts many Oracle DBAs. It is as much an art as a science. While GUI tools such as Oracle Enterprise Manager and Quest TOAD provide a nice slick graphical interface, to dig into the internal nuts and bolts of database performance, the serious Oracle performance analyst relies on reports generated by v$ dynamic performance views from within the Oracle 11g data dictionary. The following v$ views provide insight into database tuning for Oracle 11g.

Wait Eventsfor 11g

V$SESSION
V$WAITCLASSMETRIC
V$WAITCLASSMETRIC_HISTORY
V$WAITSTAT
V$WAIT_CHAINS

Oracle 11g Concurrency and SQL Tuning

V$LOCK
V$SQL
V$SQLAREA
V$SESSTAT
V$MYSTAT
V$SESS_IO
V$SYSSTAT
V$STATNAME
V$OSSTAT
V$ACTIVE_SESSION_HISTORY
V$ACTIVE_SESS_POOL_MTH
V$SESSION_WAIT
V$SESSION_WAIT_CLASS
V$SYSTEM_WAIT_CLASS
V$TRANSACTION
V$LOCKED_OBJECT
V$LATCH
V$LATCH_CHILDREN
V$LATCH_PARENT
V$LATCHNAME
V$LATCHHOLDER
V$LATCH_MISSES
V$ENQUEUE_LOCK
V$TRANSACTION_ENQUEUE
V$SYS_OPTIMIZER_ENV
V$SES_OPTIMIZER_ENV
V$SQL_OPTIMIZER_ENV
V$SQL_PLAN
V$SQL_PLAN_STATISTICS
V$SQL_PLAN_STATISTICS_ALL


Oracle 11g Memory Tuning

V$SGA
V$SGASTAT
V$SGAINFO
V$SGA_CURRENT_RESIZE_OPS
V$SGA_RESIZE_OPS
V$SGA_DYNAMIC_COMPONENTS
V$SGA_DYNAMIC_FREE_MEMORY
V$PGASTAT
V$SQL_WORKAREA_HISTOGRAM
V$PGA_TARGET_ADVICE_HISTOGRAM                                              
V$PGA_TARGET_ADVICE
V$MEMORY_CURRENT_RESIZE_OPS
V$MEMORY_RESIZE_OPS
V$MEMORY_DYNAMIC_COMPONENTS
V$LIBRARY_CACHE_MEMORY
V$SHARED_POOL_ADVICE
V$JAVA_LIBRARY_CACHE_MEMORY
V$JAVA_POOL_ADVICE
V$STREAMS_POOL_ADVICE

Posted in Oracle | Leave a comment

How to create and use installation media to reinstall Windows 11/10 via USB drive

https://www.asus.com/support/FAQ/1039507/

Posted in Windows | Leave a comment

Scan Windows for corruption

sfc /scannow

Posted in Windows | Leave a comment

Select from Oracle Alert Log

select originating_timestamp, message_text from x_$dbgalertext
where
— originating_timestamp > sysdate-2
originating_timestamp > (select LAST_ORIGINAT_TIMESTAMP_CHCK from PLDDBA.LAST_X_$DBGALERTEXT_CHCK)
and
( message_text like ‘ORA-%’
or
message_text like ‘OSD-%’
or
message_text like ‘TNS-%’
or
upper(message_text) like ‘%WARNING%’
or
upper(message_text) like ‘%ERROR%’
or
message_text like ‘%err%code%’
or
upper(message_text) like ‘%FATAL%’
or
message_text like ‘%cannot allocate new log%’
or
message_text like ‘%Checkpoint not complete%’
or
message_text like ‘%Private strand flush not complete%’
or
message_text like ‘%Client address%’
)
order by originating_timestamp ;

Posted in 12c, Oracle | Leave a comment