DBA Corner

Data is stored somewhere

Month: February 2005

  • Oracle DBNEWID (NID): Change a DBID or Database Name

    Oracle’s DBNEWID utility, invoked as nid, can change a database identifier (DBID), a database name (DBNAME), or both. This is useful after cloning a database that must be distinguished from its source in an RMAN repository. Understand the consequences Changing the DBID makes backups and archived logs created under the old DBID unusable for the…

  • Changing an Oracle DBID: Oracle 8i and 9i Considerations

    A DBID is Oracle’s internal identifier for a database. RMAN uses it to distinguish databases, so a physical clone that retains the source DBID can conflict with the source in the same recovery catalog. Oracle 9i Release 2 and later Oracle 9i Release 2 introduced the supported DBNEWID utility. Use nid rather than manually editing…

  • Script SQL Server Agent Jobs with PowerShell and SMO

    SQL-DMO and ActiveX Script job steps belong to an older SQL Server era. For current systems, use SQL Server Management Objects (SMO) from PowerShell and the maintained SqlServer module. Script every SQL Server Agent job Import-Module SqlServer $serverName = “SERVER\INSTANCE” $outputDir = “C:\DBA\SqlAgentJobs” New-Item -ItemType Directory -Force -Path $outputDir | Out-Null $server = New-Object Microsoft.SqlServer.Management.Smo.Server…

  • Monitor Oracle Processes and Threads on Windows

    On Windows, Oracle database activity is easiest to diagnose by correlating Oracle sessions with operating-system process and thread identifiers. The old Quick Slice utility is no longer needed; use supported Windows tools such as Task Manager, Performance Monitor, or Process Explorer. Map sessions to Windows activity SELECT s.sid, s.serial#, s.username, s.status, s.program, p.spid, p.stid, p.pname,…

  • Benchmark File Compression Tools Safely

    Compression choices should be based on your own data, recovery-time objectives, and available CPU. A benchmark copied from another system can be misleading because text, database exports, binaries, and already-compressed files behave very differently. Benchmark without changing the source file The following commands write new compressed files and leave sample.dat untouched: /usr/bin/time -f ‘gzip elapsed=%e…

  • Oracle: Monitor Shared Pool and Large Pool Memory

    Shared pool and large pool usage should be monitored as trends, not judged from a single “free memory” number. Oracle can use most of a pool efficiently, and a low free value does not by itself prove memory pressure. Summarize current allocations SELECT pool, name, ROUND(SUM(bytes) / 1024 / 1024, 1) AS mb FROM v$sgastat…