当前位置:网站首页>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;
边栏推荐
- 2022 vmvare download and installation tutorial on the latest official website (ultra detailed)
- CentOS installation mysql5.7
- Splunk health checks orphaned searches
- 知物由学 | 行为时序建模在社交引流黑产识别中的应用
- saltstack安装与使用
- flink 窗口表值函数
- FTP server: downloading and using Serv-U
- 9、聊聊ThreadLocal
- China Unicom 22 spring Games Group
- CMD of Jerry's AI protocol_ SET_ BLE_ Format of visibility command [chapter]
猜你喜欢

8. 18 arhat enhancements for atomic operations

flink 多流转换(侧输出流分流、Union、Connect) 实时对账app 的支付操作和第三方的支付操作的双流 Join

知麻Z1投影仪真的好用吗?实际效果怎么样?

Flink multi stream conversion (side output stream shunting, union, connect) real-time reconciliation of APP payment operations and third-party payment operations

ftp服務器:serv-u 的下載及使用

12. AQS of abstractqueuedsynchronizer

CentOS installation mysql5.7

非标自动化设备制造企业,如何借助ERP系统实现快速精准报价?

Splunk 最佳实践-减轻captain 负担

4、LockSupport与线程中断
随机推荐
2、CompletableFuture
Redis數據類型日常使用場景
China Unicom 22 spring Games Group
Jerry's CMD_ SET_ BT_ Name command format [chapter]
C# System.Guid.NewGuid() 格式化
秒杀多级缓存-----商品详情页
石头科技:研发实力和过硬品质 助力扫地机器人产业升级
The super document downloading tool scihub CN teaches you to download documents with one line of command
Construction of specflow environment
9、聊聊ThreadLocal
8、原子操作类之18罗汉增强
9. Talk about ThreadLocal
一些比较的常用网站
Splunk certificate expired, making kV store unable to start
CentOS installation mysql5.7
Record a troubleshooting of MySQL master-slave asynchrony
(recommended) how many splunks are appropriate? Search head
Wechat authorization to obtain mobile phone number
Development of TRX wave field chain pledge liquidity mining system
Flink time semantics, watermark, generated watermark, and transmission of watermark