Oracle Commands
Oracle Commands
=================
1. Go to Command Prompt
2. write: sqlplus and enter
3. enter user id & password of system as: system/system123@orcl
Note:
system is oracle main user
system123 is system password (it can be vary in different installations)
@orcl is the SID or Service Name (this can be vary in different installations,
mostly it is orcl)
===================================================================================
=================
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
===================================================================================
=================
Note:
tbs_Prism is the tablespace name, you can put any name for each schema or keep the
same for all, default tablespace in oracle is Users
As you create a new tablespace so you have to create a new datafile with .dbf
extension
Size is initial size of db, autoextend On means it will grow with data. if not
given, it keeps the db file size to 10 MB (as given here) and then stop saving data
when reached to its size.
-----------------------------------------------------------------------------------
--
Note:
PrismERP is the user / schema name
Identified by - refer to password i.e password here: Password in oracle is case
sensitive
given tablespace that created above
with temporary tablespace for transaction purpose.
-----------------------------------------------------------------------------------
--
-----------------------------------------------------------------------------------
--
Note: this will delete the user from Oracle, memory and from oracle recycle bin too
drop user required when you have no need of schema or import a new backup / dump
file on the same user/schema.
===================================================================================
=================
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
===================================================================================
=================
2. write the following commands in the above open command prompt / sqlplus:
Note:
expdp = export data pump command
system/system123@orcl = system user and password with service / SID name (i.e full
qualified name)
schemas=PrismERP == the schema / user want to export
directory=Dump == the directory created above
dumfile= anyname.dmp (mostly keep the same name as schema, with extension .dmp)
logfile= anyname.log (this to check the events, logs while running export command)
Note: in case if importing from a different schema, and into a different tablespace
use the following command:
===================================================================================
=================
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
===================================================================================
=================
===================================================================================
=================
===================================================================================
=================
SELECT
table_name, owner
FROM
all_tables
WHERE
owner='PrismERP'
ORDER BY
owner, table_name
------------------------------------
SELECT TABLE_NAME
FROM ALL_TABLES
WHERE OWNER='PrismERP'
------------------------------------
connect PrismERP/password;
select table_name from user_tables;
===================================================================================
=================
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
===================================================================================
=================
To Export:
----------
expdp system/system123@orcl full=Y directory=Dump_DB dumpfile=orcl.dmp
logfile=expdpORCL.log
To Import:
----------
impdp system/password@db10g full=Y directory=Dump_DB dumpfile=DB10G.dmp
logfile=impdpDB10G.log
===================================================================================
=================
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
===================================================================================
=================