how to change system tablespace's extent_management in oracle - oracle

i used oracle 19c.
I'm trying to see the difference between a dictionary of tablespaces, local management.
When the first database was created, it was confirmed that the management of the SYSTEM tablespace was local.
The following query was performed when creating a new tablespace.
CREATE TABLESPACE TABLESPACE1
DATAFILE
'/TS_DATAFILE1.dbf'
SIZE 1024000
AUTOEXTEND OFF
NOLOGGING
DEFAULT NOCOMPRESS STORAGE (
INITIAL 10240
NEXT 10240
MINEXTENTS 2
MAXEXTENTS 50
PCTINCREASE 50
)
ONLINE
EXTENT MANAGEMENT
DICTIONARY
SEGMENT SPACE MANAGEMENT MANUAL
FLASHBACK OFF;
But the following error occurred.
ORA 12913- Cannot create dictionary managed tablespace
I know that the 19c version is created as local by default, and it seems to be necessary to change the SYSTEM tablespace to a dictionary in order to solve the above error.
But I don't know how to change it.
Please advise.

When your system tablespace is already locally managed, you cannot create a tablespace that is dictionary managed.
Also check this info from oracle.
Cause: Attempt to create dictionary managed tablespace in database which has system tablespace as locally managed.
Action: Create a locally managed tablespace.
The extents of a locally managed tablespace are managed efficiently in the tablespace by the Oracle database server itself. Dictionary-managed option is
provided only for backward compatibility.

Related

Oracle IMPDP fail - unable to create INITIAL extent for segment in tablespace

