Tuesday, August 12, 2014

Oracle: Change datafile names


Follow below procedure to change data file names, you may need make changes to fit your case.

Procedure:

    Create respect scripts to change data file names at system and database level
    Shutdown Database
    Run script to change data file names at system level
    Run script to change data file names at database level
    Start up database

Practice:

1. Using below statement to generate script to change datafile names in database

SQL> select 'alter database rename file ''' || file_name || '''' || ' to ' || '''' || SUBSTR(file_name, 1,19) || 'pkg' || SUBSTR(file_name, 24) || ''';' from dba_data_files where file_name like '%gw%' order by file_name;

and export the result into renDBfiles.sql

2. Using below statement to generate shell script to rename data files at system level

SQL> select 'mv ' || file_name || ' ' || SUBSTR(file_name, 1,19) || 'pkg' || SUBSTR(file_name, 24) from dba_data_files where file_name like '%gw%' order by file_name;


and export the result into renSysfiles.sh

3. Shutdown Database
SQL> shutdown immediate;

4. Rename data files at system level
$ ./renSysfiles.sh

5. Rename the data files at mount stage (database is not open)
SQL> startup mount;

6. Rename date files at database level
SQL> @renDBfiles.sql

7. restart database
SQL> SHUTDOWN IMMEDIATE
SQL> startup

XServer/Xterm Trouble shooting

keep getting the message: "Server is already active for display 0"

You get an error message like:
Fatal server error:
Server is already active for display 0
 If this server is no longer running, remove /tmp/.X0-lock
 and start again.
The number denotes the display number (in this case 0). This number needs to be unique on the system, so you cannot run two servers on one system with identical display numbers. This message indicates that there is already a server with this number running on the system. You can verify this by running
 ps aux | grep `cat /tmp/.X0-lock`
If you see an output like:
root  2283  0.5  5.1 27796 6536 ?    S  Apr21  59:03 [X]
it indicates that there is indeed an Xserver running under this PID. To start a second server on the same system you have to give it a different dislay number. If you start your servers using startx you can do
startx -- :1
to start a server with display number 1. If you are sure there is no other server running on your system and above ps command indicates that no server with this PID is running, you should remove the file /tmp/.X0-lock by doing (as 'root'):
rm -rf /tmp/.X0-lock

I keep getting the message: "Cannot establish any listening sockets..."

You get an error message like:
_XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
Fatal server error:
Cannot establish any listening sockets - Make sure an X server isn't already running
This problem is very similar to the previous one. You will get this message possibly because the lock file was removed somehow or some other program which doesn't create a lock file is already listening on this port. You can check this by doing a netstat -ln. Xservers usually listen at tcp port 6000+, therefore if you have started your Xserver with the command line option :1 it will be listening on port 6001.
Please check the article above for further information.

Wednesday, August 6, 2014

Sparc Firmware Upgrade

Firmware Downloads
http://www.oracle.com/technetwork/systems/patches/firmware/release-history-jsp-138416.html

 Display Firmware Version
-> show /HOST sysfw_version

  /HOST
    Properties:
        sysfw_version = Sun System Firmware 8.5.0.a 2014/04/10 12:47

The following procedure describes how to retrieve the new firmware from MyOracle
Support and complete the installation.                                         

PROCEDURE
---------

Assuming all of the prerequisites have been met, the firmware update procedure
can now be executed.                                                         

1. To access the latest or desired release of Sun System Firmware from MyOracle
   Support, search on Patches for your hardware platform.  Based on your entitlement,
   you will find a list of available releases.                                      

2. Choose the version you are interested in.  Older releases of Sun System Firmware
   have been listed using this title: (example)

      Patch 148822-05: FIRMWARE: SPARC T4-1 - Sun System Firmware 8.2.2.c

   Newer releases will use this title format: (example)

      Patch 16588794: FIRMWARE: SPARC T5-2 SUN SYSTEM FIRMWARE 9.0.0.H


3.  Click on the release and on that MOS page, click on the "Download" button
    to download a zipped file.

