Thursday, October 22, 2015

How-To: Move Oracle Database Datafile

How-To: Move Oracle Database Datafile


Environment Info:
Windows O/S
Oracle 12c Standard
DB Name - kanaan
 
Note current datafile location:
C:\Oracle12c-db\oradata\kanaan
Note new/proposed datafile location:
C:\new-db-storage\kanaan

Task: move the USERS01.DBF database datafile to new storage location

Connect to database:
C:\>set ORACLE_SID=kanaan

C:\>sqlplus /nolog

SQL*Plus: Release 12.1.0.1.0 Production on Thu Oct 22 08:22:33 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect / as sysdba
Connected.


Note current database datafiles in Oracle:
SQL> select name from v$datafile;

NAME
--------------------------------------------------------
C:\ORACLE12C-DB\ORADATA\KANAAN\SYSTEM01.DBF
C:\ORACLE12C-DB\ORADATA\KANAAN\SYSAUX01.DBF
C:\ORACLE12C-DB\ORADATA\KANAAN\UNDOTBS01.DBF
C:\ORACLE12C-DB\ORADATA\KANAAN\USERS01.DBF


Stop the Oracle database:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.


Use Operating System Commands to Move the Database Datafile to New Location:

C:\Oracle12c-db\oradata\kanaan>move USERS01.DBF c:\new-db-storage\kanaan
        1 file(s) moved.


Start the database in 'mount' mode:
SQL> startup mount;
ORACLE instance started.

Total System Global Area 2137886720 bytes
Fixed Size                  2797920 bytes
Variable Size             671092384 bytes
Database Buffers         1442840576 bytes
Redo Buffers               21155840 bytes
Database mounted.


Issue database command to 'rename' the files:
SQL> alter database rename file 'C:\ORACLE12C-DB\ORADATA\KANAAN\USERS01.DBF' to 'C:\new-db-storage\kanaan\USERS01.DBF';

Database altered.


Reopen database:
SQL> alter database open;

Database altered.


Verify Database datafile information:
 SQL> select name from v$datafile;

NAME
---------------------------------------------------
C:\ORACLE12C-DB\ORADATA\KANAAN\SYSTEM01.DBF
C:\ORACLE12C-DB\ORADATA\KANAAN\SYSAUX01.DBF
C:\ORACLE12C-DB\ORADATA\KANAAN\UNDOTBS01.DBF
C:\NEW-DB-STORAGE\KANAAN\USERS01.DBF



Multiple database datafiles can be moved while the database is shutdown.  The ALTER DATABASE command will need to be run for each database datafile that is moved.


NOTE:   Control, Redo, Undo, Temp files may also exist in the same location and will need to be moved as well.


select name from v$controlfile;
show parameter control_files;





Friday, April 3, 2015

Oracle 12c Patch Installation - Windows

Download Oracle Patches from Oracle

For this example the patch files are stored in C:\shared

Download and extract latest version of OPatch – replace existing OPatch in Oracle home directory.

Database Patch

c:\shared\p19542943_121010_MSWIN-x86-64\19542943>set ORACLE_HOME=C:\oracle12c\product\12.1.0\dbhome_1

c:\shared\p19542943_121010_MSWIN-x86-64\19542943>echo %ORACLE_HOME%
C:\oracle12c\product\12.1.0\dbhome_1

c:\shared\p19542943_121010_MSWIN-x86-64\19542943>set PATH=%ORACLE_HOME%\opatch;%PATH%

c:\shared\p19542943_121010_MSWIN-x86-64\19542943>opatch version
OPatch Version: 12.1.0.1.5

OPatch succeeded.

Open Windows Services 
-----> STOP ORACLE SERVICES

Open Command line and execute the following command to stop Microsoft Distributed Transactions
-----> net stop msdtc

c:\shared\p19542943_121010_MSWIN-x86-64\19542943>opatch apply
Oracle Interim Patch Installer version 12.1.0.1.5
Copyright (c) 2014, Oracle Corporation.  All rights reserved.


Oracle Home       : C:\oracle12c\product\12.1.0\dbhome_1
Central Inventory : C:\Program Files\Oracle\Inventory
   from           : n/a
OPatch version    : 12.1.0.1.5
OUI version       : 12.1.0.1.0
Log file location : C:\oracle12c\product\12.1.0\dbhome_1\cfgtoollogs\opatch\1954
2943_Oct_28_2014_15_10_16\apply2014-10-28_15-10-16PM_1.log

Applying interim patch '19542943' to OH 'C:\oracle12c\product\12.1.0\dbhome_1'
Verifying environment and performing prerequisite checks...
Patch 19542943: Optional component(s) missing : [ oracle.oraolap, 12.1.0.1.0 ] ,
 [ oracle.rdbms.ic, 12.1.0.1.0 ] , [ oracle.has.cfs, 12.1.0.1.0 ] , [ oracle.has
.crs, 12.1.0.1.0 ] , [ oracle.has.cvu, 12.1.0.1.0 ] , [ oracle.usm, 12.1.0.1.0 ]

