The task is to copy an instance (
abc) to an instance
Let us assume the instance
xyz it will reside completely
on the mount point
This will be done by creating a
xyz instance, creating
its application tablespaces, and importing the export of
We will assume the Oracle software is already loaded, and that
there exists an export of
abc, and that:
The steps required to complete the task at hand:
xyz(See Create Instance)
xyztablespaces from instance
We need to generate a script create the tablespaceses and associated files. We can do this with SQL that generates SQL, or with perl. I use perl. In either case, it requires some editing to get things right.
smabc @ci spool tb0 select tablespace_name, sum(bytes)/1048576 from dba_data_files group by tablespace_name; spool off
This creates the file
Edit this file into
tb1.logto remove the SYSTEM, RBS, TEMP, USERS, and TOOLS entrys (these tablespaces were created with the creation of the
xyzinstance) along with the heading and trailing lines.
Run the perl script:
Now create the
xyzapplication tablespaces with:
smxyz @ci @tb2**
** Note: The
tb1.plscript creates a create tablespace(s) sql script. It assumes the target file system to be
/xyz/v001. This is unlikely to be the case in real life. Therefore it may be necessary to edit
tb3.sqland hand edit the tablespace files to thier appropriate file directorys. It may also possible to modify
tb1.plto accomplish and/or expedite this task.
xyzis now ready for the import of data.
Import from the
imp sys/xyzdba full=y file=expabc log=impxyz