DB2 Tablespace in state Restore pending - db2

I have the problem that in my DB2 database (SLES, Db2 v10.5) my User Temp Tablespaces are all in state "Restore pending, Storage must be defined, Storage may be defined"
When I do db2 list tablespace I get the following output (e.g.)
Tablespace ID = 6
Name = USERTEMP4
Type = System managed space
Contents = User Temporary data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined
Can anybody help how I escape from thsi situation? I didn't start any restore recently so I'm wondering how the tablespaces have reached this state
best regards and thanks in advance for reading this question!
Thomas

Related

How to dis-connect and then re-connect a postgres tablespace?

Is it possible to dis-connect and re-connect a POSTGRES tablespace and all the associated objects within that tablespace?
I have a Postgres database with two tablespaces, one on a high-speed SSD drive (I've named this FASTSPACE) , and the other on a slower, traditional magnetic HDD (named SLOWSPACE). The slower tablespace is reserved for large volumes of historic data which is rarely accessed.
Is it possible to temporarily disconnect SLOWSPACE, with the intention of reconnecting it at a later date? the DROP TABLESPACE documentation can only be used once all database objects within it have been dropped.
I'm aware that I can backup all the tables in SLOWSPACE, then delete them, and then DROP the tablespace, however this will take time (there are several Terabytes of data). If I then need the archived data again I'll have create a new version of the SLOWSPACE tablespace from blank, then re-create all the objects from the backups. Again, this will take time.
Is there any way of temporarily disconnecting SLOWSPACE from the database - whilst still leaving the rest of the database up and running?
Update - happy to accept Franks Heikens two letter answer - 'no'

Aurora PostgreSQL Temporary storage issue for index creation

We have migrated some of the data to PostgreSQL from MS-SQL Server. And are using R6G.Large aurora PostgreSQL RDS instance. We have transferred the data using DMS to PostgreSQL instance, and table size is around 183 GB and it has around 1.5 billion records. Now we are trying to create a Primary Key on an Id column, but it is failing with the below error...
ERROR: could not write to file "base/pgsql_tmp/pgsql_tmp18536.30": No
space left on device CONTEXT: SQL statement "ALTER TABLE
public.tbl_actions ADD CONSTRAINT tbl_actions_pkey PRIMARY KEY
(action_id)" PL/pgSQL function inline_code_block line 10 at SQL
statement SQL state: 53100
When looked at the documentation we found that index creation will use the temporary storage of the instance, and for r6g.large has 32 GiB. And for this huge table, that storage is not sufficient hence the index creation is failed with above error.
Is there any workaround to solve this without having to upgrade the instance type, may be by changing some values in parameter group or options groups.
To me, this looks like the storage has run out and not the RAM. You can check this using the Monitoring tab under the heading "Free Storage Space" on the RDS instance in AWS Console.
Try this:
To increase storage for a DB instance
Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.
In the navigation pane, choose Databases.
Choose the DB instance that you want to modify.
Choose Modify.
Enter a new value for Allocated storage. It must be greater than the current value.
More details here:
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.Storage
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Troubleshooting.html#CHAP_Troubleshooting.Storage

Monitoring Db2 tablespace with partitioned table

How to monitor allocation data in tablespaces with partitioned table?
I want to know when my tablespaces will fill up before creating new tablespaces with new partition.
When I perform command:
db2pd -db DBTEST -tablespace
I got information with tablespace Statistics: UsablePgs and FreePgs.
The values remain the same even when I perform runstat on my table.
I thought that after runstat this value will grow.
The information returned by this call doesn't depend on runstats.
Think about this allocation info as "always current".
Consider using MON_GET_TABLESPACE
https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.sql.rtn.doc/doc/r0053943.html

DB2 tablespace space issue

I have created db2 db with default space 4k,now my application is throwing space issue
SQLCODE: -1585, SQLSTATE: 54048, SQLERRMC: null
no sufficient space allocated for temp tablespace
how to overcome this
can any one help on this.
DB2 has different type of tablespaces
Regular (data, your default TableSpace)
Large (data with long rows)
Catalog (metadata)
User temporary (for temporary tables)
System temporary (for internal operations like sorts, joins, etc that sometimes overflows the memory)
You just need to create a system temporary table in the database to perform the operation you are trying to do. It is highly recommended to create temporary tablespaces (user and system) like SMS type, or automatic type for recent versions. Make sure the pagesize is the correct one.

How do I remove CHECK PENDING state from a DB2 Tablespace on z/OS?

maybe one of you can help me with this DB2 z/OS thingy.
I edited foreign key on a table that was already populated. Due to integrity reasons (I guess) the tablespace was placed in CHECK PENDING and I cannot perform operations on it any longer.
This IBM help page is about the exact problem
It says
Action
Perform the CHECK DATA command: CHECK DATA TABLESPACE DATABASE NAME TABLESPACE NAME
I have no clue, what this means (its no SQL statement thats for sure) or where I can issue the command. Maybe one of you cann tell me what to do. TIA
As you noted, CHECK DATA is not an SQL command, it is a DB/2 Utility. See: Check Data