All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Email address/User Name: somebody@somewhere.com  ß Use your Oracle support e-mail or leave blank
Provide your My Oracle Support password to receive security updates via your My
Oracle Support account.
Password (optional):*********  ß Use your Oracle support password

The update may sit a blinking cursor for a long time on virtual machines

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = 'C:\oracle12c\product\12.1.0\dbhome_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y

 Backing up files...

Patching component oracle.rdbms, 12.1.0.1.0...
  • - -  LIST OF PATCHES WILL BE DISPLAYED - - -
Patching component oracle.has.rsf, 12.1.0.1.0...

Verifying the update...
Patch 19542943 successfully applied
Log file location: C:\oracle12c\product\12.1.0\dbhome_1\cfgtoollogs\opatch\19542
943_Oct_28_2014_15_10_16\apply2014-10-28_15-10-16PM_1.log

OPatch succeeded.


Java VM Patch - IF jvm component is enabled on the database. 

Open Windows Command window
C:\> set ORACLE_HOME= C:\oracle12c\product\12.1.0\dbhome_1

C:\> cd %ORACLE_HOME%\opatch

C:\oracle12c\product\12.1.0\dbhome_1\OPatch>opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.5
Copyright (c) 2014, Oracle Corporation.  All rights reserved.


Oracle Home       : C:\oracle12c\product\12.1.0\dbhome_1
Central Inventory : C:\Program Files\Oracle\Inventory
   from           : n/a
OPatch version    : 12.1.0.1.5
OUI version       : 12.1.0.1.0
Log file location : C:\oracle12c\product\12.1.0\dbhome_1\cfgtoollogs\opatch\opat
ch2014-11-07_16-35-32PM_1.log

Lsinventory Output file location : C:\oracle12c\product\12.1.0\dbhome_1\cfgtooll
ogs\opatch\lsinv\lsinventory2014-11-07_16-35-32PM.txt

------------------------------------------------------------------------

Installed Top-level Products (1):

Oracle Database 12c                                                  12.1.0.1.0
There are 1 products installed in this Oracle Home.


Interim patches (1) :

Patch  19542943     : applied on Tue Oct 28 17:26:36 MDT 2014
Unique Patch ID:  18159462
Patch description:  "WINDOWS DB BUNDLE PATCH 12.1.0.1.14 (64bit): (19542943)"
   Created on 15 Oct 2014, 05:44:18 hrs PST8PDT
   Bugs fixed:
     17716305, 17854334, 16694728, 17257820, 16042673, 18096714, 16476044
     17439871, 16320173, 17762256, 16954950, 17006570, 17305959, 17710315
     14506328, 17806676, 17443596, 16878635, 17804338, 16429953, 16845022



------------------------------------------------------------------------


OPatch succeeded.

c:\oracle12c\product\12.1.0\dbhome_1\OPatch>cd c:\

c:> cd c:\shared\Java-patch-p19801531_1210114forWindows_MSWIN-x86-64\19801531

c:\shared\Java-patch-p19801531_1210114forWindows_MSWIN-x86-64\19801531>set PATH=
%ORACLE_HOME%\opatch;%PATH%

c:\>cd c:\shared\Java-patch-p19801531_1210114forWindows_MSWIN-x86-64\19801531

c:\shared\Java-patch-p19801531_1210114forWindows_MSWIN-x86-64\19801531>opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.1.0.1.5
Copyright (c) 2014, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : C:\oracle12c\product\12.1.0\dbhome_1
Central Inventory : C:\Program Files\Oracle\Inventory
   from           : n/a
OPatch version    : 12.1.0.1.5
OUI version       : 12.1.0.1.0
Log file location : C:\oracle12c\product\12.1.0\dbhome_1\cfgtoollogs\opatch\opatch2014-11-07_16-49-21PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

c:\shared\Java-patch-p19801531_1210114forWindows_MSWIN-x86-64\19801531>opatch apply
Oracle Interim Patch Installer version 12.1.0.1.5
Copyright (c) 2014, Oracle Corporation.  All rights reserved.


Oracle Home       : C:\oracle12c\product\12.1.0\dbhome_1
Central Inventory : C:\Program Files\Oracle\Inventory
   from           : n/a
OPatch version    : 12.1.0.1.5
OUI version       : 12.1.0.1.0
Log file location : C:\oracle12c\product\12.1.0\dbhome_1\cfgtoollogs\opatch\1980
1531_Nov_07_2014_16_49_52\apply2014-11-07_16-49-52PM_1.log

