request tablespace online menu item

Kent

Member²
It would be useful to have an item in the tablespace context menu to take the tablespace offline or bring it online.
 
Hello,

Below you can find two extensions. First to take tablespace offline, and a second one to make tablespace read only.

Joachim Rupik

to take offline:
-------------------------------snip-----------------------------------
PL/SQL Developer Browser Extender Command

[MAIN]
NAME=Tablespace switch status
CAPTION=Set #field_0
OTYPE=Tablespace
OOWNER=%
ONAME=%
SEPARATOR_ABOVE=N
SEPARATOR_BELOW=N
LOAD_AND_EXECUTE=N
LOAD_COMMAND=N
LOAD_AFTER=REPLACE
LOAD_WIN_TYPE=1
PRIVILEGE_REQ=N
PRIVILEGE=
ORACLE_VERSION_REQ=Y
ORACLE_VERSION=8.1.5
ONCLICK_CONFIRM=N
ONCLICK_CONFIRM_MSG=
ONCLICK_SPLASH=N
ONCLICK_SPLASH_MSG=
ONCLICK_SPLASH_MSG_BL=N
ONCLICK_SPLASH_MSG_AFTER=
ONCLICK_SPLASH_DELAY=0
ONCLICK_IGNORE_EXCEPTIONS=N
ONPOPUP_IGNORE_EXCEPTIONS=Y

[ONCLICK]
declare
s sys.dba_tablespaces.status%TYPE;
begin
Select status into s
from sys.dba_tablespaces t
where tablespace_name = '#oname'
;
if s = 'ONLINE' then
execute immediate 'alter tablespace #oname offline normal';
elsif s = 'OFFLINE' then
execute immediate 'alter tablespace #oname online';
elsif s = 'READ ONLY' then
execute immediate 'alter tablespace #oname offline normal';
end if;
end;

[ONPOPUP]
select decode(STATUS,'ONLINE','OFFLINE','OFFLINE','ONLINE','READ ONLY','OFFLINE','???')
from sys.dba_tablespaces t
where tablespace_name = '#oname'
-------------------------------snip-----------------------------------

to make read only:
-------------------------------snip-----------------------------------
PL/SQL Developer Browser Extender Command

[MAIN]
NAME=Tablespace Set IO Type
CAPTION=Set #field_0
OTYPE=Tablespace
OOWNER=%
ONAME=%
SEPARATOR_ABOVE=Y
SEPARATOR_BELOW=N
LOAD_AND_EXECUTE=N
LOAD_COMMAND=N
LOAD_AFTER=REPLACE
LOAD_WIN_TYPE=1
PRIVILEGE_REQ=N
PRIVILEGE=
ORACLE_VERSION_REQ=N
ORACLE_VERSION=7.0.0
ONCLICK_CONFIRM=N
ONCLICK_CONFIRM_MSG=
ONCLICK_SPLASH=N
ONCLICK_SPLASH_MSG=
ONCLICK_SPLASH_MSG_BL=N
ONCLICK_SPLASH_MSG_AFTER=
ONCLICK_SPLASH_DELAY=0
ONCLICK_IGNORE_EXCEPTIONS=N
ONPOPUP_IGNORE_EXCEPTIONS=Y

[ONCLICK]
declare
s sys.dba_tablespaces.status%TYPE;
begin
Select status into s
from sys.dba_tablespaces t
where tablespace_name = '#oname'
;
if s = 'READ ONLY' then
execute immediate 'alter tablespace #oname read write';
else
execute immediate 'alter tablespace #oname read only';
end if;
end;

[ONPOPUP]
select decode(STATUS,'ONLINE','READ ONLY','OFFLINE','READ ONLY','READ ONLY','READ WRITE','???')
from sys.dba_tablespaces t
where tablespace_name = '#oname'
-------------------------------snip-----------------------------------
 
Back
Top