Alter database move file oracle
Use this clause to specify or change the default type of subsequently created tablespaces. A bigfile tablespace contains only one data file or temp file, which can contain up to approximately 4 billion 2 32 blocks. The maximum size of the single data file or temp file is terabytes TB for a tablespace with 32K blocks and 32TB for a tablespace with 8K blocks.
A smallfile tablespace is a traditional Oracle tablespace, which can contain data files or temp files, each of which can contain up to approximately 4 million 2 22 blocks. Oracle Database Administrator's Guide for more information about bigfile tablespaces. Specify this clause to establish or change the default permanent tablespace of the database. The tablespace you specify must already have been created. All objects subsequently created by those users will by default be stored in the new default tablespace.
If you are replacing a previously specified default tablespace, then you can move the previously created objects from the old to the new default tablespace, and then drop the old default tablespace if you want to. Specify this clause to change the default shared temporary tablespace of the database to a new tablespace or tablespace group, or to change the default local temporary tablespace to a new tablespace.
Specify tablespace to indicate the new default temporary tablespace for the database. After this operation completes, Oracle Database automatically reassigns to the new default temporary tablespace all users who had been assigned to the old default temporary tablespace.
You can then drop the old default temporary tablespace if you want to. You cannot drop an old default temporary tablespace if it is part of the default temporary tablespace group. Local temporary tablespaces cannot be part of a tablespace group.
The tablespace you assign or reassign as the default temporary tablespace must have a standard block size. If the SYSTEM tablespace is locally managed, then the tablespace you specify as the default temporary tablespace must also be locally managed. Oracle Database Administrator's Guide for information on tablespace groups. The thread must have at least two redo log file groups, and the database must be open.
The name of the instance is a string of up to 80 characters. If no thread is currently mapped to the specified instance, then Oracle Database returns an error. The database must be open, but you cannot disable a thread if an instance using it has the database mounted.
Oracle Real Application Clusters Administration and Deployment Guide for more information on enabling and disabling instances. The database is the new database name and can be as long as eight bytes. The optional domain specifies where the database is effectively located in the network hierarchy. If you specify a domain name, then the components of the domain name must be legal identifiers. See " Database Object Naming Rules " for information on valid identifiers.
Renaming your database does not change global references to your database from existing database links, synonyms, and stored procedures and functions on remote databases.
Changing such references is the responsibility of the administrator of the remote databases. The block change tracking feature causes Oracle Database to keep track of the physical locations of all database updates on both the primary database and any physical standby database. You must enable block change tracking on each database for which you want tracking to be performed. The tracking information is maintained in a separate file called the block change tracking file.
If you are not using Oracle Managed Files, then you must specify the change tracking filename. Oracle Database uses change tracking data for some internal tasks, such as increasing the performance of incremental backups. This clause enables block change tracking and causes Oracle Database to create a block change tracking file.
You must specify this clause if you are not using Oracle Managed Files. Specify this clause if you want Oracle Database to stop tracking changes and delete the existing block change tracking file.
Use this clause to enable or disable the force full database caching mode. In contrast to the default mode, which is automatic, the force full database caching mode considers the entire database, including NOCACHE LOBs, as eligible for caching in the buffer cache. The database must be mounted but not open. In an Oracle RAC environment, the database must be mounted but not open in the current instance and unmounted in all other instances. This is the default mode. Oracle Database Concepts for more information on the force full database caching mode.
Oracle Database Administrator's Guide to learn how to enable the force full database caching mode. You must be connect to the CDB root. You can specify only one default container. You can specify this clause when the database is mounted or open. This clause cannot be specified on a physical standby database if redo apply is active. Oracle Database Backup and Recovery User's Guide for information on preparing the fast recovery area for Flashback operations.
Oracle Database stops logging Flashback data and deletes all existing Flashback Database logs. This clause is valid only when you are connected to a CDB. It lets you change the undo mode for the CDB. Oracle Database Administrator's Guide for the complete steps for configuring a CDB to use local undo mode or shared undo mode.
After setting or changing the time zone with this clause, you must restart the database for the new time zone to take effect. Oracle Database does not automatically update existing data in the database to the new time zone. For this reason, Oracle does not encourage you to change the time zone of a database that contains data.
This setting is useful if you want report operations to be able to modify data as long as it is not being replicated by logical standby. Oracle Data Guard Concepts and Administration for information on logical standby. Specify NONE if you want normal security for all data in the database. Use this clause to prepare mirror copies of the database. The filegroup contains all the prepared files.
If you do not specify the redundancy of the mirror, the redundancy of the source database is used. Use this clause to discard mirror copies of data created by the prepare statement.
You must specify the same mirror name that you used for the prepare operation. Specify this clause to enable lost write protection for data files. You can enable, remove, and suspend lost write protection for data files. Note that the lost write database is zeroed out. It is not initialized with the contents of the current data file. Additionally, it removes all references to lost write protection including tracking data from the shadow tablespace.
If you suspend lost write protection for a short time, lost write protection for the data file is stopped during the suspended period. This means that no lost write data is gathered, and no blocks are checked. If you turn on lost write protection for the data file later, there will be no records of SCN updates made to the blocks in the datafile during the suspended period. Note that disabling lost write for the database does not deallocate the lost write storage.
Using Parallel Recovery Processes: Example. The following statement adds a redo log file group with two members and identifies it with a GROUP parameter value of The following statement adds a redo log file group containing two members to thread 5 in a Real Application Clusters environment and assigns it a GROUP parameter value of Dropping Log File Members: Example.
Renaming a Log File Member: Example. The preceding statement only changes the member of the redo log group from one file to another. The statement does not actually change the name of the file diskc:log3.
Before issuing this statement, you must change the name of the file through your operating system. Setting the Default Type of Tablespaces: Example. The following statement specifies that subsequently created tablespaces be created as bigfile tablespaces by default:. Changing the Default Temporary Tablespace: Examples. Alternatively, a group of tablespaces can be defined as the default temporary tablespace by using a tablespace group.
Creating a New Data File: Example. Before creating the new data file, you must take the existing data file or the tablespace in which it resides offline. Manipulating Temp Files: Example. The following takes offline the temp file temp The statement renaming the temp file requires that you first create the file temp Changing the Global Database Name: Example.
The following statement changes the global name of the database and includes both the database name and domain:. The following statement disables block change tracking and deletes the existing block change tracking file:.
Resizing a Data File: Example. Clearing a Log File: Example. Database Recovery: Examples. The following statement performs complete recovery of the entire database, letting Oracle Database generate the name of the next archived redo log file needed:.
Previous Next JavaScript must be enabled to correctly display this content. See Also: Oracle Data Guard Concepts and Administration for additional information about opening a physical standby database. Note: Parallelism is enabled by default during full or partial database recovery and logfile recovery.
This clause recovers only online data files. Note: Parallelism is enabled by default during Redo Apply. Your email address will not be published. Save my name, email, and website in this browser for the next time I comment. Temp File. Single-Instance Database 1. Connect to the database. Suppose we want to change tempfile location of a PDB.
For tablespaces other than the SYSTEM tablespace, you can move the datafiles while the database is online, provided you take the relevant tablespace offline during the rename operation.
For a simple rename in place, it should happen immediately. If the file has to be moved to a new location, it will take as long as the file move takes to complete. Thanks Noons for pointing out this glaring omission from the article. The process for manually renaming a datafile is the same as renaming a logfile, but for the sake of clarity it is repeated below.
Using Oracle Managed Files for information about creating data files and temp files that are both created and managed by the Oracle Database server. Oracle Database Concepts. Data files are physical files of the operating system that store the data of all logical structures in the database. They must be explicitly created for each tablespace. Oracle Database assigns each data file two associated file numbers, an absolute file number and a relative file number, that are used to uniquely identify it.
These numbers are described in the following table:. Uniquely identifies a data file in the database. This file number can be used in many SQL statements that reference data files in place of using the file name. Uniquely identifies a data file within a tablespace. For small and medium size databases, relative file numbers usually have the same value as the absolute file number.
However, when the number of data files in a database exceeds a threshold typically , the relative file number differs from the absolute file number. Your database should contain several other tablespaces with their associated data files or temp files. Be aware that your operating system might impose limits on the number of data files contained in your Oracle Database.
Also consider that the number of data files, and how and where they are allocated can affect the performance of your database. One means of controlling the number of data files in your database and simplifying their management is to use bigfile tablespaces. Bigfile tablespaces comprise a single, very large data file and are especially useful in ultra large databases and where a logical volume manager is used for managing operating system files.
Bigfile tablespaces are discussed in " Bigfile Tablespaces ". This limit applies for the life of the instance. You can add data files to traditional smallfile tablespaces, subject to the following limitations:. Operating systems often impose a limit on the number of files a process can open simultaneously. More data files cannot be created when the operating system limit of open files is reached.
The database imposes a maximum limit on the number of data files for any Oracle Database opened by any instance. This limit is operating system specific. The number of data files contained in a tablespace, and ultimately the database, can have an impact upon performance. Oracle Database allows more data files in the database than the operating system defined limit.
The database DBW n processes can open all online data files. Oracle Database is capable of treating open file descriptors as a cache, automatically closing files when the number of open file descriptors reaches the operating system-defined limit. This can have a negative performance impact. When possible, adjust the operating system limit on open file descriptors so that it is larger than the number of online data files in the database.
Your operating system specific Oracle documentation for more information on operating system limits. When creating a tablespace, you should estimate the potential size of database objects and create sufficient data files. Later, if needed, you can create additional data files and add them to a tablespace to increase the total amount of disk space allocated to it, and consequently the database. Preferably, place data files on multiple devices to ensure that data is spread evenly across all devices.
Tablespace location is determined by the physical location of the data files that constitute that tablespace. Use the hardware resources of your computer appropriately. For example, if several disk drives are available to store the database, consider placing potentially contending data files on separate disks. This way, when users query information, both disk drives can work simultaneously, retrieving data at the same time. Data files should not be stored on the same disk drive that stores the database redo log files.
If the data files and redo log files are stored on the same disk drive and that disk drive fails, the files cannot be used in your database recovery procedures. If you multiplex your redo log files, then the likelihood of losing all of your redo log files is low, so you can store data files on the same drive as some redo log files. You can create data files and associate them with a tablespace using several different SQL statements. In all cases, you can either specify the file specifications for the data files being created, or you can use the Oracle Managed Files feature to create files that are created and managed by the database server.
The table includes a brief description of the statement, as used to create data files, and references the section of this book where use of the statement is specifically described:. Creates a locally-managed temporary tablespace and the tempfiles temp files are a special kind of data file that comprise it. Creates a new empty data file in place of an old one--useful to re-create a data file that was lost with no backup.
If you add new data files to a tablespace and do not fully specify the file names, the database creates the data files in the default database directory or the current directory, depending upon your operating system.
Oracle recommends you always specify a fully qualified name for a data file. Unless you want to reuse existing files, make sure the new file names do not conflict with other files. Old files that have been previously dropped will be overwritten. If a statement that creates a data file fails, the database removes any created operating system files. However, because of the large number of potential errors that can occur with file systems and storage subsystems, there can be situations where you must manually remove the files using operating system commands.
You can alter the size of a data file. For example, you can increase the size of one or more data files when more space is needed in the database. You can create data files or alter existing data files so that they automatically increase in size when more space is needed in the database.
The file size increases in specified increments up to a specified maximum. The following example enables automatic extension for a data file added to the users tablespace:.
The value of NEXT is the minimum size of the increments added to the file when it extends. Therefore, you can add more space to your database without adding more data files. This is beneficial if you are concerned about reaching the maximum number of data files allowed in your database. You are not allowed to add a data file to a bigfile tablespace. Manually reducing the sizes of data files enables you to reclaim unused space in the database.
This is useful for correcting errors in estimates of space requirements. However, because its tablespace now stores smaller objects, the data file can be reduced in size. It is not always possible to decrease the size of a file to a specific value. It could be that the file contains data beyond the specified decreased size, in which case the database will return an error. You must alter data file availability to perform certain tasks, such as performing an offline backup of a data file or relocating an offline data file.
You can alter the availability of individual data files or temp files by taking them offline or bringing them online. Offline data files are unavailable to the database and cannot be accessed until they are brought back online. You want to rename or relocate an offline data file. You can first take the data file offline or take the tablespace offline. The database has problems writing to a data file and automatically takes the data file offline.
Later, after resolving the problem, you can bring the data file back online manually. A data file becomes missing or corrupted. You must take it offline before you can open the database. The data files of a read-only tablespace can be taken offline or brought online, but bringing a file online does not affect the read-only status of the tablespace.
0コメント