Friday, March 19, 2010

DBNEWID

Procedure to Change Database DBID

Start up the database in mount mode

SQL> startup mount

ORACLE instance started.

Total System Global Area 4731174912 bytes
Fixed Size                  2061264 bytes
Variable Size             687868976 bytes
Database Buffers         4026531840 bytes
Redo Buffers               14712832 bytes

Database mounted.

SQL> quit

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

Invoke DBNEWID to generate a new dbid

D:\oracle>nid target=sys/xxxxxxr@db
DBNEWID: Release 10.2.0.3.0 - Production on Fri Mar 19 14:45:18 2010
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to database DB (DBID=2131079061)
Connected to server version 10.2.0
Control Files in database:

    K:\ DB\ORA_REDO\CONTROL01.CTL
    H:\DB\SYS\ORA_SYS\CONTROL02.CTL
    J:\DB\ORA_REDO\CONTROL03.CTL

Change database ID of database DB? (Y/[N]) => y

Proceeding with operation

Changing database ID from 2991078061 to 618795265
    Control File K:\DB\ORA_REDO\CONTROL01.CTL - modified
    Control File H:\DB\SYS\ORA_SYS\CONTROL02.CTL - modified
    Control File J:\DB\ORA_REDO\CONTROL03.CTL - modified
    Datafile ……..DBF - dbid changed
    Datafile ……..DBF - dbid changed
    Datafile ……..DBF - dbid changed
    Control File K:\DB\ORA_REDO\CONTROL01.CTL - dbid changed
    Control File H:\DB\SYS\ORA_SYS\CONTROL02.CTL - dbid changed
    Control File J:\DB\ORA_REDO\CONTROL03.CTL - dbid changed
    Instance shut down

Database ID for database DB changed to 618795265.
All previous backups and archived redo logs for this database are unusable.
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database ID.
DBNEWID - Completed succesfully.

Start up the database in mount mode

SQL> startup mount

ORACLE instance started.
Total System Global Area 4731174912 bytes
Fixed Size                  2061264 bytes
Variable Size             687868976 bytes
Database Buffers         4026531840 bytes
Redo Buffers               14712832 bytes
Database mounted.

Open the database with RESETLOGS

SQL> alter database open resetlogs;

Database altered.

Verify DBID updated

SQL> select dbid from v$database;

      DBID
----------
618795265

Wednesday, March 3, 2010

AIX

AIX lsconf

Usage of lsconf in AIX return

Serial Number for AIX
Number of Processors AIX
System Model AIX
Memory AIX
Number of internal disks AIX


# lsconf | egrep "(Serial Number|Number Of Processors|System Model|Memory Size|disk)"