环境:RHEL 6.4 + Oracle 11.2.0.3 情景一:只是部分普通数据文件迁移,可以在线操作。 1.将对应表空间offline,移动数据文件到新
环境:RHEL 6.4 + Oracle 11.2.0.3
情景一:只是部分普通数据文件迁移,可以在线操作。1.将对应表空间offline,移动数据文件到新路径
2.数据文件alter database rename file '' to '';
3.再将表空间online
情景二:所有数据文件迁移。本文是针对情景二的实验,需求:主机/oradata挂节点变更为/usr2.在/usr2建立oradata文件夹来存放之前/oradata的所有文件。
操作步骤:
1.查看当前数据库的数据文件,临时文件,日志文件,控制文件,参数文件等信息。
2.根据当前spfile创建pfile文件,正常关闭数据库,移动源数据库文件到新的存储路径。
3.修改数据库参数文件,更改控制文件路径为新的存储路径,用改好的pfile文件启动数据库到mount状态。
4.重定向数据库的所有数据文件、日志文件路径,然后正常打开数据库。
5.核查各文件路径没有问题,根据当前pfile创建spfile,重启数据库实例。
1.查看当前数据库的数据文件,临时文件,日志文件,控制文件,,参数文件等信息。
SQL> select name from v$datafile; NAME oradata/sysdata/jingyu/system01.dbf /oradata/sysdata/jingyu/sysaux01.dbf /oradata/sysdata/jingyu/undotbs01.dbf /oradata/sysdata/jingyu/users01.dbf SQL> select name from v$tempfile; NAME oradata/sysdata/jingyu/temp01.dbf SQL> select member from v$logfile; MEMBER oradataoradata/sysdata/jingyu/redo01.log SQL> select name from v$controlfile; NAME oradata/sysdata/jingyu/control01.ctl /opt/app/oracle/fast_recovery_area/jingyu/control02.ctl SQL> show parameter pfile NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string dbhome_1/dbs/spfilejingyu.ora
2.根据当前spfile创建pfile文件,正常关闭数据库,移动源数据库文件到新的存储路径。
SQL> create pfile from spfile; File created. SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. --移动源数据库文件到新的存储路径: a.建立/usr2。 b./etc/fstab配置,更改/oradata为/usr2。 c.mount /usr2 d./usr2下建立oradata文件夹。 e./usr2下文件移动到/usr2/oradata下。 f.处理相关目录权限。 g.umount -l /oradata
3.修改数据库参数文件,更改控制文件路径为新的存储路径,用改好的pfile文件启动数据库到mount状态。
$ cd $ORACLE_HOME/dbs $ more initjingyu.ora jingyu.__db_cache_size=6677331968 jingyu.__java_pool_size=33554432 jingyu.__large_pool_size=33554432 jingyu.__oracle_base#ORACLE_BASE set from environment jingyu.__pga_aggregate_target=5402263552 jingyu.__sga_target=8086618112 jingyu.__shared_io_pool_size=0 jingyu.__shared_pool_size=1275068416 jingyu.__streams_pool_size.audit_file_dest.audit_trail.compatible.control_files,.db_block_size.db_domain..db_recovery_file_dest.db_recovery_file_dest_size.diagnostic_dest.dispatchers.memory_target.open_cursors.processes.remote_login_passwordfile.sessions.undo_tablespace SQL nomount ORACLE instance started. Total System Global Area 1.3429E+10 bytes Fixed Size 2241064 bytes Variable Size 6744444376 bytes Database Buffers 6677331968 bytes Redo Buffers 4636672 bytes SQL mount; Database altered. 4.重定向数据库的所有数据文件、日志文件路径,然后正常打开数据库。
SQLrename ; Database altered. SQLrename ; Database altered. SQLrename ; Database altered. SQLrename ; Database altered. SQLrename ; Database altered. SQLrename ; Database altered. SQLrename ; Database altered. SQLrename ; Database altered. SQL; Database altered.
5.核查各文件路径没有问题,根据当前pfile创建spfile,重启数据库实例。

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

The steps to build a MySQL database include: 1. Create a database and table, 2. Insert data, and 3. Conduct queries. First, use the CREATEDATABASE and CREATETABLE statements to create the database and table, then use the INSERTINTO statement to insert the data, and finally use the SELECT statement to query the data.

MySQL is suitable for beginners because it is easy to use and powerful. 1.MySQL is a relational database, and uses SQL for CRUD operations. 2. It is simple to install and requires the root user password to be configured. 3. Use INSERT, UPDATE, DELETE, and SELECT to perform data operations. 4. ORDERBY, WHERE and JOIN can be used for complex queries. 5. Debugging requires checking the syntax and use EXPLAIN to analyze the query. 6. Optimization suggestions include using indexes, choosing the right data type and good programming habits.

MySQL is suitable for beginners because: 1) easy to install and configure, 2) rich learning resources, 3) intuitive SQL syntax, 4) powerful tool support. Nevertheless, beginners need to overcome challenges such as database design, query optimization, security management, and data backup.

Yes,SQLisaprogramminglanguagespecializedfordatamanagement.1)It'sdeclarative,focusingonwhattoachieveratherthanhow.2)SQLisessentialforquerying,inserting,updating,anddeletingdatainrelationaldatabases.3)Whileuser-friendly,itrequiresoptimizationtoavoidper

ACID attributes include atomicity, consistency, isolation and durability, and are the cornerstone of database design. 1. Atomicity ensures that the transaction is either completely successful or completely failed. 2. Consistency ensures that the database remains consistent before and after a transaction. 3. Isolation ensures that transactions do not interfere with each other. 4. Persistence ensures that data is permanently saved after transaction submission.

MySQL is not only a database management system (DBMS) but also closely related to programming languages. 1) As a DBMS, MySQL is used to store, organize and retrieve data, and optimizing indexes can improve query performance. 2) Combining SQL with programming languages, embedded in Python, using ORM tools such as SQLAlchemy can simplify operations. 3) Performance optimization includes indexing, querying, caching, library and table division and transaction management.

MySQL uses SQL commands to manage data. 1. Basic commands include SELECT, INSERT, UPDATE and DELETE. 2. Advanced usage involves JOIN, subquery and aggregate functions. 3. Common errors include syntax, logic and performance issues. 4. Optimization tips include using indexes, avoiding SELECT* and using LIMIT.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function