I can not import oracle database from another user - oracle

I exported oracle database from user c##cuongnguyen. After i exported, i had dump file , So i want to import this file to another user: mbbank
So i run this syntax:
**
imp mbbank/xxxxxx FROMUSER=c##cuongnguyen TOUSER=mbbank
file=C:\oracle\export\cuongnguyen-user.DMP;
**
I recieved the response, it's about character.
Import: Release 12.2.0.1.0 - Production on Wed Apr 22 19:30:22 2020
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights
reserved.
Connected to: Oracle Database 12c Enterprise Edition Release
12.2.0.1.0 - 64bit Production
Export file created by EXPORT:V12.02.00 via conventional path
Warning: the objects were exported by C##CUONGNGUYEN, not by you
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR
character set import server uses AL32UTF8 character set (possible
charset conversion) IMP-00085: multiple input files specified for
unbounded export file IMP-00000: Import terminated unsuccessfully
If you have any ideas, please tell me know, Many thanks

Have you tried to run the command inside the directory where the dmp file is located? Or even put the directory path between ''?
cd C:\oracle\export
imp mbbank/xxxxxx FROMUSER=c##cuongnguyen TOUSER=mbbank file=cuongnguyen-user.DMP
or
imp mbbank/xxxxxx FROMUSER=c##cuongnguyen TOUSER=mbbank file='C:\oracle\export\cuongnguyen-user.DMP'
Just for your knowledge, oracle has a more improved database export and import tool: expdp and impdp. And you can do it in your own way:
Creating a directory of export inside database:
$ORACLE_HOME/bin/sqlplus '/ as sysdba'
SQL> create or replace directory export as 'C:\oracle\export';
Exporting the schema:
expdp mbbank/xxxxxx dumpfile=cuongnguyen-user.DMP directory=export schemas=c##cuongnguyen
Finally importing as a new user:
impdp mbbank/xxxxxx dumpfile=cuongnguyen-user.DMP directory=export schemas=c##cuongnguyen remap_schema=c##cuongnguyen:mbbank

Related

My question is about exportdump with a query on oracle 9i

I am getting the following error and i need help.
hcp7 (spar)/tmp $ exp system/puppy parfile=rr.prm
Export: Release 9.2.0.8.0 - Production on Thu Oct 31 13:27:11 2019
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
Current user changed to AHS
. . exporting table HB_CONTROL_OUT_DATA
EXP-00056: ORACLE error 933 encountered
ORA-00933: SQL command not properly ended
Export terminated successfully with warnings.
hcp7 (spar)/tmp $
hcp7 (spar)/tmp $ vi rr.prm
"rr.prm" 6 lines, 258 characters
file=raj.dmp
log=raj.log
STATISTICS=none
compress=y
tables=AHS.HB_CONTROL_OUT_DATA
query="[select * from hb_control_out_data where exists (select '1' from hb_control_out where hbod_tran_num = hbo_tran_num and ADD_MO
NTHS(HBO_TO_MIS_DATE,24) >SYSDATE)]"
You need to escape your quotes in the query. See the documentation at https://docs.oracle.com/cd/B10501_01/server.920/a96652/ch01.htm#1005843.
BTW, version 9i belongs in a software museum. It was released 17 years ago and the final patch set was released over 12 years ago.
The error message is
EXP-00056: ORACLE error 933 encountered
ORA-00933: SQL command not properly ended
What SQL are you executing? Well, your parameter file includes a QUERY parameter. It may be a trick of the cut'n'paste into the StackOverflow question box but this looks odd:
ADD_MO NTHS(HBO_TO_MIS_DATE,24)
^
If that space or newline is not an artefact remove and re-run the export.

oracle 11g impdp returns invalid operation and object was not found

I wanted to transfer an oracle table between two users using expdp and impdp commands.
First of all, I created a directory and granted proper privileges to source and destination users:
SQL> CREATE OR REPLACE DIRECTORY TEST_DIR AS '/u01/app/oracle/oradata/temp_dirs';
Directory created.
SQL> GRANT READ, WRITE ON DIRECTORY test_dir TO SOURCE_USER;
Grant succeeded.
SQL> GRANT READ, WRITE ON DIRECTORY test_dir TO DEST_USER;
Grant succeeded.
SQL> commit;
This is my expdp command and it's output:
oracle#lab-57:~$ expdp SOURCE_USER/SOURCE_USER tables=tbl_user directory=TEST_DIR dumpfile=users.dmp logfile=exp_users.log
Export: Release 11.2.0.1.0 - Production on Tue Jul 24 16:18:27 2018
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SOURCE_USER"."SYS_EXPORT_TABLE_01": SOURCE_USER/******** tables=tbl_user directory=TEST_DIR dumpfile=users.dmp logfile=exp_users.log
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "SOURCE_USER"."TBL_USER" 8.085 KB 2 rows
Master table "SOURCE_USER"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SOURCE_USER.SYS_EXPORT_TABLE_01 is:
/u01/app/oracle/oradata/temp_dirs/users.dmp
Job "SOURCE_USER"."SYS_EXPORT_TABLE_01" successfully completed at 16:18:38
This implies the export operation was done successfully.
Then I tried to import it using impdp as following:
oracle#lab-57:~$ impdp DEST_USER/DEST_USER tables=TBL_USER directory=TEST_DIR dumpfile=users.dmp logfile=imp_users.log
Import: Release 11.2.0.1.0 - Production on Tue Jul 24 17:26:58 2018
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39002: invalid operation
ORA-39166: Object DEST_USER.TBL_USER was not found.
I also tried tables=DEST_USER.TBL_USER and content=data_only; both returned same error.
As you're exporting as SOURCE_USER and importing as DEST_USER, the REMAP_SCHEMA parameter might help. (I'll split the command into several rows for easier reading)
impdp DEST_USER/DEST_USER tables=TBL_USER directory=TEST_DIR
dumpfile=users.dmp logfile=imp_users.log
remap_schema=source_user:dest_user --> this
If you're on 11.2, you might hit a bug which won't allow you to do that (see My Oracle Support for more info). In that case, you can still perform import, but you'll have to omit the TABLES parameter, i.e.
TABLES was in this gap
|
impdp DEST_USER/DEST_USER v directory=TEST_DIR
dumpfile=users.dmp logfile=imp_users.log
remap_schema=source_user:dest_user
Simple answer :
Create import : keep the dump ready.
Two option to restore the dump , consider complete dump or specific table.
For table specific :- Table name = MONTHS_DAY
impdp DBA_USER/DBA_Password tables = SOURCE_SCHEMA.MONTHS_DAY directory=AKSHAY_SPM_EDIR dumpfile=MONTHS_DAY.dmp logfile=impdpMONTHS_DAY.log remap_schema = SOURCE_SCHEMA:DESTINATION_SCHEMA
For complete import :
impdp DBA_USER/DBA_Password directory = AKSHAY_SPM_EDIR dumpfile=MONTHS_DAY.dmp logfile=impdpMONTHS_DAY.log remap_schema = SOURCE_SCHEMA:DESTINATION_SCHEMA
Make sure, directory is accessible as dump is present there

