ITPub博客

首页 > Linux操作系统 > Linux操作系统 > convert database

convert database

原创 Linux操作系统 作者:mambo_shen 时间:2009-11-23 20:21:31 0 删除 编辑

SQL> set serveroutput on

SQL> declare
  2         retcode boolean;
  3       begin
  4         retcode := dbms_tdb.check_db('Linux IA (32-bit)',
  5          dbms_tdb.skip_none);
  6       end;
  7  /
Database is not open in READ-ONLY mode. Open the database in READ-ONLY mode and retry.

SQL> startup mount

SQL> alter database open read only ;

SQL> select platform_name from v$db_transportable_platform;

PLATFORM_NAME
--------------------------------------------------------------------------------
Microsoft Windows IA (32-bit)
Linux IA (32-bit)
HP Tru64 UNIX
Linux IA (64-bit)
HP Open VMS
Microsoft Windows IA (64-bit)
Linux x86 64-bit
Microsoft Windows x86 64-bit
Solaris Operating System (x86)
Solaris Operating System (x86-64)
HP IA Open VMS

SQL> ! mkdir /home/oracle/mambos/TDB

RMAN> convert database
2> transport script. '/home/oracle/mambos/TDB/TDB_gsbc.sql'
3> new database 'gsbcwin'
4> to platform. 'Microsoft Windows IA (32-bit)'
5> parallelism 2
6> format '/home/oracle/mambos/TDB/gsbcwin'
7>  db_file_name_convert '/home/oracle/OraBase/oradata/GSBC/datafile/' '/home/oracle/mambos/TDB/gsbcwin';

[root@hzctempdb TDB]# ll
total 1045584
-rw-r-----  1 oracle dba 293609472 Nov 23 12:14 gsbcwino1_mf_sysaux_584mgp3b_.dbf
-rw-r-----  1 oracle dba 461381632 Nov 23 12:14 gsbcwino1_mf_system_584mg54m_.dbf
-rw-r-----  1 oracle dba 309338112 Nov 23 12:14 gsbcwino1_mf_undotbs1_584mgl5l_.dbf
-rw-r-----  1 oracle dba   5251072 Nov 23 12:14 gsbcwino1_mf_users_584mgx9d_.dbf
-rw-r--r--  1 oracle dba      1514 Nov 23 12:14 init_gsbcwin.ora
-rw-r--r--  1 oracle dba      2362 Nov 23 12:14 TDB_gsbc.sql

[root@hzctempdb TDB]# cat TDB_gsbc.sql
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- The contents of online logs will be lost and all backups will
-- be invalidated. Use this only if online logs are damaged.

-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE

STARTUP NOMOUNT PFILE='/home/oracle/mambos/TDB/init_gsbcwin.ora'
CREATE CONTROLFILE REUSE SET DATABASE "GSBCWIN" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 SIZE 50M,
  GROUP 2 SIZE 50M,
  GROUP 3 SIZE 50M
DATAFILE
  '/home/oracle/mambos/TDB/gsbcwino1_mf_system_584mg54m_.dbf',
  '/home/oracle/mambos/TDB/gsbcwino1_mf_undotbs1_584mgl5l_.dbf',
  '/home/oracle/mambos/TDB/gsbcwino1_mf_sysaux_584mgp3b_.dbf',
  '/home/oracle/mambos/TDB/gsbcwino1_mf_users_584mgx9d_.dbf'
CHARACTER SET AL32UTF8
;

-- Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;

-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE
     SIZE 20971520  AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
-- End of tempfile additions.
--

set echo off
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prompt * Your database has been created successfully!
prompt * There are many things to think about for the new database. Here
prompt * is a checklist to help you stay on track:
prompt * 1. You may want to redefine the location of the directory objects.
prompt * 2. You may want to change the internal database identifier (DBID)
prompt *    or the global database name for this database. Use the
prompt *    NEWDBID Utility (nid).
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SHUTDOWN IMMEDIATE
STARTUP UPGRADE PFILE='/home/oracle/mambos/TDB/init_gsbcwin.ora'
@@ ?/rdbms/admin/utlirp.sql
SHUTDOWN IMMEDIATE
STARTUP PFILE='/home/oracle/mambos/TDB/init_gsbcwin.ora'
-- The following step will recompile all PL/SQL modules.
-- It may take serveral hours to complete.
@@ ?/rdbms/admin/utlrp.sql
set feedback 6;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16348200/viewspace-620339/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: oracle patch category
请登录后发表评论 登录
全部评论

注册时间:2008-10-09

  • 博文量
    86
  • 访问量
    87708