当前位置:网站首页>Oracle database import data steps
Oracle database import data steps
2022-06-11 12:27:00 【Three years old, funny】
When we import data into the database , The routine steps are as follows :
The logged in user system Administrators
–【 Steps must be taken : Create tablespace 】
create tablespace test datafile 'G:\app\zky\oradata\hsp\test01.DBF' size 1024M autoextend on;
create tablespace ESB datafile 'G:\app\zky\oradata\hsp\ESB.DBF' size 1024M autoextend on;
create tablespace LIS datafile 'G:\app\zky\oradata\hsp\LIS.DBF' size 1024M autoextend on;
create tablespace EMR datafile 'G:\app\zky\oradata\hsp\EMR.DBF' size 1024M autoextend on;
notes :G:\app\zky\oradata\hsp\ESB.DBF Path the path to store the table space for your database , The above is the personal path ,autoextend on Increase the size of the table space .
–【 It's not necessary : Create user 】
create user ESB_USER identified by ESB_USER default tablespace test;
–【 It's not necessary : Create the role 】
create role ESB_ROLE;
–【 It's not necessary : Authorize roles 】
grant ESB_ROLE to ESB_USER;
–【 Steps must be taken : Create Import Directory , After creation, you need to put DMP Put the backup files of into this directory 】
create directory dump_file_dir as 'd:\expdp1';
–【 Steps must be taken :cmd function 】
–impdp user name / password @ database schemas= To import a, Users to import b, Users to import c directory=dump_file_dir dumpfile= Backup file .DMP logfile= Import log _in.log;
impdp system/[email protected] schemas=hsp,lis,esb_user directory=dump_file_dir dumpfile=2020031901.DMP logfile=2020031901_in.log;
— Grant the user name dba Authority
–grant connect,resource,dba to user name ;
grant connect,resource,dba to hsp_cp;
— to grant authorization ( Sign in sys User authorization )
grant select on sys.v_$session to hsp_cp;
Methods described
grant SELECT ANY DICTIONARY jurisdiction ( For all dictionary tables and views );
Grant this user select on sys.v_ s e s s i o n power limit , and send use Yes power limit use Household Yes v session jurisdiction , And use authorized users to v session power limit , and send use Yes power limit use Household Yes vsession Create common synonyms ( If granted public select on sys.v_KaTeX parse error: Expected group after '_' at position 38: …select on sys.v_̲session jurisdiction , And create a pair under this user sys.v_ s e s s i o n Of private Yes Same as The righteous word ( Yes The use Household , also Yes The Depending on the chart ) . v session Private synonym for ( For this user , Also for this view ).v session Of private Yes Same as The righteous word ( Yes The use Household , also Yes The Depending on the chart ).vsession yes v_$session Another name for
–【 Steps must be taken 】
– After importing the database, you need to PL/SQL Compiling invalid objects in
impdp hsp/test directory=lis_file_dir dumpfile=LIS20200526.dmp logfile=LIS20200526.DMP_in.log full=y table_exists_action=replace
All right. , What is mentioned above is the operation of conventional data , Generally no problem , Let's talk about special circumstances !
1, When we don't need all the data of a library , When only the data of a certain module is required , We need to import this into our local database . There is a little pit !
2, First install the general operation , Create tablespace , user , And then execute imp command .
impdp system/[email protected] schemas=hsp directory = dump_file_dir dumpfile =TEST.DMP logfile=export.log
cmd Window error :SYS_IMPORT_FULL_01 Invalid operation scheme , Invalid object table .
reason : Maybe it's a user conflict or permission problem , The scene is not easy to restore , The statement... Is used
impdp system/[email protected] directory=DUMP_DIR dumpfile=TEST.DMP logfile=export.log remap_schema=hsp:HSP table_exists_action=replace transform=segment_attributes:n
An error is as follows :
The reason is that the user is not given tablespace permissions and dba jurisdiction
— Grant the user name dba Authority
--grant connect,resource,dba to user name ;
Finally, optimize imp command :
impdp HSP/[email protected] directory=DUMP_DIR dumpfile=TEST.DMP logfile=export.log remap_schema=hsp:HSP
Success is like this :
At last, I put up some common sentences :
– With system The user login , Find the user to delete :
– Find user
select * from dba_users;
– Find the path to the workspace
select * from dba_data_files;
– Delete user
drop user hsp cascade;
– Delete tablespace
drop tablespace HSP_BLOB including contents and datafiles cascade constraint;
– Change user password
alter user HSP identified by HSP;
– Query directory location
SELECT * FROM dba_data_files ;
– Inquire about dba Catalog
select * from dba_directories;
– Delete directory
DROP DIRECTORY Directory name ;
for example : Delete the user name as LYK, The tablespace name is LYK
– Delete user , And cascading relationships are also deleted
drop user LYK cascade;
– Delete tablespace , And the corresponding tablespace files are also deleted
drop tablespace HSP_CLS including contents and datafiles cascade constraint;
– Query tablespace
SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_size
FROM dba_tablespaces t, dba_data_files d
WHERE t.tablespace_name = d.tablespace_name
GROUP BY t.tablespace_name;
边栏推荐
- Construction of specflow environment
- 1、线程基础知识
- 2. Completablefuture
- 美创科技数据安全管理平台荣获2022数博会“领先科技成果奖”
- CMD of Jerry's AI protocol_ SET_ BT_ Name [chapter]
- Splunk 最佳实践-减轻captain 负担
- Flink deployment mode and runtime architecture (session mode, single job mode, application mode, jobmanager, taskmanager, yarn mode deployment and runtime architecture)
- Flink time semantics, watermark, generated watermark, and transmission of watermark
- 14、课程总结与回顾
- JMeter learning experience
猜你喜欢
随机推荐
Command symbols commonly used by programmers
Record a JVM GC process
9、聊聊ThreadLocal
You call this shit MQ?
知物由学 | 行为时序建模在社交引流黑产识别中的应用
FTP server: downloading and using Serv-U
近期使用nodejs pinyin包时遇到的问题
oracle删除用户后,却还可以使用该用户登录
Flick controls window behavior (trigger, remover, allow delay, put late data into side output stream)
Splunk certificate expired, making kV store unable to start
Acwing50+Acwing51周赛+Acwing3493.最大的和(未完结)
netstat 命令详解
Where is it safer to open an account for soda ash futures? How much is the margin for soda ash futures?
Specflow环境搭建
7、CAS
2、CompletableFuture
Gocron scheduled task management platform
13、ReentrantLock、ReentrantReadWriteLock、StampedLock讲解
Zabbix安装及配置应用
splunk 证书过期 使KV-store不能启动






![Harmonyos application development -- General app interface framework appgeneralframework[app general framework][api v6]](/img/b6/d1d7d0e670af9505a4fabee76211c6.jpg)

