Tag Archive: Oracle


It is really really easy to change the default NLS_DATE_FORMAT setting but to be honest, you should set it at a session level IMHO.

We basically just need to run “ALTER SYSTEM SET NLS_DATE_FORMAT=’YYYY-MM-DD’ SCOPE=SPFILE” as a user with sysdba privileges. If you started the Oracle instance without a spfile (it should be located at $ORACLE_HOME/dbs/spfile[instance name].ora), you will receive the ORA-32001 error.

SQL> ALTER SYSTEM SET NLS_DATE_FORMAT=‘YYYY-MM-DD’ SCOPE=SPFILE;
ALTER SYSTEM SET NLS_DATE_FORMAT=‘YYYY-MM-DD’ SCOPE=SPFILE
*
ERROR at line 1:
ORA-32001: WRITE TO SPFILE requested but no SPFILE specified at startup

Just create a new spfile, restart:

SQL> SELECT INSTANCE_NAME FROM v$instance;

INSTANCE_NAME
—————-
UAT2

SQL> CREATE spfile=‘/oracle/10g/dbs/spfileUAT2.ora’ FROM pfile=‘/oracle/10g/dbs/initUAT2.ora’;

*restart*

SQL> SELECT INSTANCE_NAME FROM v$instance;

INSTANCE_NAME
—————-
UAT2

SQL> ALTER SYSTEM SET NLS_DATE_FORMAT=‘YYYY-MM-DD’ SCOPE=SPFILE;

System altered.

*restart*

SQL> SELECT value FROM v$nls_parameters WHERE parameter =‘NLS_DATE_FORMAT’;

VALUE
—————————————————————-
YYYY-MM-DD

That’s it. :)

  • On the source machine:
    • Set the tablespace(s) into read only mode
      • SQL> Alter tablespace <tablespace> read only
  • Export the tablespace meta data using export
    • % expdp system/<password> DUMPFILE=expdat.dmp DIRECTORY = dpump_dir TRANSPORT_TABLESPACES = <list of tablespaces separated by commas> TRANSPORT_FULL_CHECK=Y
    • If the dumpdir is not set up, you will get an ‘invalid’ directory error:
      • SQL> CREATE DIRECTORY dmpdir as ‘/somedir’;
      • SQL> GRANT read,write on DIRECTORY to system;
  • Export the data converting on the fly:
    • Determine the platform name for the destination machine:
      • SQL> SELECT PLATFORM_ID, PLATFORM_NAME, ENDIAN_FORMAT FROM V$TRANSPORTABLE_PLATFORM
    • % rman TARGET /
      • RMAN> CONVERT TABLESPACE <list of tablespaces separated by commas> to PLATFORM ‘<platform name from previous step>’  FORMAT=’/somedir/%U’;
  • Put the tablespaces into read/write mode
    • SQL> alter tablespace <tablespace> READ WRITE;
    • Transfer the files to the destination machine (Setup the dumpdir if you haven’t already)
      • Create the oracle user(s) with the same names as on the source oracle (if you don’t you will need to remap the ownership using the REMAP_SCHEMA for the impdb )
      • Import the tablespace schema and data (repeat for each tablespace)
        • % impdp  system/<password> DUMPFILE=expdat.dmp DIRECTORY = dpump_dir TRANSPORT_DATAFILES = <Full path to each tablespace datafile separated by commas>
  • Put the tablespaces in to read/write mode
    • SQL> alter tablespace <tablespace> READ WRITE;

I was trying to install Oracle 11g client on to a WinXP box but Symantec Antivirus wouldn’t let me because it thought it was infected with over 800 viruses.  Same file was marked clean on another box.  So, I picked several of the viruses it said was infected with and looked for any evidence of them on the WinXP box.  No dice.  This led me to believe that Symantec Antivirus itself was somehow mucked up.

When I tried to uninstall Symantec Antivirus, it asked for a password.  When I put in the correct password, it refused it.  So how to uninstall it with a messed up password?  Easy..

Open up regedit (as an administrator) and change HKEY_LOCAL_MACHINE\SOFTWARE\INTEL\LANDesk\VirusProtect6\CurrentVersion\AdministratorOnly\Security\UseVPUninstallPassword to “0″ (zero).