VARCHAR2 field and NVARCHAR2 exsit in the same table,the former is correct,the latter was garbled

the database A field Type is:
select column_name,data_type From all_tab_columns ;
COLUMN_NAME DATA_TYPE
------------------------------------
NAME VARCHAR2
ID_ISSUE_PLACE VARCHAR2
NATIONALITY NVARCHAR2
I want to export a table with expdp:
expdp abc/123 tables=A.CUST:PARTNUM_0 exclude=grant,index,contraint,statistics,trigger DIRECTORY=DATATMP filesize=100M dumpfile=expdp_%U.dmp parallel=4 cluster=N COMPRESSION=DATA_ONLY
Then,I import the dmp file to my local oracle,the field 'NATIONALITY' is correct , but the other field is garbled.
impdp abc/123 DIRECTORY=DATATMP DUMPFILE=expdp_01.dmp
[oracle#db01 tmp]$ impdp bi71/bi71 DIRECTORY=datatmp
DUMPFILE=expdp_01.dmp
Import: Release 11.2.0.1.0 - Production on Tue Sep 6 11:18:05 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights
reserved.
Connected to: Oracle Database 11g Enterprise Edition Release
11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Master table
"A"."SYS_IMPORT_FULL_01" successfully loaded/unloaded Starting
"A"."SYS_IMPORT_FULL_01": abc/******** DIRECTORY=datatmp
DUMPFILE=expdp_01.dmp Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA . . imported
"A"."CUST":"PARTNUM_0" 5.990 MB 78037 rows
Statement:Not a windows client problems,because the vietnamese charecter has been displayed properly.Here with reason screenshot windows client, is to make the results better clarity.
screenshot
I found a rule,once vietnamese nationality in this line appears,the field NAME,ID_ISSUE_PLACE are garbled.
How to resolve? thanks(^_^).

write command log to file in window

I want to write log of following command to file in window:
C:\Users\The Linh>IMP system/Thelinh05#orcl FILE= D:\source\rabbit\db_dmp\billus
er.dmp FULL=Y IGNORE=Y;
(This command use to import data in to oracle).
I try to use this command:
C:\Users\The Linh>IMP system/Thelinh05#orcl FILE= D:\source\rabbit\db_dmp\billus
er.dmp FULL=Y IGNORE=Y;>log.txt
But it not write log to file. The output in command line is:
Import: Release 11.2.0.1.0 - Production on Thu Jan 14 16:32:47 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
IMP-00058: ORACLE error 1017 encountered ORA-01017: invalid
username/password; logon deniedUsername:
I've found solution for this problem. use below command:
IMP system/Thelinh05#orcl FILE= D:\source\rabbit\db_dmp\billuser.dmp
FULL=Y IGNORE=Y logfile=log.txt

Cannot import Oracle dump: IMP-00033: Warning: Table not found in export file

I have an Oracle dump (.dmp) that I want to import into my local Oracle instance. But when I do a full import, it fails with
IMP-00033: Warning: Table not found in export file.
Some facts:
using imp system/pass ignore=yes tables=(t1,t2,t3,..)
export is successful (according to log)
export is done in Oracle Database 10g Release 10.1.0.4.0, import is done in Oracle Database 11g Express Edition Release 11.2.0.2.0
when I do show=y DDL is shown for all the tables on the list
before printing the 00033 warning, there is IMP-00009: abnormal end of export file
when I do a full import (without specifying table names), there are all sorts of errors, including
"IMP-00003: ORACLE error 1435 encountered",
"ORA-01435: user does not exist",
"ORA-01031: insufficient privileges".
These errors do not appear when I specify the table names.
How to do the import?
If you got IMP-00009: abnormal end of export file this probably means that the import file do not have the expected format, or worse that it is incomplete! (but in that last case you would not be able to import specifying table names).
Since the database versions are so different, you should make sure that your import script specifies the format of incoming data with version=10.1.0 in your imp command

Resources