Re: best way to convert from unix to linux
Date: Fri, 25 May 2012 15:31:48 +0100
Message-ID: <4FBF97D4.8070500_at_dunbar-it.co.uk>
Hi Dustin,
On 25/05/12 12:14, Dustin Hayden wrote:
> I have a 3TB database that needs to be moved from hp-ux to linux.
I did this recently with a 6.5 TB database or three. It just worked. I used transportable tablespaces to do it.
When I got it on Linux, I had to carry out a ROWS=NO import to get the PL/SQL, triggers etc - TTs don't take those across.
Once that has been done, I needed to run DBMS_STATS.UNLOCK_SCHEMA_STATS on any schema that had been imported by the imp ROWS=NO which, for some unknown reason, locks stats and doesn't bother to mention it. (Except in the manual.)
The process is well documented in the manuals, but basically you:
- Run a few tests to make sure that there are no dependencies etc accross tablespaces you wish to transport and others that you are not transporting.
- Put the tablespaces into read only mode.
- Copy the data files making up the tablespace(s) to a safe place.
- Run an exp (or expdp) in transportable tablespace mode.
- Run an exp (or expdp) in ROWS=NO mode.
- Take the tablespaces back out of read only mode.
Get the files over to the Linux server and copy them to "a/safe/place" which is not where they will end up going when the database is finished.
- Build a new database, but WITHOUT the tablespaces you are transporting.
- Create all the users in the HP database in the Linux database. Point their default_tablespace at a temporary one which is not coming from HP.
- Run up RMAN with target set to the Linux database.
- run the following command in RMAN:
convert datafile='a/safe/place/data_file_1.dbf',
'a/safe/place/data_file_2.dbf', ... from_platform='HP-UX (64-bit)' to_platform='Linux x86 64-bit'
db_file_name_convert='/what/it/was/on/HP','/what/it/needs/to/be/';
So if your files were in /u01/app/SID1/data on HP and are going into /srv/app/SID1/data on Linux, you need:
db_file_name_convert='/u01/','/srv/';
The files will be copied from /a/safe/place to /srv/app/SID1/data and on the way, will be converted from HP-UX to Linux format.
- When all files are converted, exit from RMAN and run an IMP or IMPDP in transportable tablespace mode.
- Login to the database and put the tablespaces into read-write mode.
- Run an IMP or IMPDP in ROWS=No mode to get the PL/SQL etc.
- Login to the database and unlock schema stats.
- Alter your user's default_tablespace to point at the corrrect one(s) that you have just TT'd into the database.
Caveats:
- The exporting database must be 10203 Enterprise or higher.
- The importing database can be SE or EE as required.
- You might have trouble with Spatial Indexes.
- The exporting database needs to have compatible set to 10.2.0.0.0 or higher.
- If you have to change it, do it while the tablespaces are read-write!
- Both exporting and importing databases must use the same character set(s).
- Sequences, triggers, procedures, functions, packages need to be imported by IMP or IMPDP. The TT process will not copy them across.
- Stats will be locked for any schema imported with IMP and ROWS=NO. They must be unlocked afterwards.
Have fun.
Cheers,
Norm.
PS. I have a very rough and ready document on this very subject if you want a copy, I can modify the names and such like to protect the innocent and let you have a copy.
-- Norman Dunbar Dunbar IT Consultants Ltd Registered address: Thorpe House 61 Richardshaw Lane Pudsey West Yorkshire United Kingdom LS28 7EL Company Number: 05132767 -- http://www.freelists.org/webpage/oracle-lReceived on Fri May 25 2012 - 09:31:48 CDT