I was able to uninstall and reinstall Symantec Antivirus.

At work we have three generic LCD monitors mounted on a pole to view monitoring metrics for our Oracle & Sybase database servers. On a previous machine that was cannibalized for another task, we ran Microsoft Windows XP to drive the three monitors.

Last week we were given a hand me down desktop, a Dell Optiplex GX520 with integrated Intel 82945G/GZ video on the motherboard. When we added the NVidia GeForce4 MX 4000 low profile video card, Windows XP for whatever reason was unable to use both video cards. I proposed Kubuntu 9.04 Linux as an alternative. As it was only myself that I had to convince to make the attempt, I was hard pressed to say no ;-)

The Intel 82945G/GZ video card will be the primary card and must be attached to “Screen 0″ in the ServerLayout section.

The NVidia video card has two connectors:

  1. A standard VGA port driven by a GeForce4 MX 4000 GPU < - Primary nvidia port
  2. A super-video port driven by a Quadro NVS 110M

After the base install of the operating system, XWindows was only able to see the Intel video card. After much tinkering with the /etc/xorg.conf file, I was able to get all three LCD monitors to work with Xinerama. There are a number of gotchas that you might run into:

  • If the integrated Intel video card is set to Auto in the BIOS, the card will be completely disabled. You need to disable Auto
  • You need to know which Nvidia Device entry drives the VGA connector. It must be initialized prior to the S-Video port.
  • Disable NVidia’s TwinView and metamodes option lines in the Screen Section.
  • Use sudo lspci to identify the pci bus ids. You will need to put them in the Device Sections.
  • The integrated Intel video card must use the vesa video driver as the intel video driver will stacktrace when used with xinerama.
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 1.0  (buildd@palmer)  Sun Feb  1 20:21:04 UTC 2009

Section "ServerLayout"
    Identifier     "Default Layout"
    Screen      0  "Screen0" 0 0  
    Screen      1  "Screen2" Above "Screen0"
    Screen      2  "Screen1" Above "Screen2"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"    
    Option "Xinerama" "On"                  
EndSection                                  

Section "Files"
    ModulePath      "/usr/lib/xorg/modules/extensions"
    ModulePath      "/usr/lib/xorg/modules/drivers"  
    ModulePath      "/usr/lib/xorg/modules"          
EndSection                                            

Section "Module"
    Load           "glx"
EndSection              

Section "ServerFlags"
    Option         "xinerama" "true"
    Option         "DefaultServerLayout" "Default Layout"
EndSection                                              

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"      
EndSection                    

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"  
EndSection                              

Section "Monitor"
    Identifier     "Configured Monitor"
EndSection                            

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "CMO CMC 17 AD"
    HorizSync       30.082.0  
    VertRefresh     50.075.0  
EndSection                        

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "CMO CMC 17 AD"
    HorizSync       30.082.0  
    VertRefresh     50.075.0  
EndSection                        

Section "Monitor"
    Identifier     "Monitor2"
    VendorName     "Unknown"
    ModelName      "Seiko"  
    HorizSync       30.075.0
    VertRefresh     60.0      
EndSection                    

Section "Device"
    Identifier     "Configured Video Device"
    Driver         "nvidia"                
    Option         "NoLogo" "True"          
EndSection                                  

Section "Device"
   Identifier  "Device0"
   #Driver      "intel"
   Driver      "vesa"  
   VendorName  "Intel Corporation"
   BoardName   "82945G/GZ Integrated Graphics Controller"
   BusID       "PCI:0:2:0"                              
   Screen          0                                    
EndSection                                              

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "Quadro NVS 110M"
    BusID          "PCI:4:0:0"
    Screen          1
EndSection

Section "Device"
    Identifier     "Device2"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce4 MX 4000"
    BusID          "PCI:4:0:0"
EndSection

Section "Screen"
    Identifier     "Default Screen"
    Device         "Configured Video Device"
    Monitor        "Configured Monitor"
    DefaultDepth    24
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "TwinView" "0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen2"
    Device         "Device2"
    Monitor        "Monitor2"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "TwinViewXineramaInfoOrder" "CRT-0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Extensions"
    Option         "Composite" "on"
EndSection

Powered by WordPress | Theme: Motion by 85ideas.