I'm trying to import a database dump into our local Oracle 11.2g using the IMPDP functionality, but am getting the following error:
ORA-39171: Job is experiencing a resumable wait.
ORA-01658: unable to create INITIAL extent for segment in tablespace {TABLESPACE}
All of the answers/solutions I have seen for this, tell you to ALTER the tablespace with the following command:
ALTER DATABASE DATAFILE 'C:\APP\ADMIN\ORADATA\ORCL\TABLESPACE.DBF' AUTOEXTEND ON MAXSIZE UNLIMITED;
I have done this, but am still getting the same error. Any other suggestions as to what could be wrong?
The error: `unable to create INITIAL extent for segment in tablespace {TABLESPACE}'
Check your disk space to have enough space to create an extent of the table
Well it looks like recreating the TABLESPACE using this has worked - CREATE BIGFILE TABLESPACE

How to grant quota on a temporary tablespace to a user

I'm trying to create a user in Oracle 12c with a default temporary tablespace and with a quota for that tablespace.
My statement is:
CREATE USER test_user2
IDENTIFIED BY "pass1234"
DEFAULT TABLESPACE TEMP_WORK_TS
QUOTA 100M ON TEMP_WORK_TS
QUOTA 100M ON TEMP_TEST_01
TEMPORARY TABLESPACE TEMP_TEST_01
PROFILE DEFAULT_PROFILE
ACCOUNT UNLOCK;
But I get error:
ORA-30041: Cannot grant quota on the tablespace
The Oracle documentation shows a quota being assigned for a user's temporary tablespace.
Why does my statement doing the same thing get that error?
That looks like a documentation bug. That example goes back at least to Oracle 9i documentation, so it may predate true temporary tablespaces.
Also from the 12c documentation:
You can assign each user a tablespace quota for any tablespace (except a temporary tablespace).
And the text for ORA-30041 is:
ORA-30041: Cannot grant quota on the tablespace
Cause: User tried to grant quota on an undo or temporary tablespace
Action: Check the tablespace name and reissue the command
It's said that since 10g, but the 9i version only referred to undo tablespaces. The behaviour seems to have changed, and the example just has hasn't been updated to reflect that.
So you can't grant that temporary tablespace quota. Just omit it from the create user statement. A quota only really makes sense for permanent extents anyway, and you don't know how much temporary space the optimiser might need to allocate for queries the user might run.

how to move undo datafile in running database without disturbing transactions?

Unfortunately one UNDO data file was misplaced in wrong location when I was adding space. I want to move that file to correct location. As it is Production database, I don't want to disturb the ongoing transactions. Can I offline that particular undo data file, while moving... will Database work normally with zero data loss?
Version Of Oracle DB: 11.2.0.4.0
can any one suggest?
During database running and in 24/7 environment, you should need to create new undo tablespace with new location of undo datafile. After creating this newer tablespace, you can switch older to newer undo tablespace online without affecting any ongoing transactions.
Following example shows how to achieve your goal. Using this trick, you can avoid data loss.
SQL>create undo tablespace undotbs2 datafile '/yournewlocation/undotbs02.dbf' size 1000m;
Now set new undo tablespace as default undo tablespace using following command as SYSDBA in SQLPLUS
SQL> alter system set undo_tablespace= undotbs2 ;
After finishing above task you can drop old undotbs tablespace from database using following command.
SQL> drop tablespace undotbs including contents;
I would consider creating the undo tablespace as a BIGFILE datafile:
CREATE BIGFILE UNDO TABLESPACE UNDOTBS02
DATAFILE '/yournewlocation/UNDOTBS02.dbf'
SIZE 100M AUTOEXTEND ON NEXT 100M
MAXSIZE 500G; --or whatever size you consider sufficient for your DB
I would also alter the system with a scope of BOTH, to make sure the change is made in both memory and spfile:
ALTER SYSTEM SET UNDO_TABLESPACE=UNDOTBS02 SCOPE=BOTH;
Then, provided all active transactions and the UNDO_RETENTION period (if any) are done, you'll be able to drop the tablespace as described by doc123.

Lucene Indexing from Oracle:ORA-01652: unable to extend temp segment

I met a problem when using Lucene to build full-text index of the data from the Oracle 11g database, with the following information:
"ora-01652 unable to extend temp segment by 128 in tablespace temp, on MDSYS.SDO_RDF_TRIPLE_S", line 608"
The total size of the dataset is about 1.5GB. After the problem occur, I followed some instructions online:
CREATE TEMPORARY TABLESPACE temp01
TEMPFILE 'D:\oracle\oradata\temp01.dbf' SIZE 2048M AUTOEXTEND ON MAXSIZE UNLIMITED;
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp01;
However, the problem is still there. The disk space is enough, though. Can anyone give me some help? Thanks in advance!
What tablespace is MDSYS.SDO_RDF_TRIPLE_S in? That's the tablespace to which space needs to be added. Also, MAXSIZE UNLIMITED doesn't really mean unlimited; on most platforms, that means 32767 MB.
Changing the default temporary tablespace for the database doesn't modify the assigned value for existing users who explicitly had a temporary tablespace set. Check the user you're connecting as, in dba_users, and if it has a different temporary tablespace do alter user <id> temporary tablespace temp01.
You could also have increased the size of the existing temporary tablespace, by increasing the size of its tempfile, setting that to autoextend, or adding an additional tempfile. However, if this is a one-off task then creating a new large tablespace for it and dropping it afterwards may not be a bad idea.

how to execute several ddl words with batch processing

When I deploy my asp.net application,I have to create some tablesapces/users,I use the pqsql,however I want to know is there any way I can create them with batch processing?
For example,I can execute this ddl:
create tablespace TSA.....
Then I can execute:
create user a ... default tablespace TSA...
But when I execute them at the same time:
create tablespace TSA.....
create user a ... default tablespace TSA...
I will get an error.
ANy way?
update
Error is something like this:
ORA-02180: invalid CREATE TABLESPACE words
BTW,I run the sql batches in the sql window of the pl/sql developer.
Now,I just want to know if there is any way I can run a whole ddl sql file?
Suppose this is the content of the init.sql:
create smallfile tablespace "DEV" datafile 'f:\app\administrator\oradata\orcl\dev01.dbf' size 100m autoextend on next 10m maxsize unlimited logging extent management local segment space management auto default nocompress
-- Create the user
create user dev_sa
identified by "000000"
default tablespace DEV
temporary tablespace TEMP;
-- Grant/Revoke role privileges
grant connect to dev_sa;
grant dba to dev_sa;
--create another tablespace
--.....
How to execute it in the batch process model?
If you have the two statements in a file you're running from SQL*Plus, you need to separate the statements with the / character, which also causes each to be executed
create tablespace TSA ...
/
create user a ... default tablespace TSA
/
(That's quite a big 'if', of course as per #APC's comment; but is something that's come up before. As has different ways of running things in SQL Developer, among other things. But really no more than a guess from the minimal info given...)
You have a semi-colon ; missing off the end of your first CREATE TABLE

Resources