Applying interim patch '19801531' to OH 'C:\oracle12c\product\12.1.0\dbhome_1'
Verifying environment and performing prerequisite checks...
Patch 19801531: Optional component(s) missing : [ oracle.sqlj, 12.1.0.1.0 ] , [
oracle.sqlj.companion, 12.1.0.1.0 ]
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = 'C:\oracle12c\product\12.1.0\dbhome_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...

Patching component oracle.javavm.server, 12.1.0.1.0...

Patching component oracle.rdbms.dbscripts, 12.1.0.1.0...

Patching component oracle.rdbms, 12.1.0.1.0...

Verifying the update...
Patch 19801531 successfully applied
Log file location: C:\oracle12c\product\12.1.0\dbhome_1\cfgtoollogs\opatch\19801
531_Nov_07_2014_16_49_52\apply2014-11-07_16-49-52PM_1.log


OPatch succeeded.

Use these instructions with caution.  They may not be complete for your environment or situation...

Tiger VNC setup on CentOS 6.5

Install TigerVNC Server as root:
# yum install tigervnc-server

Configure Firewall to allow TigerVNC ports:
5900, 5901, etc

Edit /etc/sysconfig/vncservers
Two entries manage the users and ports.  Users must exist in Linux prior to starting tigervnc-server service
VNCSERVERS="2:robert"
VNCSERVERARGS[2]="-geometry 1440x900"

Command to start/stop/restart TigerVNC-server (run as root)
# service vncserver start
# service vncserver stop
# service vncserver restart

Set TigerVNC-Server to automatically start when Linux is rebooted (run as root):
# chkconfig vncserver on

Login as the Linux user noted in /etc/sysconfig/vncservers and execute:
$ vncpasswd
Password:

Verify:

Start VNC Client software:








Enter hostname:port# and select OK
Enter password.
Use Password set by the vncpasswd utility.

You should be connected.

WARNING:  This method of configuring and using VNC does not use SSH security/encyption.
DO NOT USE on external facing networks.

Friday, February 27, 2015

Linux TCO post on Microsoft MCP Magazine

There was a link to a Linux 'total cost of ownership' on a Microsoft online magazine.  Interesting place to find such an article...


Random Text in a forum page

This little bit doesn't seem to go with the rest of the discussion...


Tuesday, March 18, 2014

Normal.dot Fix

In MS Word the COM Add-Ins can cause problems when more than one window of MS Word is open. Launch MS Word and navigate to Word Options:
Highlight 'Add-Ins' on the left pane. At the bottom of the page in the Manage section, make sure COM Add-Ins is shown in the Manage drop down. Select GO.
Un-check any Add-Ins. Select OK. Exit MS Word Test the changes. Enjoy.

Friday, February 28, 2014

Windows Shortcut Keys

End Goes to end of current line
Ctrl + End Goes to end of document
Shift + Home Highlights from current position to beginning of line
Shift + End Highlights from current position to end of line
Ctrl + Left arrow Moves one word to the left at a time
Ctrl + Right arrow Moves one word to the right at a time


Alt + Tab Switch between open applications
Alt + Shift + Tab Switch backwards between open applications.
Alt + double-click Display the properties of the object you double-click on. For example, doing this on a file would display its properties.
Ctrl + Tab Switches between program groups or document windows in applications that support this feature.
Ctrl + Shift + Tab Same as above but backwards.
Alt + Print Screen Create a screen shot only for the program you are currently in.
Ctrl + Alt + Del Reboot the computer and/or bring up the Windows task manager.
Ctrl + Esc Bring up the Windows Start menu. In Windows 3.x this would bring up the Task Manager.
Alt + Esc Switch Between open applications on taskbar.
F1 Activates help for current open application.
F2 Renames selected Icon.
F3 Starts find from desktop.
F4 Opens the drive selection when browsing.
F5 Refresh Contents.
F10 Activates menu bar.
Shift + F10 Simulates right-click on selected item.
F4 Select a different location to browse in the Windows Explorer toolbar.
Alt + F4 Closes Current open program.
Ctrl + F4 Closes Window in Program.
F6 Move cursor to different Windows Explorer pane.
Ctrl + Space bar Drops down the window control menu.
Ctrl + (the '+' key on the keypad) Automatically adjust the widths of all the columns in Windows explorer
Alt + Enter Opens properties window of selected icon or program.
Shift + Del Delete programs/files without throwing them into the recycle bin.
Holding Shift Boot safe mode or by pass system files as the computer is booting.
Holding Shift When putting in an audio CD, will prevent CD Player from playing.
Enter Activates the highlighted program.
Alt + Down arrow Display all available options on drop down menu.
* (on the keypad) Expands all folders on the currently selected folder or drive in Windows Explorer.
+ (on the keypad) Expands only the currently selected folder in Windows Explorer.
- (on the keypad) Collapses the currently selected folder in Windows Explorer.