4.  Unzip the file and find the .pkg file.  On older releases, it will be at the
    top level.  Newer releases will include a "Sun System Firwmware" subdirectory
    under a top-level "Firmware" subdirectory.  You will find the .pkg file under
    the "Sun System Firmware" subdirectory.

5.  The *.pkg file is the image that will be transferred to the Service Processor
    for installation/upgrade purposes.  This is accomplished via the included
    "sysfwdownload" utility found under the "Sun System Firmware" subdirectory.

6.  From a Solaris terminal window on the system to be upgraded, type the following:

        # ./sysfwdownload -u [image].pkg
        Answer yes/no to the following question:

        WARNING: Host will be powered down for automatic firmware update when download is completed.
        Do you want to continue(yes/no)?

7.  The sysfwdownload tool will copy the [image].pkg to the dual bank storage on
    the Service Processor. Then it will automatically shutdown the Solaris host.
    The service processor will automatically load the firmware image onto the
    Service Processor and Host.  The system will then automatically reset the
    Service Processor, and when Oracle ILOM reboots, the new Sun System Firmware
    image will be running.  The host will re-boot after the installation is completed.

8.  Log back into the Solaris host, now run ./sysfwdownload -g and verify the Sun
    System Firmware version is the one you loaded.

        # ./sysfwdownload -g

Sparc Firmware Upgrade

 Display Firmware Version
-> show /HOST sysfw_version

  /HOST
    Properties:
        sysfw_version = Sun System Firmware 8.5.0.a 2014/04/10 12:47

The following procedure describes how to retrieve the new firmware from MyOracle
Support and complete the installation.                                         

PROCEDURE
---------

Assuming all of the prerequisites have been met, the firmware update procedure
can now be executed.                                                         

1. To access the latest or desired release of Sun System Firmware from MyOracle
   Support, search on Patches for your hardware platform.  Based on your entitlement,
   you will find a list of available releases.                                      

2. Choose the version you are interested in.  Older releases of Sun System Firmware
   have been listed using this title: (example)

      Patch 148822-05: FIRMWARE: SPARC T4-1 - Sun System Firmware 8.2.2.c

   Newer releases will use this title format: (example)

      Patch 16588794: FIRMWARE: SPARC T5-2 SUN SYSTEM FIRMWARE 9.0.0.H


3.  Click on the release and on that MOS page, click on the "Download" button
    to download a zipped file.

4.  Unzip the file and find the .pkg file.  On older releases, it will be at the
    top level.  Newer releases will include a "Sun System Firwmware" subdirectory
    under a top-level "Firmware" subdirectory.  You will find the .pkg file under
    the "Sun System Firmware" subdirectory.

5.  The *.pkg file is the image that will be transferred to the Service Processor
    for installation/upgrade purposes.  This is accomplished via the included
    "sysfwdownload" utility found under the "Sun System Firmware" subdirectory.

6.  From a Solaris terminal window on the system to be upgraded, type the following:

        # ./sysfwdownload -u [image].pkg
        Answer yes/no to the following question:

        WARNING: Host will be powered down for automatic firmware update when download is completed.
        Do you want to continue(yes/no)?

7.  The sysfwdownload tool will copy the [image].pkg to the dual bank storage on
    the Service Processor. Then it will automatically shutdown the Solaris host.
    The service processor will automatically load the firmware image onto the
    Service Processor and Host.  The system will then automatically reset the
    Service Processor, and when Oracle ILOM reboots, the new Sun System Firmware
    image will be running.  The host will re-boot after the installation is completed.

8.  Log back into the Solaris host, now run ./sysfwdownload -g and verify the Sun
    System Firmware version is the one you loaded.

        # ./sysfwdownload -g

Tuesday, August 5, 2014

Windows 2003 Terminal User License Expired

Windows 2003 Terminal User License Expired

1. Stop Terminal Server Licensing in Component Services
2. Remove files in C:\WINDOWS\system32\LServer except Bkup
3. Start Terminal Server Licensing in Component Services