Oracle DB migration from windows to Exadata machine
Database Migration steps from windows 2003 to Exadata DB Server :
Steps @(windows) Source server:
1.Connect to the database
Cmd>set oracle_sid=<sidname>
Cmd>sqlplus sys as sysdba
Password:<password>
Sql>select name from v$database;
2.Check the any recyclebin objects in the Database.
Sql>select count(*) from dba_recyclebin:
If any recyclebin objects are there purge that objects
Sql>purge dba_recyclebin;
- Purge the recyclebin;
Sql>purge recyclebin;
4.Now Check the any recyclebin objects in the Database.
Sql>select count(*) from dba_recyclebin:
It will shows o objects.
- check the invalid objects using the following query.
SQL> select object_type,count(1) from dba_objects where owner='<username>’ and status=’INVALID’ group by object_type;
If we found any invalid objects recompile the objects.
Sql>@?rdbms/admin/utlrp.sql;
Run the above step n Number of times up to getting the 0 invalid objects.
6.Check the current database object count.
SQL> select count(*) from dba_objects where owner='<username>’;
COUNT(*)
———-
347
SQL> select object_type, count(*) from dba_objects where owner='<schema_name>’ group by object_type;
OBJECT_TYPE COUNT(*)
——————- ———-
SEQUENCE 34
PROCEDURE 3
LOB 1
PACKAGE 15
PACKAGE BODY 14
TABLE 118
INDEX 122
VIEW 40
8 rows selected.
SQL> select object_type,count(1) from dba_objects where owner=’FMS’ and status=’INVALID’ group by object_type;
OBJECT_TYPE COUNT(1)
——————- ———-
PACKAGE 1
PACKAGE BODY 1
SQL> set lines 200
SQL> col object_name for a30
SQL> col object_type for a30
SQL> select object_name,object_type from dba_objects where owner=’<schema-name>’ and status=’INVALID’;
OBJECT_NAME OBJECT_TYPE
—————————— ——————————
NEW_DRAFT_PK PACKAGE
NEW_DRAFT_PK PACKAGE BODY
SQL> select * from dba_db_links;
no rows selected
SQL> select count(*) from dba_jobs;
COUNT(*)
———-
1
After checking all objects Follow the below steps.
1.Shutdown the database.
Sql>shutdown immediate;
2.Start the Database with restrict option.
Sql>startup restrict.
- Enable the database with restricted session.
Sql>alter system enable restricted session;
Start the expdp backup:
- Create the directory in os lenel.
Dir path D:\oracle\export
- Create the directory in Database level.
Sql> create or replace directory dpump as ‘D:\oracle\export’;
Sql> grant read,write on directory dpump to system;
- Take the database expdp backup.
Cmd>set oracle_sid=<sid-name>
Cmd> expdp usermame/password directory=dpump dumpfile=<dumpfile-name> logfile=<logfile-name> schemas=<schema1,schema2,schema3>
Note: Take the schema level export backup instead of full database backup.
Steps to copy the expdp dump files from Windows Server to Linux Server.
1.Go to the generated dump files directory Location.
Cmd>cd D:\oracle\export {enter}
Cmd>D: (enter)
2.D:\oracle\export>ftp <Linux server IP>
Connected…
Provide the username and password
Username:<username>
Password:<password>
Go to the created directory location from Windows server.
ftp>cd /u01/app/oracle/admin/dbname/expbkp
ftp>bin
ftp>put <file-name>
(OR)
ftp>mput *.dmp
Check the copy status in linux server
Cmd>du –sh *.dmp
Steps @Exadataserver:
1.Create the tablespace in newly created database.
login as: oracle
oracle@<Linux Server>’s password:
oracloud01 {/home/oracle}:. oraenv
ORACLE_SID = [dbm011] ? sid1
Run the impdp cmd:
oracloud01 {/home/oracle}: impdp username/password directory=dpump_dir dumpfile=<dumpfile_name>.dmp logfile=<logfile_name>.log schemas=<schema_name> cluster=N
=>If you want to change the schema name user the Below command.
remap_schema=schema1:schema2
=>If you want to change the schema name user the Below command.
remap_tablespace=tbs1:tbs2
Finally check the object count in newly migrated database.
Change the user password.
See also
- Best Practices while doing expdp and impdp activity
- what schemas exported/imported using expdp/impdp ?
- Import Running longer time due to huge log switch